List clients
Page through the authenticated client and all of its descendants, with filters for parent, reference and name.
Returns the authenticated client together with all of its descendants. A parent, a sibling or an unrelated client never appears.
The Clients API must be enabled for your account. Until it is, this endpoint responds with 404.
Request
GET /v2/clients
parent_idstring (UUID)Return only the direct children of this client. It must be the authenticated client or one of its descendants. Any other value returns 404 with error code client_not_found.
external_referencestringReturn only the client with this exact external_reference.
querystringCase-insensitive search across client names and external_reference.
pageintegerPage number, starting at 1.
per_pageintegerClients per page. SQUAKE uses its default page size when you omit the value or send an invalid one.
GET /v2/clients in the API referencecurl "https://api.sandbox.squake.earth/v2/clients?page=1&per_page=50" \
--header "Authorization: Bearer $SQUAKE_API_KEY"To list only the direct children of the authenticated client, filter by its ID:
curl "https://api.sandbox.squake.earth/v2/clients?parent_id=0f1f3d3b-2775-4cc0-885e-8d51db6d6de1" \
--header "Authorization: Bearer $SQUAKE_API_KEY"To look up one of your customers by your own reference, filter by external_reference:
curl "https://api.sandbox.squake.earth/v2/clients?external_reference=example-de" \
--header "Authorization: Bearer $SQUAKE_API_KEY"Response
The body is a JSON array of clients. Pagination metadata comes back in the response headers.
[
{
"id": "0f1f3d3b-2775-4cc0-885e-8d51db6d6de1",
"name": "Example Travel Group",
"external_reference": null,
"parent_id": null,
"status": "active",
"metadata": {},
"methodology_options": [
{ "activity_type": "flight", "methodology": "TIM", "version": "AT_TIME_OF_TRAVEL", "default": true },
{ "activity_type": "flight", "methodology": "DEFRA", "version": "AT_TIME_OF_TRAVEL", "default": false },
{ "activity_type": "train", "methodology": "DEFRA", "version": "AT_TIME_OF_TRAVEL", "default": true },
{ "activity_type": "car", "methodology": "DEFRA", "version": "AT_TIME_OF_TRAVEL", "default": true },
{ "activity_type": "hotel", "methodology": "GREENVIEW", "version": "AT_TIME_OF_TRAVEL", "default": true }
]
},
{
"id": "4fb3ec7a-92cb-471f-b75f-c3fe7c2a34d5",
"name": "Example Travel Germany",
"external_reference": "example-de",
"parent_id": "0f1f3d3b-2775-4cc0-885e-8d51db6d6de1",
"status": "active",
"metadata": { "crm_id": "ACC-1042" },
"methodology_options": [
{ "activity_type": "flight", "methodology": "TIM", "version": "AT_TIME_OF_TRAVEL", "default": true },
{ "activity_type": "flight", "methodology": "DEFRA", "version": "AT_TIME_OF_TRAVEL", "default": false },
{ "activity_type": "train", "methodology": "REM", "version": null, "default": true },
{ "activity_type": "car", "methodology": "DEFRA", "version": "AT_TIME_OF_TRAVEL", "default": true },
{ "activity_type": "hotel", "methodology": "GREENVIEW", "version": "AT_TIME_OF_TRAVEL", "default": true }
]
},
{
"id": "9a7c2e15-6b3d-4f80-a1c4-7e2d5b9f0c38",
"name": "Example Travel France",
"external_reference": "example-fr",
"parent_id": "0f1f3d3b-2775-4cc0-885e-8d51db6d6de1",
"status": "active",
"metadata": {},
"methodology_options": [
{ "activity_type": "flight", "methodology": "TIM", "version": "AT_TIME_OF_TRAVEL", "default": true },
{ "activity_type": "flight", "methodology": "DEFRA", "version": "AT_TIME_OF_TRAVEL", "default": false },
{ "activity_type": "train", "methodology": "DEFRA", "version": "AT_TIME_OF_TRAVEL", "default": true },
{ "activity_type": "car", "methodology": "DEFRA", "version": "AT_TIME_OF_TRAVEL", "default": true },
{ "activity_type": "hotel", "methodology": "GREENVIEW", "version": "AT_TIME_OF_TRAVEL", "default": true }
]
}
]The first entry is the authenticated client, the root of the hierarchy. Example Travel Germany was created with its own methodology options. Example Travel France was created without them, so it got a copy of its parent's options. For every field, see Retrieve the authenticated client.
Errors
| Status | Code | Meaning |
|---|---|---|
401 | The API key is missing or invalid. | |
404 | client_not_found | The parent_id isn't the authenticated client or one of its descendants. |
404 | The Clients API isn't enabled for your account. |
Related
- Retrieve a client
- Create a child client
- List Clients in the API reference