Skip to main content

Imports API

Imports endpoints exposed by the Devotel CPaaS API Base path: /api/v1/imports Endpoint count: 13

title: “Errors worth branching on” description: “Per-endpoint failure templates matching the envelope — what actually fires, what to retry, what to surface to the operator.”

Errors worth branching on

These five failures cover the import job create + status poll (POST /api/v1/imports, GET /api/v1/imports/), hammered by every onboarding wizard. Each block below is a full { error, meta } envelope as the API returns it, and the matrix at the bottom answers retry vs surface for the same five classes. For the platform-wide decision table these branches plug into, see the error handling guide.

401 — Unauthorized

A 401 on this page is the bearer key failing before the route ran — it never means the resource is wrong. Rotate the key or re-mint the scoped token; retrying the same request changes nothing.

403 — Forbidden

A 403 means the key authenticated but the operation is gated by scope — check the key’s scopes on the developer page; a 403 is never a data-not-found shape.

422 — Schema

A 422 means the payload did not match the request schema — branch on error.details.field and poll GET /api/v1/imports/ for the job state instead of re-posting the same payload instead of blind-retrying the same body.

429 — Rate

The Retry-After header and error.details.retry_after are both set on every 429 — resend the SAME request after the lower of the two.

402 — Feature gate

Keep polling the job status; re-run the connect wizard only when the job reports source_lost.

60-second retry matrix


List recent import jobs

GET /api/v1/imports
Return the recent migration import jobs for the calling organization, each with its source, status, and per-entity progress. Use this to render the import history table in the dashboard and to find the job id of an import to inspect, cancel, or roll back.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Get an import job

GET /api/v1/imports/{jobId}
Fetch a single migration import job by id, including its source, current status, failure reason (if any), and per-entity progress counts. Poll this for a point-in-time snapshot, or subscribe to /imports//progress for a live stream of the same job.
string
required
Import job id, as returned by POST /imports//run or the list endpoint.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Stream import job progress

GET /api/v1/imports/{jobId}/progress
Subscribe to a Server-Sent Events stream of an import job’s progress: per-entity counts, status transitions, and a terminal end event. The first frame is a snapshot of the current job state so a late subscriber renders immediately, and keepalive comments are sent every 15 seconds. Open this from the wizard after starting a run; a job that has already terminated replays its final frame and closes.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Complete the Twilio Connect authorization

GET /api/v1/imports/twilio/callback
OAuth redirect target for the Twilio Connect flow. Validates the CSRF state and PKCE verifier, exchanges the authorization code for Twilio credentials, encrypts them into an opaque envelope, and redirects the browser back to the import wizard with the envelope attached. Twilio calls this URL directly after the user approves access — it is not invoked from an SDK, and the raw access token is never returned to the browser.
string
Authorization code posted back by Twilio after the user approves access.
string
CSRF state token issued by GET /imports/twilio/connect. Single-use.
string
Twilio error code when the user denied the authorization.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Start the Twilio Connect authorization

GET /api/v1/imports/twilio/connect
Begin the Twilio Connect OAuth flow for the one-click migration importer. Generates a PKCE (S256) challenge and a CSRF state bound to the caller’s organization and user, stores them server-side, and returns the Twilio authorization URL for the wizard to open. Call this from step one of the import wizard; when Twilio Connect is not configured on the environment the endpoint returns 503 and the operator falls back to manual credentials.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Cancel a running import job

POST /api/v1/imports/{jobId}/cancel
Request cancellation of an in-flight import job. The status is flipped to cancelled and the worker stops between pages on its next status re-check. Only jobs that are still pending or running can be cancelled; a job that has already reached a terminal status returns a conflict.
string
required
—
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Roll back a completed import

POST /api/v1/imports/{jobId}/rollback
Delete every contact created by this import batch in a single transaction and record the rollback on the job. This is destructive and is restricted to owner or admin roles; roll back only after the job has finished or been cancelled. A job that is still running, or one already rolled back, returns a conflict.
string
required
—
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Preview an import before running it

POST /api/v1/imports/{source}/dry-run
Count the upstream entities and detect conflicts with existing Orbit data for the selected source, so the wizard can show an accurate ETA and conflict count before the operator commits to a run. Post the encrypted credentials envelope and the entity kinds to import (optionally capping Twilio conversation history at 90 days); nothing is written. Use this in the wizard’s “pick what to import” step, ahead of the run call.
string
required
—
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Start an import job

POST /api/v1/imports/{source}/run
Enqueue a background import job for the selected source. Persists the encrypted credentials envelope on a fresh import job, queues the worker, and returns the job id so the wizard can open the progress stream at /imports//progress. Post the same envelope and entity selection used for the dry-run, optionally with a per-entity conflict policy (skip, overwrite, or merge).
string
required
—
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Submit Klaviyo credentials manually

POST /api/v1/imports/klaviyo/manual-credentials
Accept a Klaviyo private API key (starts with pk_) and an optional display-only account label and return an encrypted, opaque credentials envelope for the import wizard. The key is used only to READ the customer’s Klaviyo audience and configuration — lists, segments, templates, flows, and profiles — during the migration; no outbound traffic is ever routed through Klaviyo as a result. The raw key is never echoed back or logged.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Submit MessageBird credentials manually

POST /api/v1/imports/messagebird/manual-credentials
Accept a MessageBird (Bird) access key and an optional display-only account label and return an encrypted, opaque credentials envelope for the import wizard. The key is used only to READ the customer’s MessageBird configuration and audience — conversation channels, contacts, and flows — during the migration; no outbound traffic is ever routed through MessageBird as a result. The raw key is never echoed back or logged.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Submit Telnyx credentials manually

POST /api/v1/imports/telnyx/manual-credentials
Accept a Telnyx V2 API key (starts with KEY) and an optional display-only account identifier and return an encrypted, opaque credentials envelope for the import wizard. The key is used only to READ the customer’s Telnyx configuration — phone numbers, messaging profiles, 10DLC campaigns, and recent message records — during the migration; no outbound traffic is ever routed through Telnyx as a result. The raw key is never echoed back or logged.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Submit Twilio credentials manually

POST /api/v1/imports/twilio/manual-credentials
Fallback to the Twilio Connect OAuth flow: accept a Twilio Account SID (starts with AC) and Auth Token and return an encrypted, opaque credentials envelope the import wizard hands forward to the dry-run and run steps. Use this when the OAuth flow is unavailable, such as self-hosted subaccounts or environments without Twilio Connect. The envelope is never stored client-side and the raw auth token is never echoed back.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.