Skip to main content

Get My Organisations

GET/me/organisations
See 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

Response

Organisations retrieved successfully

Notes

ℹ️The organisation slug is what you'll use in the `X-Ticketlayer-Org` header for most other API calls.
💡If a user only belongs to one organisation, you can skip the picker and use that one automatically.
Code Samples

Get your organisations using the TypeScript SDK:

import { BackstageClient } from '@ticketlayer/backstage';

const client = new BackstageClient({
organisationSlug: 'your-org',
});
client.setAccessToken('YOUR_ACCESS_TOKEN');

// Get all organisations you have access to
const organisations = await client.users.getMyOrganisations();

for (const org of organisations) {
console.log(`${org.name} (${org.slug})`);
}

Try It

Related