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

200 OKapplication/json
{
  "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.

FieldTypeDescription
idstring (UUID)The client's identifier. Use it as parent_id when you create a child, or as client_id when you submit travel data.
namestring | nullThe client's display name.
external_referencestring | nullYour own reference for the client, unique among the children of one parent. Generated from the name when you omit it on creation.
parent_idstring (UUID) | nullThe client's parent, or null for the authenticated client.
statusstringThe client's lifecycle status. Currently always active.
metadataobjectYour own key-value pairs.
methodology_optionsarrayThe methodologies the client calculates with. See Methodology options.

Errors

StatusMeaning
401The API key is missing or invalid.
404The Clients API isn't enabled for your account.

On this page

GET/v2/clients/me

Run this request against the sandbox with your test key.

Open in API reference