Skip to main content

Worked request and response samples

Copy a request body as written, substitute your own ids, and compare the response envelope. Errors follow Devotel Orbit’s { error, meta } envelope, shown once below under Error envelope.
Auto-winner governance. POST /campaigns/{id}/variants accepts three optional knobs that gate the automatic winner-promotion scheduler: ab_auto_promote (boolean | null — false keeps every promotion behind the manual POST /campaigns/{id}/ab-select-winner call, null resets to the default true), ab_min_sample_size (integer | null — deliveries the leading variant must reach before an automatic verdict, 10–1,000,000, null resets to the default 30), and ab_confidence_threshold (number | null — Bayesian posterior confidence required to promote, 0.500–0.999, null resets to the default 0.950). GET /campaigns/{id}/ab-results echoes those settings together with a live auto_winner_progress snapshot — the gate values the evaluator currently applies, the current leader, and whether it would already lock — so a dashboard can render real progress toward an automatic verdict. See the A/B testing guide.
Cross-channel governance in one call. GET /campaigns/{id}/governance-summary aggregates the four governance primitives a campaign’s settings panel previously issued four separate calls for: the A/B(n) experiment config plus auto-winner governance, the control hold-out cohort, the resolved quiet-hours window (with campaign / org_default / platform_default source attribution), and the effective frequency-cap rules — global rules folded in alongside channel-scoped rules, each labelled applies: true|false so the dashboard can place the badge without re-admitting the org-wide caps list client-side. Use this ONE round-trip when you render the “rules in effect” card; the individual sources stay available if you only want one.

Create a campaign

POST /api/v1/campaigns/
Request

Check for overlapping schedules

POST /api/v1/campaigns/check-schedule-conflicts
Request

Launch the campaign

POST /api/v1/campaigns/{id}/send
Request

Error envelope

422

Worked sequences

The catalogue trims operations past the fifteenth to the cURL + Node.js (TypeScript) pair the SDK sample coverage policy guarantees. The chain below re-runs this surface’s hero flow in the full six-language group so the same calls are copy-paste complete from Python, Go, Ruby, and PHP: create with the typed call where the SDK publishes one, launch under a stable Idempotency-Key, poll to a terminal status with the 429 retry_after branch, then reconcile the per-recipient ledger page by cursor page. The cURL/REST walkthrough with the full failure-modes table is REST API recipes, task 36.

1. Create the campaign

Create against a saved segment. The Node and Python SDKs type name, channel, and the optional message_template; to attach the audience (segment_id) or template_id at creation instead, post the cURL body as-is through each SDK’s request helper.

2. Launch the send under a stable Idempotency-Key

The send is the one call in the loop where the key is yours to choose: generate it from the run you are dispatching (job id plus attempt salt), not from a clock. Sandbox semantics ride on the key prefix — on dv_test_sk_… nothing is delivered for real and no credits are deducted (test_sent status, meta.test_mode: true).

3. Poll the run to a terminal status, honoring 429

GET /campaigns/{id} moves the run through draft → sending → one terminal status: completed, partially_failed, paused, or cancelled. partially_failed is still terminal — the ledger in step 4 names which recipients failed. Poll on a few-second cadence; when a poll itself 429s, sleep the named retry_after before the next attempt instead of burning the rate budget.

4. Reconcile the per-recipient ledger

GET /campaigns/{id}/recipients pages the run’s recipient rows. The page handle lives at pagination, one level deeper than the standard meta.pagination. Each row carries to, status, channel, contact_id, the error_code / error_message pair on failures, the sent_at / delivered_at / failed_at timestamps, and segments, price, currency for billing-side joins. pagination.total_count and pagination.failed_count are computed over the full run, not the loaded page, so they close the ledger without draining every page.

When the send or the poll errors

Two envelopes deserve explicit branches. A 409 on POST /campaigns/{id}/send means the run has left a sendable state — paused, cancelled, or terminal — and Orbit refuses to double-dispatch it. Do not retry the same send: resume the same run with POST /campaigns/{id}/resume, or clone the campaign and send the clone.
409
A 429 on any call names the wait in error.retry_after and repeats it in the Retry-After header. Sleep the named seconds, then retry — a send replayed with the same Idempotency-Key after a throttle returns the original dispatch, never a second batch.
429
A send whose audience resolves to zero recipients fails fast with a 422, and a credit balance below the wallet floor fails with a 402 — both reject before dispatch, so the fix-then-replay path is safe with the same key. An expired or wrong cursor on the ledger is a 422 INVALID_CURSOR; restart the iteration without a cursor.