Browse the docs

Update organization

PATCH /v2/api-gateway/organizations/{id}

Updates the organization name. Only name can be changed through this endpoint; an empty body is accepted and returns the organization unchanged.

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.

Body

FieldTypeDescription
namestringNew display name.

Example request

cURL

curl --request PATCH \
     --url 'https://api.themooncard.com/v2/api-gateway/organizations/8d2cd518-5ef2-4280-91e8-63b1a0e672e7' \
     --header 'x-api-key: YOUR_API_KEY' \
     --header 'content-type: application/json' \
     --data '{
       "name": "string"
     }'

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

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