Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

Sending domain

A project’s email, sign-in codes included, comes from a domain it verified; until one verifies, it sends none, except to a dev environment’s test inbox. Add the domain, then add the DNS records the answer lists. Agentpost checks every 5 minutes for the first hour, then hourly, for up to 72 hours, and emails the workspace’s owners when the domain verifies or fails. A domain belongs to the first workspace that adds it; if it fails to verify, another workspace may add it.

Paths are from https://api.agentpost.tools, and every route follows the API basics. The examples send the first credential the route takes; Credentials explains each one.

Get the sending domain

GET /v1/projects/{id}/sending-domain

The project’s sending domain and the sender in force. A pending domain is checked again first, so polling this shows when it verifies.

  • Who may call: A member of the workspace, with its API key; a member of the workspace, with its session; or a delegate, with its delegated token.
  • Access: The caller holds apoa.project:view in the project’s workspace.
  • Credential: the examples send your API key, agp_ak_apoa_…, as Authorization: Bearer <token>.

Path parameters

Name Type Required Description
id string Yes A project ID, prj_…. The id of a Project.

Response

200 OK, with SendingDomainState.

Errors

Any operation can also answer with the codes Conventions lists.

Set the sending domain

PUT /v1/projects/{id}/sending-domain

Adds a domain to send from, or changes the address. The answer lists the DNS records to add. While a new domain is pending, the current sender keeps sending.

  • Who may call: A member of the workspace, with its API key; a member of the workspace, with its session; or a delegate, with its delegated token.
  • Access: The caller holds apoa.project:update in the project’s workspace.
  • Credential: the examples send your API key, agp_ak_apoa_…, as Authorization: Bearer <token>.

Path parameters

Name Type Required Description
id string Yes A project ID, prj_…. The id of a Project.

Body

Name Type Required Description
domain string Yes Such as example.com.
address string No At the domain. Default no-reply@<domain>.

Response

200 OK, with SendingDomainState.

Errors

Any operation can also answer with the codes Conventions lists.

Remove the sending domain

DELETE /v1/projects/{id}/sending-domain

Removes the sending domain. The project sends no email, sign-in codes included, until another domain verifies, so it needs the domain as confirmation.

  • Who may call: A member of the workspace, with its API key; a member of the workspace, with its session; or a delegate, with its delegated token.
  • Access: The caller holds apoa.project:update in the project’s workspace.
  • Credential: the examples send your API key, agp_ak_apoa_…, as Authorization: Bearer <token>.

Path parameters

Name Type Required Description
id string Yes A project ID, prj_…. The id of a Project.

Body

Name Type Required Description
confirm string Yes The domain.

Response

200 OK, with SendingDomainState.

Errors

Any operation can also answer with the codes Conventions lists.

The SendingDomainState object

A project’s sending domain, and the sender in force, which stays the old one until a new domain verifies.

Name Type Present Description
projectId string Always
sendingDomain SendingDomain or null Always null when the project asked for none.
sender object or null Always Where the project’s email comes from now. null when it sends none in production.

The SendingDomain object

The domain a project asked to send email from.

Name Type Present Description
domain string Always
address string Always The address email comes from.
status string Always One of "pending", "verified", or "failed".
waitingOn string[] Always What Agentpost still waits on, in words. Empty unless pending.
failure string When set Why it failed, and what to do.
records DnsRecord array Always Add every one; verification waits on them all.
recommended DnsRecord array Always Records that help delivery but that nothing waits on, such as DMARC when the domain has none.
requestedAt string Always An ISO 8601 date and time.
checkedAt string When set An ISO 8601 date and time.
nextCheckAt string When set When Agentpost checks again. Set only while pending.
verifiedAt string When set An ISO 8601 date and time.

The DnsRecord object

A record to add at a domain’s DNS provider.

Name Type Present Description
type "CNAME", "MX", or "TXT" Always
name string Always
value string Always