Browse the docs

Get main organization

GET /v2/api-gateway/organizations/main

Returns the caller's top-level organization (parent_organization_id is null).

Request

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

Example request

cURL

curl --request GET \
     --url 'https://api.themooncard.com/v2/api-gateway/organizations/main' \
     --header 'x-api-key: YOUR_API_KEY'

Responses

200 Success
FieldTypeDescription
id requiredstringOrganization id.
name requiredstring
parent_organization_id requiredstring, nullableParent organization, or null for a root organization.
created_at requiredstring, nullable
updated_at requiredstring, nullable

JSON

{
  "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"
}
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

The caller has no top-level 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