---
title: "Add Domain"
description: "Adds a custom domain for whitelabeling. Creates a pending DNS verification record. The first domain is automatically set as primary. Requires admin role."
---

`POST /api/organization/whitelabel/domains`

## Request Body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `hostname` | string | Yes | Custom domain hostname (3-253 chars). No wildcards. |

## Example (cURL)

```bash
curl -X POST "$BASE_URL/api/organization/whitelabel/domains" \
  -H "Cookie: $SESSION_COOKIE" \
  -H "Content-Type: application/json" \
  -d '{
    "hostname": "app.deinkunde.com"
  }'
```

## Response

```json
{
  "domain": {
    "id": 2,
    "hostname": "app.deinkunde.com",
    "status": "pending",
    "role": "app",
    "isPrimary": false,
    "verificationToken": "xyz789-abc456",
    "verifiedAt": null,
    "createdAt": "2026-04-15T12:00:00.000Z",
    "updatedAt": "2026-04-15T12:00:00.000Z"
  },
  "dns": {
    "txtName": "_uptimeify-verify.app.deinkunde.com",
    "txtValue": "xyz789-abc456"
  }
}
```

Add a DNS TXT record with the `txtName` and `txtValue`, then call [Verify Domain](./verify-domain).

## Common errors

- `400 Invalid hostname` when hostname format is wrong
- `400 This hostname is reserved` when hostname matches the main platform
- `400 Wildcard domains are not supported`
- `409 Hostname already exists`

