# Update a Client Updates the editable fields of a visible client: , , , and . Only the fields you send are changed; the others keep their current values. Sending 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 (), and readable but disallowed options — an unknown or , two defaults for one activity type, more than three per type — with (). Either way nothing is written, including the other fields sent in the same request. Re-parenting is not supported. A that would move the client — including , which reads as a request to make it a root — is rejected with () and nothing is written. Sending the client's current 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 . Endpoint: PATCH /v2/clients/{id} Security: Bearer-Auth ## Path parameters: - `id` (string, required) ## Request fields (application/json): - `name` (string) - `external_reference` (string) - `metadata` (object) A set of key-value pairs of yours that helps you link this record in your system. - `methodology_configuration` (object) The methodologies the client calculates with. Omit the whole object to leave the current configuration untouched. When present it must carry ; an empty object is rejected with (). - `methodology_configuration.methodology_options` (array, required) The full list of options to store. Replaces the client's current options outright — an empty array clears them. - `methodology_configuration.methodology_options.activity_type` (string, required) The activity type this option applies to. Enum: "flight", "train", "car", "hotel" - `methodology_configuration.methodology_options.methodology` (string, required) The methodology used to calculate this activity type. Must be one of the methodologies available for the ; anything else is rejected with (). - `methodology_configuration.methodology_options.version` (string,null) The methodology version to calculate with. Use to always pick the factor set that was valid on the travel date. Send (or omit the field) to use the methodology's current version. Only , , , , and publish selectable versions; for the others the value is informational. - `methodology_configuration.methodology_options.default` (boolean, required) Whether this is the methodology reported for the activity type. Exactly one option per must be . Required on every entry — an entry without a boolean is rejected with (). ## Response 200 fields (application/json): - `id` (string, required) The client's unique identifier (UUID). Use this value as a or as the travel-data . - `name` (string,null) The client's display name. - `external_reference` (string,null) Your own reference for this client, unique among the children of a given parent. Generated from the name when omitted on creation. - `parent_id` (string,null, required) The UUID of this client's parent, or for the authenticated (root) client. - `status` (string, required) The client's lifecycle status. Enum: "active" - `metadata` (object, required) A set of key-value pairs of yours that helps you link this record in your system. - `methodology_options` (array, required) 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 ( and for flights, for trains and cars, for hotels — all ). Set it with the object on and . - `methodology_options.activity_type` (string, required) The activity type this option applies to. Enum: "flight", "train", "car", "hotel" - `methodology_options.methodology` (string, required) The methodology used to calculate this activity type. Must be one of the methodologies available for the ; anything else is rejected with (). - `methodology_options.version` (string,null) The methodology version to calculate with. Use to always pick the factor set that was valid on the travel date. Send (or omit the field) to use the methodology's current version. Only , , , , and publish selectable versions; for the others the value is informational. - `methodology_options.default` (boolean, required) Whether this is the methodology reported for the activity type. Exactly one option per must be . Required on every entry — an entry without a boolean is rejected with (). ## Response 400 fields (application/json): - `errors` (array) - `errors.code` (string, required) An application-specific error code, expressed as a string value. Enum: "field_validation_error", "invalid_params", "server_error", "not_authorized", "not_found", "invalid_methodology", "invalid_type", "client_not_found", "invalid_parent_client", "client_has_children", "parent_id_immutable", "travel_data_not_found" - `errors.detail` (string) A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized. - `errors.source` (object) An object containing references to the primary source of the error - `errors.source.id` (string) - `errors.source.attribute` (string, required) - `errors.source.model` (string) ## Response 401 fields (application/json): - `errors` (array) - `errors.code` (string, required) An application-specific error code, expressed as a string value. Enum: "field_validation_error", "invalid_params", "server_error", "not_authorized", "not_found", "invalid_methodology", "invalid_type", "client_not_found", "invalid_parent_client", "client_has_children", "parent_id_immutable", "travel_data_not_found" - `errors.detail` (string) A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized. - `errors.source` (object) An object containing references to the primary source of the error - `errors.source.id` (string) - `errors.source.attribute` (string, required) - `errors.source.model` (string) ## Response 404 fields (application/json): - `errors` (array) - `errors.code` (string, required) An application-specific error code, expressed as a string value. Enum: "field_validation_error", "invalid_params", "server_error", "not_authorized", "not_found", "invalid_methodology", "invalid_type", "client_not_found", "invalid_parent_client", "client_has_children", "parent_id_immutable", "travel_data_not_found" - `errors.detail` (string) A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized. - `errors.source` (object) An object containing references to the primary source of the error - `errors.source.id` (string) - `errors.source.attribute` (string, required) - `errors.source.model` (string) ## Response 422 fields (application/json): - `errors` (array) - `errors.code` (string, required) An application-specific error code, expressed as a string value. Enum: "field_validation_error", "invalid_params", "server_error", "not_authorized", "not_found", "invalid_methodology", "invalid_type", "client_not_found", "invalid_parent_client", "client_has_children", "parent_id_immutable", "travel_data_not_found" - `errors.detail` (string) A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized. - `errors.source` (object) An object containing references to the primary source of the error - `errors.source.id` (string) - `errors.source.attribute` (string, required) - `errors.source.model` (string)