Operation
Get My Organisations
GET
/me/organisationsSee which organisations the current user belongs to.
Most users belong to just one organisation, but some (like agencies or
consultants) might have access to several. This endpoint returns all of them
so you can build an organisation switcher or let users pick which one to work with.
Each organisation in the response includes its name, slug, and basic settings.
When to use this
- Building an organisation picker/switcher in your app
- Showing users their available workspaces after login
- Determining which organisation to use for subsequent API calls
Returns
Organisations retrieved successfully
Errors
- 400
- Bad Request - Invalid input
- 401
- Unauthorized - Authentication required
- 403
- Forbidden - Insufficient permissions
- 404
- Not Found - Resource not found
- 500
- Internal Server Error
Every error names its code and links to it. All error codes
Notes
Note
The organisation slug is what you'll use in the `X-Ticketlayer-Org` header for most other API calls.
Tip
If a user only belongs to one organisation, you can skip the picker and use that one automatically.
Related
import { BackstageClient } from '@ticketlayer/backstage';const client = new BackstageClient({ organisationSlug: 'your-org',});client.setAccessToken('YOUR_ACCESS_TOKEN');// Get all organisations you have access toconst organisations = await client.users.getMyOrganisations();for (const org of organisations) { console.log(`${org.name} (${org.slug})`);}Response 200
{
"organisations": [
{
"id": "org_xyz789",
"slug": "acme-corp",
"name": "Acme Corporation",
"testMode": true,
"primaryColor": "#FF5733",
"secondaryColor": "#3366FF",
"logoUrl": "https://example.com/logo.png",
"userId": "usr_abc123"
}
]
}