Languages: every operation supports cURL, Node.js (TypeScript), Python, Go, Ruby, and PHP. The first 15 operations on this page show all six languages; the remaining 31 show cURL and TypeScript — the two most-used.
Email API
Email endpoints exposed by the Devotel CPaaS API Base path:/api/v1/email
Endpoint count: 44
title: “Worked email lifecycle samples” description: “Worked request and response samples for the email senders lifecycle: register a sender, verify the domain’s DNS records, run a test-send, manage suppressions, and validate recipients.”
Worked email lifecycle samples
Copy a request as written, substitute your own ids, and compare the response envelope. Errors follow Devotel Orbit’s{ error, meta } envelope and carry a request_id in meta you quote when reporting. The sender chain: register a sender → publish the domain’s DNS records → run a test-send → keep suppressions clean.
1. Register a sender
POST /api/v1/email/sendersdomain is registered with the sending provider, which issues real SPF/DKIM records — publish them with your DNS provider, then verify with the DNS-status read below before the sender can send. Omit default_from_email to send as noreply@<domain>.
2. Update the sender’s defaults
PUT /api/v1/email/senders/{senderId}PUT replaces the From/Reply-To defaults — pass every field you want to keep. Promoting back to default uses the dedicated endpoint below (flipping isDefault: false here is a no-op).
3. Promote a sender to the org default
POST /api/v1/email/senders/{senderId}/set-defaultDELETE /api/v1/email/senders/{senderId}) removes it from the dropdown and accepts no body.
4. Check the domain’s DNS records
GET /api/v1/email/domains/{domainId}/dns-statusvalid / warning / invalid / unknown); overallStatus is the worst of them. Compare recordExpected against recordActual to see what your DNS provider is missing. Pass ?refresh=true to re-verify at the provider, not just at DNS. GET /dns-history?days=30 returns the same id with an entries array of dated record snapshots so you can trace propagation.
5. Run a test-send and poll the result
POST /api/v1/email/domains/{domainId}/test-sendGET /api/v1/email/domains/{domainId}/test-send/{testId}/result with the returned testId:
estimated: true means the spamScore is a provisional estimate from the domain’s DNS grid, not the measured receiver verdict. GET /inbox-placement?days=30 aggregates delivered proofs into an inbox/spam/promotions breakdown with an inboxRate percentage.
6. Validate recipient addresses
POST /api/v1/email/validatesuggestion carries the corrected domain on mistyped common domains (e.g. gamil.com → gmail.com). For batch checks, POST /api/v1/email/validate/bulk:
Request
deliverable, mailbox_full / undeliverable, mailbox_disabled, spamtrap, potential, invalid_mx, no_mx, or syntax_failure. The bulk form returns a results map plus the invalidAddresses list so you don’t have to cross-check every entry.
7. Manage the suppression list
POST /api/v1/email/suppressionsmanual, unsubscribe, complaint, or hard_bounce; bounce/automatic entries (collector handles them) carry the machine reasons. Repeat an add and it returns 200 with the existing entry rather than 201.
Bulk-import (POST /api/v1/email/suppressions/bulk-import) accepts either CSV text (one address per line, optional email header row tolerated) or an emails array:
Request
imported counts newly-added entries; skipped counts duplicates already on the list; invalid counts malformed addresses dropped. GET /api/v1/email/suppressions pages the list (?limit=&offset=&search=&reason=):
DELETE /api/v1/email/suppressions/{id} (returns { "ok": true }). GET /api/v1/email/suppressions/reputation?days=30 reports a suppression-rate breakdown by reason over trailing send volume — the number a deliverability review quotes.
8. Poll readiness and DNS, then promote to default
Once the DNS records publish (step 4), poll until the records showvalid and then promote the sender to the org default. The Node.js escape hatch — the SDK is generated from this same OpenAPI contract, so a typed client covers it; raw fetch is fine too:
refresh=true re-verifies at the provider, not just at DNS — pass it when you just published the records. The promote call accepts no body; steps 3–5 above show the shapes.
Warmup, dedicated IP, TLS reports, and inbound routing (advanced)
These complete the sender’s onboard checklist; most tenants never need them.POST /api/v1/email/inbound-routes registers an inbound subdomain→destination mapping (webhook):
Request
GET /api/v1/email/warmup-plan returns the day-by-day ramp for your ?targetDailyVolume=:
GET /api/v1/email/warmup-status adds what you have actually sent (sent.totalSent, the live-day current.maxAllowed, and reputation). GET /api/v1/email/warmup-enforcement answers “which batches get sent when the pattern doesn’t match a plan day” for a requested batch.
Dedicated sending — eligibility, request, status
Check eligibility (GET /api/v1/email/dedicated-sending/eligibility) against your actual trailing-30-day volume, submit a free-text request, then read back the server-authoritative status (GET /api/v1/email/dedicated-sending):
GET /dedicated-sending):
POST /dedicated-sending/request with a justification note:
eligibility.monthlySendVolume comes from real send history, not a client estimate — the request is rejected 403 below the ~50k/month bar, and re-submitting a pending request returns the existing record.
TLS-report and Postmaster reputation reads
Two stateless analysis routes fold the aggregate reports mailbox providers mail (TLS-RPT) and the per-delivery reputation Google / feedback loops expose (Postmaster) into one tenant-side readout — no persistence, no quota to the provider. TLS-RPT —POST /api/v1/email/tls-rpt/reports/analyze (base64-encode the report body you receive, or publish the _smtp._tls.<domain> record providers attach as application/tlsrpt+gzip):
POST /api/v1/email/postmaster/reputation/analyze (POST the payloads a tenant’s scheduled connector fetches from Google Postmaster Tools and your configured feedback loops — we deliberately do not pull from Google directly, so the route stays read-through):
skipped, never thrown — a corrupt attachment or a single bad snapshot never sinks the batch.
See also
- Email attachments guide — attach outbound media and pull inbound attachments.
- Inbound email parse guide — map parsed inbound email into your webhook.
- Email lifecycle guide — the full sender-setup walk-through this page excerpts.
Get dedicated sending status
GET /api/v1/email/dedicated-sendingCheck dedicated IP eligibility
GET /api/v1/email/dedicated-sending/eligibilityList sending domains
GET /api/v1/email/domainsRead one email sending domain
GET /api/v1/email/domains/{domainId}{ id, domain, isDefault } entry the collection root GET /email/domains lists — so a REST consumer that listed the collection and then GETs one domain by id resolves it through the same resolveDomain path every per-domain deliverability sub-resource shares, and the two endpoints never disagree on the descriptor. Use it to confirm an id before wiring dns-status, dns-history, or the test-send flows against it. Unknown ids return DOMAIN_NOT_FOUND 404 (never Fastify’s opaque not-found); the literal id default always resolves to the Devotel-managed platform sending domain. Read-only: tenant config is the only input — no DNS lookup, no provider call, no write. Requires owner or admin role.
Get domain DNS verification history
GET /api/v1/email/domains/{domainId}/dns-historyCheck domain DNS records
GET /api/v1/email/domains/{domainId}/dns-statusrefresh=true to trigger a provider re-verification and update Resend’s domain status. Requires owner or admin role.
Get domain inbox placement rate
GET /api/v1/email/domains/{domainId}/inbox-placementGet test email send result
GET /api/v1/email/domains/{domainId}/test-send/{testId}/resultList inbound email routes
GET /api/v1/email/inbound-routesList email senders
GET /api/v1/email/sendersesend_legacy_<slug> row when the org still uses a flat channels domain. Requires owner or admin role.
Get one email sender
GET /api/v1/email/senders/{senderId}esend_legacy_<slug> ids the list endpoint advertises. Use it to fetch the sender’s domain, from-fields, and stream assignment before editing. Returns 404 when the id does not exist for the organization. Requires owner or admin role.
List email sending streams
GET /api/v1/email/streamsestream_…), name, reputation kind (transactional | marketing | custom), free-text description, the per-stream throttle ceilings (maxPerMinute / dailyQuota, null = no per-stream cap), the isDefault flag, and createdAt. Use it to populate the stream dropdown on sender assignment and the streams settings table. Requires owner or admin role.
List suppressed email addresses
GET /api/v1/email/suppressionslimit / offset pagination plus search and reason filters. Use it to audit why email to an address stopped and to decide which entry to remove. Requires owner or admin role.
Page size (default 50, max 200). Coerced number falls back to the default on a malformed value.
Export suppression list as CSV
GET /api/v1/email/suppressions/exportemail, reason, bounce_type, added_at, expires_at). Use it to reconcile the blocklist against an external system or take an offline snapshot. Requires owner or admin role.
Get sender-reputation summary
GET /api/v1/email/suppressions/reputationdays, max 90). Use it to spot deliverability regressions — a rising hard-bounce or complaint rate directly degrades sender reputation. Requires owner or admin role.
One-click email unsubscribe
Need this flow in Python, Go, Ruby, or PHP? The Worked sequences section renders this surface’s hero flows in the full six-language group.
GET /api/v1/email/unsubscribe/{token}token embedded in every outbound email’s List-Unsubscribe URL, records the recipient address on the tenant suppression list (idempotent), then either 302-redirects to the organization’s configured unsubscribe page or renders a minimal HTML confirmation. POST is the RFC 8058 one-click method (mailbox gateways POST without a body); GET is the human-click fallback. Invalid, expired, or tampered tokens return an HTTP 400 HTML error page.
HMAC-signed token binding tenant, message id, and recipient address; minted into the message’s List-Unsubscribe URL at send time.
Check batch send against warmup headroom
GET /api/v1/email/warmup-enforcementtargetDailyVolume plus the requested batch size; startingVolume / growthFactor are optional ramp-tuning knobs identical to /warmup-plan. Read-only: the verdict only ever withholds volume above today’s ceiling, it never authorises a send. Requires owner or admin role.
Get IP warmup ramp plan
GET /api/v1/email/warmup-planGet live IP warmup status
GET /api/v1/email/warmup-statusRequest a dedicated sending IP
POST /api/v1/email/dedicated-sending/requestAnalyze DMARC aggregate reports
POST /api/v1/email/dmarc/reports/analyzeapplication/gzip — into the unified deliverability summary plus the none→quarantine→reject policy recommendation. Body: reports[] (1-20 payloads, each content up to 1 MiB with encoding utf8/base64/gzip) and an optional topSpoofingSources bound (1-200, default 50) on the ranked spoofing-source list. Use it from a tenant-run cron or connector that fetches the published RUA mailbox to feed the panel the SPF/DKIM alignment pass rates, applied dispositions, and the ranked DMARC-failing sources the RECEIVING providers see. Corrupt payloads are skipped, never 422 the batch. Stateless (nothing is persisted; response is a computed analysis). Requires owner or admin role.
Configure BIMI brand logo
POST /api/v1/email/domains/{domainId}/bimiAuto-configure cloudflare
POST /api/v1/email/domains/{domainId}/cloudflare/auto-configureRun the MTA-STS + TLS-RPT setup wizard
POST /api/v1/email/domains/{domainId}/mta-stsv=STSv1; … MTA-STS TXT record plus the HTTPS policy-file body, and the v=TLSRPTv1; … aggregate-reporting record, from the wizard’s mode / MX-hosts / policy-id / report-address inputs, and validate whatever is currently published at _mta-sts.<domain> / _smtp._tls.<domain> — the final member of the SPF/DKIM/DMARC/BIMI transport-security set. Body is all-optional: an empty body just validates the live records; supplying mode (enforce|testing|none), mxHosts, policyId, maxAgeSeconds, and ruaDestinations also generates the records to publish. POST (not GET) only because the wizard inputs arrive as a body — the call is read-only, DNS lookups only, nothing is persisted. Unknown domain id returns 404. Requires owner or admin role.
Kick provider domain re-verification
POST /api/v1/email/domains/{domainId}/provider-verifyInitiate a test email send
POST /api/v1/email/domains/{domainId}/test-sendRegister an inbound email route
POST /api/v1/email/inbound-routesAnalyze Google Postmaster Tools + feedback-loop reputation data
POST /api/v1/email/postmaster/reputation/analyzegoogle is an array of Google Postmaster Tools daily TrafficStats snapshots (≤200 records: domainReputation, ipReputation, user-reported spam ratio, SPF/DKIM/DMARC success ratios, delivery-error breakdown) and feedback an array of feedback-loop complaint records (Yahoo / Microsoft / AOL; ≤200); at least one record is required (422 otherwise). Use it from a tenant-run cron or connector that pulls the Postmaster Tools API + FBL mailbox and feeds the deliverability panel what the RECEIVING providers actually report — the platform-computed orbittest-probe score never saw any of that. Stateless (nothing is persisted); the response is a computed analysis. Requires owner or admin role.
Create an email sender
POST /api/v1/email/sendersdomain (already verified for the org), optional default_from_email / default_from_name / default_reply_to, optional isDefault, and an optional streamId assignment. The effective sending identity is the from-address: the explicit default_from_email, or the synthesised noreply@<domain> when omitted — a duplicate identity (or an explicit from-address whose host is not this sender’s own domain) returns a 4xx rather than persisting a sender the gateway would reject. Use it from the Senders settings form; 201 with the created row. Requires owner or admin role.
Promote a sender to the org default
POST /api/v1/email/senders/{senderId}/set-defaultCreate an email sending stream
POST /api/v1/email/streamsname (80 chars), kind (transactional | marketing | custom, default transactional), optional description (280 chars), an optional throttle (maxPerMinute, dailyQuota, both bounded at 1e9), and an optional isDefault flag that promotes the new stream in the same call. High-volume senders split by reputation class first so a campaign spike on the marketing stream cannot starve transactional delivery. Requires owner or admin role. The route declares its real 201 success in streams.controller.ts (an OPERATION_DOC_PINS response2xx* pair would only ever net-add a duplicate status, so the doc lives route-side).
Promote a stream to the org default
POST /api/v1/email/streams/{streamId}/set-defaultstreamId resolves to this stream (the isDefault fallthrough picks it). Exactly one stream carries the default flag, so this call moves the flag to and clears it on the previous default. Use it when a brand line becomes the primary sender; unknown id returns 404. Requires owner or admin role.
Add an email suppression
POST /api/v1/email/suppressionsemail (3–254 chars) and an optional reason from the manual-write set (manual default, unsubscribe, complaint, hard_bounce). The write is idempotent — a re-add of an already-suppressed address returns the existing entry with HTTP 200 instead of creating a duplicate row (201 only on the first add, declared route-side in suppressions.controller.ts). Requires owner or admin role.
Bulk-import email suppressions
POST /api/v1/email/suppressions/bulk-importcsv string (1 MiB cap, one address per line, optional RFC 4180 header row) or an explicit emails array (≤20,000 entries, each ≤254 chars), plus a reason from the manual-write set applied to every row (manual default). Use it to flush a SendGrid/Mailgun export or a DNC list; per-row invalid addresses are counted and skipped, never 422 the whole import. Rows beyond the address cap are truncated by the service (logged, not silent). Requires owner or admin role.
Analyze TLS-RPT aggregate reports
POST /api/v1/email/tls-rpt/reports/analyzeapplication/tlsrpt+gzip — into the TLS negotiation success rate plus the ranked, downgrade/interception-flagged failure breakdown mailbox providers periodically send to your _smtp._tls.<domain> rua= address. Use it after POST /domains/:domainId/mta-sts publishes the TLS-RPT policy so report collection actually pays off. Stateless (no persistence); body caps at 20 reports / 1 MiB per payload, optional topFailureTypes bounds the ranked failure list (1-200). Corrupt payloads are skipped, never 422 the batch. Requires owner or admin role.
One-click email unsubscribe
POST /api/v1/email/unsubscribe/{token}token embedded in every outbound email’s List-Unsubscribe URL, records the recipient address on the tenant suppression list (idempotent), then either 302-redirects to the organization’s configured unsubscribe page or renders a minimal HTML confirmation. POST is the RFC 8058 one-click method (mailbox gateways POST without a body); GET is the human-click fallback. Invalid, expired, or tampered tokens return an HTTP 400 HTML error page.
HMAC-signed token binding tenant, message id, and recipient address; minted into the message’s List-Unsubscribe URL at send time.
Validate a recipient email address
POST /api/v1/email/validatePOST /api/v1/email/validate/bulk to scrub a whole list in one call. The address is never persisted (transient validation only). Owner / admin only; an invalid body returns 422 and an unexpected validator failure returns 500.
Bulk-validate recipient email addresses
POST /api/v1/email/validate/bulksummary (total, valid, invalid, risky). Accepts up to 1,000 addresses per call (de-duplicated case-insensitively), runs the MX fan-out behind a concurrency cap, and meters one usage event per call with quantity = distinct addresses validated (sandbox traffic is never metered). Use it to surface undeliverable or risky rows pre-import; use POST /api/v1/email/validate for a single address. Recipient addresses are never persisted. Invalid bodies return 422.
Address list to validate — 1 to 1,000 entries, each 3–254 characters. De-duplicated case-insensitively before validation; one result row per distinct address, input order preserved (required).
Update an email sender
PUT /api/v1/email/senders/{senderId}default_from_email (must keep its host on this sender’s immutable domain), default_from_name, default_reply_to, and the streamId assignment (explicit null clears it; a non-null id must resolve to a real stream). The domain itself is immutable — changing it invalidates the DNS records and deliverability history, so delete + re-create instead. isDefault: true here is equivalent to POST /email/senders//set-default; isDefault: false is a no-op (exactly-one-default means demotion happens by promoting another row). Unknown sender id returns 404. Requires owner or admin role.
Update an email sending stream
PUT /api/v1/email/streams/{streamId}name (80 chars), kind (transactional | marketing | custom), description (280 chars, empty string clears), and the throttle maxPerMinute/dailyQuota ceilings (omitting throttle preserves the existing policy; an empty object clears both ceilings, free-text null per ceiling means no stream-specific cap). Setting isDefault: true is equivalent to POST /email/streams//set-default; isDefault: false is a no-op — defaults move forward only. Unknown stream id returns 404. Requires owner or admin role.
Delete an inbound email route
DELETE /api/v1/email/inbound-routes/{routeId}Delete an email sender
DELETE /api/v1/email/senders/{senderId}email.domain so a stale custom domain stops resolving on the send path. Use it when a from-address or brand line is retired; unknown sender id returns 404. Requires owner or admin role.
Delete an email sending stream
DELETE /api/v1/email/streams/{streamId}Remove an email suppression
DELETE /api/v1/email/suppressions/{id}