Retrieve the authenticated client
Read the client your API key belongs to, including its ID and methodology options.
Returns the client that your API key authenticates as. Use it to find your own client id before you create child clients or submit travel data on behalf of a descendant.
The Clients API must be enabled for your account. Until it is, this endpoint responds with 404.
Request
GET /v2/clients/me
The endpoint takes no parameters.
curl "https://api.sandbox.squake.earth/v2/clients/me" \
--header "Authorization: Bearer $SQUAKE_API_KEY"Response
{
"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 }
]
}parent_id is null because the authenticated client is the root of the hierarchy you can see. This client has never been configured, so methodology_options shows the SQUAKE defaults.
| Field | Type | Description |
|---|---|---|
id | string (UUID) | The client's identifier. Use it as parent_id when you create a child, or as client_id when you submit travel data. |
name | string | null | The client's display name. |
external_reference | string | null | Your own reference for the client, unique among the children of one parent. Generated from the name when you omit it on creation. |
parent_id | string (UUID) | null | The client's parent, or null for the authenticated client. |
status | string | The client's lifecycle status. Currently always active. |
metadata | object | Your own key-value pairs. |
methodology_options | array | The methodologies the client calculates with. See Methodology options. |
Errors
| Status | Meaning |
|---|---|
401 | The API key is missing or invalid. |
404 | The Clients API isn't enabled for your account. |
Related
- List clients
- Retrieve the Authenticated Client in the API reference