List organizations
GET /v2/api-gateway/organizations
Returns every organization owned by the caller (the top-level organization and all of its children), paginated with page / per_ (per_ must be below 50, default 10). A page with no results — including a page past the end — returns 404 ORGANIZATIONS_, not 200 with an empty list.
Request
Authentication: your API key in the x-api-key header.
Query parameters
| Field | Type | Description |
|---|---|---|
page | integer | 1-based page number. |
current_ | integer | Page number, starting at 1 — the canonical spelling, accepted on every paginated endpoint and matching pagination.current_ in the response. page means the same thing and keeps working; if both are sent, current_ wins. |
per_ | integer | Page size, 1–49. Defaults to 10. A value of 50 or more is rejected with a 400 on this listing — it does not clamp. |
Example request
cURL
curl --request GET \
--url 'https://api.themooncard.com/v2/api-gateway/organizations' \
--header 'x-api-key: YOUR_API_KEY'Responses
200 Success
| Field | Type | Description |
|---|---|---|
organizations required | array of object | |
organizations[]. required | string | Organization id. |
organizations[]. required | string | |
organizations[]. required | string, nullable | Parent organization, or null for a root organization. |
organizations[]. required | string, nullable | |
organizations[]. required | string, nullable | |
pagination required | object | |
pagination. required | integer | Total number of items across all pages. |
pagination. required | integer | Number of the last page (0 when there are no items). |
pagination. required | integer, nullable | Previous page number, or null on the first page. |
pagination. required | integer, nullable | Next page number, or null on the last page. |
pagination. required | integer | Page size that was applied. |
pagination. required | integer | 1-based current page. |
pagination. required | integer | 1-based index of the first item on this page (0 when empty). |
pagination. required | integer | 1-based index of the last item on this page (0 when empty). |
JSON
{
"organizations": [
{
"id": "5c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"name": "Acme Inc.",
"parent_organization_id": null,
"created_at": "2026-07-14T11:03:20.000Z",
"updated_at": "2026-08-16T17:51:01.000Z"
},
{
"id": "1d2e3f4a-5b6c-4d7e-8f90-a1b2c3d4e5f6",
"name": "Acme Europe",
"parent_organization_id": "5c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"created_at": "2026-07-20T08:44:10.000Z",
"updated_at": null
}
],
"pagination": {
"total": 2,
"last_page": 1,
"prev_page": null,
"next_page": null,
"per_page": 10,
"current_page": 1,
"from": 1,
"to": 2
}
}400 Error
Validation failed (errors[] lists each offending field) or a domain rule rejected the request ({ message, code }).
The body is the standard error object: see Errors.
401 Error
Missing or invalid credentials, e.g. { "message": "Invalid API Key", "code": "UNAUTHORIZED" }.
The body is the standard error object: see Errors.
404 Error
No organizations on the requested page (ORGANIZATIONS_).
The body is the standard error object: see Errors.
500 Error
Unexpected server error. Body is { message: "Internal server error", code: "INTERNAL_.
The body is the standard error object: see Errors.
Last updated June 5, 2026