---
title: "Write a new storage object or replace an existing one."
method: PUT
path: "/v2/console/storage/{collection}/{key}/{user_id}"
tags: ["Console"]
---

# Write a new storage object or replace an existing one.

`PUT /v2/console/storage/{collection}/{key}/{user_id}`

## Request

- Base URL: `http://127.0.0.1:7351`
- URL: `http://127.0.0.1:7351/v2/console/storage/{collection}/{key}/{user_id}`
- Auth: API key in header `Authorization`

## Path parameters

- `collection` string, required
- `key` string, required
- `user_id` string, required

## Request body

- ConsoleWriteStorageObjectBody: Write a new storage object or update an existing one.
  - `value` string: Value.
  - `version` string: Version for OCC.
  - `permission_read` integer: Read permission value.
  - `permission_write` integer: Write permission value.

## Response `200`

A successful response.

- StorageObjectAck: A storage acknowledgement.
  - `collection` string: The collection which stores the object.
  - `key` string: The key of the object within the collection.
  - `version` string: The version hash of the object.
  - `user_id` string: The owner of the object.
  - `create_time` string, date-time: The UNIX time (for gRPC clients) or ISO string (for REST clients) when the object was created.
  - `update_time` string, date-time: The UNIX time (for gRPC clients) or ISO string (for REST clients) when the object was last updated.

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/heroiclabs/apis/nakama-console-api-v2.md) - [All operations](https://skmtc.dev/heroiclabs/apis/nakama-console-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/heroiclabs/apis/nakama-console-api-v2/revisions/fbde2e3c5ead?raw)
