VocalDocscontracts 1.65.0

Import Contacts

POST /v1/contacts/imports

PropertyValue
Operationcreate_contact_import
GroupContacts
Scopecontacts:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited contacts.import.create (mutation)
Released in1.61.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Queues an import of at most 10,000 Contacts (a target), each upserted as POST /v1/contacts/upsert matches it, and answers 202 with the import and its Location (1.61.0). The rows are encrypted under the Organization data key, stored and deleted within 7 days of processing (a target); the report names failed rows by number and code only.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the contacts:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/contacts/imports" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "contacts": [
      {}
    ]
  }'

Parameters

NameInTypeRequiredDescription
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: ContactImportRequest.

FieldTypeRequiredDescription
contactsarray of ContactCreateRequestyesAt most 10000 rows (a target), each upserted as POST /v1/contacts/upsert matches it.

Responses

StatusContent typeShapeError codes
202application/jsonContactImport
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 202 answer

The shape is ContactImport.

FieldTypeRequiredDescription
countsContactImportCountsyes
created_atTimestampyes
created_byActorRefyes
environmentEnvironmentyes
error_codestring or nullyesWhy a failed import read nothing; null otherwise.
errorsarray of ContactImportRowErroryesThe first 100 failed rows (a target), in row order.
finished_atTimestamp or nullyes
idContactImportIdyes
kindContactImportKindyes
object"contact_import"yes
started_atTimestamp or nullyes
statusContactImportStatusyes