Update a Client
Updates the editable fields of a visible client: name, external_reference, metadata, and
methodology_configuration. Only the fields you send are changed; the others keep their
current values.
Sending methodology_configuration replaces the client's methodology options in full — send
every option the client should keep, not just the ones that change. When the resulting list
differs from the current one, the activities already stored for this client are recalculated
with the new methodologies in the background; the response returns as soon as the
configuration is written.
The whole update is atomic: options that cannot be read as a list are rejected with
invalid_methodology_options (400), and readable but disallowed options — an unknown
activity_type or methodology, two defaults for one activity type, more than three per
type — with invalid_methodology_options (422). Either way nothing is written, including
the other fields sent in the same request.
Re-parenting is not supported. A parent_id that would move the client — including null,
which reads as a request to make it a root — is rejected with parent_id_immutable (400)
and nothing is written. Sending the client's current parent_id is accepted and ignored, so
you can read a client, change a field, and send the whole object back unchanged in shape.
Requires this feature to be enabled for your account (contact us); otherwise this endpoint responds with 404.
Bearer-AuthAuthorizationBearer <token>id*stringuuidapplication/json- body
name?stringexternal_reference?stringmetadata?A set of key-value pairs of yours that helps you link this record in your system.
methodology_configuration?The methodologies the client calculates with. Omit the whole object to leave the
current configuration untouched. When present it must carry
methodology_options; an empty object is rejected with
invalid_methodology_options (400).
OK
application/json- 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*stringThe client's unique identifier (UUID). Use this value as a parent_id or as the travel-data client_id.
uuidname?|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.
uuidstatus*"active"The client's lifecycle status.
"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}.
curl -X PATCH 'https://api.sandbox.squake.earth/v2/clients/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Content-Type: application/json' \ -d '{}'{ "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 } ]}List Clients
Returns the authenticated client together with all of its descendants. Only clients you can act for are ever returned — never a parent, sibling, or unrelated client. Results are paginated with the standard `page` / `per_page` query parameters; pagination metadata is returned in the response headers. Requires this feature to be enabled for your account (contact us); otherwise this endpoint responds with `404`.
Create Child Client
Creates a new child client under the authenticated client (or under a visible descendant via `parent_id`). The child is created for travel-data ingestion only: it inherits address, tax, currency, and methodology defaults from its parent, but has no credentials, no billing or purchasing capability, and no product or project access. Submit travel data for the new client by passing its `id` as the `client_id` on `POST /v2/travel-data`. The child is usable on the very next request after creation. Send `methodology_configuration` to configure the child's methodologies in the same request instead of inheriting the parent's. Omit it and the child gets a copy of the parent's current options — a copy, not a link: later changes on the parent never propagate to the child. Options that cannot be read as a list at all are rejected with `invalid_methodology_options` (`400`); options that are readable but not allowed — an unknown `activity_type` or `methodology`, two defaults for one activity type, more than three per type — are rejected with `invalid_methodology_options` (`422`). In both cases no client is created. Requires this feature to be enabled for your account (contact us); otherwise this endpoint responds with `404`.