Skip to main content
POST
/
:projectId
/
api
/
v7
/
comments
Create Comment
curl --request POST \
  --url https://api.replyke.com/api/v6/:projectId/api/v7/comments \
  --header 'Content-Type: application/json' \
  --data '
{
  "entityId": "<string>",
  "content": "<string>",
  "gif": {},
  "attachments": [
    {}
  ],
  "parentId": "<string>",
  "referencedCommentId": "<string>",
  "foreignId": "<string>",
  "mentions": [
    {}
  ],
  "metadata": {},
  "userId": "<string>",
  "createdAt": "<string>",
  "updatedAt": "<string>"
}
'
Creates a new comment on an entity, or a reply to an existing comment. The comment is attributed to the authenticated user. Notifications are sent to the entity owner, parent comment author (for replies), and mentioned users. Authentication required.

Body Parameters

entityId
string
required
The UUID of the entity this comment belongs to.
content
string
The text content of the comment. At least one of content, gif, or attachments must be provided.
gif
object
A GIF to attach to the comment. At least one of content, gif, or attachments must be provided.
{
  "id": "gif-id",
  "altText": "laughing cat",
  "gifUrl": "https://media.giphy.com/...",
  "gifPreviewUrl": "https://media.giphy.com/...",
  "url": "https://giphy.com/...",
  "aspectRatio": "16:9"
}
attachments
object[]
An array of generic attachment objects. At least one of content, gif, or attachments must be provided.
parentId
string
The UUID of the parent comment. When provided, this comment is treated as a reply to that comment. The parent comment’s author receives a reply notification.
referencedCommentId
string
The UUID of a comment being quoted or referenced. Used for quote-replies.
foreignId
string
Your application’s identifier for this comment.
mentions
object[]
Users or spaces mentioned in the comment. Each mentioned user receives an in-app notification.
  • { type: "user", id: string, username: string, foreignId?: string }
  • { type: "space", id: string, slug: string }
metadata
object
A free-form JSON object for any custom data your application needs alongside the comment.
userId
string
Attribute the comment to a specific user. Service or master key only. Useful for backfilling comments from external systems.
createdAt
string
ISO 8601 datetime to backfill a creation timestamp. Service or master key only.
updatedAt
string
ISO 8601 datetime for updatedAt. Requires createdAt. Must be ≥ createdAt. Service or master key only.

Response

Returns 201 Created with the new Comment object, populated with the author’s user profile.

Error Responses

{ "error": "Entity not found", "code": "comment/entity-not-found" }
{ "error": "Missing user ID", "code": "comment/missing-user-id" }
Returned when none of content, gif, or attachments is provided.