> ## 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 Container

> Create a new container within a storage service

# Create a Container

Create a new container within a storage service.

## Body Parameters

**name** `string` *required*

Name of the container. Must be unique within the parent storage service or parent container.

**service** `string` *required*

Fully qualified name of the parent StorageService, for example `s3_datalake`.

**displayName** `string`

Human-readable display name for the container.

**description** `string`

Description of the container in Markdown format.

**parent** `object`

Reference to a parent container for nested containers.

**properties**

**id** `string`

UUID of the parent container.

**type** `string`

Type of entity (always `container`).

**prefix** `string`

Path prefix for objects in the container, for example `/raw/events/`.

**numberOfObjects** `number`

Number of objects stored in the container.

**size** `number`

Total size of the container in bytes.

**fileFormats** `array`

List of file formats stored in the container, for example `csv`, `tsv`, `parquet`, `avro`, `json`, `jsonl`, `jsonGz`, `jsonZip`.

**dataModel** `object`

Data model describing the schema of files in the container.

**properties**

**isPartitioned** `boolean`

Whether the data is partitioned.

**columns** `array`

Array of column definitions for the data model.

**properties**

**name** `string` *required*

Column name.

**dataType** `string` *required*

Data type, for example `STRING`, `INT`, `DOUBLE`, `TIMESTAMP`.

**description** `string`

Description of the column.

**fullPath** `string`

Full path of the container, for example `s3://analytics-bucket/raw/events`.

**owners** `array`

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

**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.

**domains** `array`

Fully qualified names of the domains to assign for governance purposes.

**tags** `array`

Array of classification tags to apply to the container.

**properties**

**tagFQN** `string` *required*

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

**extension** `object`

Custom property values defined by your organization's metadata schema.

```python POST /v1/containers theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import Containers
from metadata.generated.schema.api.data.createContainer import CreateContainerRequest

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

request = CreateContainerRequest(
    name="analytics-bucket",
    displayName="Analytics Bucket",
    service="s3_datalake",
    description="Primary analytics data lake bucket",
    prefix="/analytics/",
    numberOfObjects=150000,
    size=5368709120,
    fileFormats=["parquet", "json"],
    dataModel={
        "isPartitioned": True,
        "columns": [
            {"name": "event_id", "dataType": "STRING", "description": "Unique event identifier"},
            {"name": "timestamp", "dataType": "TIMESTAMP", "description": "Event timestamp"},
            {"name": "user_id", "dataType": "STRING", "description": "User identifier"}
        ]
    },
    fullPath="s3://analytics-bucket"
)

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

```java POST /v1/containers theme={null}
import java.util.List;
import org.openmetadata.schema.api.data.CreateContainer;
import org.openmetadata.schema.entity.data.Container;
import org.openmetadata.schema.type.ContainerFileFormat;

// client is an initialized OpenMetadataClient.

CreateContainer request = new CreateContainer()
    .withName("analytics-bucket")
    .withDisplayName("Analytics Bucket")
    .withService("s3_datalake")
    .withDescription("Primary analytics data lake bucket")
    .withPrefix("/analytics/")
    .withNumberOfObjects(150000.0)
    .withSize(5368709120.0)
    .withFileFormats(List.of(ContainerFileFormat.Parquet, ContainerFileFormat.Json));

Container container = client.containers().create(request);
```

```bash POST /v1/containers theme={null}
curl -X POST "{base_url}/api/v1/containers" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "analytics-bucket",
    "displayName": "Analytics Bucket",
    "service": "s3_datalake",
    "description": "Primary analytics data lake bucket",
    "prefix": "/analytics/",
    "numberOfObjects": 150000,
    "size": 5368709120,
    "fileFormats": ["parquet", "json"],
    "dataModel": {
      "isPartitioned": true,
      "columns": [
        {"name": "event_id", "dataType": "STRING", "description": "Unique event identifier"},
        {"name": "timestamp", "dataType": "TIMESTAMP", "description": "Event timestamp"},
        {"name": "user_id", "dataType": "STRING", "description": "User identifier"}
      ]
    },
    "fullPath": "s3://analytics-bucket"
  }'
```

```json Response theme={null}
{
  "id": "14744329-85c2-499e-b1fa-249fb8162341",
  "name": "analytics-bucket",
  "displayName": "Analytics Bucket",
  "fullyQualifiedName": "s3_datalake.analytics-bucket",
  "description": "Primary analytics data lake bucket",
  "version": 0.1,
  "updatedAt": 1769982673032,
  "updatedBy": "admin",
  "service": {
    "id": "d1589e1d-2ab0-431c-a383-15e4be20a106",
    "type": "storageService",
    "name": "s3_datalake",
    "fullyQualifiedName": "s3_datalake",
    "deleted": false
  },
  "serviceType": "S3",
  "prefix": "/analytics/",
  "numberOfObjects": 150000,
  "size": 5368709120,
  "fileFormats": ["parquet", "json"],
  "dataModel": {
    "isPartitioned": true,
    "columns": [
      {"name": "event_id", "dataType": "STRING", "description": "Unique event identifier"},
      {"name": "timestamp", "dataType": "TIMESTAMP", "description": "Event timestamp"},
      {"name": "user_id", "dataType": "STRING", "description": "User identifier"}
    ]
  },
  "fullPath": "s3://analytics-bucket",
  "href": "http://localhost:8585/api/v1/containers/14744329-85c2-499e-b1fa-249fb8162341",
  "deleted": false,
  "owners": [],
  "tags": [],
  "followers": [],
  "votes": {
    "upVotes": 0,
    "downVotes": 0
  },
  "domains": []
}
```

***

## Returns

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

## Response

**id** `string`

Unique identifier for the container (UUID format).

**name** `string`

Container name.

**fullyQualifiedName** `string`

Fully qualified name in format `service.containerName`.

**displayName** `string`

Human-readable display name.

**description** `string`

Description of the container in Markdown format.

**service** `object`

Reference to the parent storage service.

**properties**

**id** `string`

UUID of the storage service.

**type** `string`

Type of entity (always `storageService`).

**name** `string`

Name of the storage service.

**fullyQualifiedName** `string`

Fully qualified name of the storage service.

**serviceType** `string`

Type of storage service, for example S3, GCS, ADLS, CustomStorage.

**prefix** `string`

Path prefix for objects in the container.

**numberOfObjects** `number`

Number of objects stored in the container.

**size** `number`

Total size of the container in bytes.

**fileFormats** `array`

List of file formats stored in the container.

**dataModel** `object`

Data model describing the schema of files.

**properties**

**isPartitioned** `boolean`

Whether the data is partitioned.

**columns** `array`

Array of column definitions.

**fullPath** `string`

Full path of the container.

**owners** `array`

List of owners assigned to the container.

**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.

**domains** `array`

Domain assignments for governance.

**tags** `array`

Classification tags applied to the container.

**properties**

**tagFQN** `string`

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

**extension** `object`

Custom property values defined by your organization's metadata schema.

**version** `number`

Version number for the entity (starts at 0.1).

***

## Create or Update (PUT)

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

```bash theme={null}
curl -X PUT "{base_url}/api/v1/containers" \
  -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.

***

## Bulk Create or Update (PUT)

Use `PUT /v1/containers/bulk` to create or update multiple containers in a single request. The request body is an array of create request objects.

```bash theme={null}
curl -X PUT "{base_url}/api/v1/containers/bulk" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '[
    { "name": "analytics-bucket", "service": "s3_datalake" },
    { "name": "raw-data-bucket", "service": "s3_datalake" }
  ]'
```

***

## 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 containers |
| `409` | `ENTITY_ALREADY_EXISTS` | Container with same name already exists in service (POST only) |


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