VocalDocscontracts 1.65.0

Merge a Contact into another

POST /v1/contacts/{contact_id}/merge

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

Merges the source the body names into the Contact the path names (1.61.0; section 2.5, rule 3), irreversibly: the source becomes a merged tombstone that Calls resolve through for 90 days (a target), and an Audit event names both ids; contact.merged is written. Two ids of one system are 409 contact_merge_conflict; a target that is not active is contact_not_active; the source itself or one that is not active is validation_failed (contact_merge_self, contact_merge_source_not_active).

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/ctc_.../merge" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "source_contact_id": "ctc_..." }'

Parameters

NameInTypeRequiredDescription
contact_idpathContactIdyesThe id of a Contact: ctc_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
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: ContactMergeRequest.

FieldTypeRequiredDescription
source_contact_idContactIdyesThe Contact merged into the target.

Responses

StatusContent typeShapeError codes
200application/jsonContactMerge
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused, contact_not_active, contact_merge_conflict
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is ContactMerge.

FieldTypeRequiredDescription
contactContactyes
merged_atTimestampyes
object"contact_merge"yes
source_contact_idContactIdyesNow a merged tombstone.