Skip to main content

Sender Pools API

Sender Pools endpoints exposed by the Devotel CPaaS API Base path: /api/v1/messaging/sender-pools Endpoint count: 8

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.”

Worked request and response samples

Copy a request as written, substitute your own ids, and compare the response envelope. The chain a pool-integration runs: create → list → send through the pool → (optional) preview → swap strategy. For narrative walkthroughs see the Sender pools guide.

1. Create a pool

POST /api/v1/messaging/sender-pools
Request
sender_dids accepts a mix of E.164 long codes, numeric short codes, and alphanumeric sender IDs (up to 50 per pool, no duplicates). Success returns 201 with the new pool id:

2. List pools

GET /api/v1/messaging/sender-pools
Request
The list is keyset-paginated: limit is clamped to 1–100 (default 50) and meta.pagination carries has_more plus the opaque next_cursor to pass back as ?cursor=.... Each row includes the full sender_dids membership:

3. Send through the pool

POST /api/v1/messages/sms
Request
Omit from and pass sender_pool_id; the service resolves the sender via the pool’s strategy. When both are set, the pool wins — same precedence Twilio uses for Messaging Services vs From. The echoed envelope names the resolved sender:
The full send-and-track chain (status polls, DLR webhooks) is on the Messaging samples page.

4. Preview the pick

GET /api/v1/messaging/sender-pools/{id}/preview?recipient=<E.164>
Request
Preview is strictly read-only: it never persists stickiness state, advances the round-robin counter, or mutates production routing. Use it to verify exactly which DID a pool hands a recipient before you wire the pool into a campaign:

5. Swap the strategy

PATCH /api/v1/messaging/sender-pools/{id}
Request
PATCH must carry at least one of label, sender_dids, or strategy; the response echoes the full pool so the diff (strategy moved sticky → round_robin, updated_at bumped) is visible:
The pool cache refreshes within seconds, so the next send uses the new strategy immediately.

Errors worth branching on

These failures cover the pool endpoints shown above. Each block is a full { error, meta } envelope as the API returns it, and the matrix at the bottom answers retry vs surface. 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 resend with valid sender_dids entries instead of blind-retrying the same body. A pool whose members were all pruned after creation surfaces the same status with code SENDER_POOL_EMPTY on the next send or preview — add at least one DID before sending through it.

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.

409 — Conflict

Sender membership is single-owner: a sender one pool already holds is excluded from every other pool’s member selector. Move the sender out of its current pool (or drop it from this request) and resend — repeating the same body re-conflicts deterministically, so this is a fix-then-resend class, not a retry class.

60-second retry matrix


List sender pools

GET /api/v1/messaging/sender-pools
List the tenant’s sender pools as a keyset-paginated page, newest-first. A sender pool groups sending identities (E.164 long codes, short codes, alphanumeric sender IDs) under one id you pass to /v1/messages as sender_pool_id, which resolves the actual from via the pool’s selection strategy. Use it to populate a pool picker; page with the opaque cursor query parameter from a prior page’s next_cursor and a limit clamped to 1–100 (an oversized value is clamped, not rejected).

Get sender pool

GET /api/v1/messaging/sender-pools/{id}
Fetch a single sender pool by its Orbit id, returning its label, sender identities (E.164 long codes, short codes and/or alphanumeric sender IDs) and selection strategy. Use it to hydrate a detail or edit view before rotating members into or out of the pool. Returns 404 when the id is not a sender pool in this tenant.
string
required
—

Get sender pool health

GET /api/v1/messaging/sender-pools/{id}/health
string
required
—

Explain pool members against the verified inbound inventory

GET /api/v1/messaging/sender-pools/{id}/inbound-inventory
string
required
—

Preview sender pool selection

GET /api/v1/messaging/sender-pools/{id}/preview
Dry-run which sender identity a pool would assign to a given recipient. Pass the destination as the recipient query parameter (E.164). The endpoint is read-only: it never persists stickiness state, advances the round-robin counter, or mutates production routing — preview reflects the pool’s persisted strategy. Use it to verify exactly which DID a pool hands a recipient before you wire the pool into a campaign. Returns 404 when the id is not a sender pool in this tenant.
string
required
—

Create sender pool

POST /api/v1/messaging/sender-pools
Create a sender pool — the id you reference from /v1/messages as sender_pool_id so the send path resolves the actual from identity. Required: a label and one to 50 sender_dids (E.164 long codes, short codes, or alphanumeric sender IDs — mixed types unblock alphanumeric-mandatory markets). Optional strategy selects how the pool picks a sender: sticky (same recipient keeps one DID), round_robin, random, or geomatch (recipient area code match); the default is sticky. Owner / admin only.
any
Human-readable name, 1–200 characters (required).
any
1–50 sender identities as an array of strings: E.164 long codes, numeric short codes, or alphanumeric sender IDs (required).
any
Optional selection strategy — sticky, round_robin, random or geomatch; defaults to sticky.

Update sender pool

PATCH /api/v1/messaging/sender-pools/{id}
Update mutable fields on a sender pool in place — send only the fields you want to change (label, sender_dids and/or strategy; at least one is required or the request is 422). Use it to rotate members into or out of a live pool or to switch its selection strategy without re-pointing the messages that reference it. Owner / admin only; returns 404 when the id is not a sender pool in this tenant.
string
required
—
any
New human-readable name, 1–200 characters.
any
Replacement member list, 1–50 sender identities as an array of strings.
any
New selection strategy — sticky, round_robin, random or geomatch.

Delete sender pool

DELETE /api/v1/messaging/sender-pools/{id}
Permanently delete a sender pool and its stickiness rows (per-recipient DID assignments). New /v1/messages calls referencing the id fail to resolve immediately; messages already sent are unaffected. Use it to retire a rotation group you no longer need. Owner / admin only; returns 404 when the id is not a sender pool in this tenant and 204 No Content on success.
string
required
—
Response: 204 No Content