Skip to main content

Imports API

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

List recent import jobs

GET /api/v1/imports/
Return the recent migration import jobs for the calling organization, each with its source, current status, and lifecycle timestamps. 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. This is a light projection — the full per-entity progress and run options are fetched from the single-job endpoint.

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), run options, 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

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

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.

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.

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

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

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
required
Encrypted credentials envelope returned by the connect / manual-credentials step.
string[]
required
Entity kinds to preview (e.g. phone_numbers, contacts, messaging_services).
integer
Optional lookback window for conversation history (Twilio caps this at 90 days).

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
required
Encrypted credentials envelope returned by the connect / manual-credentials step.
string[]
required
Entity kinds to import (e.g. phone_numbers, contacts, messaging_services).
integer
Optional lookback window for conversation history (Twilio caps this at 90 days).
object
Optional per-entity conflict policy keyed by entity kind.

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
required
Telnyx V2 API key — starts with KEY followed by 16-128 base62 characters.
string
Optional display-only Telnyx account identifier surfaced in the wizard 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
required
Twilio Account SID — starts with AC followed by 32 hex characters.
string
required
Twilio Auth Token for the account (8-256 characters).