---
title: "Get organization IDs from the token or the first WorkOS membership page"
method: GET
path: "/api/cli/org"
tags: ["Authentication"]
---

# Get organization IDs from the token or the first WorkOS membership page

`GET /api/cli/org`

## Request

- Base URL: `https://api.factory.ai`
- URL: `https://api.factory.ai/api/cli/org`
- Auth: HTTP bearer

Accepts only a WorkOS user access token: a Factory API key, including a service account's, is answered 401, as is a request without a bearer credential or with a token whose signature does not verify. For a token that carries a WorkOS organization, returns that organization alone; otherwise returns organization IDs from only the first page of WorkOS memberships for the token's user (active ones, up to 10, under WorkOS's current defaults), without following or returning a pagination cursor. A 429 passes on WorkOS rate limiting of that list. A 503 means WorkOS could not serve the request: its signing keys could not be fetched to check the token, or the list answered a server error or bad JSON, or was unreachable.

## Headers

- `X-Factory-Org-Id` string

## Response `200`

Response for status 200

- ListUserOrganizations200ResponseBody
  - `workosOrgIds` string[], required

## Other responses

- `400`: Response for status 400
- `401`: Response for status 401
- `402`: Response for status 402
- `403`: Response for status 403
- `404`: Response for status 404
- `409`: Response for status 409
- `410`: Response for status 410
- `413`: Response for status 413
- `422`: Response for status 422
- `429`: Response for status 429
- `451`: Response for status 451
- `500`: Response for status 500
- `502`: Response for status 502
- `503`: Response for status 503

## Changes

- **2026-11-17** `54bb6cc588c0`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/factory/apis/factory-public-api/changes/api/cli/org/get.md)

---

[API](https://skmtc.dev/factory/apis/factory-public-api.md) - [All operations](https://skmtc.dev/factory/apis/factory-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/factory/apis/factory-public-api/revisions/2e37e1b079d2?raw)
