---
title: "POST /v2/CreateBucket"
method: POST
path: "/v2/CreateBucket"
tags: ["Bucket"]
---

# POST /v2/CreateBucket

`POST /v2/CreateBucket`

Creates a new bucket, either with a global alias, a local one, or no alias at all.
Technically, you can also specify both `globalAlias` and `localAlias` and that would create two aliases.

## Request body

- CreateBucketRequest
  - `globalAlias` string, nullable
  - `localAlias` CreateBucketLocalAlias
    - `accessKeyId` string, required
    - `alias` string, required
    - `allow` ApiBucketKeyPerm
      - `owner` boolean
      - `read` boolean
      - `write` boolean

## Response `200`

Returns exhaustive information about the bucket

- CreateBucketResponse
  - `bytes` integer, required — Total number of bytes used by objects in this bucket
  - `corsRules` CorsRule[], nullable — CORS rules for this bucket
    - `AllowedHeader` unknown[]
      - unknown
    - `AllowedMethod` unknown[], required
      - unknown
    - `AllowedOrigin` unknown[], required
      - unknown
    - `ExposeHeader` unknown[]
      - unknown
    - `ID` unknown
    - `MaxAgeSeconds` integer
  - `created` string, date-time, required — Bucket creation date
  - `globalAliases` string[], required — List of global aliases for this bucket
  - `id` string, required — Identifier of the bucket
  - `keys` GetBucketInfoKey[], required — List of access keys that have permissions granted on this bucket
    - `accessKeyId` string, required
    - `bucketLocalAliases` string[], required
    - `name` string, required
    - `permissions` ApiBucketKeyPerm, required
      - `owner` boolean
      - `read` boolean
      - `write` boolean
  - `lifecycleRules` LifecycleRule[], nullable — Object lifecycle rules for this bucket
    - `AbortIncompleteMultipartUpload` LifecycleAbortIncompleteMpu
      - `DaysAfterInitiation` integer, required
    - `Expiration` LifecycleExpiration
      - `Date` unknown
      - `Days` integer
    - `Filter` LifecycleFilter
      - `And` LifecycleFilter — recursive
      - `ObjectSizeGreaterThan` integer
      - `ObjectSizeLessThan` integer
      - `Prefix` unknown
    - `ID` unknown
    - `Status` unknown, required
  - `objects` integer, required — Number of objects in this bucket
  - `quotas` ApiBucketQuotas, required
    - `maxObjects` integer, nullable
    - `maxSize` integer, nullable
  - `unfinishedMultipartUploadBytes` integer, required — Total number of bytes used by unfinished multipart uploads in this bucket
  - `unfinishedMultipartUploadParts` integer, required — Number of parts in unfinished multipart uploads in this bucket
  - `unfinishedMultipartUploads` integer, required — Number of unfinished multipart uploads in this bucket
  - `unfinishedUploads` integer, required — Number of unfinished uploads in this bucket
  - `websiteAccess` boolean, required — Whether website access is enabled for this bucket
  - `websiteConfig` GetBucketInfoWebsiteResponse
    - `errorDocument` string, nullable
    - `indexDocument` string, required
    - `routingRules` WebsiteRoutingRule[], nullable
      - `Condition` WebsiteCondition
        - `HttpErrorCodeReturnedEquals` integer
        - `KeyPrefixEquals` unknown
      - `Redirect` WebsiteRedirect, required
        - `HostName` unknown
        - `HttpRedirectCode` integer
        - `Protocol` unknown
        - `ReplaceKeyPrefixWith` unknown
        - `ReplaceKeyWith` unknown

## Other responses

- `500` — Internal server error

---

[API](https://skmtc.dev/deuxfleurs/apis/garage-administration-api.md) · [All operations](https://skmtc.dev/deuxfleurs/apis/garage-administration-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/deuxfleurs/garage-administration-api/revisions/07ffb2d0febb/schema)
