---
title: "Start a thread or reply to one"
method: POST
path: "/api/pages/{id}/comments"
tags: ["comments"]
---

# Start a thread or reply to one

`POST /api/pages/{id}/comments`

## Request

- Base URL: `https://telawiki.com`
- URL: `https://telawiki.com/api/pages/{id}/comments`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `tela_session`

Two shapes. A **root** comment omits `parent_id` and must carry all three anchor fields — the quoted text plus its surrounding context, which is how tela re-locates the comment after the page is edited. A **reply** sets `parent_id` to a root comment on the same page; anchors are ignored. Replies to replies are refused: threads are one level deep.

## Request body

- object
  - `body` string, required
  - `parent_id` integer, nullable: The root comment being replied to.
  - `anchor_prefix` string, nullable: Text immediately before the quoted span. Required on a root comment.
  - `anchor_exact` string, nullable: The quoted span itself. Required and non-empty on a root comment.
  - `anchor_suffix` string, nullable: Text immediately after the quoted span. Required on a root comment.

## Response `201`

The comment.

- object
  - `comment` Comment, required
    - `id` integer, required
    - `page_id` integer, required
    - `parent_id` integer, nullable, required: Null on a root comment.
    - `author_id` integer, required
    - `author_username` string, required
    - `body` string, required
    - `anchor_prefix` string: Root comments only — the text before the quoted span.
    - `anchor_exact` string: Root comments only — the quoted span.
    - `anchor_suffix` string: Root comments only — the text after the quoted span.
    - `resolved` boolean, required
    - `resolved_at` string
    - `resolved_by` integer
    - `resolved_by_username` string
    - `created_at` string, required: `YYYY-MM-DD HH:MM:SS` in UTC.
    - `updated_at` string, required: `YYYY-MM-DD HH:MM:SS` in UTC.

## Other responses

- `400`: `bad_request`, `comment_no_anchor` (a root comment without anchors), or `comment_reply_to_reply`.
- `403`: `forbidden` (no access, or the role is too low), `viewer_no_write`, `api_key_scope` (the token's scope forbids this method), or `api_key_space_scope` (the token is pinned to another space).
- `404`: `comment_not_found` — no such parent comment.
- `500`: `internal` — server error.

---

[API](https://skmtc.dev/telawiki/apis/tela-rest-api.md) · [All operations](https://skmtc.dev/telawiki/apis/tela-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/telawiki/apis/tela-rest-api/revisions/f316f31f6fcb?raw)
