---
title: "/buckets"
url: "https://developers.rest.rodeo/apis/storage/versions/8415f51a-292b-4046-b795-bc13ea7a48cf/operations/createBucket"
---

> Full API specification: https://developers.rest.rodeo/apis/storage/versions/8415f51a-292b-4046-b795-bc13ea7a48cf.md

# /buckets

`POST` `/buckets`

Operation ID: `createBucket`

Creates a bucket. Returns 402 when the subscription tier's bucket quota is already reached.

## Request body (required)

Content types: `application/json`

## Responses

- `201` - The created bucket
- `400` - Invalid JSON body or invalid `name`
- `401` - Missing or invalid bearer token
- `402` - Bucket quota exceeded for the subscription tier
- `405` - Method not allowed

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Storage API
  version: 1.0.0
servers:
  - url: https://api.rest.rodeo/storage/api/v1
    description: Production
paths:
  /buckets:
    post:
      operationId: createBucket
      summary: /buckets
      description: Creates a bucket. Returns 402 when the subscription tier's bucket
        quota is already reached.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BucketRequest"
            examples:
              create:
                value:
                  name: project-files
      responses:
        "201":
          description: The created bucket
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Bucket"
              examples:
                bucket:
                  value:
                    id: 5a1c2c7e-0c6f-4e58-b3e3-c6a2d1f1a9e4
                    name: project-files
        "400":
          description: Invalid JSON body or invalid `name`
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Missing or invalid bearer token
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "402":
          description: Bucket quota exceeded for the subscription tier
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "405":
          description: Method not allowed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
security:
  - bearerAuth: []
components:
  schemas:
    BucketRequest:
      type: object
      required:
        - name
      additionalProperties: false
      properties:
        name:
          type: string
          description: The bucket name.
          maxLength: 256
          minLength: 1
    Bucket:
      type: object
      required:
        - id
        - name
      additionalProperties: false
      properties:
        id:
          type: string
          format: uuid
          description: The bucket id.
        name:
          type: string
          description: The bucket name.
          maxLength: 256
    Error:
      type: object
      required:
        - error
      additionalProperties: false
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
