# Update source configuration PATCH /v1/a/segment/{id}/source/{source\_id} Select code sample ``` const url = 'https://example.com/v1/a/segment/example/source/example'; const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"auto_update":true,"reset_reach":true}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ``` curl --request PATCH \ --url https://example.com/v1/a/segment/example/source/example \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "auto_update": true, "reset_reach": true }' ``` - /v1/a/segment/{id}/source/{source\_id} Takes `auto_update` and `reset_reach`. Rules: - `reset_reach` changes only while the source is a draft. - A file source’s content is not here: it is the `file` sub-resource, and each supply carries its own `type` and `country_code`. Refused while a publish of the segment’s sources runs. ## Permission This operation needs the permission [`segment:write`](https://docs.aiva.apifonica.com/concepts/roles-and-permissions/#segment-write). ## Authorizations - **[bearerAuth](https://docs.aiva.apifonica.com/api/account/#bearerauth)** ## Parameters ### Path Parameters **id** required string **source\_id** required string ### Header Parameters **X-Account-Sid** string Names the target account for account-scoped resources. By principal: - A tenant API key carries no account scope of its own and names the account here. - An account-scoped principal may omit it. Refused when: - A tenant API key omits it. - An account-scoped principal sends a value naming any other account. - The named account belongs to another tenant. - The named account does not exist; it is answered as not found. ## Request Bodyrequired Media typeapplication/json The source’s own configuration, as opposed to its content: a file’s rows are supplied on its `file` sub-resource, not here. object **auto\_update** Keeps the segment in step with this source. Refused for a kind whose content cannot change. boolean | null **reset\_reach** Puts the contacts this source supplies back on the automation’s list when the source is published. Changeable while the source is a draft; refused afterwards. boolean | null ##### Examplegenerated ``` { "auto_update": true, "reset_reach": true } ``` ## Responses ### 200 OK Media typeapplication/json An origin a segment’s membership comes from. It belongs to the segment it was uploaded into and cannot exist without one. object **id** required string **account\_sid** required Names the account that owns the source. string **segment\_sid** required Names the segment this source belongs to. A source never exists without one. string **kind** required Says where this source’s contacts come from. Values: - `file`: the contacts come from a supplied file. - `manual`: the contacts are named one at a time. string Allowed values: file manual **status** required Records the state of the source. Values: - `draft`: its content is editable. - `published`: is set after publish. - `removed`: is set after a delete. A published or removed source is frozen and stays in the list. string Allowed values: draft published removed **auto\_update** required Says whether the segment follows later changes to this source. Always false for the kinds served today, whose content cannot change once supplied. boolean **reset\_reach** required Puts the contacts this source supplies back on the list of the automation that holds the segment when the source is published. Changeable while the source is a draft. boolean **filename** Names the uploaded file, as supplied. string | null **counts** required Counts the rows a source holds. object **total** required Counts the rows the source holds. integer format: int64 **success** required Counts the rows that are published, each a contact. integer format: int64 **rejected** required Counts the rows that could not be used. Retrievable as a file. integer format: int64 **total\_count** required Rows the source holds. Replaced by `counts.total`. integer format: int64 **success\_count** required Rows that are published, each a contact. Replaced by `counts.success`. integer format: int64 **error\_count** required Rows that could not be used. Replaced by `counts.rejected`. integer format: int64 **created\_at** required string format: date-time **updated\_at** required string format: date-time ##### Example ``` { "kind": "file", "status": "draft" } ``` ### 400 Bad request Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required Carries the registered machine code, stable once assigned. The codes: - `ERRxxx`: is a generic code that follows from the status class. - `ERR001`–`ERR020`: are reserved for generic codes. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** Names why a number or a row is refused. Values: - `number_missing`: the number is missing or blank. - `number_no_digits`: the number holds no digits. - `identifier_invalid`: an alphanumeric identifier does not start with a letter or a digit. - `number_not_international`: the number is written as international and is not a valid one. - `number_not_for_country`: the number is not valid for the stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was stated to read it by. - `value_too_long`: a data value is longer than the account’s value limit in bytes. Given for a row only. - `type_mismatch`: a data value does not read as the type its field holds across the account’s contacts. Given for a row only. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** Names the rule the contact data breaks. Values: - `array_item_not_scalar`: an array item is an object, an array or null. - `type_mismatch`: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** Names the field by its path. By failure: - For a broken limit, it is the field that breaks the limit. - For too many fields, it is the first new field past the limit. - For a rename, it is the field that stops the rename. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** Carries the details of the breach. By breach: - For a broken limit, it carries the numbers of the limit. - For a type mismatch, it carries the two types. - For an array item that is not a scalar, it is empty. object **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: Refuses a request whose form is wrong. Returned when: - The body, a path parameter or a query parameter does not parse. - `Content-Encoding` names a compression the API does not accept, or the body cannot be decompressed as named. - A brick to validate names a type or a version the API does not know. - A data field path or a column name in the body is not well formed, or a key of a row’s `data` is empty or holds a dot. - A node `position` in the constructor of a scenario save carries one of `x` and `y` without the other. - The operation needs a WebSocket upgrade, and the request is not one. `message` names what failed. string Allowed values: bad\_request The credential acts for a tenant or for the platform, and the request names no account in `X-Account-Sid` (or no tenant in `X-Tenant-Sid`). string Allowed values: missing\_scope\_header Refuses the value of the scope header. Returned when: - The scope header names an account or tenant the credential does not cover. - The scope header carries a value that is not an id of that kind. string Allowed values: scope\_conflict ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "bad_request" } ``` ### 401 Unauthorized Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required Carries the registered machine code, stable once assigned. The codes: - `ERRxxx`: is a generic code that follows from the status class. - `ERR001`–`ERR020`: are reserved for generic codes. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** Names why a number or a row is refused. Values: - `number_missing`: the number is missing or blank. - `number_no_digits`: the number holds no digits. - `identifier_invalid`: an alphanumeric identifier does not start with a letter or a digit. - `number_not_international`: the number is written as international and is not a valid one. - `number_not_for_country`: the number is not valid for the stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was stated to read it by. - `value_too_long`: a data value is longer than the account’s value limit in bytes. Given for a row only. - `type_mismatch`: a data value does not read as the type its field holds across the account’s contacts. Given for a row only. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** Names the rule the contact data breaks. Values: - `array_item_not_scalar`: an array item is an object, an array or null. - `type_mismatch`: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** Names the field by its path. By failure: - For a broken limit, it is the field that breaks the limit. - For too many fields, it is the first new field past the limit. - For a rename, it is the field that stops the rename. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** Carries the details of the breach. By breach: - For a broken limit, it carries the numbers of the limit. - For a type mismatch, it carries the two types. - For an array item that is not a scalar, it is empty. object **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: Refuses a request that cannot be authenticated. Returned when: - The request carries no usable credential. - The user, account or tenant behind the credential is not active. string Allowed values: unauthenticated ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "unauthenticated" } ``` ### 403 Forbidden Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required Carries the registered machine code, stable once assigned. The codes: - `ERRxxx`: is a generic code that follows from the status class. - `ERR001`–`ERR020`: are reserved for generic codes. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** Names why a number or a row is refused. Values: - `number_missing`: the number is missing or blank. - `number_no_digits`: the number holds no digits. - `identifier_invalid`: an alphanumeric identifier does not start with a letter or a digit. - `number_not_international`: the number is written as international and is not a valid one. - `number_not_for_country`: the number is not valid for the stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was stated to read it by. - `value_too_long`: a data value is longer than the account’s value limit in bytes. Given for a row only. - `type_mismatch`: a data value does not read as the type its field holds across the account’s contacts. Given for a row only. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** Names the rule the contact data breaks. Values: - `array_item_not_scalar`: an array item is an object, an array or null. - `type_mismatch`: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** Names the field by its path. By failure: - For a broken limit, it is the field that breaks the limit. - For too many fields, it is the first new field past the limit. - For a rename, it is the field that stops the rename. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** Carries the details of the breach. By breach: - For a broken limit, it carries the numbers of the limit. - For a type mismatch, it carries the two types. - For an array item that is not a scalar, it is empty. object **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: The credential is valid and in scope, but the caller’s roles do not grant the permission the operation needs. string Allowed values: permission\_denied ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "permission_denied" } ``` ### 404 Not found Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required Carries the registered machine code, stable once assigned. The codes: - `ERRxxx`: is a generic code that follows from the status class. - `ERR001`–`ERR020`: are reserved for generic codes. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** Names why a number or a row is refused. Values: - `number_missing`: the number is missing or blank. - `number_no_digits`: the number holds no digits. - `identifier_invalid`: an alphanumeric identifier does not start with a letter or a digit. - `number_not_international`: the number is written as international and is not a valid one. - `number_not_for_country`: the number is not valid for the stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was stated to read it by. - `value_too_long`: a data value is longer than the account’s value limit in bytes. Given for a row only. - `type_mismatch`: a data value does not read as the type its field holds across the account’s contacts. Given for a row only. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** Names the rule the contact data breaks. Values: - `array_item_not_scalar`: an array item is an object, an array or null. - `type_mismatch`: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** Names the field by its path. By failure: - For a broken limit, it is the field that breaks the limit. - For too many fields, it is the first new field past the limit. - For a rename, it is the field that stops the rename. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** Carries the details of the breach. By breach: - For a broken limit, it carries the numbers of the limit. - For a type mismatch, it carries the two types. - For an array item that is not a scalar, it is empty. object **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: Refuses an identifier that names no resource the caller can use. Returned when: - No live resource with this identifier is visible to the caller. - The resource the identifier names belongs to another account. string Allowed values: not\_found No live segment of the account with this id. string Allowed values: segment\_not\_found No source with this id in the segment addressed. string Allowed values: source\_not\_found ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "not_found" } ``` ### 409 Conflict Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required Carries the registered machine code, stable once assigned. The codes: - `ERRxxx`: is a generic code that follows from the status class. - `ERR001`–`ERR020`: are reserved for generic codes. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** Names why a number or a row is refused. Values: - `number_missing`: the number is missing or blank. - `number_no_digits`: the number holds no digits. - `identifier_invalid`: an alphanumeric identifier does not start with a letter or a digit. - `number_not_international`: the number is written as international and is not a valid one. - `number_not_for_country`: the number is not valid for the stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was stated to read it by. - `value_too_long`: a data value is longer than the account’s value limit in bytes. Given for a row only. - `type_mismatch`: a data value does not read as the type its field holds across the account’s contacts. Given for a row only. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** Names the rule the contact data breaks. Values: - `array_item_not_scalar`: an array item is an object, an array or null. - `type_mismatch`: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** Names the field by its path. By failure: - For a broken limit, it is the field that breaks the limit. - For too many fields, it is the first new field past the limit. - For a rename, it is the field that stops the rename. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** Carries the details of the breach. By breach: - For a broken limit, it carries the numbers of the limit. - For a type mismatch, it carries the two types. - For an array item that is not a scalar, it is empty. object **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: The account’s default segment takes no edit, no source and no delete. string Allowed values: segment\_default\_read\_only A publish of the segment’s sources is running; until it ends the sources take no write and no second publish. A publish that stopped without finishing counts as running for five minutes after it last worked. string Allowed values: segment\_publish\_running ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "segment_default_read_only" } ``` ### 422 Unprocessable Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required Carries the registered machine code, stable once assigned. The codes: - `ERRxxx`: is a generic code that follows from the status class. - `ERR001`–`ERR020`: are reserved for generic codes. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** Names why a number or a row is refused. Values: - `number_missing`: the number is missing or blank. - `number_no_digits`: the number holds no digits. - `identifier_invalid`: an alphanumeric identifier does not start with a letter or a digit. - `number_not_international`: the number is written as international and is not a valid one. - `number_not_for_country`: the number is not valid for the stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was stated to read it by. - `value_too_long`: a data value is longer than the account’s value limit in bytes. Given for a row only. - `type_mismatch`: a data value does not read as the type its field holds across the account’s contacts. Given for a row only. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** Names the rule the contact data breaks. Values: - `array_item_not_scalar`: an array item is an object, an array or null. - `type_mismatch`: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** Names the field by its path. By failure: - For a broken limit, it is the field that breaks the limit. - For too many fields, it is the first new field past the limit. - For a rename, it is the field that stops the rename. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** Carries the details of the breach. By breach: - For a broken limit, it carries the numbers of the limit. - For a type mismatch, it carries the two types. - For an array item that is not a scalar, it is empty. object **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: Refuses the segment or source in the request. Returned when: - `name` is empty. - The source kind is not one the platform offers. - `auto_update` is set on a source kind that cannot be followed. string Allowed values: segment\_invalid The source is published; its rows and its `reset_reach` no longer change. string Allowed values: source\_published The source is removed and takes no write. string Allowed values: source\_removed ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "segment_invalid" } ``` ### 500 Internal server error Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required Carries the registered machine code, stable once assigned. The codes: - `ERRxxx`: is a generic code that follows from the status class. - `ERR001`–`ERR020`: are reserved for generic codes. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** Names why a number or a row is refused. Values: - `number_missing`: the number is missing or blank. - `number_no_digits`: the number holds no digits. - `identifier_invalid`: an alphanumeric identifier does not start with a letter or a digit. - `number_not_international`: the number is written as international and is not a valid one. - `number_not_for_country`: the number is not valid for the stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was stated to read it by. - `value_too_long`: a data value is longer than the account’s value limit in bytes. Given for a row only. - `type_mismatch`: a data value does not read as the type its field holds across the account’s contacts. Given for a row only. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** Names the rule the contact data breaks. Values: - `array_item_not_scalar`: an array item is an object, an array or null. - `type_mismatch`: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** Names the field by its path. By failure: - For a broken limit, it is the field that breaks the limit. - For too many fields, it is the first new field past the limit. - For a rename, it is the field that stops the rename. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** Carries the details of the breach. By breach: - For a broken limit, it carries the numbers of the limit. - For a type mismatch, it carries the two types. - For an array item that is not a scalar, it is empty. object **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" } } ``` ## Error codes | Status | Error | Meaning | | ------ | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `bad_request` | Refuses a request whose form is wrong. Returned when: - The body, a path parameter or a query parameter does not parse. - `Content-Encoding` names a compression the API does not accept, or the body cannot be decompressed as named. - A brick to validate names a type or a version the API does not know. - A data field path or a column name in the body is not well formed, or a key of a row's `data` is empty or holds a dot. - A node `position` in the constructor of a scenario save carries one of `x` and `y` without the other. - The operation needs a WebSocket upgrade, and the request is not one. `message` names what failed. | | 400 | `missing_scope_header` | The credential acts for a tenant or for the platform, and the request names no account in `X-Account-Sid` (or no tenant in `X-Tenant-Sid`). | | 400 | `scope_conflict` | Refuses the value of the scope header. Returned when: - The scope header names an account or tenant the credential does not cover. - The scope header carries a value that is not an id of that kind. | | 401 | `unauthenticated` | Refuses a request that cannot be authenticated. Returned when: - The request carries no usable credential. - The user, account or tenant behind the credential is not active. | | 403 | `permission_denied` | The credential is valid and in scope, but the caller's roles do not grant the permission the operation needs. | | 404 | `not_found` | Refuses an identifier that names no resource the caller can use. Returned when: - No live resource with this identifier is visible to the caller. - The resource the identifier names belongs to another account. | | 404 | `segment_not_found` | No live segment of the account with this id. | | 404 | `source_not_found` | No source with this id in the segment addressed. | | 409 | `segment_default_read_only` | The account's default segment takes no edit, no source and no delete. | | 409 | `segment_publish_running` | A publish of the segment's sources is running; until it ends the sources take no write and no second publish. A publish that stopped without finishing counts as running for five minutes after it last worked. | | 422 | `segment_invalid` | Refuses the segment or source in the request. Returned when: - `name` is empty. - The source kind is not one the platform offers. - `auto_update` is set on a source kind that cannot be followed. | | 422 | `source_published` | The source is published; its rows and its `reset_reach` no longer change. | | 422 | `source_removed` | The source is removed and takes no write. |