Skip to content

Update contact

PATCH
/v1/a/contact/{id}
curl --request PATCH \
--url https://example.com/v1/a/contact/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "number": "example", "type": "number", "country_code": "example", "data": {}, "revision": "example" }'

Updates the contact: an omitted number, type, country_code or data preserves the current value.

The fields:

  • number: a submitted one is brought to the stored form by type and country_code, as on create.
  • data: a submitted object replaces the stored one wholesale, and {} clears it.
  • communication_history: is not writable.

Refused when:

  • The revision is not the contact’s current one.
  • A data value has another type than its field holds across the account’s contacts.
  • The contact’s data would be past a data limit of the account after the write, data stored before a limit was lowered included.

Permission

This operation needs the permission contact:write.

id
required
string
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.
Media typeapplication/json

Carries a partial update of the contact: an omitted number, type, country_code or data preserves the current value.

The fields:

  • number: a submitted one reaches the stored form through type and country_code, as on create.
  • data: a submitted object replaces the stored one wholesale; its parts are never merged, and {} clears it.
  • A field of data set to null is not stored.
  • communication_history: is absent here because it is not writable through the API.

Refused when:

  • type or country_code is sent without a number.
  • data is set to null.
object
number

As on create; the type and country_code of this request apply to it.

string
type

Declares what an identifier is.

Values:

  • number: is a phone number, brought to the stored form before it is kept or compared.
  • alphanumeric: is a SIP identifier, kept as sent and checked only to start with a letter or a digit.

A request that omits it means number, and a value outside the two is refused.

string
Allowed values: number alphanumeric
country_code

Supplies the country for a phone number that arrives without an international mark (+ or 00): 0501111222 with pl stores as 48501111222.

Rules:

  • It is an ISO 3166-1 alpha-2 code, in upper or lower case, from GET /v1/a/info/countries.
  • A number already in the international form ignores it.

Refused when:

  • The code is unknown.
  • The code is sent with type alphanumeric.
string
data
object
key
additional properties
any
revision
required

Carries the revision the caller read, exactly as it was returned.

string

OK

Media typeapplication/json

The full contact, including its call log in communication_history.

object
id
required
string
account_sid
required

Names the account that owns the contact.

string
number
required

Identifies the contact within the account, in the stored form.

By type:

  • A phone number is stored as its country calling code followed by the national number, digits only (37123112233).
  • A SIP identifier is stored as it was sent.
string
type
required
Any of:

Declares what an identifier is.

Values:

  • number: is a phone number, brought to the stored form before it is kept or compared.
  • alphanumeric: is a SIP identifier, kept as sent and checked only to start with a letter or a digit.

A request that omits it means number, and a value outside the two is refused.

string
Allowed values: number alphanumeric
country_code
required

Records the country the stored number belongs to, ISO 3166-1 alpha-2, lowercase.

Null when:

  • The identifier is alphanumeric.
  • The number is outside any country’s range.
  • The platform holds no country for the number.
string | null
data
required

Holds everything the account has on the person; {} when nothing is held.

object
key
additional properties
any
data_usage
required

Reports how much of the account’s limits the contact’s data takes, counted the way the limits count it.

object
fields
required
object
current
required

Counts the fields of the data, at any depth, an array as one field.

integer
limit
required

Reports the account’s field limit.

integer
value_bytes
required

Reports the account’s byte limit for one value and for each item of an array.

integer
array_items
required

Reports the account’s limit for the items of one array.

integer
values
required

Lists every field of the data by its dotted path, in path order.

Array<object>
object
field
required

Names the field by its dotted path.

string
bytes
required

Counts the bytes of the value’s text; for an array, those of its longest item.

integer
items

Counts the items of an array; absent for any other value.

integer
revision
required

Hash of the contact’s current number, type, country_code and data. An edit sends it back to prevent a lost update under concurrent writes.

string
communication_history
required

Lists the last 50 finished calls with the person.

Rules:

  • The newest call comes first.
  • A deleted communication is not listed.
  • The list is [] when there is none.

A call receives the same list at its start as the read-only communication_history system variable.

Array<object>

One finished call with a contact, as the contact’s call log carries it. A call is finished when its status is done, failed, drifted or stopped.

object
communication_sid
required

Names the communication that holds the full record of the call.

string
direction
required
string
Allowed values: inbound outbound
communication_status
required

Where the call stands. stopped is the one that is not an outcome: the call was asked for and never placed, because the work that asked for it was switched off first, so the person is still to reach. in_progress_offline is a call that has ended while its scenario still runs the bricks that need no call; the line is free, and the outcome follows when the scenario ends.

string
Allowed values: new ready dialing in_progress in_progress_offline bounced done failed drifted stopped
call_status
required
Any of:

Reports the telephony state of the call.

Values:

  • trying, ringing and answered are transient: the call is still running.
  • Every other value is final.
  • abandoned: is an inbound call the caller ended before it was answered.
string
Allowed values: trying ringing answered busy rejected no_answer voicemail incomplete completed failed tech_canceled abandoned
reason
required

Explains why the call ended in its status; empty when no reason was recorded.

string
duration
required

Reports the call duration between answer and hangup, in seconds; 0 for a call that was not answered or never placed.

integer
scenario_sid
required

Names the scenario the call ran; empty for a call that records no scenario.

string
agent_sid
required

Names the agent the call ran through; empty for a call with no agent.

string
automation_sid
required

Names the automation that placed the call; null for a call no automation placed.

string | null
occurred_at
required

Records when the call reached its final status.

string format: date-time
segment_sids
required

Lists the account’s segments this contact is currently in, its default segment included.

Array<string>
created_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{
"type": "number",
"communication_history": [
{
"direction": "inbound",
"communication_status": "new",
"call_status": "trying"
}
]
}

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>
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<object>

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<object>

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<object>

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<object>

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<object>

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
Example
{
"data": {
"reason": "number_missing",
"trigger": "too_many_fields"
},
"error": "bad_request"
}

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>
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<object>

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<object>

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<object>

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<object>

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<object>

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"
}

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>
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<object>

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<object>

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<object>

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<object>

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<object>

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"
}

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>
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<object>

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<object>

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<object>

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<object>

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<object>

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:

No live contact with this id.

string
Allowed values: contact_not_found
Example
{
"data": {
"reason": "number_missing",
"trigger": "too_many_fields"
},
"error": "contact_not_found"
}

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>
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<object>

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<object>

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<object>

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<object>

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<object>

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 contact does not have the revision the request carries.

string
Allowed values: contact_changed
Example
{
"data": {
"reason": "number_missing",
"trigger": "too_many_fields"
},
"error": "contact_changed"
}

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>
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<object>

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<object>

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<object>

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<object>

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<object>

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 contact data the account cannot hold.

Returned when:

  • The contact data would break a limit of its account.
  • The contact data is already past a limit, and the write leaves it past.
  • A value has another type than its field holds across the account’s contacts.
  • An item of an array is an object, an array or null.

data names the limit, the field and the numbers or the types.

string
Allowed values: contact_data_limit
Example
{
"data": {
"reason": "number_missing",
"trigger": "too_many_fields"
},
"error": "contact_data_limit"
}

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>
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<object>

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<object>

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<object>

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<object>

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<object>

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

StatusErrorMeaning
400bad_requestRefuses 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.
400country_code_invalidRefuses the country_code of the request. Returned when: - country_code is not a known country. - country_code is not accepted with the type given.
400identifier_type_invalidtype names an unknown way of reading a number.
400missing_scope_headerThe 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).
400scope_conflictRefuses 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.
400validation_failedRefuses a body that does not pass validation. Returned when: - The body does not parse. - The body lacks a required field. - The body carries a value that is not accepted. message names the field.
401unauthenticatedRefuses 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.
403permission_deniedThe credential is valid and in scope, but the caller's roles do not grant the permission the operation needs.
404contact_not_foundNo live contact with this id.
404not_foundRefuses 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.
409contact_changedThe contact does not have the revision the request carries.
422contact_data_limitRefuses contact data the account cannot hold. Returned when: - The contact data would break a limit of its account. - The contact data is already past a limit, and the write leaves it past. - A value has another type than its field holds across the account's contacts. - An item of an array is an object, an array or null. data names the limit, the field and the numbers or the types.
422contact_invalidRefuses the contact number in the request. Returned when: - The number is missing. - The number cannot be brought to the stored form. data.reason names why, as a code.
422contact_number_takenThe account already holds a contact with this number.
422validation_failedRefuses a body that does not pass validation. Returned when: - The body does not parse. - The body lacks a required field. - The body carries a value that is not accepted. message names the field.