---
title: "Create bucket"
method: POST
path: "/api/containers/{namespace}/{repo}"
tags: ["containers"]
---

# Create bucket

`POST /api/containers/{namespace}/{repo}`

## Path parameters

- `namespace` string, required
- `repo` string, required

## Request body

- object — Bucket creation options
  - `private` boolean, nullable — Bucket visibility. Defaults to public
  - `resourceGroupId` string
  - `cdn` object[] — CDN pre-warming regions
    - `provider` 'gcp' | 'aws', required
    - `region` 'us' | 'eu', required
  - `region` 'us' | 'eu' — The region where the bucket is hosted.
  - `description` string — Free-text description.

## Response `200`

Bucket created, url is given

- object
  - `url` string, required
  - `name` string, required
  - `id` string, required — A hex string of 24 characters representing an ObjectId.

## Other responses

- `409` — Bucket already exists, url is given

## Changes

- **2026-09-23** `ea15a26e9ab3` — 1 info
  - added the new optional request property `description`
- **2026-09-18** `74f2b0d17636` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/huggingface/apis/hub-api-endpoints/changes/api/containers/:namespace/:repo/post.md)

---

[API](https://skmtc.dev/huggingface/apis/hub-api-endpoints.md) · [All operations](https://skmtc.dev/huggingface/apis/hub-api-endpoints/llms.txt) · [OpenAPI document](https://skmtc.dev/huggingface/apis/hub-api-endpoints/revisions/b88d4a4da99f?raw)
