Comments API
8 operations. Authentication, errors and pagination work as described in the REST API overview.
Threads on a target
GET/api/v1/commentsToken optional
One page of top-level comments (oldest first, keyset cursor) with all their replies, nested up to 4 levels (deeper replies are flattened with replyTo). Hidden, held and deleted comments appear only to those allowed to see them; a deleted comment with replies is a tombstone.
| Name | Type | Description |
|---|---|---|
targetType queryrequired | "prompt" | "prompt_version" | "make" | "post" | "change_request" | |
targetId queryrequired | string | |
cursor query | string |
Responses: 200 OK400, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
targetrequired | object | |
nodesrequired | __schema0[] | |
nextCursorrequired | string | null | |
totalrequired | integer (-9007199254740991–9007199254740991) | |
lockedrequired | boolean | |
viewerrequired | object |
curl 'https://incantory.ai/api/v1/comments' \
-H "Authorization: Bearer $INCANTORY_TOKEN"Comment or reply
POST/api/v1/commentsToken required
Markdown body; @handle mentions notify (respecting blocks). New accounts' comments containing links are held for review (held: true). Rate-limited per user.
Request body
| Name | Type | Description |
|---|---|---|
targetTyperequired | "prompt" | "prompt_version" | "make" | "post" | "change_request" | |
targetIdrequired | string | |
parentId | string | null | |
bodyrequired | string |
Responses: 201 OK400, 401, 403, 404, 409, 429
Response fields
| Name | Type | Description |
|---|---|---|
idrequired | string | |
heldrequired | boolean | Held for review (new account with links) |
createdAtrequired | string | ISO 8601 timestamp (UTC) |
curl -X POST 'https://incantory.ai/api/v1/comments' \
-H "Authorization: Bearer $INCANTORY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"targetType":"prompt","targetId":"targetId","body":"body"}'Edit your comment (within 24 hours)
PATCH/api/v1/comments/{id}Token required
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Id |
Request body
| Name | Type | Description |
|---|---|---|
bodyrequired | string |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
idrequired | string | |
editedAtrequired | string | ISO 8601 timestamp (UTC) |
curl -X PATCH 'https://incantory.ai/api/v1/comments/{id}' \
-H "Authorization: Bearer $INCANTORY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"body":"body"}'Delete a comment (author or moderator; replies stay)
DELETE/api/v1/comments/{id}Token required
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Id |
Responses: 204 OK400, 401, 403, 404, 429
curl -X DELETE 'https://incantory.ai/api/v1/comments/{id}' \
-H "Authorization: Bearer $INCANTORY_TOKEN"Hide a comment (moderators)
POST/api/v1/comments/{id}/hideToken required
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Id |
Request body (optional)
| Name | Type | Description |
|---|---|---|
reason | string |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
hiddenrequired | true | |
changedrequired | boolean |
curl -X POST 'https://incantory.ai/api/v1/comments/{id}/hide' \
-H "Authorization: Bearer $INCANTORY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{}'Unhide a comment (moderators); publishes a held comment
DELETE/api/v1/comments/{id}/hideToken required
| Name | Type | Description |
|---|---|---|
id pathrequired | string | Id |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
hiddenrequired | false | |
changedrequired | boolean |
curl -X DELETE 'https://incantory.ai/api/v1/comments/{id}/hide' \
-H "Authorization: Bearer $INCANTORY_TOKEN"Lock or unlock a thread (owner or moderator)
PUT/api/v1/comments/lockToken required
Request body
| Name | Type | Description |
|---|---|---|
targetTyperequired | "prompt" | "prompt_version" | "make" | "post" | "change_request" | |
targetIdrequired | string | |
lockedrequired | boolean | |
reason | string |
Responses: 200 OK400, 401, 403, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
lockedrequired | boolean | |
lockedAtrequired | string | null |
curl -X PUT 'https://incantory.ai/api/v1/comments/lock' \
-H "Authorization: Bearer $INCANTORY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"targetType":"prompt","targetId":"targetId","locked":true}'@handle autocomplete
GET/api/v1/comments/mentionsToken optional
Users whose handle starts with q, excluding anyone in a block with you. Empty when signed out.
| Name | Type | Description |
|---|---|---|
q query | string |
Responses: 200 OK400, 404, 429
Response fields
| Name | Type | Description |
|---|---|---|
itemsrequired | object[] |
curl 'https://incantory.ai/api/v1/comments/mentions' \
-H "Authorization: Bearer $INCANTORY_TOKEN"