---
title: "Claim a domain for an inbound stream"
method: POST
path: "/v1/inbound/domains"
tags: ["Inbound"]
---

# Claim a domain for an inbound stream

`POST /v1/inbound/domains`

## Request

- Base URL: `https://api.sendora.se`
- URL: `https://api.sendora.se/v1/inbound/domains`
- Auth: HTTP bearer

Claims the domain for one of the server’s inbound streams and answers the two DNS records to add: an MX that brings the domain’s mail to Sendora and a TXT record that proves the claim. Mail to any address on the domain is accepted once both records are seen, which Sendora checks on its own and on request. A stream holds one domain; the first account to verify a name holds it.

## Request body

- object
  - `streamId` string, uuid, required: An inbound stream of the server.
  - `domain` string, required: The domain mail is sent from, such as example.se; lower-cased and IDNA-encoded.

## Response `201`

A domain on an inbound stream and the two records it needs.

- object: A domain on an inbound stream and the two records it needs.
  - `inboundDomainId` string, uuid, required
  - `streamId` string, uuid, required: The inbound stream the domain delivers to.
  - `domain` string, required: The domain, lower-cased and IDNA-encoded.
  - `verified` boolean, required: True while both records are seen; only then is mail to the domain accepted.
  - `createdAt` string, date-time, required
  - `lastCheckedAt` string, date-time, nullable, required: When the records were last looked up.
  - `unverifiedAt` string, date-time, nullable, required: When a verified domain lost its records. Mail to it is deferred for 72 hours from then and refused after, until the records are back.
  - `mx` object, required: The MX record that brings the domain’s mail to Sendora, at any priority.
    - `type` 'MX', required
    - `host` string, required: The name to create the record under.
    - `value` string, required: The value the record must hold.
    - `verified` boolean, required
    - `verifiedAt` string, date-time, nullable, required
  - `txt` object, required: The TXT record that proves the claim; it carries a value only you were shown.
    - `type` 'TXT', required
    - `host` string, required: The name to create the record under.
    - `value` string, required: The value the record must hold.
    - `verified` boolean, required
    - `verifiedAt` string, date-time, nullable, required

## Other responses

- `400`: The body does not match what the route takes, or the domain is reserved.
- `401`: The key is missing, malformed or revoked.
- `403`: The key is of the other kind, or a connected app may not do this here: it is not for connections, the connection may only read here, or it is for test servers only.
- `409`: The stream already has a domain, or another account holds the name verified.
- `422`: The streamId names no stream of this server, or an archived one.

---

[API](https://skmtc.dev/sendora/apis/sendora-api.md) · [All operations](https://skmtc.dev/sendora/apis/sendora-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sendora/apis/sendora-api/revisions/72efbbb34b64?raw)
