Browse the docs

Get child organizations

GET /v2/api-gateway/organizations/{id}/children

Lists the direct children of an organization you own, newest first, paginated with page / per_page (per_page must be below 50, default 10). Unlike GET /organizations, an empty page returns 200 with an empty organizations list.

Request

Authentication: your API key in the x-api-key header.

Path parameters

FieldTypeDescription
id requiredstring, uuidOrganization id (id from GET /organizations). Must be your organization or one of its children.

Query parameters

FieldTypeDescription
pageinteger1-based page number.
current_pageintegerPage number, starting at 1 — the canonical spelling, accepted on every paginated endpoint and matching pagination.current_page in the response. page means the same thing and keeps working; if both are sent, current_page wins.
per_pageintegerPage 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/8d2cd518-5ef2-4280-91e8-63b1a0e672e7/children' \
     --header 'x-api-key: YOUR_API_KEY'

Responses

200 Success
FieldTypeDescription
organizations requiredarray of object
organizations[].id requiredstringOrganization id.
organizations[].name requiredstring
organizations[].parent_organization_id requiredstring, nullableParent organization, or null for a root organization.
organizations[].created_at requiredstring, nullable
organizations[].updated_at requiredstring, nullable
pagination requiredobject
pagination.total requiredintegerTotal number of items across all pages.
pagination.last_page requiredintegerNumber of the last page (0 when there are no items).
pagination.prev_page requiredinteger, nullablePrevious page number, or null on the first page.
pagination.next_page requiredinteger, nullableNext page number, or null on the last page.
pagination.per_page requiredintegerPage size that was applied.
pagination.current_page requiredinteger1-based current page.
pagination.from requiredinteger1-based index of the first item on this page (0 when empty).
pagination.to requiredinteger1-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

Parent organization not found or not owned by this organization (ORGANIZATION_NOT_FOUND).

The body is the standard error object: see Errors.

500 Error

Unexpected server error. Body is { message: "Internal server error", code: "INTERNAL_SERVER_ERROR" }.

The body is the standard error object: see Errors.

Last updated June 5, 2026