Comments & discussions
A discussion is a thread of comments scoped to one piece of your content. Discussions are lazy: you never create one explicitly — it materialises when the first comment is posted, keyed by your content identifier (the external id).
In practice, you address comments by your own article id rather than an RSMG Engage UUID.
Post a comment
POST /api/v1/discussions/by-external/{externalId}/comments
X-API-Key: ek_…
X-RSMG-Engage-Identity: <assertion>
X-RSMG-Engage-Identity-Signature: t=…,v1=…,kid=…
Content-Type: application/json
{ "body": "Great match!", "parent_id": "<uuid, optional, for replies>", "title": "<optional>" }
- The first post for an
externalIdcreates the discussion.title(1-500 characters) only counts on that first post; it defaults to theexternalId. The response hasdiscussionCreatedto tell you whether this post created the discussion. bodyis limited per tenant (default 10000 characters). Replies nest to a tenant-set depth (default 2, so three levels); deeper replies return422.- You can also post by discussion UUID with
POST /api/v1/discussions/{discussionId}/comments. - The acting user comes from the identity assertion — you don't send a
user_id; the user is created on their first action. - Pass
Idempotency-Key: <uuid>for retry-safe posting.
The 201 response's status field can be published, pending, or hidden. Word filters and
automated review decide which. hidden comments never appear in reads. pending comments appear
only to their author, when the read carries that author's identity. Neither emits an SSE event. Only
a pending comment can be approved; a comment_approved SSE event then
signals publication. Check status before rendering the new comment optimistically.
Read comments
GET /api/v1/discussions/by-external/{externalId}/comments?limit=20&sort=newest
X-API-Key: ek_…
- Returns 404 before the first comment exists (the discussion isn't materialised yet) — this is normal; render an empty state.
- Results are cursor-paginated: pass
meta.cursorfrom the response as?cursor=…, and trustmeta.hasMore. Pinned comments come first. - Pass
?parent_id=<uuid>to read the replies to one comment. - Each comment carries
reactionCounts,replyCount,isPinnedandeditWindowClosesAt. - Pass the viewer's identity assertion to add viewer-specific
fields, such as
viewerReactions, and to see the viewer's ownpendingcomments. - By UUID, use
GET /api/v1/discussions/{discussionId}/comments. To find discussions, useGET /api/v1/discussions(paginated) orGET /api/v1/discussions/{externalId}.
Edit and delete
| Action | Endpoint | Notes |
|---|---|---|
| Edit | PATCH /api/v1/comments/{commentId} | Author-only. The edit window is per tenant (default 15 minutes); after it, 403 EDIT_WINDOW_EXPIRED. Editing a deleted comment returns 409. An edit can send the comment back to pending. |
| Delete | DELETE /api/v1/comments/{commentId} | Author self-delete; soft-delete (thread stays coherent). The body becomes [deleted]. Deleting twice returns 409. |
| Report | POST /api/v1/comments/{commentId}/report | One report per reader per comment (a repeat returns 409). Body: reason is spam, harassment, hate_speech, misinformation or other; optional description up to 1000 characters. You can't report your own comment or an unpublished one (422). |
All three carry the identity assertion, so RSMG Engage verifies the acting reader as the author or reporter.
Discussion lifecycle
An admin — or a key with moderate_discussion — can lock, unlock, or archive a discussion,
for example to close comments when an article is retired.
| Action | Endpoint |
|---|---|
| Lock | POST /api/v1/discussions/{discussionId}/lock |
| Unlock | DELETE /api/v1/discussions/{discussionId}/lock |
| Archive | POST /api/v1/discussions/{discussionId}/archive |
Lock and archive accept an optional reason (up to 500 characters). Writes to a locked discussion
return 403 DISCUSSION_LOCKED — see Errors. Writes to an archived discussion return
a plain 403. There is no unarchive.
Moderators can also remove a comment with POST /api/v1/comments/{commentId}/remove, and pin or
unpin one with POST and DELETE /api/v1/comments/{commentId}/pin. Both need the moderate_content
capability.
The exact request and response schema for every field is in the API Reference under Comments and Discussions.