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

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

# /buckets/{bucketId}/objects/{objectId}

`PUT` `/buckets/{bucketId}/objects/{objectId}`

Operation ID: `updateObject`

Replaces the object's `data`. Returns 413 when the stringified `data` exceeds 1MB.

## Path parameters

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

## Request body (required)

Content types: `application/json`

## Responses

- `200` - The updated object
- `400` - Invalid JSON body or missing `data`
- `401` - Missing or invalid bearer token
- `404` - No bucket or object with these ids
- `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/{objectId}:
    put:
      operationId: updateObject
      summary: /buckets/{bucketId}/objects/{objectId}
      description: Replaces the object's `data`. Returns 413 when the stringified
        `data` exceeds 1MB.
      parameters:
        - $ref: "#/components/parameters/BucketId"
        - $ref: "#/components/parameters/ObjectId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ObjectRequest"
            examples:
              update:
                value:
                  data:
                    name: manifest.json
                    size: 2048
      responses:
        "200":
          description: The updated object
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StoredObject"
              examples:
                object:
                  value:
                    id: c7f2b6de-4b1a-4e0f-9b0d-1f6e4c8a2b3c
                    data:
                      name: manifest.json
                      size: 2048
        "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"
        "404":
          description: No bucket or object with these ids
          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.
    ObjectId:
      name: objectId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: The object 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
```
