# Request a DNS TXT challenge for an email domain (owner)

Stores a pending domain (not unique). Publish a TXT record at `_notify-verification.<domain>` with value `notify-verify=<token>`, then POST `/teams/{id}/domain/verify`. Public mailbox domains are rejected.

HTML: https://notify.belweave.ai/docs/api/postTeamsIdDomain

Required scopes: `teams:write`

```http
POST /api/agent/teams/{id}/domain
Authorization: Bearer ntf_your_token
```

## Operation schema

```json
{
  "summary": "Request a DNS TXT challenge for an email domain (owner)",
  "description": "Stores a pending domain (not unique). Publish a TXT record at `_notify-verification.<domain>` with value `notify-verify=<token>`, then POST `/teams/{id}/domain/verify`. Public mailbox domains are rejected.",
  "operationId": "postTeamsIdDomain",
  "security": [
    {
      "bearer": [
        "teams:write"
      ]
    }
  ],
  "x-notify-scopes": [
    "teams:write"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "schema": {
        "type": "string"
      },
      "required": true
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "domain": {
              "type": "string",
              "maxLength": 253,
              "pattern": "^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$"
            }
          },
          "required": [
            "domain"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "team": {
                "$ref": "#/components/schemas/Team"
              },
              "challenge": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "host": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "required": [
                  "domain",
                  "host",
                  "value"
                ]
              }
            },
            "required": [
              "team",
              "challenge"
            ]
          }
        }
      }
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Missing, unknown, revoked, or expired token",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "The token lacks a required scope or the account lacks permission",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "404": {
      "description": "Not found for this account",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```

Resolve schema references against [OpenAPI](https://notify.belweave.ai/openapi.json).
