Skip to content

SendingDomains_create

POST
/sending-domains
curl --request POST \
--url http://localhost:3000/api/sending-domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "domain": "example", "dkimSelector": "example" }'

Create a resource

Media typeapplication/json

Add a Sending domain; mints the DKIM keypair and returns the DNS records to publish.

object
domain
required

The domain to authenticate, e.g. “mail.acme.com” (normalized to lowercase ASCII)

string
dkimSelector

DKIM selector; defaults to “sphericon” when omitted

string

Example generated

{
"domain": "example",
"dkimSelector": "example"
}

The request has succeeded and a new resource has been created as a result.

Media typeapplication/json

Sending domain (ADR 0010). sphericon generates the DKIM keypair; the caller publishes the DKIM TXT record. The private key is never returned. verified is a live property re-checked in the background: it can flip back if the DNS record disappears.

object
id
required

Unique identifier

string format: int64
/^[0-9]{1,18}$/
domain
required

The authenticated domain, e.g. “mail.acme.com”

string
dkimSelector
required

DKIM selector; the record host is “._domainkey.”

string
verified
required

Whether the DKIM DNS is currently published and matches our key

boolean
dkimRecord
required

The required DKIM TXT record

object
type
required

The record type (always TXT for the records we generate)

string
Allowed values: TXT
host
required

The host / name to create the record at

string
value
required

The record value to publish

string
spfRecord
required

The suggested SPF TXT record (advisory: does not gate sending)

object
type
required

The record type (always TXT for the records we generate)

string
Allowed values: TXT
host
required

The host / name to create the record at

string
value
required

The record value to publish

string
dmarcRecord
required

The suggested DMARC TXT record (advisory bulk-readiness signal)

object
type
required

The record type (always TXT for the records we generate)

string
Allowed values: TXT
host
required

The host / name to create the record at

string
value
required

The record value to publish

string
trackingRecord

The Tracking domain CNAME; absent when the instance has no tracking target configured

object
type
required

The record type (always CNAME)

string
Allowed values: CNAME
host
required

The host to create the record at: “track.” followed by the domain

string
target
required

The edge host the CNAME must point at

string
state
required

Where the Tracking domain stands

string
Allowed values: pending dns_verified serving
reason

Why the domain is not advancing; absent when nothing holds it back

string
Allowed values: host_taken
lastCheckedAt

When the Tracking domain was most recently checked (null = never)

string format: date-time
stateChangedAt

When the state most recently changed (null = never)

string format: date-time
lastCheckedAt

When the DKIM DNS was most recently checked (null = never)

string format: date-time
verifiedAt

When the domain most recently became verified (null = never)

string format: date-time
createdAt
required

Creation timestamp

string format: date-time
updatedAt
required

Last update timestamp

string format: date-time

Example

{
"dkimRecord": {
"type": "TXT"
},
"spfRecord": {
"type": "TXT"
},
"dmarcRecord": {
"type": "TXT"
},
"trackingRecord": {
"type": "CNAME",
"state": "pending",
"reason": "host_taken"
}
}

RFC 7807 bad request response

Media typeapplication/problem+json

RFC 7807 Problem Details

object
code

Why the request was refused, when the client should act on it

string
Allowed values: second_factor_required email_verification_required signup_closed
type

A URI reference that identifies the problem type

string
title

A short, human-readable summary of the problem type

string
status

HTTP status code

integer format: int32
detail

A human-readable explanation specific to this occurrence

string
instance

A URI reference that identifies the specific occurrence

string
errors

Validation errors grouped by field

object
key
additional properties
Array<string>
form

Form-level validation error

string
fields

Field validation errors

object
key
additional properties
string
retryAfter

Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait

integer format: int32
debug

Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)

object
error
required

The error that failed the request, or the panic value

string
stack

The goroutine stack of a panic; absent for an error a handler returned

string
requestId

The request id the server log carries for this request

string
method
required

The HTTP method of the failed request

string
path
required

The path of the failed request

string

Example

{
"code": "second_factor_required"
}

RFC 7807 unauthorized response

Media typeapplication/problem+json

RFC 7807 Problem Details

object
code

Why the request was refused, when the client should act on it

string
Allowed values: second_factor_required email_verification_required signup_closed
type

A URI reference that identifies the problem type

string
title

A short, human-readable summary of the problem type

string
status

HTTP status code

integer format: int32
detail

A human-readable explanation specific to this occurrence

string
instance

A URI reference that identifies the specific occurrence

string
errors

Validation errors grouped by field

object
key
additional properties
Array<string>
form

Form-level validation error

string
fields

Field validation errors

object
key
additional properties
string
retryAfter

Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait

integer format: int32
debug

Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)

object
error
required

The error that failed the request, or the panic value

string
stack

The goroutine stack of a panic; absent for an error a handler returned

string
requestId

The request id the server log carries for this request

string
method
required

The HTTP method of the failed request

string
path
required

The path of the failed request

string

Example

{
"code": "second_factor_required"
}

RFC 7807 conflict response

Media typeapplication/problem+json

RFC 7807 Problem Details

object
code

Why the request was refused, when the client should act on it

string
Allowed values: second_factor_required email_verification_required signup_closed
type

A URI reference that identifies the problem type

string
title

A short, human-readable summary of the problem type

string
status

HTTP status code

integer format: int32
detail

A human-readable explanation specific to this occurrence

string
instance

A URI reference that identifies the specific occurrence

string
errors

Validation errors grouped by field

object
key
additional properties
Array<string>
form

Form-level validation error

string
fields

Field validation errors

object
key
additional properties
string
retryAfter

Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait

integer format: int32
debug

Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)

object
error
required

The error that failed the request, or the panic value

string
stack

The goroutine stack of a panic; absent for an error a handler returned

string
requestId

The request id the server log carries for this request

string
method
required

The HTTP method of the failed request

string
path
required

The path of the failed request

string

Example

{
"code": "second_factor_required"
}

RFC 7807 validation response

Media typeapplication/problem+json

RFC 7807 Problem Details

object
code

Why the request was refused, when the client should act on it

string
Allowed values: second_factor_required email_verification_required signup_closed
type

A URI reference that identifies the problem type

string
title

A short, human-readable summary of the problem type

string
status

HTTP status code

integer format: int32
detail

A human-readable explanation specific to this occurrence

string
instance

A URI reference that identifies the specific occurrence

string
errors

Validation errors grouped by field

object
key
additional properties
Array<string>
form

Form-level validation error

string
fields

Field validation errors

object
key
additional properties
string
retryAfter

Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait

integer format: int32
debug

Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)

object
error
required

The error that failed the request, or the panic value

string
stack

The goroutine stack of a panic; absent for an error a handler returned

string
requestId

The request id the server log carries for this request

string
method
required

The HTTP method of the failed request

string
path
required

The path of the failed request

string

Example

{
"code": "second_factor_required"
}

RFC 7807 too many requests response: a rate limit was exceeded (ADR 0025)

Media typeapplication/problem+json

RFC 7807 Problem Details

object
code

Why the request was refused, when the client should act on it

string
Allowed values: second_factor_required email_verification_required signup_closed
type

A URI reference that identifies the problem type

string
title

A short, human-readable summary of the problem type

string
status

HTTP status code

integer format: int32
detail

A human-readable explanation specific to this occurrence

string
instance

A URI reference that identifies the specific occurrence

string
errors

Validation errors grouped by field

object
key
additional properties
Array<string>
form

Form-level validation error

string
fields

Field validation errors

object
key
additional properties
string
retryAfter

Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait

integer format: int32
debug

Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)

object
error
required

The error that failed the request, or the panic value

string
stack

The goroutine stack of a panic; absent for an error a handler returned

string
requestId

The request id the server log carries for this request

string
method
required

The HTTP method of the failed request

string
path
required

The path of the failed request

string

Example

{
"code": "second_factor_required"
}
Retry-After
required
integer format: int32

Seconds to wait before retrying

X-RateLimit-Limit
required
integer format: int32

The request budget of the window that was exceeded

X-RateLimit-Remaining
required
integer format: int32

Requests left in the current window

X-RateLimit-Reset
required
integer format: int64

Unix time at which the window resets