List tenants the current user can access
const url = 'http://localhost:3000/api/v1/tenant/my-tenants';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/my-tenants \ --header 'Authorization: Bearer <token>'Returns the user’s organization memberships. Superusers/support see every organization.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”UUID of the organization (tenant) the request acts in. It selects the tenant and grants nothing: the server checks membership or an open tenant switch. Not needed for global operations. A malformed value returns 400. API keys are fixed to their own organization; another organization returns 403. The x-organization-source header grants nothing.
Responses
Section titled “Responses”object
Tenants the user can access
object
Organization ID
Organization name
Organization slug
Role name (null for superuser/support)
How the user has access: direct membership or via system role
Whether this is the user’s current/default organization
Total tenants
True when items reflect a system-role view (all orgs); false when items only contain memberships
Example
{ "items": [ { "accessVia": "member" } ]}Forbidden. The caller lacks the permission, or is an API key (API keys cannot use tenant switches).