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

# Add an Email Domain

> Add a new email domain for DKIM verification. Returns the DKIM TXT record to add to DNS.



## OpenAPI

````yaml https://api.useinvent.com/openapi.json post /orgs/{org_id}/emails/domains
openapi: 3.1.0
info:
  version: 1.0.0
  title: Invent API
servers:
  - url: https://api.useinvent.com
security:
  - bearerAuth: []
paths:
  /orgs/{org_id}/emails/domains:
    post:
      tags:
        - Orgs Emails
      summary: Add an Email Domain
      description: >-
        Add a new email domain for DKIM verification. Returns the DKIM TXT
        record to add to DNS.
      parameters:
        - schema:
            type: string
          required: true
          description: The ID of the org
          name: org_id
          in: path
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEmailDomainSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateEmailDomainSchema'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EmailDomainSchema'
                  - description: An email domain with DKIM verification
components:
  schemas:
    CreateEmailDomainSchema:
      type: object
      properties:
        domain:
          type: string
          minLength: 1
          maxLength: 512
          description: Domain name to verify for DKIM
      required:
        - domain
      description: Schema for adding a new email domain
    EmailDomainSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the email domain
        domain:
          type: string
          description: The domain name
        dkim_status:
          $ref: '#/components/schemas/EmailDomainDkimStatusSchema'
        dkim_tokens:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/EmailDomainDkimTokenSchema'
          description: DKIM CNAME records to add to DNS
        verified_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the domain was verified
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the domain was created
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the domain was last updated
      required:
        - id
        - domain
        - dkim_status
        - dkim_tokens
        - verified_at
        - created_at
        - updated_at
      description: Linked email domain
    EmailDomainDkimStatusSchema:
      type: string
      enum:
        - PENDING
        - VERIFIED
        - FAILED
      description: DKIM verification status of an email domain
    EmailDomainDkimTokenSchema:
      type: object
      properties:
        name:
          type: string
          description: CNAME record name
        value:
          type: string
          description: CNAME record value
      required:
        - name
        - value
      description: A DKIM CNAME record for domain verification
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Bearer token authentication using your API key

````