Get current tenant context
GET
/api/v1/tenant/context
const url = 'http://localhost:3000/api/v1/tenant/context';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3000/api/v1/tenant/context \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ” Media type application/json
object
isSwitched
required
Whether user is currently switched to another tenant
boolean
originalOrgId
Original organization ID (if switched)
string
originalOrgName
Original organization name (if switched)
string
currentOrgId
required
Current organization ID
string
currentOrgName
Current organization name
string
currentOrgSlug
Current organization slug
string
originalOrgSlug
Original organization slug (if switched)
string
activeSwitch
Active switch details (if switched)
object
id
required
Switch record ID
string
userId
required
User ID who performed the switch
string
fromOrgId
Original organization ID
string
fromOrgName
Original organization name
string
toOrgId
required
Target organization ID
string
toOrgName
Target organization name
string
duration
Duration of the switch
string
reason
Reason for switching
string
switchedAt
required
When the switch was performed
string format: date-time
expiresAt
When the switch expires
string format: date-time
returnedAt
When the user returned to default tenant
string format: date-time
isActive
required
Whether the switch is currently active
boolean
expiresAt
When the switch expires (if switched)
string format: date-time
Example generated
{ "isSwitched": true, "originalOrgId": "example", "originalOrgName": "example", "currentOrgId": "example", "currentOrgName": "example", "currentOrgSlug": "example", "originalOrgSlug": "example", "activeSwitch": { "id": "example", "userId": "example", "fromOrgId": "example", "fromOrgName": "example", "toOrgId": "example", "toOrgName": "example", "duration": "example", "reason": "example", "switchedAt": "2026-04-15T12:00:00Z", "expiresAt": "2026-04-15T12:00:00Z", "returnedAt": "2026-04-15T12:00:00Z", "isActive": true }, "expiresAt": "2026-04-15T12:00:00Z"}Forbidden — caller lacks required permission