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>"
}
}Switches the active organisation on the authenticated session. Called in-process via auth.api.setActiveOrganization so server-to-server requests are not subject to Better Auth’s Origin-header CSRF check. Better Auth rotates the active-org cookie; the rotated Set-Cookie headers are forwarded on the response so the browser’s cookie jar is updated atomically with the 201 reply.
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>"
}
}Id of the organization to set as the active organisation on the authenticated session.
1 - 256Successfully switched active organization
The organisation that was set as the active organisation on the authenticated session.
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).
Show child attributes