Skip to main content

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 externalId creates the discussion. title (1-500 characters) only counts on that first post; it defaults to the externalId. The response has discussionCreated to tell you whether this post created the discussion.
  • body is limited per tenant (default 10000 characters). Replies nest to a tenant-set depth (default 2, so three levels); deeper replies return 422.
  • 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.
Moderation can hold a comment

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.cursor from the response as ?cursor=…, and trust meta.hasMore. Pinned comments come first.
  • Pass ?parent_id=<uuid> to read the replies to one comment.
  • Each comment carries reactionCounts, replyCount, isPinned and editWindowClosesAt.
  • Pass the viewer's identity assertion to add viewer-specific fields, such as viewerReactions, and to see the viewer's own pending comments.
  • By UUID, use GET /api/v1/discussions/{discussionId}/comments. To find discussions, use GET /api/v1/discussions (paginated) or GET /api/v1/discussions/{externalId}.

Edit and delete​

ActionEndpointNotes
EditPATCH /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.
DeleteDELETE /api/v1/comments/{commentId}Author self-delete; soft-delete (thread stays coherent). The body becomes [deleted]. Deleting twice returns 409.
ReportPOST /api/v1/comments/{commentId}/reportOne 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.

ActionEndpoint
LockPOST /api/v1/discussions/{discussionId}/lock
UnlockDELETE /api/v1/discussions/{discussionId}/lock
ArchivePOST /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.