---
title: "Switch environment"
method: POST
path: "/v1/auth/switch-environment"
tags: ["auth"]
---

# Switch environment

`POST /v1/auth/switch-environment`

Switches the user's environment between LIVE and SANDBOX and returns a new custom token with the environment claim

## Request body

- HandlersSwitchEnvironmentRequest
  - `environment` string — "LIVE" or "SANDBOX"

## Response `200`

OK

- HandlersSwitchEnvironmentResponse
  - `customToken` string
  - `environment` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.net/resourcly/apis/resourcly-api.md) · [All operations](https://skmtc.net/resourcly/apis/resourcly-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/resourcly/resourcly-api/revisions/7f97d8cd0f1e/schema)
