Skip to main content
POST
/
v0
/
auth
/
organizations
/
set-active
Set active organization for current session
curl --request POST \
  --url https://api.avidoai.com/v0/auth/organizations/set-active \
  --header 'Content-Type: application/json' \
  --data '
{
  "organizationId": "<string>"
}
'
{
  "data": {
    "id": "<string>",
    "name": "<string>",
    "allowDomainAutoJoin": true,
    "domain": "<string>",
    "slug": "<string>",
    "logo": "<string>"
  }
}

Body

application/json

Id of the organization to set as the active organisation on the authenticated session.

organizationId
string
required
Required string length: 1 - 256

Response

Successfully switched active organization

The organisation that was set as the active organisation on the authenticated session.

data
Organization · object
required

A Better Auth organisation the authenticated user belongs to, normalised to the public Avido shape (Prisma-nullable slug/domain surfaced as absent rather than null).