# Add a workspace domain

Claims a domain for the workspace and answers the DNS records to create: an ownership TXT that must be added before the domain verifies, plus SPF, DKIM where the connected mail provider has one, and DMARC. Nothing is resolved by this call - use the recheck action once the records are published.

Access class: `workspace:admin`.

## Endpoint

`POST /v1/workspace/domains`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "domain": "string"
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "createdAt": "string",
    "domain": "string",
    "id": "",
    "inboundCount": 1.5,
    "records": [
      {
        "host": "string",
        "ok": true,
        "purpose": "string",
        "required": true,
        "type": "string",
        "value": "string"
      }
    ],
    "status": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
