Create or change a custom contact field
Add a contact field, or change an existing field's label or choice options, by key. key is lowercase letters, digits and underscores, starting with a letter; left out, it is made from the label. kind is text (the default), number, boolean or choice; a choice needs options. A field's kind can't change once it exists (kind_locked): delete it and add a new one. A workspace has at most 50 fields.
Authorization
bearerAuth A personal access token from Settings > API tokens.
In: header
Path Parameters
Workspace slug (GET /me lists yours).
Header Parameters
A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/workspaces/string/contacts/fields" \ -H "Content-Type: application/json" \ -d '{}'{
"field": {
"key": "string",
"label": "string",
"kind": "string",
"property1": null,
"property2": null
},
"created": true,
"property1": null,
"property2": null
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}List contacts GET
List a workspace's contacts, 50 a page, most recently changed first. Each has its id, phoneNumber (E.164), name, tags, fields (values by field key), source (import, api or manual), doNotCall (true when the number is on the workspace's do-not-call list, which every campaign skips) and timestamps. search matches part of a name or number; tags keeps contacts with every tag given; fields keeps contacts whose field equals the value given. Contacts are separate from caller memory: someone who has called an agent is a contact only once added.
Add or remove tags on contacts POST
Add and remove tags on up to 1000 contacts at once, each named by id or phone number. A reference that matches no contact is ignored. Returns { updated }, the contacts found. Tags are stored lower case, without commas, at most 40 characters each and 50 a contact.