Skip to main content

The contact resource

A contact is one record in your directory — phone, email, name, tags, consent, plus your own data layered on top. Custom-field values ride on the contact as the custom_fields object: set them on a contact and they come back inline on every contact response — create, read, list — with no separate lookup. Custom-field keys and their types are defined under /api/v1/custom-fields. Write a value with PUT /api/v1/custom-fields/values and read it back on the contact’s custom_fields object. Every response on this page follows the same envelope — data plus a meta block carrying request_id, timestamp, and, on list responses, pagination — so the examples below hold for every endpoint here. Errors follow Devotel Orbit’s { error, meta } envelope, shown once under Error envelope.

Worked sequence: create, set custom fields, read back

The run-through every integration does first: create the contact, attach your own data, then pull the contact back and see the values inline.

1. Create the contact

POST /api/v1/contacts/
At least one of phone or email is required. Send phone numbers in E.164 (+14155551234); display formats are normalized to E.164 before insert. Request
The new contact returns an empty custom_fields object until you set values.

2. Set custom-field values

PUT /api/v1/custom-fields/values
One call per field. key must match a custom-field definition you already created, and the value must match that definition’s type — values of the wrong type are rejected. Request

3. Read back — values inline

GET /api/v1/contacts/{id}
Request

Worked sequence: list with filters, then paginate

GET /api/v1/contacts/
Filters combine on the query string — tags=vip, country_code=US — search narrows by name, phone, or email. The response is cursor-paginated: while meta.pagination.has_more is true, pass meta.pagination.cursor back as the cursor query parameter to fetch the next page. Here the list is filtered to one tag. Request
has_more is true, so request the next page:
Treat the cursor as opaque. Keep the same filters across pages and stop when has_more comes back false.

Error envelope

Validation failures return 422 with a VALIDATION_ERROR code. The classic case is a phone value that fails the format and length checks — below the E.164 floor or not recognizable:
422
When you hit this on create or update, normalize the number to E.164 (country code, digits only, leading +) and retry. A missing-or-unknown custom-field key on PUT /custom-fields/values surfaces the same envelope with a four-hundred status, so handle both before you code a special case.

GDPR erasure — from request to confirmed status

Erasure is a tenant-owned control: you file it, Orbit executes it and keeps the audit chain. The generated reference section for DELETE /api/v1/contacts/{id}/gdpr/delete documents the synchronous cascade but stops at 204 No Content — nothing there tells you how to confirm the deletion you just ran, or how to read the pending/completed status on the cancellable flow. This section closes that gap.

The immediate delete answers 204; the status lives one call away

DELETE /api/v1/contacts/{id}/gdpr/delete
The immediate right-to-erasure returns 204 with an intentionally empty body. On success the contact is gone — any read of the same id returns 404. The probe pair: mint the re-auth challenge, delete, then confirm. Step 1 — mint the re-auth challenge
200
Step 2 — delete (204, empty body by design)
Without a valid challenge token in X-Reauth-Challenge, the delete returns 401 and erases nothing:
401 Error

The cancellable erasure request returns a full status envelope

POST /api/v1/contacts/{id}/gdpr/erasure-request
Unlike the immediate cascade, this flow starts a cooling-off window (per-tenant, seven days by default) and answers 202 with the full request — so you always know whether the deletion is still pending, executing, completed, or cancellable:
status moves pending → executing → executed once the scheduled worker hard-deletes the contact past cooling_off_ends_at (a failed run leaves failure_reason and retries up to its attempt cap; a cancelled request records cancelled_at and never executes). To cancel while it is still pending, pass the request id to POST /:id/gdpr/erasure-request/:requestId/cancel. Poll the status on the per-contact list endpoint — the object above under data.items:
200

Duplicate detection and merge review

Two endpoints handle duplicate detection: a cheap aggregate count for banner surfaces and pre-merge checks, and the full group list you fetch when you open the merge workflow.
GET /api/v1/contacts/duplicates/count
Returns extras — the number of contacts that would be merged away — plus hasMore indicating whether duplicates exist beyond the slice the count scanned. Use it for banner headlines and pre-merge checks.
string
exact (default) or fuzzy. exact is the right choice for banner counts; fuzzy mirrors the detection pass the merge endpoint uses.
integer
Per-strategy group cap, default 100, range 1–200. Raise it when hasMore returns true and you need to scan deeper before reporting “0 duplicates.”
Use GET /duplicates to fetch the full group list (with per-group contact records) when you actually render the merge review UI — fetching it just for a banner paints the contacts page with data you don’t read.

Response envelopes for the generated shells

The operations below return real bodies that the generated sections render as the empty placeholder shell. Each block ships the envelope the handler actually sends — request line first, then the 200/201 body — so you can code against the fields your integration branches on. Cursor-paginated responses carry meta.pagination (as on the list example above); a one-line callout marks each of them and every 204-style empty body.

Reads — profile, preview, scores, health, engagement, timeline

1. Lightweight contact preview

GET /api/v1/contacts/{id}/preview
Use this for inbox-row hover cards; it is a strict subset of the profile below (phone, email, sent/received counters only) so a hover never pays for the full Customer 360 fetch.

2. Customer 360 profile

GET /api/v1/contacts/{id}/profile
The timeline slice is cursor-paginated via limit + next_cursor; every other slice returns in full. score is null until the nightly scoring run has seeded the contact.

3. Predictive scores

GET /api/v1/contacts/{id}/scores
A contact the nightly scoring run has not reached yet returns the same envelope with scored: false, all score fields null, and a message explaining when the first score lands.

4. Deliverability health for one contact

GET /api/v1/contacts/{id}/deliverability-health
raw is the deliverability blend before consent is considered; sendableScore, blockReason, and label are the consent-suppression overlay verdict. The pair lets you render “healthy 0.92, blocked by opt-out” without conflating the two questions.

5. Engagement profile

GET /api/v1/contacts/{id}/engagement
profile is null until the profiler has seen five events; counters still returns zeroed figures so you can judge whether smart-send timing has enough signal yet.

6. Unified contact timeline

GET /api/v1/contacts/{id}/timeline
Cursor-paginated: pass next_cursor back as cursor while has_more is true. Item ids are composite <type>:<source-id> and stable across calls; filter with channels[] (sms, email, call, ticket, event).

7. GDPR erasure requests for a contact

GET /api/v1/contacts/{id}/gdpr/erasure-requests
The full status vocabulary (pending → executing → executed, plus cancelled / failed) is documented in the GDPR section above; pass the row’s id to the cancel endpoint below while it is still pending.

8. Pre-erasure data-impact preview

GET /api/v1/contacts/{id}/gdpr/preview
counts keys are the categories the cascade erases; total_records is their sum. 404 when the contact does not exist in the tenant.

9. Blocked contacts

GET /api/v1/contacts/blocked
Cursor-paginated like the main list. Rows are full contact records plus the blocked_at / blocked_reason audit pair; the list is the reconciliation surface for POST /{id}/block and POST /{id}/unblock.

10. Duplicate count

GET /api/v1/contacts/duplicates/count
extras counts contacts that would be merged away; hasMore says whether more duplicate groups exist beyond the capped scan. See the duplicate-detection section above for strategy guidance.

11. One segment

GET /api/v1/contacts/segments/{id}
contact_count is the cached audience size from the last refresh tick; the estimate and evaluate endpoints below give live numbers. 404 when the id does not exist.

12. Segment deliverability health

GET /api/v1/contacts/segments/{id}/deliverability-health
overallHealth is the raw deliverability blend over the cohort; sendableHealth is the same blend after the consent-suppression overlay — the honest “78–88% reachable, rest consent-blocked” split for the segment card. truncated turns true when the cohort slice hits the member cap.

13. Segment totals

GET /api/v1/contacts/segments/stats
Use this for header aggregates instead of summing the paginated GET /segments rows, which understates totals once a tenant has more than one page. membersCapped is true when any segment’s member count hit the counting cap.
POST /api/v1/contacts/{id}/consent
Request
GET /api/v1/contacts/{id}/consent
Request

16. GDPR re-auth challenge

POST /api/v1/contacts/{id}/gdpr/delete/challenge
Request
Without the challenge in X-Reauth-Challenge, DELETE /{id}/gdpr/delete answers 401 REAUTH_REQUIRED and erases nothing.

17. Cancel a pending erasure request

POST /api/v1/contacts/{id}/gdpr/erasure-request/{requestId}/cancel
Request
Once the request has moved to executing or executed, cancel answers 409 CONFLICT — the cooling-off window is the only cancellable phase.

18. Export personal data (DSAR)

POST /api/v1/contacts/{id}/gdpr/export
Request
Without include_messages=true the body collapses to contact + exported_at only. Every call is audit-logged.

19. Create a note

POST /api/v1/contacts/{id}/notes
Request

20. Add tags

POST /api/v1/contacts/{id}/tags
Request
Duplicates in the request are ignored; the response is always the contact’s complete tag set after the merge.

21. Remove one tag

DELETE /api/v1/contacts/{id}/tags/{tag}
Request

22. Unblock a contact

POST /api/v1/contacts/{id}/unblock
Request
The updated blocked state; POST /{id}/block is the inverse and mirrors the audit pair (contact.blocked / contact.unblocked).

23. Bulk create contacts

POST /api/v1/contacts/bulk
Request
Large bodies are chunked into a background job (job_id set); poll GET /contacts/import-jobs/{id} for progress. Dedup hits count under skipped.

24. Ad-hoc blast to a contact selection

POST /api/v1/contacts/bulk/send
Request
The blast creates a real campaign, so opt-outs, frequency caps, billing, and DLR tracking apply exactly as for scheduled campaigns; a send-queue outage at launch answers 503 and sends nothing instead of stranding a half-launched campaign.

25. Opt a contact out of a channel

POST /api/v1/contacts/optouts
Request
data is the contact with the suppression applied plus already_opted_out; a repeat opt-out answers 200 (not 201) with already_opted_out: true so your UI can toast “already opted out” distinctly.

26. Re-opt a contact in for a channel

DELETE /api/v1/contacts/optouts/{id}/{channel}
Request
The inverse of the opt-out: the channel suppression is removed and the contact.opted_in webhook fires; data is the contact record with the suppression cleared.

27. Bulk contact actions

POST /api/v1/contacts/actions
Request
action is one of tag, untag, stage_change, delete, add_to_list; failed lists the ids that did not apply and partial flips true when it is non-empty.

28. Estimate a segment definition

POST /api/v1/contacts/segments/estimate
Request
A bounded, timeout-capped count over the filter AST — use it to show the audience size before you commit to POST /segments.

29. Create a segment

POST /api/v1/contacts/segments
Request
Missing in_segment / not_in_segment references answer 400 before any row is written, so a typo can never create a segment that silently matches zero contacts.

Typed-SDK writes — segments, bulk actions, DSAR export

The generated tabs above ship these writes as raw HTTP. Both official SDKs reach the same routes — Node wraps segments on orbit.contacts.segments.* (list, create, get, iter) and exposes orbit.request(...) for the rest; Python wraps the core contact surface on client.contacts.* and uses client.request(...) for routes below it. Where a typed method exists, these samples are the ones to copy.

30. Create a segment with the typed SDKs

POST /api/v1/contacts/segments
Request
Both forms answer the same 201 envelope shown in item 29 — data is the stored segment row with contact_count live immediately.

31. Read a segment’s members

GET /api/v1/contacts/segments/{id}/members
Request
Member rows are full contact records — the same shape the main list returns. Keep limit identical across pages and stop when has_more is false.

32. Bulk tag and segment actions

POST /api/v1/contacts/actions
Request
The batch answers the same envelope as item 27 — affected, failed, and partial. action also takes untag, stage_change, delete, and add_to_list; add_to_list is how a bulk action applies a segment.

33. Export personal data (DSAR) from the SDKs

POST /api/v1/contacts/{id}/gdpr/export
Request
The body is the item-18 envelope — contact, messages when requested, and exported_at. Without include_messages=true it collapses to contact + exported_at.

Worked sequence: build a segment and read its members

The full loop in one pass, ported from the API recipes guide in typed-SDK form: create the segment, then page its membership for the contacts behind it. Create the segment
A 201 returns the stored row — data.contact_count is live immediately, not a scheduler estimate. Read its members
Pass meta.pagination.cursor back as cursor while has_more is true; keep limit identical across pages. To preview the audience size before creating anything, run the filter through POST /segments/estimate (item 28) first.