# Read your workspace with the API (https://notert.io/docs/api/read-your-workspace)

Last updated 2026-12-02

The Notert API lets your own scripts and services work with a workspace as plain HTTP and JSON: its requests and their comments and voters, its roadmap, its customers and conversations, its changelog, its help center and its system status. A token reads only the areas its permissions name, and writes or deletes only with a permission that allows it: see [work with requests](/docs/api/work-with-requests), [work with people](/docs/api/work-with-people), [work with conversations](/docs/api/work-with-conversations), [write the changelog](/docs/api/write-the-changelog), [write help articles](/docs/api/write-help-articles) and [review held posts](/docs/api/review-held-posts). To hear about changes as they happen instead of asking for them, use [webhooks](/docs/webhooks/receive-webhooks).

The API is included on every plan, Free too. See the [plans](/#pricing).

## Authenticate [#authenticate]

Each call sends an API token in the `Authorization` header, as a Bearer token. An owner or admin creates one in the workspace's settings, picking its permissions, as [create and manage API tokens](/support/workspace/api-tokens) describes. A token belongs to its workspace and reaches only that workspace. A call its permissions don't cover answers 403 `INSUFFICIENT_SCOPE`, saying which permission it needs. A token can also be [restricted](/support/workspace/api-tokens#restrict-a-token-to-boards-or-networks) to some boards, and then every call sees and changes only the requests on them, or to some networks, and then a call from anywhere else answers 403 `NETWORK_NOT_ALLOWED`. Any token may call `GET /token`, whatever its permissions, to learn what it holds: its workspace, its permissions, the boards and networks it's restricted to and when it expires.

<Screenshot name="api-token-new" alt="The Create API token page on its Permissions step, each area such as Requests, People and Changelog with how many permissions it holds" />

A token starts with `sst_`. Keep it on your server, like a password, in an environment variable such as `NOTERT_API_TOKEN`. The API answers no browser on another site, so call it from your backend, never from a page your users load.

### Your first call [#your-first-call]

<Steps>
1. **Create a token** with `requests:read`, and copy it when it's shown: it isn't shown again.
2. **Put it in your environment**, then list your boards:

   ```sh
   export NOTERT_API_TOKEN="sst_..."
   curl -i https://app.notert.io/api/v1/boards \
     -H "Authorization: Bearer $NOTERT_API_TOKEN"
   ```

3. **Read the answer.** A working token answers 200 with your boards, and headers that say how much of the minute's calls are left:

   ```http
   HTTP/2 200
   content-type: application/json
   ratelimit-policy: "token";q=300;w=60, "workspace";q=600;w=60
   ratelimit: "token";r=299;t=1, "workspace";r=599;t=1

   {"items":[{"id":"b7e1d2c3-4a5b-4c6d-8e9f-0a1b2c3d4e5f","name":"Features","visibility":"public"}]}
   ```
</Steps>

A 401 means the header didn't carry a token Notert knows, and a 403 `INSUFFICIENT_SCOPE` that it did but the token lacks the permission: see [errors](#errors).

## What a token can read [#what-a-token-can-read]

Each read needs the permission beside it. The writes are listed in the guides linked above.

| Endpoint                                                                                             | Permission           | Answers                                                                                                         |
| ---------------------------------------------------------------------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------- |
| [`GET /requests`](/docs/api/reference/list-requests)                                                 | `requests:read`      | A page of the workspace's requests                                                                              |
| [`GET /requests/{id}`](/docs/api/reference/get-a-request)                                            | `requests:read`      | One request, with its tags and owners                                                                           |
| [`GET /requests/{requestId}/comments`](/docs/api/reference/list-a-request-s-comments)                | `requests:read`      | A page of a request's comments and notes                                                                        |
| [`GET /requests/{requestId}/voters`](/docs/api/reference/list-a-request-s-voters)                    | `people:read`        | A page of who voted for a request                                                                               |
| [`GET /requests/{requestId}/followers`](/docs/api/reference/list-a-request-s-followers)              | `people:read`        | Who follows a request and hears of its changes                                                                  |
| [`GET /requests/similar`](/docs/api/reference/find-similar-requests)                                 | `requests:read`      | The requests that look like one about to be filed                                                               |
| [`GET /comments`](/docs/api/reference/search-comments)                                               | `requests:read`      | A page of comments and notes across requests, found by their words or documents                                 |
| [`GET /boards`](/docs/api/reference/list-boards)                                                     | `requests:read`      | Every board in the workspace                                                                                    |
| [`GET /tags`](/docs/api/reference/list-tags)                                                         | `requests:read`      | Every tag in the workspace                                                                                      |
| [`GET /statuses`](/docs/api/reference/list-statuses)                                                 | `requests:read`      | Every status, with how many requests it holds                                                                   |
| [`GET /teammates`](/docs/api/reference/list-teammates)                                               | `requests:read`      | A page of teammates, by name and role                                                                           |
| [`GET /roadmap`](/docs/api/reference/get-the-roadmap)                                                | `roadmap:read`       | The roadmap's columns and their requests                                                                        |
| [`GET /insights/request-counts`](/docs/api/reference/count-requests)                                 | `requests:read`      | How many requests, grouped by status, board, tag or owner                                                       |
| [`GET /insights/request-trends`](/docs/api/reference/get-request-trends)                             | `requests:read`      | Requests and votes per day, week or month                                                                       |
| [`GET /insights/overview`](/docs/api/reference/get-the-workspace-overview)                           | `requests:read`      | Requests per status, waiting conversations, the latest update and posts to review, each part the token may read |
| [`GET /insights/inbox`](/docs/api/reference/get-the-inbox-overview)                                  | `conversations:read` | How many conversations wait, are open, unread, snoozed or resolved                                              |
| [`GET /insights/inbox-report`](/docs/api/reference/get-the-inbox-report)                             | `conversations:read` | How support went over some days, beside the days before                                                         |
| [`GET /insights/changelog`](/docs/api/reference/get-a-changelog-entry-s-analytics)                   | `changelog:read`     | How a changelog entry was read, its reactions and its email                                                     |
| [`GET /insights/help-articles`](/docs/api/reference/get-a-help-article-s-analytics)                  | `help:read`          | How a help article was read, and how readers rated it                                                           |
| [`GET /insights/help-search-gaps`](/docs/api/reference/get-help-center-search-gaps)                  | `help:read`          | What readers searched the help center for and didn't find                                                       |
| [`GET /insights/help-broken-links`](/docs/api/reference/list-broken-help-links)                      | `help:read`          | Links in help articles that lead nowhere                                                                        |
| [`GET /insights/otto`](/docs/api/reference/get-otto-s-activity)                                      | `knowledge:read`     | How much Otto answered in the last 30 days                                                                      |
| [`GET /search`](/docs/api/reference/search-the-workspace)                                            | `requests:read`      | Requests, and whatever else the token may read, matching a query                                                |
| [`GET /people`](/docs/api/reference/list-people)                                                     | `people:read`        | A page of your customers and teammates                                                                          |
| [`GET /people/{id}`](/docs/api/reference/get-a-person)                                               | `people:read`        | One person, with their traits, plan and latest activity                                                         |
| [`GET /conversations`](/docs/api/reference/list-conversations)                                       | `conversations:read` | A page of conversations                                                                                         |
| [`GET /conversations/{id}`](/docs/api/reference/get-a-conversation)                                  | `conversations:read` | One conversation, with its newest messages                                                                      |
| [`GET /conversations/{id}/messages`](/docs/api/reference/list-a-conversation-s-messages)             | `conversations:read` | A page of a conversation's messages                                                                             |
| [`GET /operators`](/docs/api/reference/list-operators)                                               | `conversations:read` | The teammates who answer conversations                                                                          |
| [`GET /saved-replies`](/docs/api/reference/list-saved-replies)                                       | `conversations:read` | Your team's saved replies, found by their words                                                                 |
| [`GET /changelog-entries`](/docs/api/reference/list-changelog-entries)                               | `changelog:read`     | A page of the changelog's entries                                                                               |
| [`GET /changelog-entries/{id}`](/docs/api/reference/get-a-changelog-entry)                           | `changelog:read`     | One changelog entry, with what it says                                                                          |
| [`GET /changelog-tags`](/docs/api/reference/list-changelog-tags)                                     | `changelog:read`     | Every changelog tag                                                                                             |
| [`GET /help-articles`](/docs/api/reference/list-help-articles)                                       | `help:read`          | A page of the help center's articles                                                                            |
| [`GET /help-articles/{id}`](/docs/api/reference/get-a-help-article)                                  | `help:read`          | One help article, with what it says                                                                             |
| [`GET /help-collections`](/docs/api/reference/list-help-collections)                                 | `help:read`          | Every collection in the help center                                                                             |
| [`GET /status`](/docs/api/reference/get-the-system-status)                                           | `status:read`        | Your health checks and what visitors are shown                                                                  |
| [`GET /knowledge-sources`](/docs/api/reference/list-knowledge-sources)                               | `knowledge:read`     | The websites and files Otto answers from                                                                        |
| [`GET /knowledge-sources/{id}/pages`](/docs/api/reference/list-a-knowledge-source-s-pages)           | `knowledge:read`     | A page of a source's pages, and whether Otto answers from each                                                  |
| [`GET /knowledge-sources/{id}/problems`](/docs/api/reference/list-why-a-source-s-pages-weren-t-read) | `knowledge:read`     | Why a source's pages weren't read, most often first                                                             |
| [`GET /otto/answer`](/docs/api/reference/try-otto)                                                   | `knowledge:read`     | What Otto would reply to a question and the pages it would cite, or that it would hand off                      |
| [`GET /otto/gaps`](/docs/api/reference/list-what-otto-couldn-t-answer)                               | `knowledge:read`     | The questions Otto couldn't answer, and the searches that found no page                                         |
| [`GET /moderation/queue`](/docs/api/reference/list-posts-for-review)                                 | `moderation:manage`  | A page of the posts held for review, flagged or decided, to a token an owner or admin holds                     |
| [`GET /audit-events`](/docs/api/reference/list-audit-events)                                         | `audit:read`         | A page of the audit log, newest first, to a token an owner or admin holds                                       |
| [`GET /webhooks`](/docs/api/reference/list-webhooks)                                                 | `webhooks:manage`    | Your webhooks, never their secrets, to a token an owner or admin holds                                          |
| [`GET /webhooks/{id}/deliveries`](/docs/api/reference/list-a-webhook-s-deliveries)                   | `webhooks:manage`    | A page of a webhook's deliveries and how each went, to a token an owner or admin holds                          |
| [`GET /token`](/docs/api/reference/get-the-calling-token)                                            | Any                  | The token itself: its workspace, permissions, boards, networks and when it expires                              |
| `GET /openapi.json`                                                                                  | None                 | The API described as OpenAPI, no token needed                                                                   |

Each path is under `https://app.notert.io/api/v1`, and each endpoint's page in the reference lists every field it takes and answers, with an example call in curl, JavaScript and Python. Point an OpenAPI tool at `https://app.notert.io/api/v1/openapi.json` to generate a client or browse the endpoints.

## List requests [#list-requests]

`GET /requests` answers the workspace's requests newest first:

```json
{
  "items": [
    {
      "id": "3f2a9c1e-6b7d-4e58-9a0f-1c2d3e4f5a6b",
      "key": "REQ-44",
      "title": "Dark mode for the public board",
      "details": "Our team works late, and the board is **very** bright.",
      "status": "planned",
      "boardId": "b7e1d2c3-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
      "parentId": null,
      "boardUrl": "https://feedback.example.com/p/3f2a9c1e-6b7d-4e58-9a0f-1c2d3e4f5a6b",
      "authorId": "c_9c8b7a6f-5e4d-4c3b-8a29-1f0e9d8c7b6a",
      "votes": 42,
      "createdAt": "2026-10-12T09:31:40.118Z",
      "updatedAt": "2026-10-29T14:02:11.482Z"
    }
  ],
  "nextCursor": "WyIyMDI2LTEwLTEyIDA5OjMxOjQwLjExOCIsIjNmMmE5YzFlLTZiN2QtNGU1OC05YTBmLTFjMmQzZTRmNWE2YiJd"
}
```

- **`status`** is one of `pending`, `in_review`, `planned`, `in_progress`, `completed` and `closed`.
- **`details`** is Markdown, and empty when the request has none.
- **`parentId`** is the request it's a sub-request of, and `null` for one that stands on its own. A sub-request whose parent was removed stands on its own: it's listed with the requests that do, and `parentId` is `null`.
- **`key`** is what people call the request by, as its page shows it, such as REQ-44. Every endpoint that takes a request's id takes its key too, so `GET /requests/REQ-44` works.
- **`boardUrl`** is its page on your public board, at your own domain once one is connected, and `null` while a stranger can't open it: hidden, waiting for review or on a private board.
- **`authorId`** is who filed it, a customer's `c_` id or a teammate's `m_` id from the people endpoints, and `null` once neither is left, such as after the customer is erased.
- **`votes`** is how many votes it has.
- **`updatedAt`** is when it last changed, such as its title, details, status or board. A vote or a comment doesn't change it.

It lists what your team's own lists hold, private boards included. Two kinds of request are left out: one merged into another, whose votes now count on the one it was merged into, and one a moderator removed.

### Filter [#filter]

Add any of these to the query, and a request has to match every one you send:

| Parameter      | Lists                                                                                               |
| -------------- | --------------------------------------------------------------------------------------------------- |
| `status`       | Requests in that status, such as `?status=planned`                                                  |
| `boardId`      | Requests on that board, by its `id` from `GET /boards`                                              |
| `parentId`     | That request's sub-requests, in place of the requests that stand on their own                       |
| `updatedSince` | Requests whose `updatedAt` is at or after that moment, such as `?updatedSince=2026-11-20T00:00:00Z` |

Without `parentId`, the list holds only requests that stand on their own, never sub-requests.

To keep a copy in step, note when each sync starts and send that moment as `updatedSince` on the next. The list stays newest first by when each request was filed, so a request changed while you page is never skipped or listed twice, and the next sync picks up what changed meanwhile. Votes and comments don't change `updatedAt`: listen for the [webhook events](/docs/webhooks/webhook-events) to hear of those.

The changelog's entries keep in step the same way: `GET /changelog-entries?sort=oldest_changed&updatedSince=...` lists those changed since, the oldest change first, so an entry changed while you page moves later in the list and is never skipped. The inbox's conversations do with `GET /conversations?sort=oldest&activeAfter=...`, since a new message moves a conversation later in that order. A status or assignee change moves no moment there, so listen for the conversation [webhook events](/docs/webhooks/webhook-events) to hear of those.

### Page through [#page-through]

A page holds 50 requests unless you ask for another `limit`, up to 100. When there are more, `nextCursor` is a string: send it back as `cursor`, with the same filters, for the next page. On the last page it's `null`. Treat a cursor as opaque: its contents can change.

```js
async function allRequests(token) {
  const requests = [];
  let cursor = null;
  do {
    const url = new URL("https://app.notert.io/api/v1/requests");
    url.searchParams.set("limit", "100");
    if (cursor) url.searchParams.set("cursor", cursor);
    const response = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
    if (!response.ok) throw new Error(`Notert answered ${response.status}`);
    const page = await response.json();
    requests.push(...page.items);
    cursor = page.nextCursor;
  } while (cursor);
  return requests;
}
```

The same in Python, with [requests](https://requests.readthedocs.io):

```python
import os

import requests

def all_requests(status=None):
    session = requests.Session()
    session.headers["Authorization"] = f"Bearer {os.environ['NOTERT_API_TOKEN']}"
    params = {"limit": 100}
    if status:
        params["status"] = status
    items = []
    while True:
        response = session.get("https://app.notert.io/api/v1/requests", params=params)
        response.raise_for_status()
        page = response.json()
        items.extend(page["items"])
        if not page["nextCursor"]:
            return items
        params["cursor"] = page["nextCursor"]
```

## Get a request [#get-a-request]

`GET /requests/{id}` answers one request in the same shape as the list's items, a sub-request included, with its tags, owners and expected day, and its pictures and files under `attachments`. A request that's been merged or removed, or that isn't in the token's workspace, answers 404.

```sh
curl https://app.notert.io/api/v1/requests/3f2a9c1e-6b7d-4e58-9a0f-1c2d3e4f5a6b \
  -H "Authorization: Bearer $NOTERT_API_TOKEN"
```

```json
{
  "id": "3f2a9c1e-6b7d-4e58-9a0f-1c2d3e4f5a6b",
  "key": "REQ-44",
  "title": "Dark mode for the public board",
  "details": "Our team works late, and the board is **very** bright.",
  "status": "planned",
  "boardId": "b7e1d2c3-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
  "parentId": null,
  "boardUrl": "https://feedback.example.com/p/3f2a9c1e-6b7d-4e58-9a0f-1c2d3e4f5a6b",
  "authorId": "c_9c8b7a6f-5e4d-4c3b-8a29-1f0e9d8c7b6a",
  "votes": 42,
  "createdAt": "2026-10-12T09:31:40.118Z",
  "updatedAt": "2026-11-20T14:02:11.482Z",
  "version": "2026-11-20 14:02:11.482931+00",
  "tagIds": ["d9a3f4e5-6c7d-4e8f-a0b1-2c3d4e5f6a7b"],
  "ownerIds": ["m_Qm7Lk2Xv9Rt4Hb8Nc3Pd6Wf1Zs5Jy0Ae"],
  "estimatedDate": "2026-12-15",
  "hidden": false,
  "heldForReview": false,
  "attachments": [
    {
      "attachmentId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
      "name": "board-at-night.webp",
      "type": "image/webp",
      "size": 184320,
      "url": "https://files.notert.io/..."
    }
  ]
}
```

- **`version`** is what a change sends back, so one made since is refused rather than written over. Treat it as opaque.
- **`tagIds`** are ids from `GET /tags`, and **`ownerIds`** teammates' `m_` person ids from `GET /teammates`.
- **`estimatedDate`** is the day your team expects to ship it, or `null`.
- **`hidden`** is `true` when your team keeps it off the public board.
- **`heldForReview`** is `true` while it waits for a moderator to approve it, off the public board until then. A request a moderator removed isn't found at all.
- **`attachments`** lists its pictures and files. `url` is `null` while a file can't be opened from outside Notert, such as while it's still being checked, so key a file by `attachmentId`.

After a [webhook](/docs/webhooks/receive-webhooks) tells you a request changed, call it with the delivery's `data.request.id` to read the request as it is now, which matters when deliveries arrive out of order.

## List boards [#list-boards]

`GET /boards` answers every board, in the order your team arranged them, all at once:

```json
{
  "items": [
    { "id": "b7e1d2c3-4a5b-4c6d-8e9f-0a1b2c3d4e5f", "name": "Features", "visibility": "public" },
    { "id": "c8f2e3d4-5b6c-4d7e-9f0a-1b2c3d4e5f6a", "name": "Internal", "visibility": "private" }
  ]
}
```

`visibility` is `public` for a board whose requests show on the public board, and `private` for one only your team sees.

## Read the help center [#read-the-help-center]

`GET /help-articles` answers a page of the help center's articles in the order your team arranged them, drafts included and those in the trash left out, with `limit` (up to 100, 50 by default) and `cursor` as the requests' list takes them. `status=draft` or `status=published` keeps one kind, and `collectionId` one collection's articles, by its `id` from `GET /help-collections`. `updatedSince` keeps the articles whose words or state changed at or after a moment, as the requests' list takes it. Moving an article changes neither, so a sync that keeps where each article sits reads the whole list; it pages on from the last article's place, so an article that stays where it is is never skipped.

```json
{
  "items": [
    {
      "id": "0b4f6c1e-8d2a-4f3b-9c7e-5a1d2e3f4a5b",
      "title": "Invite your team",
      "description": "The first step",
      "status": "published",
      "visibility": "public",
      "collectionId": null,
      "topLevel": true,
      "slug": "invite-your-team",
      "url": "https://brightline.notert.io/help/articles/invite-your-team",
      "publishedAt": "2026-11-01T10:00:00.000Z",
      "updatedAt": "2026-11-02T08:30:00.000Z"
    }
  ],
  "nextCursor": null
}
```

`visibility` is `public` for an article listed on your board, `unlisted` for one only its link reaches and `team` for one only your team reads. `url` is its page on your board, which readers open once it's published, and `null` while your board has no address. `collectionId` is `null` for an article at the top level (`topLevel` is `true`) or placed nowhere yet.

`GET /help-articles/{id}` answers one article in the same shape with `body`, what it says in Markdown, and `unpublishedChanges`: the `title`, `description` and `body` a published article holds that readers don't see until it's published again, or `null`. One in the trash, or one that isn't in the token's workspace, answers 404. `GET /help-collections` answers every collection, in your team's order, each with its `id`, `name`, `description` and `slug`.

## Read the audit log [#read-the-audit-log]

`GET /audit-events` answers the workspace's audit log newest first, the same events the Audit log page in Notert and its CSV export list, kept a year, with `limit` (up to 100, 50 by default) and `cursor` as the requests' list takes them. It narrows as the page does: `area` keeps one area, such as `developers` or `team`; `period` keeps the last `day`, `week`, `month` or `quarter`; `by` keeps what one teammate did, by their `m_` id, or what `notert` or `stripe` did; and `via` keeps what teammates did in the app (`person`), through an API token (`api_token`) or through an AI client (`ai_client`). Only owners and admins read the log, so the token must be held by one, and the workspace's plan must include the audit log.

```json
{
  "items": [
    {
      "id": "6d1f3b8a-2c4e-4a7d-9f1b-3e5c7a9d1b2f",
      "action": "member.role_changed",
      "description": "Changed a member's role",
      "area": "team",
      "actorId": "m_5k2m9p4q7r1t",
      "actorName": "Hannah Lee",
      "actorKind": "person",
      "targetType": "member",
      "targetId": "m_8h3j6k1n4p7s",
      "createdAt": "2026-11-20T09:41:07.512Z"
    }
  ],
  "nextCursor": null
}
```

`action` is a stable id to branch on, and `description` says it in the log's own words. `actorId` and `actorName` name the teammate who did it, never their email address, and are `null` where Notert, its support team or Stripe did it, or once the teammate's account is deleted; `actorKind` says how it was done. `targetId` names what it was done to, a teammate by their `m_` id. To pull the log into your own tools on a schedule, keep the newest `id` you have seen and page until you reach it.

## Read the inbox report [#read-the-inbox-report]

`GET /insights/inbox-report` counts how support went over some days, as the Reports page does: the conversations customers started in the widget and by email, the median minutes to your team's first reply and to a resolve, how often visitors opened the widget, how customers rated resolved conversations, and what Otto answered, settled alone and handed off, and why. Each number sits beside the same number over as many days before, with how much it changed and whether that is better. Name the days with `period`, `7d` or `30d` (the default) up to today, or with both `from` and `to`, and count them in your `timeZone`, UTC by default. `periods` splits the conversations and widget opens by day, week, month or year, the finest that keeps the stretch short, and `sampleOnly` names a part with nothing of its own to count yet (`widget` or `otto`), which the Reports page draws over sample numbers. Only owners and admins open the Reports page, so the token must be held by one.

## Try Otto [#try-otto]

`GET /otto/answer?question=...` asks Otto a question the way a customer would in the widget, and answers what Otto would reply and the pages and files it would cite, or that it would pass the question to your team. Nothing is sent to anyone or stored, so you can check what Otto knows before you turn it on or after you add knowledge. It works on every plan. Each try counts toward the token's tries and your workspace's tries for the month, and past either the answer is a 429 that says when to try again. The question travels in the address, so one in a script such as Chinese or Japanese is refused at a shorter length than one in English.

`GET /otto/gaps` lists what Otto couldn't answer: the questions it passed to your team because nothing it reads answers them (`reason` is `not_covered`) or because the visitor asked for a person after its answer (`asked_after_answer`), each with its conversation, leaving out those your team marked handled on the Knowledge page, and the searches your team made for pages Otto reads that found none and still find none. They point to the help articles worth writing.

## Keep your status and Otto's knowledge up to date [#keep-your-status-and-ottos-knowledge-up-to-date]

A token with `status:write` adds, edits, pauses and resumes the health checks your widget shows: `POST /status/services` adds one, hidden from visitors until its first check passes, `PUT /status/services/{id}` changes its address, name or application, and `PUT /status/services/{id}/paused` pauses or resumes it, so a service being moved or retired isn't shown as down. A token with `knowledge:write` adds a website for Otto with `POST /knowledge-sources`, reads one again from its first page with `POST /knowledge-sources/{id}/crawl`, holds and carries on a crawl with `/pause` and `/resume`, and keeps a page out of the links replies offer with `PUT /knowledge-pages/{id}/hidden`. Each takes a token whose holder is an owner or admin, and a call sent again for a state it is already in changes nothing.

## Retry a write safely [#retry-a-write-safely]

A call that creates or sends something takes an `Idempotency-Key` header: any key of your own up to 255 visible characters, such as a UUID, sent again unchanged when you retry the call after a lost answer. The same key with the same call creates or sends it once and answers what the first stored, while the same key with other words, or sent by a token another teammate holds, makes something new. It works on `POST /requests`, `POST /requests/{requestId}/comments`, `POST /conversations`, `POST /conversations/{id}/messages`, `POST /changelog-entries`, `POST /changelog-tags`, `POST /help-articles`, `POST /help-collections`, `POST /saved-replies`, `POST /tags` and `POST /webhooks`. Each of them also takes an `id` of your own in the body for the same purpose; send one or the other, since both together, or a key a header can't carry, are refused with 400 `IDEMPOTENCY_KEY_REFUSED`.

```sh
curl https://app.notert.io/api/v1/conversations/$CONVERSATION_ID/messages \
  -H "Authorization: Bearer $NOTERT_API_TOKEN" \
  -H "Idempotency-Key: ticket-4821-reply-1" \
  -H "Content-Type: application/json" \
  -d '{ "kind": "reply", "body": "Thanks, we are on it." }'
```

## Rate limits [#rate-limits]

A workspace's calls are counted each minute, every token together, and each token may make up to half of them, so one busy or leaked token can't stop your other integrations. A Free workspace makes up to 300 calls a minute and each of its tokens up to 150; a Starter workspace makes up to 600 and each token up to 300; a Professional workspace makes up to 1,200 and each token up to 600.

Every answer names both limits in a `RateLimit-Policy` header, the token's first, and says in a `RateLimit` header how many calls each has left now (`r`) and the seconds until it is full again (`t`):

```http
RateLimit-Policy: "token";q=300;w=60, "workspace";q=600;w=60
RateLimit: "token";r=299;t=1, "workspace";r=599;t=1
```

Past either one, a call answers 429 with a `Retry-After` header, the seconds to wait before trying again, and a `RateLimit` header naming the limit it reached. The body says the same in `data.retryAfter`:

```json
{
  "defined": true,
  "code": "TOO_MANY_REQUESTS",
  "status": 429,
  "message": "Too Many Requests",
  "data": { "retryAfter": 12 }
}
```

Pace your calls by `RateLimit`'s `r`, and wait as long as `Retry-After` says before retrying:

```js
async function notert(path, init = {}) {
  for (let attempt = 0; attempt < 3; attempt++) {
    const response = await fetch(`https://app.notert.io/api/v1${path}`, {
      ...init,
      headers: { Authorization: `Bearer ${process.env.NOTERT_API_TOKEN}`, ...init.headers },
    });
    if (response.status !== 429) return response;
    const wait = Number(response.headers.get("Retry-After") ?? 1);
    await new Promise((resolve) => setTimeout(resolve, wait * 1000));
  }
  throw new Error("Notert kept answering 429");
}
```

A write also counts toward the limits a teammate has on that kind of change in Notert, such as how many requests they file in an hour. Each token keeps limits of its own, apart from the teammate who holds it and from your other tokens, so a busy script never uses up what that teammate can do in Notert. Past one, the write answers 429 with `Retry-After` too.

## Errors [#errors]

An error answers with a JSON body whose `code` names it and whose `message` says what went wrong, and some carry `data` with more. Branch on `status` and `code`, never on `message`, whose words can change:

```json
{
  "defined": true,
  "code": "INSUFFICIENT_SCOPE",
  "status": 403,
  "message": "This API token can't read the roadmap. Create one that may in the workspace's settings."
}
```

| Status | `code`                 | Why                                                                                               |
| ------ | ---------------------- | ------------------------------------------------------------------------------------------------- |
| 400    | `BAD_REQUEST`          | A parameter isn't one the endpoint takes, such as a `limit` over 100 or an unknown `status`       |
| 401    | `UNAUTHORIZED`         | The token is missing, mistyped, revoked or expired. The answer carries `WWW-Authenticate: Bearer` |
| 403    | `INSUFFICIENT_SCOPE`   | The token lacks the permission the call needs. `message` names it                                 |
| 403    | `NETWORK_NOT_ALLOWED`  | The token is held to some networks, and the call came from another                                |
| 403    | `HOLDER_NOT_ALLOWED`   | The account holding the token is suspended. A teammate who can act should roll it                 |
| 404    | `NOT_FOUND`            | The record isn't one the token's workspace holds, or no endpoint has the path                     |
| 405    | `METHOD_NOT_SUPPORTED` | The path exists but takes other methods, which the `Allow` header names                           |
| 413    | `PAYLOAD_TOO_LARGE`    | The body is larger than a call takes. Send less in one call                                       |
| 429    | `TOO_MANY_REQUESTS`    | The token or the workspace has spent its minute. Wait as long as `Retry-After` says               |

Each write adds refusals of its own, listed on its guide and on its page in the reference.

An expired token's `message` says it expired: roll it in the workspace's settings for a new one, and it works again for the same length of time. An address that keeps calling with a token that doesn't work is answered 429 rather than 401 for the rest of the minute, so stop retrying a token that's been refused.

## Changes to the API [#changes-to-the-api]

The version is in the path. Within `v1`, fields and endpoints are only ever added, so ignore a field you don't know rather than refusing it. A change that would break your code comes as a new version beside this one.