Retrieve an organization

Retrieving organization data is critical to being able to call the API with the correct organization slug. There's a couple of ways to go about it:

1. Retrieve information about all organizations that a user belongs to
2. Retrieve information about a specific organization a user belongs to
3. Call the user dashboard endpoint

Endpoints

Get all organizations a user belongs to

  • GET /organizations
    • Permissions: user:organization:read
    • Roles: user_basic

Response: Paginated Array

  • id - string: Organization Id
  • name - string: Organization name
  • role - string: Role user who is calling the endpoint has within the organization
  • slug - string: Organization slug

Example

$ http GET 'http://localhost:5000/organizations?limit=2' 'Authorization: Bearer ACCESS_TOKEN'

HTTP/1.1 200 OK
{
    "cursor": "orgz_56ce2a2e-0864-411c-a4db-60ca221fd3f4",
    "elements": [
        {
            "id": "orgz_64010772-1522-4c37-83ca-219ae906d843",
            "name": "Test Org",
            "role": "owner",
            "slug": "test-org"
        },
        {
            "id": "orgz_56ce2a2e-0864-411c-a4db-60ca221fd3f4",
            "name": "Test Org 2",
            "role": "owner",
            "slug": "test-org-2"
        }
    ]
}

Get information about a specific organization

Get information regarding a specific organization by using the slug. Can be called publicly without an access token.

  • GET /organizations/:slug
    • Permissions: none

Response

Paginated Array

  • id - string: Organization Id
  • name - string: Organization name
  • slug - string: Organization slug

Example

$ http GET 'http://localhost:5000/organizations/test-org'

HTTP/1.1 200 OK
{
    "id": "orgz_64010772-1522-4c37-83ca-219ae906d843",
    "name": "Test Org",
    "role": "OWNER",
    "slug": "test-org"
}

Get organization data by calling the dashboard

See Dashboard section

Was this page helpful?