Sender Domains API
Sender domains control which email addresses your workspace can send from. Verifying your own domain is optional — every workspace can send (in both test and live mode) from Synapse's shared, already-verified pyrx.tech domain with no setup. To send from your own domain instead, add it and verify ownership by configuring DNS records (SPF, DKIM, and DMARC). A verified custom domain improves deliverability, isolates your sender reputation, and puts your brand in the "From" address. This API manages those custom domains; it is not a prerequisite for sending.
When you add a domain, Synapse automatically detects the DNS provider from NS records and returns it in the dns_provider field. For providers that support Domain Connect (currently Cloudflare), you can use the Domain Connect endpoints to configure DNS records automatically.
For a user guide on configuring sender domains in the dashboard, see Sender Domain Setup.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /v1/workspace/domains | List sender domains |
GET | /v1/workspace/domains/{domain_id} | Get domain detail with DNS records and provider detection |
POST | /v1/workspace/domains | Add a new sender domain |
POST | /v1/workspace/domains/{domain_id}/verify | Trigger DNS verification |
GET | /v1/workspace/domains/{domain_id}/domain-connect/discover | Discover Domain Connect support for a domain |
GET | /v1/workspace/domains/{domain_id}/domain-connect | Get signed Domain Connect apply URL |
GET | /v1/workspace/domains/domain-connect/callback | Handle redirect after Domain Connect authorization |
POST | /v1/workspace/domains/{domain_id}/domain-connect/reset | Reset a failed Domain Connect flow |
DELETE | /v1/workspace/domains/{domain_id} | Delete a sender domain |
List Domains
Returns all sender domains configured for the current workspace.
Auth: JWT (dashboard). Requires domains:read permission.
Response
Response Fields
| Field | Type | Description |
|---|---|---|
dns_provider | string or null | Detected DNS provider identifier. One of: cloudflare, namecheap, godaddy, route53, google, digitalocean, ns1, hetzner, vultr, linode, hover, dnsimple, dyn, vercel, wordpress, other, or null if not yet detected. |
is_cloudflare | boolean | Whether the domain uses Cloudflare nameservers. |
dc_provider | string or null | Domain Connect provider name (e.g., "Cloudflare"), set after discovery. |
dc_flow_state | string or null | Current Domain Connect flow state. See Domain Connect Flow States. |
Get Domain Detail
Returns detailed domain information including individual DNS record verification status, DNS provider detection, and Domain Connect availability.
Auth: JWT (dashboard). Requires domains:read permission.
Response
Response Fields
The detail response extends the list response with additional fields:
| Field | Type | Description |
|---|---|---|
dns_records | array | Flattened list of DNS records with individual verified status. Each record includes type, host, name (provider-friendly label), value, purpose, and verified. |
dns_provider | string or null | Detected DNS provider identifier. Detected on first access if not already set. |
is_cloudflare | boolean | Whether the domain uses Cloudflare nameservers. |
dc_available | boolean | Whether Domain Connect auto-configuration is available for this domain. true when the domain's DNS provider supports Domain Connect and the server has Domain Connect configured. |
dc_provider | string or null | Domain Connect provider display name (e.g., "Cloudflare"). |
dc_flow_state | string or null | Current Domain Connect flow state. See Domain Connect Flow States. |
dc_applied_at | datetime or null | When Domain Connect records were last applied. |
dns_verified_at | datetime or null | When DNS records were last verified. |
The dns_provider field is detected automatically when you first access the domain detail. The detection result is cached on the domain record. The dns_records array in the detail response is flattened (a list of record objects), while in the list response it uses the raw JSONB structure with a records wrapper.
Add a Domain
Registers a new sender domain and generates the DNS records you need to configure for verification.
Auth: JWT (dashboard). Requires domains:write permission.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | The domain to add (4-255 characters, valid domain format, e.g., mail.acme.com) |
Use a subdomain like mail.acme.com or notifications.acme.com rather than your root domain. This isolates email sending reputation and avoids conflicts with existing DNS records.
Response (201 Created)
After adding the domain, configure the DNS records shown in the response with your DNS provider, then call the verify endpoint. Alternatively, use the Domain Connect discover endpoint to check if auto-configuration is available.
Error: Duplicate Domain (409 Conflict)
Verify Domain DNS
Triggers a DNS verification check for a domain. Synapse queries your DNS records and updates the verification status for each record. Call this after configuring the DNS records returned by the create endpoint.
Auth: JWT (dashboard). Requires domains:write permission.
Response (200 OK)
When all DNS records are verified:
When verification is still pending (DNS records not yet propagated):
DNS propagation can take up to 48 hours, though most records propagate within minutes. If verification fails, double-check that your CNAME records match the values exactly -- including trailing dots if your DNS provider requires them.
Error: Domain Not Found (404)
Domain Connect
Domain Connect is an open protocol that allows one-click DNS configuration. Instead of manually copying DNS records into your provider's dashboard, Domain Connect redirects you to your DNS provider's authorization page where you approve the changes in one click.
Synapse currently supports Domain Connect for domains hosted on Cloudflare. Support for additional providers that implement the Domain Connect protocol will be added over time.
Domain Connect Flow States
The dc_flow_state field on a domain tracks where it is in the Domain Connect flow:
| State | Meaning |
|---|---|
null | Domain Connect has not been initiated |
discovery | Discovery completed -- provider supports Domain Connect |
pending_consent | User has been redirected to the DNS provider for authorization |
applied | DNS records were applied successfully by the provider |
failed | Authorization was cancelled or an error occurred |
Typical Flow
- Discover: Call the discover endpoint to check if the domain's provider supports Domain Connect.
- Get apply URL: Call the Domain Connect URL endpoint to get a signed URL.
- Redirect: Redirect the user's browser to the apply URL.
- Callback: The DNS provider redirects back to the callback endpoint after authorization.
- Auto-verify: The callback endpoint triggers DNS verification automatically.
Discover Domain Connect Support
Checks whether the domain's DNS provider supports Domain Connect. Performs DNS discovery (queries _domainconnect TXT record) and returns availability along with a signed apply URL if supported.
Discovery results are cached for 7 days. Pass force=true to re-run discovery regardless of cache age.
If the domain's dc_flow_state is "failed", this endpoint resets it so the user can retry the flow.
Auth: JWT (dashboard). Requires domains:write permission.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
force | boolean | false | Force re-discovery even if cached result is fresh (less than 7 days old) |
Response: Available (200 OK)
| Field | Type | Description |
|---|---|---|
available | boolean | Whether Domain Connect is supported for this domain |
provider_name | string or null | Display name of the Domain Connect provider (e.g., "Cloudflare") |
provider_id | string or null | Provider identifier from the Domain Connect settings endpoint |
apply_url | string or null | Signed URL to redirect the user to for DNS authorization. Includes all required DNS record templates and a redirect URI back to the dashboard. |
Response: Not Available (200 OK)
Returned when the domain's DNS provider does not support Domain Connect, or when Domain Connect is not configured on the server.
Error: Domain Not Found (404)
Get Domain Connect URL
Returns a signed Domain Connect apply URL for one-click DNS setup. Uses cached discovery data if available and fresh; otherwise runs discovery first.
This endpoint sets dc_flow_state to "pending_consent", indicating the user is about to be redirected to the DNS provider.
Auth: JWT (dashboard). Requires domains:write permission.
Response (200 OK)
| Field | Type | Description |
|---|---|---|
url | string | Signed Domain Connect apply URL. Redirect the user's browser to this URL. |
provider | string or null | Display name of the DNS provider. |
Redirect the user to the returned url. After they authorize the DNS changes, their browser is redirected back to the dashboard callback page, which calls the callback endpoint to complete the flow.
Error: Not Configured (501 Not Implemented)
Error: Provider Not Supported (422 Unprocessable Entity)
Error: Domain Not Found (404)
Domain Connect Callback
Handles the redirect from the DNS provider after the user authorizes (or cancels) the Domain Connect flow. This endpoint is called by the dashboard's callback page, not directly by API consumers.
Auth: JWT (dashboard). Requires domains:write permission.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
domain_id | UUID | Yes | The domain ID passed through the redirect |
status | string | No | Status from the DNS provider (e.g., "success") |
error | string | No | Error message from the DNS provider, if authorization was cancelled or failed |
Behavior
- Validates that
dc_flow_stateis"pending_consent"(prevents replay attacks). - On success: sets
dc_flow_stateto"applied", recordsdc_applied_at, and triggers DNS verification with retry (to allow for propagation delay). - On error: sets
dc_flow_stateto"failed".
Response (200 OK)
Returns a DomainResponse with the updated domain state.
Error: Invalid Flow State (409 Conflict)
Reset Domain Connect State
Resets a failed or stuck Domain Connect flow so the user can retry. Clears dc_flow_state back to null and invalidates the cached discovery data so the next discover call runs fresh.
Auth: JWT (dashboard). Requires domains:write permission.
Response (200 OK)
Returns a DomainResponse with dc_flow_state set to null.
Error: Invalid State (409 Conflict)
Can only reset from "failed" or "pending_consent" states:
Error: Domain Not Found (404)
Delete a Domain
Permanently removes a sender domain from the workspace. Any email templates or flows referencing this domain's sender address will need to be updated.
Auth: JWT (dashboard). Requires domains:write permission.
Response
Returns 204 No Content on success.
Error: Domain Not Found (404)
DNS Provider Detection
When a domain is accessed via the detail endpoint, Synapse automatically detects the DNS provider by querying NS records. The detected provider is returned in the dns_provider field and cached on the domain record.
Supported Providers
| Provider ID | Display Name |
|---|---|
cloudflare | Cloudflare |
namecheap | Namecheap |
godaddy | GoDaddy |
route53 | AWS Route 53 |
google | Google Cloud DNS |
digitalocean | DigitalOcean |
ns1 | NS1 |
hetzner | Hetzner |
vultr | Vultr |
linode | Linode (Akamai) |
hover | Hover |
dnsimple | DNSimple |
dyn | Dyn (Oracle) |
vercel | Vercel |
wordpress | WordPress.com |
other | Unrecognized provider |