List accounts
GET /v2/api-gateway/accounts
Lists the accounts of your top-level organization and its direct child organizations, newest first. Pass organization_ to scope the list to one organization you own.
Request
Authentication: your API key in the x-api-key header.
Query parameters
| Field | Type | Description |
|---|---|---|
page | number | Min 1 |
per_ | number | Min 1, max 100. A larger value is rejected with a 400 on this listing. |
organization_ | string, uuid | Return only accounts of this organization (yours or one of its children). Omit for all. |
search | string | Case-insensitive partial match against account id and name |
current_ | number | 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. |
Example request
cURL
curl --request GET \
--url 'https://api.themooncard.com/v2/api-gateway/accounts' \
--header 'x-api-key: YOUR_API_KEY'Responses
200 Success
| Field | Type | Description |
|---|---|---|
accounts required | array of object | |
accounts[]. required | string | Account id. |
accounts[]. required | string, nullable | |
accounts[]. required | string | |
accounts[]. required | string | Internal. May change or be removed without notice — do not rely on it. |
accounts[]. required | number | Current balance as a number. |
accounts[]. required | number | Spendable balance as a number. |
accounts[]. required | string | ISO-4217 currency code, e.g. "USD". |
accounts[]. required | object | The key-value data you stored on this account, returned exactly as you sent it. An empty object when you never set any — it is never null. |
accounts[]. required | string | ISO-8601 timestamp. |
accounts[]. required | string, nullable | ISO-8601 timestamp, or null. |
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
{
"accounts": [
{
"id": "9b2e7d10-6c1f-4a3e-8f5d-2a4b6c8d0e1f",
"name": "Operations",
"organization_id": "5c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"ledger_account_id": "0a1b2c3d-4e5f-4061-8273-8495a6b7c8d9",
"balance": 1250.75,
"available_balance": 1180.25,
"currency": "USD",
"metadata": {
"cost_center": "CC-204"
},
"created_at": "2026-08-01T09:12:44.000Z",
"updated_at": "2026-08-16T17:51:01.000Z"
}
],
"pagination": {
"total": 1,
"last_page": 1,
"prev_page": null,
"next_page": null,
"per_page": 10,
"current_page": 1,
"from": 1,
"to": 1
}
}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 (returned with code ACCOUNT_).
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