Contacts and batches API
Endpoints, parameters and writable fields.
Updated
The routes, their parameters, and which fields you can write. Prose about what any of it means lives on Contacts and Batches.
List
GET /api/v1/orgs/<org_id>/contacts/| Parameter | Values |
|---|---|
status | lead, active, customer, archived |
do_not_call | the literal string true |
q or search | an email, a + phone number, or a name fragment |
limit, cursor | pagination |
cURL
curl "https://api.voxcore.net/api/v1/orgs/<org_id>/contacts/?status=lead&limit=100" \
-H "Authorization: Bearer vox_sk_live_..."Python
import os, httpx
BASE, ORG = "https://api.voxcore.net", os.environ["VOXCORE_ORG"]
AUTH = {"Authorization": f"Bearer {os.environ['VOXCORE_API_KEY']}"}
page = httpx.get(
f"{BASE}/api/v1/orgs/{ORG}/contacts/",
headers=AUTH,
params={"status": "lead", "limit": 100},
).json()Python (voxcore)
from voxcore import Voxcore
vox = Voxcore()
leads = vox.contacts.list(status="lead", limit=100) # one page
everyone = vox.contacts.iterate(status="lead") # all of themCreate
POST /api/v1/orgs/<org_id>/contacts/Writable: first_name, last_name,
company, title, phone,
email, status, tags, notes,
do_not_call, do_not_call_reason,
do_not_message.
Read-only in the payload: id, display_name,
source, source_detail, do_not_call_at,
do_not_message_at, all six marketing_consent_* fields,
created_by_name, last_called_at,
call_count, created_at, updated_at.
cURL
curl -X POST https://api.voxcore.net/api/v1/orgs/<org_id>/contacts/ \
-H "Authorization: Bearer vox_sk_live_..." \
-H "Idempotency-Key: crm-row-4187" \
-H "Content-Type: application/json" \
-d '{"first_name": "Dana", "phone": "+18175550147", "status": "lead"}'Python
import os, httpx
BASE, ORG = "https://api.voxcore.net", os.environ["VOXCORE_ORG"]
AUTH = {"Authorization": f"Bearer {os.environ['VOXCORE_API_KEY']}"}
contact = httpx.post(
f"{BASE}/api/v1/orgs/{ORG}/contacts/",
headers={**AUTH, "Idempotency-Key": "crm-row-4187"},
json={"first_name": "Dana", "phone": "+18175550147", "status": "lead"},
).json()Python (voxcore)
from voxcore import Voxcore
vox = Voxcore()
contact = vox.contacts.create(
first_name="Dana",
phone="+18175550147",
status="lead",
idempotency_key="crm-row-4187",
)Writes with an API key are governed by the key's scopes. See Authentication.
Read, update, delete
GET /api/v1/orgs/<org_id>/contacts/<contact_id>/
PATCH /api/v1/orgs/<org_id>/contacts/<contact_id>/
DELETE /api/v1/orgs/<org_id>/contacts/<contact_id>/cURL
curl https://api.voxcore.net/api/v1/orgs/<org_id>/contacts/<contact_id>/ \
-H "Authorization: Bearer vox_sk_live_..."
curl -X PATCH https://api.voxcore.net/api/v1/orgs/<org_id>/contacts/<contact_id>/ \
-H "Authorization: Bearer vox_sk_live_..." \
-H "Content-Type: application/json" \
-d '{"status": "customer"}'Python
import os, httpx
BASE, ORG = "https://api.voxcore.net", os.environ["VOXCORE_ORG"]
AUTH = {"Authorization": f"Bearer {os.environ['VOXCORE_API_KEY']}"}
url = f"{BASE}/api/v1/orgs/{ORG}/contacts/{contact_id}/"
contact = httpx.get(url, headers=AUTH).json()
contact = httpx.patch(url, headers=AUTH, json={"status": "customer"}).json()
httpx.delete(url, headers=AUTH).raise_for_status()Python (voxcore)
from voxcore import Voxcore
vox = Voxcore()
contact = vox.contacts.retrieve(contact_id)
contact = vox.contacts.update(contact_id, status="customer")
vox.contacts.delete(contact_id) # soft, and returns nothingPATCH means omitted fields are left alone.
Bulk import
POST /api/v1/orgs/<org_id>/contacts/bulk/Body {"contacts": [...]}, max 500. The response:
{
"created": 482,
"skipped": [{"row": 7, "reason": "..."}],
"failed": [{"row": 12, "reason": "..."}],
"ids": ["con__...", ...]
}201 if anything was created, 200 if nothing
was.
A contact's calls
GET /api/v1/orgs/<org_id>/contacts/<contact_id>/calls/{"data": [...]}, not paginated, at most 50 rows.
Batches
GET /api/v1/orgs/<org_id>/contact-batches/ ?kind=static|dynamic
POST /api/v1/orgs/<org_id>/contact-batches/
GET /api/v1/orgs/<org_id>/contact-batches/fields/
GET /api/v1/orgs/<org_id>/contact-batches/<id>/preview/
POST /api/v1/orgs/<org_id>/contact-batches/<id>/recount/
GET /api/v1/orgs/<org_id>/contact-batches/<id>/members/
POST /api/v1/orgs/<org_id>/contact-batches/<id>/members/
DELETE /api/v1/orgs/<org_id>/contact-batches/<id>/members/cURL
curl "https://api.voxcore.net/api/v1/orgs/<org_id>/contact-batches/?kind=dynamic" \
-H "Authorization: Bearer vox_sk_live_..."Python
import os, httpx
BASE, ORG = "https://api.voxcore.net", os.environ["VOXCORE_ORG"]
AUTH = {"Authorization": f"Bearer {os.environ['VOXCORE_API_KEY']}"}
batches = httpx.get(
f"{BASE}/api/v1/orgs/{ORG}/contact-batches/",
headers=AUTH,
params={"kind": "dynamic"},
).json()["data"]Python (voxcore)
from voxcore import Voxcore
vox = Voxcore()
for batch in vox.contact_batches.iterate(kind="dynamic"):
print(batch["name"], batch["member_count"], batch["member_count_is_exact"])Writable on a batch: name, description,
kind (immutable after creation) and rule.