> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifique.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Register email domain

> Register a domain for sending email (e.g. @yourcompany.com). The response shows what to set in DNS.



## OpenAPI

````yaml /en/emails-api/api-reference/openapi-email.json post /v1/email/domains
openapi: 3.0.3
info:
  title: Notifique API. E-mail
  description: >-
    Send emails, manage domains, and check status. Authenticate with
    `Authorization: Bearer sk_live_...` or `x-api-key`.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Production
security:
  - ntfEmailBearerAuth: []
  - ntfEmailApiKeyHeader: []
tags:
  - name: E-mail
    description: Envio e consulta de e-mail
  - name: Domínios
    description: Registro e verificação de domínios para envio de e-mail
paths:
  /v1/email/domains:
    post:
      tags:
        - Domínios
        - E-mail
      summary: Register email domain
      description: >-
        Register a domain for sending email (e.g. @yourcompany.com). The
        response shows what to set in DNS.
      operationId: ntfEmail_postV1EmailDomains
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NtfEmail_CreateEmailDomainRequest'
            examples:
              rootDomain:
                summary: Root domain
                description: E.g. emails from @yourcompany.com
                value:
                  domain: yourcompany.com
              subdomain:
                summary: Subdomain
                description: E.g. emails from @mail.yourcompany.com
                value:
                  domain: mail.yourcompany.com
      responses:
        '200':
          description: >-
            Domínio registrado. Configure os registros DNS retornados e depois
            chame o endpoint de verify.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_CreateEmailDomainResponse'
              example:
                success: true
                data:
                  id: clxx123...
                  domain: seudominio.com
                  status: PENDING
                  dnsRecords:
                    - type: TXT
                      name: notifique._domainkey.seudominio.com
                      value: p=MIGf...
                  createdAt: '2025-02-15T10:00:00.000Z'
                message: >-
                  Add the DNS record(s) above to your domain, then call the
                  verify endpoint or use the Verify button in the dashboard.
        '400':
          description: Domínio inválido.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_ErrorResponse'
              example:
                success: false
                error: Bad Request
                message: Invalid domain
                details:
                  - field: domain
                    message: domain must be a valid domain name
                code: BAD_REQUEST
        '401':
          description: Missing or invalid API Key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_ErrorResponse'
        '402':
          description: Trial/plano expirado (WORKSPACE_BLOCKED).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_ErrorResponse'
        '403':
          description: >-
            Escopo ausente ou limite de domínios do plano
            (PLAN_LIMIT_EMAIL_DOMAINS).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_ErrorResponse'
              example:
                success: false
                error: Plan limit reached
                message: Your plan allows up to N domain(s). Upgrade to add more.
                code: PLAN_LIMIT_EMAIL_DOMAINS
        '409':
          description: Domínio já registrado neste workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_ErrorResponse'
              example:
                success: false
                error: Conflict
                message: This domain is already registered for this workspace.
                data:
                  id: clxx...
                  domain: seudominio.com
                  status: PENDING
                code: CONFLICT
        '502':
          description: Falha ao iniciar verificação do domínio.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_ErrorResponse'
        '503':
          description: Serviço de e-mail não configurado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_ErrorResponse'
components:
  schemas:
    NtfEmail_CreateEmailDomainRequest:
      type: object
      required:
        - domain
      properties:
        domain:
          type: string
          minLength: 1
          description: >-
            Domain you will send from (e.g. yourcompany.com or
            mail.yourcompany.com).
    NtfEmail_CreateEmailDomainResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            id:
              type: string
            domain:
              type: string
            status:
              type: string
              enum:
                - PENDING
                - VERIFIED
                - FAILED
            dnsRecords:
              type: array
              items:
                type: object
            createdAt:
              type: string
              format: date-time
        message:
          type: string
          description: Mensagem orientando a configurar DNS e chamar verify.
    NtfEmail_ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: HTTP-style error label (e.g. Unauthorized, Bad Request, Not Found).
        message:
          type: string
          description: >-
            Human-readable message for end users (localized via Accept-Language
            / x-locale when applicable).
        code:
          type: string
          description: >-
            Stable API v1 code (enum). Always present on errors. Use with the
            HTTP status to decide retry or fix. See [Error
            responses](/en/guides/conceitos/resposta-de-erros).
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
        data:
          type: object
          description: 'Dados adicionais em alguns erros (ex.: status do e-mail em cancel).'
      required:
        - success
        - error
        - message
        - code
  securitySchemes:
    ntfEmailBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API Key no header Authorization. Exemplo: `Authorization: Bearer
        sk_live_xxxxx`
    ntfEmailApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key no header x-api-key. Exemplo: `x-api-key: sk_live_xxxxx`'

````