/organizations - Get available organizations

GET /organizations

Get organizations the current user can assign users to, filtered by business hierarchy

Responses

  • 200 application/json

    Organizations retrieved successfully

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • organizations array[object]
        Hide organizations attributes Show organizations attributes object
        • id string

          Database UUID of the organization

        • logto_id string

          Logto organization ID (use this value for assignment operations)

        • name string

          Organization name

        • description string

          Organization description

        • type string

          Organization type

          Values are owner, distributor, reseller, or customer.

      • pagination object
        Hide pagination attributes Show pagination attributes object
        • page integer

          Current page number

          Minimum value is 1.

        • page_size integer

          Number of items per page

          Minimum value is 1, maximum value is 100.

        • total_count integer

          Total number of items

          Minimum value is 0.

        • total_pages integer

          Total number of pages

          Minimum value is 0.

        • has_next boolean

          Whether there is a next page

        • has_prev boolean

          Whether there is a previous page

        • next_page integer | null

          Next page number if available

        • prev_page integer | null

          Previous page number if available

        • sort_by string | null

          Field used for sorting

        • sort_direction string | null

          Sort direction

          Values are asc or desc.

  • 401 application/json

    Unauthorized - invalid or missing token

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
GET /organizations
curl \
 --request GET 'https://api.your-domain.com/api/organizations' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "code": 200,
  "message": "organizations retrieved successfully",
  "data": {
    "organizations": [
      {
        "id": "4405ffd0-0aca-44ef-bae2-c8545bce94f4",
        "logto_id": "akkbs6x2wo82",
        "name": "ACME Corp",
        "description": "Main customer organization",
        "type": "customer"
      }
    ],
    "pagination": {
      "page": 1,
      "page_size": 20,
      "total_count": 156,
      "total_pages": 8,
      "has_next": true,
      "has_prev": false,
      "next_page": 2,
      "prev_page": 42,
      "sort_by": "name",
      "sort_direction": "asc"
    }
  }
}
Response examples (401)
{
  "code": 401,
  "message": "invalid token",
  "data": {}
}