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

# Add a sender domain

> Adds a domain with SendGrid, pending until a verify finds its DNS records, and returns the records to publish (201). A domain already in the workspace comes back as it is, with a 200, and SendGrid is not called again. A 502 means SendGrid failed and nothing was added: retry.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/sender-domains
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/sender-domains:
    post:
      tags:
        - sender_domains
      summary: Add a sender domain
      description: >-
        Adds a domain with SendGrid, pending until a verify finds its DNS
        records, and returns the records to publish (201). A domain already in
        the workspace comes back as it is, with a 200, and SendGrid is not
        called again. A 502 means SendGrid failed and nothing was added: retry.
      operationId: sender_domains_add
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                dkim_selector:
                  anyOf:
                    - maxLength: 3
                      type: string
                    - type: 'null'
                  default: null
                  description: >-
                    3 letters or digits for the DKIM records' names
                    (s1._domainkey becomes <selector>._domainkey). Left out,
                    SendGrid's default
                  title: Dkim Selector
                domain:
                  description: >-
                    The domain name, such as acme.com. Letter case and a
                    trailing dot don't matter. Statisfy's own sending domains
                    are refused
                  maxLength: 300
                  minLength: 1
                  title: Domain
                  type: string
              required:
                - domain
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SenderDomain'
          description: Successful Response
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SenderDomain'
          description: Created
      security:
        - HTTPBearer: []
components:
  schemas:
    SenderDomain:
      properties:
        added_by:
          anyOf:
            - type: string
            - type: 'null'
          description: The email of the person who added it
          title: Added By
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Created At
        domain:
          title: Domain
          type: string
        records:
          description: >-
            The DNS records to publish at your DNS provider. Verify checks them;
            whether each one is found is not returned, only the domain's status
          items:
            $ref: '#/components/schemas/DnsRecord'
          title: Records
          type: array
        status:
          description: >-
            pending (added, not yet verified), verified (SendGrid found the
            records; the workspace can send from it) or failed (the last verify
            did not find them)
          enum:
            - pending
            - verified
            - failed
          title: Status
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Updated At
        verified_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When it became verified; null while it is not
          title: Verified At
      required:
        - domain
        - status
        - added_by
        - records
        - created_at
        - updated_at
        - verified_at
      title: SenderDomain
      type: object
    DnsRecord:
      properties:
        host:
          description: The record's name
          title: Host
          type: string
        purpose:
          description: mail_cname, dkim1 or dkim2, as SendGrid names them
          title: Purpose
          type: string
        type:
          description: The record type to publish, such as cname
          title: Type
          type: string
        value:
          description: What the record points to
          title: Value
          type: string
      required:
        - purpose
        - type
        - host
        - value
      title: DnsRecord
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.