---
title: "Write an author entry"
method: PUT
path: "/api/{ns}/{id}/state/{col}/{key}"
tags: ["Page data"]
---

# Write an author entry

`PUT /api/{ns}/{id}/state/{col}/{key}`

## Request

- Base URL: `https://brewpage.app`
- URL: `https://brewpage.app/api/{ns}/{id}/state/{col}/{key}`
- Auth: one of:
  - API key in header `X-Owner-Token`
  - API key in header `X-Manage-Key`

Creates or replaces your own entry `key` in a list (for example a menu in a list with write author); visitors' entries stay untouched. The body is the entry's value, any one JSON value (object, array, string, number, true, false or null) stored as sent, at most the page's entry size (16 KB by default). If-Match: <version> replaces only that version. A page that has not turned page data on answers 404 STATE_UNAVAILABLE: turn it on first (PATCH .../state with {}, or publish with state).

## Path parameters

- `ns` string, required
- `id` string, required
- `col` string, required
- `key` string, required

## Headers

- `If-Match` string
- `X-Owner-Token` unknown
- `X-Manage-Key` unknown

## Request body

- unknown

## Response `200`

Saved

- StateWriteResponse
  - `key` string, required
  - `id` string, required
  - `version` integer, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400`: STATE_INVALID: list name, entry name, If-Match or value has a mistake
- `403`: Owner token revoked or expired; or OWNER_AUTHORIZATION_FAILED: a public publication you do not own
- `404`: PUBLICATION_UNAVAILABLE: no such HTML page or site, not yours, hidden or expired; or STATE_UNAVAILABLE: page data is not turned on
- `409`: STATE_CONFLICT: the entry changed since that version, or is absent; or OLD_PUBLICATION_READ_ONLY
- `413`: STATE_TOO_LARGE: larger than the entry size; or STATE_QUOTA: no room left on this page
- `429`: Rate limited: wait Retry-After (= retryAfterSeconds); no account: accountUrl, free sign-up with higher limits
- `503`: STATE_UNAVAILABLE: page data is switched off for now; wait Retry-After

## Changes

- **2026-11-21** `19a6c5561e70`: 7 info
  - added the optional property `level` to the response with the `400` status
  - added the optional property `level` to the response with the `403` status
  - added the optional property `level` to the response with the `404` status
  - added the optional property `level` to the response with the `409` status
  - …3 more
- **2026-11-11** `957711dab4b5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/brewpage/apis/brewpage-api/changes/api/:ns/:id/state/:col/:key/put.md)

---

[API](https://skmtc.dev/brewpage/apis/brewpage-api.md) - [All operations](https://skmtc.dev/brewpage/apis/brewpage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/brewpage/apis/brewpage-api/revisions/78d2720a18a9?raw)
