Vocatech

By area

Contacts

Read from the API’s own reference file every hour.

Plain text

Your contacts: the fields they carry, the list, create or update in batches, delete, and find by phone number.

List contact fields

GET/v1/contacts/fields

The fields your contacts carry, in display order. A field's name is the key in every contact's fields, and the name to use when you create or update contacts.

is_match fields find an existing contact on create. is_phone fields hold phone numbers: we keep digits only, and several numbers are separated by ;. A field tied to one of your integrations carries integration.

Request

curl https://api.vocatech.com/v1/contacts/fields \
  -H "Authorization: Bearer YOUR_API_KEY"

Answers

200
Your contact fields.
FieldTypeDescription
fields requiredarray of objects
fields[].id requiredinteger
fields[].name requiredstringThe field's name: the key in every contact's fields.
fields[].order requiredintegerDisplay order.
fields[].is_phone requiredbooleanHolds phone numbers. We keep digits only; several numbers are separated by ;.
fields[].is_match requiredbooleanUsed to find an existing contact on create. A contact whose match fields all equal yours is updated instead.
fields[].reports_enabled requiredbooleanA display setting from the portal.
fields[].hide_no_data requiredbooleanA display setting from the portal.
fields[].show_in_fields requiredbooleanA display setting from the portal.
fields[].is_integration requiredbooleanTrue when the field is tied to one of your integrations.
fields[].integrationobjectPresent only on integration fields: the integration's settings, as set in the portal.
fields[].integration.idinteger
fields[].integration.initialsstring
fields[].integration.image_urlstring
fields[].integration.fieldsarray of objects
fields[].integration.fields[].keystring
fields[].integration.fields[].display_namestring
fields[].integration.fields[].valuestring
fields[].integration.fields[].fillsarray, each anyIntegration settings, as set in the portal.
Example
{
  "fields": [
    {
      "id": 31,
      "name": "First Name",
      "order": 1,
      "is_phone": false,
      "is_match": false,
      "reports_enabled": true,
      "hide_no_data": false,
      "show_in_fields": true,
      "is_integration": false
    },
    {
      "id": 32,
      "name": "Last Name",
      "order": 2,
      "is_phone": false,
      "is_match": false,
      "reports_enabled": true,
      "hide_no_data": false,
      "show_in_fields": true,
      "is_integration": false
    },
    {
      "id": 33,
      "name": "Phone",
      "order": 3,
      "is_phone": true,
      "is_match": true,
      "reports_enabled": true,
      "hide_no_data": false,
      "show_in_fields": true,
      "is_integration": false
    },
    {
      "id": 34,
      "name": "Email",
      "order": 4,
      "is_phone": false,
      "is_match": false,
      "reports_enabled": false,
      "hide_no_data": true,
      "show_in_fields": true,
      "is_integration": false
    },
    {
      "id": 35,
      "name": "Account Number",
      "order": 5,
      "is_phone": false,
      "is_match": true,
      "reports_enabled": false,
      "hide_no_data": true,
      "show_in_fields": true,
      "is_integration": false
    }
  ]
}
401
No key, or a key that is wrong or turned off.
403
Refused. The key is scoped away from this route, the request came from an address not on the key's allow-list, or the route refused the request (the message says why).
429
A rate limit was reached. Wait Retry-After seconds. The body names the counter, the window and the limit.
HeaderTypeDescription
Retry-AfterintegerSeconds to wait before you try again.
503
Try again shortly. The key could not be checked just now (Retry-After: 5), or a service this route needs could not be reached.
HeaderTypeDescription
Retry-AfterintegerSeconds to wait before you try again.

List contacts

GET/v1/contacts

Your contacts, oldest first. search finds contacts where any field contains the text.

Request

curl -G https://api.vocatech.com/v1/contacts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "page=1" \
  --data-urlencode "limit=100"

Parameters

NameInTypeDescription
pagequeryintegerPage number, from 1. Default 1. At least 1.
limitqueryintegerContacts per page, 1 to 500. A value outside that range is brought inside it. Default 100. From 1 to 500.
searchquerystringText to find in any field. For example Reyes.

Answers

200
A page of contacts.
FieldTypeDescription
query requiredobject
query.page requiredinteger
query.limit requiredinteger
query.search requiredstring or null
contacts requiredarray of objects
contacts[].id requiredintegerThe contact's id.
contacts[].fields requiredobjectField name to value. The names are your contact fields (GET /v1/contacts/fields). Phone fields hold digits; several numbers are separated by ;.
contacts[].fields.{field}string or nullOne value for each field, by its name.
meta requiredobjectPaging for list routes. Each list adds its own total.
meta.page requiredintegerThis page, from 1.
meta.limit requiredintegerRows per page, after limits were applied.
meta.total_pages requiredintegerHow many pages there are.
meta.total_contacts requiredintegerContacts that match. total_pages is 0 when there are none.
Example
{
  "query": {
    "page": 1,
    "limit": 100,
    "search": null
  },
  "contacts": [
    {
      "id": 5012,
      "fields": {
        "First Name": "Jordan",
        "Last Name": "Reyes",
        "Phone": "7185550142",
        "Email": "jordan.reyes@example.com",
        "Account Number": "A-2291"
      }
    },
    {
      "id": 5013,
      "fields": {
        "First Name": "Sam",
        "Last Name": "Patel",
        "Phone": "7185550143;9175550123",
        "Email": "sam.patel@example.com",
        "Account Number": "A-2310"
      }
    }
  ],
  "meta": {
    "page": 1,
    "limit": 100,
    "total_pages": 1,
    "total_contacts": 2
  }
}
401
No key, or a key that is wrong or turned off.
403
Refused. The key is scoped away from this route, the request came from an address not on the key's allow-list, or the route refused the request (the message says why).
429
A rate limit was reached. Wait Retry-After seconds. The body names the counter, the window and the limit.
HeaderTypeDescription
Retry-AfterintegerSeconds to wait before you try again.
503
Try again shortly. The key could not be checked just now (Retry-After: 5), or a service this route needs could not be reached.
HeaderTypeDescription
Retry-AfterintegerSeconds to wait before you try again.

Create or update contacts

POST/v1/contacts

Creates a contact, or updates the one that matches. Send one contact as {"fields": {...}}, or up to 500 as {"contacts": [{"fields": {...}}]}.

fields maps field names (from GET /v1/contacts/fields) to values. Names we do not know are ignored. Values over 255 characters are cut. Phone fields keep digits only; separate several numbers with ;.

Matching. When your account has match fields (is_match: true), a contact whose match fields all equal yours is updated instead of created. With no match fields, every contact is created new.

One contact answers 201 when created and 200 when updated. A batch always answers 200. One bad entry does not stop the rest: errors lists each one by its index in your array.

Request

curl -X POST https://api.vocatech.com/v1/contacts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "First Name": "Jordan",
      "Last Name": "Reyes",
      "Phone": "(718) 555-0142",
      "Email": "jordan.reyes@example.com",
      "Account Number": "A-2291"
    }
  }'

Body

One contact

FieldTypeDescription
fields requiredobjectField name to value. Names come from GET /v1/contacts/fields; unknown names are ignored. Values over 255 characters are cut. At least 1 field.
fields.{field}string or nullOne value for each field, by its name.

A batch

FieldTypeDescription
contacts requiredarray of objectsUp to 500 items.
contacts[].fields requiredobjectField name to value. Names come from GET /v1/contacts/fields; unknown names are ignored. Values over 255 characters are cut. At least 1 field.
contacts[].fields.{field}string or nullOne value for each field, by its name.
One contact
{
  "fields": {
    "First Name": "Jordan",
    "Last Name": "Reyes",
    "Phone": "(718) 555-0142",
    "Email": "jordan.reyes@example.com",
    "Account Number": "A-2291"
  }
}
A batch
{
  "contacts": [
    {
      "fields": {
        "First Name": "Jordan",
        "Last Name": "Reyes",
        "Phone": "7185550142",
        "Account Number": "A-2291"
      }
    },
    {
      "fields": {
        "First Name": "Sam",
        "Last Name": "Patel",
        "Phone": "7185550143;9175550123",
        "Account Number": "A-2310"
      }
    }
  ]
}

Answers

200
One contact was updated, or a batch was processed.
FieldTypeDescription
summary requiredobject
summary.total requiredinteger
summary.created requiredinteger
summary.updated requiredinteger
summary.errors requiredinteger
contacts requiredarray of objects
contacts[].contact requiredobject
contacts[].contact.id requiredintegerThe contact's id.
contacts[].contact.fields requiredobjectField name to value. The names are your contact fields (GET /v1/contacts/fields). Phone fields hold digits; several numbers are separated by ;.
contacts[].contact.fields.{field}string or nullOne value for each field, by its name.
contacts[].action requiredstringOne of created or updated.
errors requiredarray of objects
errors[].index requiredintegerThe entry's position in your contacts array, from 0.
errors[].message requiredstring
Example
{
  "summary": {
    "total": 2,
    "created": 1,
    "updated": 1,
    "errors": 0
  },
  "contacts": [
    {
      "contact": {
        "id": 5012,
        "fields": {
          "First Name": "Jordan",
          "Last Name": "Reyes",
          "Phone": "7185550142",
          "Email": "jordan.reyes@example.com",
          "Account Number": "A-2291"
        }
      },
      "action": "updated"
    },
    {
      "contact": {
        "id": 5013,
        "fields": {
          "First Name": "Sam",
          "Last Name": "Patel",
          "Phone": "7185550143;9175550123",
          "Email": "sam.patel@example.com",
          "Account Number": "A-2310"
        }
      },
      "action": "created"
    }
  ],
  "errors": []
}
201
One contact was created.
FieldTypeDescription
summary requiredobject
summary.total requiredinteger
summary.created requiredinteger
summary.updated requiredinteger
summary.errors requiredinteger
contacts requiredarray of objects
contacts[].contact requiredobject
contacts[].contact.id requiredintegerThe contact's id.
contacts[].contact.fields requiredobjectField name to value. The names are your contact fields (GET /v1/contacts/fields). Phone fields hold digits; several numbers are separated by ;.
contacts[].contact.fields.{field}string or nullOne value for each field, by its name.
contacts[].action requiredstringOne of created or updated.
errors requiredarray of objects
errors[].index requiredintegerThe entry's position in your contacts array, from 0.
errors[].message requiredstring
Example
{
  "summary": {
    "total": 1,
    "created": 1,
    "updated": 0,
    "errors": 0
  },
  "contacts": [
    {
      "contact": {
        "id": 5012,
        "fields": {
          "First Name": "Jordan",
          "Last Name": "Reyes",
          "Phone": "7185550142",
          "Email": "jordan.reyes@example.com",
          "Account Number": "A-2291"
        }
      },
      "action": "created"
    }
  ],
  "errors": []
}
401
No key, or a key that is wrong or turned off.
403
Refused. The key is scoped away from this route, the request came from an address not on the key's allow-list, or the route refused the request (the message says why).
422
No fields object, or a batch over 500.
Example bodies
Example
{
  "error": {
    "code": 422,
    "type": "UNPROCESSABLE_ENTITY",
    "message": "Missing or invalid \"fields\" object."
  }
}
Example
{
  "error": {
    "code": 422,
    "type": "UNPROCESSABLE_ENTITY",
    "message": "Batch size cannot exceed 500 contacts."
  }
}
429
A rate limit was reached. Wait Retry-After seconds. The body names the counter, the window and the limit.
HeaderTypeDescription
Retry-AfterintegerSeconds to wait before you try again.
503
Try again shortly. The key could not be checked just now (Retry-After: 5), or a service this route needs could not be reached.
HeaderTypeDescription
Retry-AfterintegerSeconds to wait before you try again.

Delete contacts

DELETE/v1/contacts

Deletes one contact ({"id": 5012}) or up to 500 ({"ids": [5012, 5013]}). The ids go in a JSON body.

One contact that is not yours or does not exist answers 404. In a batch it is listed in errors, and the rest are deleted.

Request

curl -X DELETE https://api.vocatech.com/v1/contacts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": 5012
  }'

Body

One contact

FieldTypeDescription
id requiredinteger

A batch

FieldTypeDescription
ids requiredarray of integersUp to 500 items.
One contact
{
  "id": 5012
}
A batch
{
  "ids": [
    5012,
    5013,
    5099
  ]
}

Answers

200
Deleted.

One contact

FieldTypeDescription
deleted requiredintegerThe id that was deleted.

A batch

FieldTypeDescription
summary requiredobject
summary.total requiredinteger
summary.deleted requiredinteger
summary.errors requiredinteger
deleted requiredarray of integersThe ids that were deleted.
errors requiredarray of objectsIds not found on your account.
errors[].id requiredinteger
errors[].message requiredstring
One contact
{
  "deleted": 5012
}
A batch
{
  "summary": {
    "total": 3,
    "deleted": 2,
    "errors": 1
  },
  "deleted": [
    5012,
    5013
  ],
  "errors": [
    {
      "id": 5099,
      "message": "The contact you requested does not exist."
    }
  ]
}
401
No key, or a key that is wrong or turned off.
403
Refused. The key is scoped away from this route, the request came from an address not on the key's allow-list, or the route refused the request (the message says why).
404
One contact: not found on your account.
Example body
Example
{
  "error": {
    "code": 404,
    "type": "NOT_FOUND",
    "message": "The contact you requested does not exist."
  }
}
422
No id, or a batch over 500.
Example bodies
Example
{
  "error": {
    "code": 422,
    "type": "UNPROCESSABLE_ENTITY",
    "message": "Missing \"id\" field."
  }
}
Example
{
  "error": {
    "code": 422,
    "type": "UNPROCESSABLE_ENTITY",
    "message": "Batch size cannot exceed 500 IDs."
  }
}
429
A rate limit was reached. Wait Retry-After seconds. The body names the counter, the window and the limit.
HeaderTypeDescription
Retry-AfterintegerSeconds to wait before you try again.
503
Try again shortly. The key could not be checked just now (Retry-After: 5), or a service this route needs could not be reached.
HeaderTypeDescription
Retry-AfterintegerSeconds to wait before you try again.

Find contacts by phone number

GET/v1/contacts/lookup

The contacts a phone number belongs to, up to 10, through the same phone index Callpop uses. Any format works on either side: (718) 555-0142, +17185550142 and 7185550142 find the same contact.

Keys with the agents scope can call this route.

Request

curl -G https://api.vocatech.com/v1/contacts/lookup \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "phone=7185550142"

Parameters

NameInTypeDescription
phone requiredquerystringThe phone number, any format, at least 7 digits. For example 7185550142.

Answers

200
The contacts with that number. found is false when there are none.
FieldTypeDescription
phone requiredstringThe number you asked about, digits only, without a leading 1.
found requiredboolean
contacts requiredarray of objectsUp to 10. Up to 10 items.
contacts[].id requiredintegerThe contact's id.
contacts[].fields requiredobjectField name to value. The names are your contact fields (GET /v1/contacts/fields). Phone fields hold digits; several numbers are separated by ;.
contacts[].fields.{field}string or nullOne value for each field, by its name.
Example
{
  "phone": "7185550142",
  "found": true,
  "contacts": [
    {
      "id": 5012,
      "fields": {
        "First Name": "Jordan",
        "Last Name": "Reyes",
        "Phone": "7185550142",
        "Email": "jordan.reyes@example.com",
        "Account Number": "A-2291"
      }
    }
  ]
}
400
No phone, or fewer than 7 digits.
Example body
Example
{
  "error": {
    "code": 400,
    "type": "BAD_REQUEST",
    "message": "phone is required and must contain at least 7 digits."
  }
}
401
No key, or a key that is wrong or turned off.
403
Refused. The key is scoped away from this route, the request came from an address not on the key's allow-list, or the route refused the request (the message says why).
429
A rate limit was reached. Wait Retry-After seconds. The body names the counter, the window and the limit.
HeaderTypeDescription
Retry-AfterintegerSeconds to wait before you try again.
503
Try again shortly. The key could not be checked just now (Retry-After: 5), or a service this route needs could not be reached.
HeaderTypeDescription
Retry-AfterintegerSeconds to wait before you try again.