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

# Create bucket

`POST /api/buckets/{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.

## Response `200`

Bucket created, url is given

- object
  - `url` string, required
  - `name` string, required
  - `id` string, required

## Other responses

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

---

[API](https://skmtc.net/huggingface/apis/hub-api-endpoints.md) · [All operations](https://skmtc.net/huggingface/apis/hub-api-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/huggingface/hub-api-endpoints/versions/dae0cc3790f0/schema)
