# Create or replace an item

> Writes data at key: 201 when the key was free, 200 when it replaced an item. tags replace the bag when sent and leave it alone when omitted. data is at most…

Writes `data` at `key`: `201` when the key was free, `200` when it replaced an item. `tags` replace the bag when sent and leave it alone when omitted. `data` is at most 64 KB as JSON and must satisfy the collection's `schema`. A precondition (`If-Match` or `expected_version`) names a version of an existing item, so it is `404` for a free key.

  Request

<ParamsDetails
  {...require("./put-collection-item.ParamsDetails.json")}
>

<RequestSchema
  {...require("./put-collection-item.RequestSchema.json")}
>

<StatusCodes
  {...require("./put-collection-item.StatusCodes.json")}
>
