# Create

`POST /workspaces/:workspace/domains`

Create a domain of any type (register, claim, point or private)

**Required Scopes:** `DOMAIN_MANAGE`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
}
```

## Body Parameters

```typescript
interface BodyParameters {
  /** The type of the domain to create */
  type: "REGISTERED" | "POINTED" | "PRIVATE" | "CLAIMED";
  /** The name of the domain to create */
  name: string;
  /** Whether to enable auto-renewal for the domain (only if `type = REGISTERED`) */
  auto_renew?: boolean;
  /** Whether to register or claim the domain on the workspace owner's behalf (only if `type = REGISTERED` or `type = CLAIMED`) */
  on_owner_behalf?: boolean;
}
```

## Response Body

```typescript
interface ResponseBody {
  /** The type of the domain */
  type?: "REGISTERED" | "POINTED" | "PRIVATE" | "CLAIMED";
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The name of the domain */
  name?: string;
  /** The ID of the domain */
  id?: string;
  pointed_via?: string[];
  /** Whether the domain is set to auto-renew */
  auto_renew?: boolean;
  /** Whether the domain has transfer lock enabled */
  transfer_lock?: boolean;
  /** Whether DNSSEC is enabled for the domain */
  dnssec?: boolean;
  /** The expiration date of the domain registration */
  expiry_date?: string;
}
```

## Request Example

```bash
curl -X POST "https://api.buddy.works/workspaces/:workspace/domains" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "testdomain.pl",
  "type": "REGISTERED",
  "auto_renew": true,
  "on_owner_behalf": false
}'
```

## Response Example

**Status:** `201 Domain created`

```json
{
  "url": "https://api.buddy.works/workspaces/my-company/domains/4krmDRPw",
  "html_url": "https://app.buddy.works/my-company/-/domain/4krmDRPw",
  "id": "4krmDRPw",
  "name": "example.com",
  "type": "REGISTERED",
  "auto_renew": true,
  "transfer_lock": true,
  "dnssec": false,
  "expiry_date": "2026-09-26T19:30:18Z"
}
```

---
Original source: https://buddy.works/docs/api/domains/create