Switch current organization
POST
/v1/users/me/switch-org
const url = 'https://app.everruns.com/api/v1/users/me/switch-org';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"org_id":"org_2f3c1b3e6a9d4c6f8a1d4e9c9b7f21a0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.everruns.com/api/v1/users/me/switch-org \ --header 'Content-Type: application/json' \ --data '{ "org_id": "org_2f3c1b3e6a9d4c6f8a1d4e9c9b7f21a0" }'Sets a cookie with the selected organization. This org will be used for all subsequent requests (including SSE connections via EventSource). The user must be a member of the requested organization.
Request Body required
Section titled “Request Body required ” Media type application/json
Request to switch organization
object
org_id
required
Organization public ID to switch to
string
Example
org_2f3c1b3e6a9d4c6f8a1d4e9c9b7f21a0Responses
Section titled “ Responses ”Organization switched successfully
Media type application/json
Response from switch org endpoint
object
org_id
required
The organization ID that was switched to
string
success
required
Whether the switch was successful
boolean
Example generated
{ "org_id": "example", "success": true}Invalid organization ID format
Unauthorized
Organization not found or user is not a member