Skip to content

Switch the session to another org

POST
/auth/session/org
curl --request POST \
--url https://api.sloose.com/auth/session/org \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "orgId": "example" }'

Points the session at one of the person’s orgs. Every org-scoped call after this runs there, with the role they hold there. Refused for an org they are not a member of, or where their access is revoked.

Session only.

Media typeapplication/json
object
orgId
required
string
Examplegenerated
{
"orgId": "example"
}

The session now works in this org.

Media typeapplication/json
object
orgId
required
string
dc
required
string
role
required
string
Allowed values: owner admin builder operator
Example
{
"role": "owner"
}

The request body did not match the schema. issues carries the Zod issue list.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No bearer, or one that is expired, revoked or no longer resolves to a member.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

Not a member of that org (code: NOT_A_MEMBER), access revoked (code: ACCESS_REVOKED), or the org has been closed (code: ORG_CLOSED).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}