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

# Create Domain

> Register a custom domain to enable sending and receiving from branded email addresses.

Register a custom sending/receiving domain with your gork.email organization. Once registered, gork.email generates SPF, DKIM, DMARC, and MX records for DNS authentication.

### Body

<ParamField body="domain" type="string" required>
  The domain or subdomain to register (e.g. `mail.yourdomain.com` or `outbound.company.com`).
</ParamField>

### Response

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Unique identifier for the domain (`dom_...`).
    </ResponseField>

    <ResponseField name="domainName" type="string">
      The registered domain string.
    </ResponseField>

    <ResponseField name="status" type="string">
      Current verification status: `pending`, `active`, or `failed`.
    </ResponseField>

    <ResponseField name="dnsInstructions" type="array">
      Required DNS records (MX, SPF, DKIM, DMARC) to configure in your DNS provider.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.gork.email/v1/domains \
    -H "Authorization: Bearer gk_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "domain": "outbound.yourdomain.com"
    }'
  ```

  ```typescript TypeScript theme={null}
  import { GorkClient } from "@gorkmail/sdk"

  const client = new GorkClient({ apiKey: process.env.GORK_API_KEY })

  const domain = await client.domains.create({
    domain: "outbound.yourdomain.com"
  })

  console.log(domain.dnsInstructions)
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "data": {
      "id": "dom_83fa90bc712e",
      "domainName": "outbound.yourdomain.com",
      "status": "pending",
      "dnsInstructions": [
        {
          "type": "TXT",
          "name": "_gork-challenge.outbound.yourdomain.com",
          "value": "gork-verification=37a1c890f42b",
          "purpose": "Domain Ownership Verification"
        },
        {
          "type": "MX",
          "name": "outbound.yourdomain.com",
          "value": "route1.mx.cloudflare.net",
          "priority": 10,
          "purpose": "Inbound Email Routing"
        },
        {
          "type": "TXT",
          "name": "outbound.yourdomain.com",
          "value": "v=spf1 include:_spf.mx.cloudflare.net ~all",
          "purpose": "SPF Sender Authorization"
        },
        {
          "type": "TXT",
          "name": "_dmarc.outbound.yourdomain.com",
          "value": "v=DMARC1; p=quarantine; pct=100;",
          "purpose": "DMARC Policy"
        }
      ]
    }
  }
  ```
</ResponseExample>
