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

# Create a Domain

> Create a new domain for organizing data assets by business area

# Create a Domain

Create a new domain for organizing data assets by business area.

## Body Parameters

**name** `string` *required*

Name of the domain. Must be unique at the same level (top-level or within a parent domain).

**domainType** `string` *required*

Type of domain. One of: `Source-aligned`, `Consumer-aligned`, `Aggregate`.

**displayName** `string`

Human-readable display name for the domain.

**description** `string`

Description of the domain in Markdown format.

**parent** `string`

Fully qualified name of the parent domain for creating nested domains, for example `Engineering`.

**owners** `array`

Array of owner references (users or teams) to assign to the domain.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**experts** `array`

Array of user references who are subject matter experts for this domain.

**properties**

**id** `string`

UUID of the user.

**type** `string`

Type of entity (always `user`).

**name** `string`

Name of the user.

```python POST /v1/domains theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import Domains
from metadata.generated.schema.api.domains.createDomain import CreateDomainRequest

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)

request = CreateDomainRequest(
    name="TestDomain",
    displayName="Test Domain",
    domainType="Aggregate",
    description="Lorem ipsum..."
)

domain = Domains.create(request)
print(f"Created: {domain.fullyQualifiedName.root}")
```

```java POST /v1/domains theme={null}
import org.openmetadata.schema.api.domains.CreateDomain;

// client is an initialized OpenMetadataClient.
var request = new CreateDomain()
    .withName("TestDomain")
    .withDisplayName("Test Domain")
    .withDomainType(CreateDomain.DomainType.AGGREGATE)
    .withDescription("Lorem ipsum...");

var domain = client.domains().create(request);
```

```bash POST /v1/domains theme={null}
curl -X POST "{base_url}/api/v1/domains" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "TestDomain",
    "domainType": "Aggregate",
    "description": "Lorem ipsum...",
    "owners": [],
    "experts": []
  }'
```

```json Response theme={null}
{
  "id": "a0729e98-e946-4e25-acde-10e8a2294ba1",
  "domainType": "Aggregate",
  "name": "TestDomain",
  "fullyQualifiedName": "TestDomain",
  "description": "Lorem ipsum...",
  "version": 0.1,
  "updatedAt": 1769984330261,
  "updatedBy": "admin",
  "href": "http://localhost:8585/api/v1/domains/a0729e98-e946-4e25-acde-10e8a2294ba1",
  "deleted": false,
  "owners": [],
  "children": []
}
```

***

## Returns

Returns the created domain object with all specified properties and system-generated fields.

## Response

**id** `string`

Unique identifier for the domain (UUID format).

**name** `string`

Domain name.

**fullyQualifiedName** `string`

Fully qualified name, for example `TestDomain` or `parent.child`.

**displayName** `string`

Human-readable display name.

**description** `string`

Description of the domain in Markdown format.

**domainType** `string`

Type of domain: `Source-aligned`, `Consumer-aligned`, or `Aggregate`.

**owners** `array`

List of owners assigned to the domain.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**children** `array`

List of child domain references.

**version** `number`

Version number for the entity (starts at 0.1).

***

## Create or Update (PUT)

Use `PUT /v1/domains` instead of `POST` to perform an upsert. If a domain with the same `fullyQualifiedName` already exists, it will be updated; otherwise, a new domain is created. The request body is the same as `POST`.

```bash theme={null}
curl -X PUT "{base_url}/api/v1/domains" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ ... same body as POST ... }'
```

> [!NOTE]
>
> `PUT` will not return a `409` conflict error if the entity already exists -- it will update the existing entity instead.

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | Invalid request body or missing required fields |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to create domains |
| `409` | `ENTITY_ALREADY_EXISTS` | Domain with same name already exists (POST only) |


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