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

# Add Custom Domain

> Add a new custom domain

<Note>
  Custom domains are available on Pro and Enterprise plans.
</Note>

## Request Body

<ParamField body="domain" type="string" required>
  Your domain name (e.g., "yourdomain.com")
</ParamField>

<ParamField body="subdomain" type="string">
  Optional subdomain (e.g., "go" for "go.yourdomain.com")
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://snip.sa/api/domains \
    -H "Content-Type: application/json" \
    -H "X-API-Key: your_api_key_here" \
    -d '{
      "domain": "yourdomain.com",
      "subdomain": "go"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await axios.post('https://snip.sa/api/domains', {
    domain: 'yourdomain.com',
    subdomain: 'go'
  }, {
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': 'your_api_key_here'
    }
  });
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Domain added successfully",
    "data": {
      "domain": {
        "_id": "507f1f77bcf86cd799439015",
        "domain": "yourdomain.com",
        "subdomain": "go",
        "fullDomain": "go.yourdomain.com",
        "status": "pending",
        "verified": false,
        "dnsRecords": [
          {
            "type": "CNAME",
            "name": "go",
            "value": "snip.sa"
          }
        ]
      }
    }
  }
  ```
</ResponseExample>
