Retrieve a Client

GET
/v2/clients/{id}

Returns a single visible client by id (the authenticated client or one of its descendants). Clients outside your hierarchy are indistinguishable from missing ones: both return client_not_found (404).

Requires this feature to be enabled for your account (contact us); otherwise this endpoint responds with 404.

Authorization

Bearer-Auth
headerAuthorizationBearer <token>

Path Parameters

id*string
Formatuuid

Response Body

OK

application/json
  1. response

A client in your hierarchy, as returned by the /v2/clients endpoints. The authenticated client and each of its descendants are represented by this object.

The id is the client's UUID: pass it as parent_id when creating a child, or as the travel-data client_id when submitting on behalf of a descendant.

id*string

The client's unique identifier (UUID). Use this value as a parent_id or as the travel-data client_id.

Formatuuid
name?|

The client's display name.

external_reference?|

Your own reference for this client, unique among the children of a given parent. Generated from the name when omitted on creation.

parent_id*|

The UUID of this client's parent, or null for the authenticated (root) client.

Formatuuid
status*"active"

The client's lifecycle status.

Value in"active"
metadata*

A set of key-value pairs of yours that helps you link this record in your system.

methodology_options*array<>

The methodologies this client calculates with, one entry per activity type and methodology. Always present: a client that has never been configured reports the SQUAKE defaults it calculates with (TIM and DEFRA for flights, DEFRA for trains and cars, GREENVIEW for hotels — all AT_TIME_OF_TRAVEL).

Set it with the methodology_configuration object on POST /v2/clients and PATCH /v2/clients/{id}.

Example Request
curl -X GET 'https://api.sandbox.squake.earth/v2/clients/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{  "id": "4fb3ec7a-92cb-471f-b75f-c3fe7c2a34d5",  "name": "BMW Germany",  "external_reference": "bmw-de",  "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    }  ]}