---
title: "/buckets/{bucketId}/objects"
url: "https://developers.rest.rodeo/apis/storage/versions/8415f51a-292b-4046-b795-bc13ea7a48cf/operations/createObject"
---

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

# /buckets/{bucketId}/objects

`POST` `/buckets/{bucketId}/objects`

Operation ID: `createObject`

Creates an object in the bucket. Returns 402 when the subscription tier's total object quota is already reached, and 413 when the stringified `data` exceeds 1MB.

## Path parameters

- `bucketId` (string, uuid, required) - The bucket id.

## Request body (required)

Content types: `application/json`

## Responses

- `201` - The created object
- `400` - Invalid JSON body or missing `data`
- `401` - Missing or invalid bearer token
- `402` - Object quota exceeded for the subscription tier
- `404` - No bucket with this id
- `405` - Method not allowed
- `413` - The stringified `data` exceeds 1MB

## 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/{bucketId}/objects:
    post:
      operationId: createObject
      summary: /buckets/{bucketId}/objects
      description: Creates an object in the bucket. Returns 402 when the subscription
        tier's total object quota is already reached, and 413 when the
        stringified `data` exceeds 1MB.
      parameters:
        - $ref: "#/components/parameters/BucketId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ObjectRequest"
            examples:
              create:
                value:
                  data:
                    name: manifest.json
                    size: 1024
      responses:
        "201":
          description: The created object
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StoredObject"
              examples:
                object:
                  value:
                    id: c7f2b6de-4b1a-4e0f-9b0d-1f6e4c8a2b3c
                    data:
                      name: manifest.json
                      size: 1024
        "400":
          description: Invalid JSON body or missing `data`
          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: Object quota exceeded for the subscription tier
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: No bucket with this id
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "405":
          description: Method not allowed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "413":
          description: The stringified `data` exceeds 1MB
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
security:
  - bearerAuth: []
components:
  parameters:
    BucketId:
      name: bucketId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: The bucket id.
  schemas:
    ObjectRequest:
      type: object
      required:
        - data
      additionalProperties: false
      properties:
        data:
          description: The JSON value to store. May be any JSON type and any depth, as
            long as its stringified content does not exceed 1MB.
    StoredObject:
      type: object
      required:
        - id
        - data
      properties:
        id:
          type: string
          format: uuid
          description: The object id.
        data:
          description: The stored JSON value. May be any JSON type and any depth, as long
            as its stringified content does not exceed 1MB.
    Error:
      type: object
      required:
        - error
      additionalProperties: false
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
