A comment object contains information about an individual comment. It contains relationships to a post, a user and attachment.
An example of a comment object is displayed below.
{
"id": "comment_1234abcd",
"type": "comment",
"attributes": {
"content": "Great point, thanks for sharing!",
"htmlContent": "<p>Great point, thanks for sharing!</p>",
"attachment": {
"url": "https://cdn.padlet.dev/uploads/image.png"
},
"status": "approved",
"createdAt": "2025-01-17T12:34:56Z",
"updatedAt": "2025-01-17T12:34:56Z"
},
"relationships": {
"author": {
"data": {
"id": "user_abcd1234efgh5678",
"type": "user"
}
},
"post": {
"data": {
"id": "post_lkROZPOe62X2QjMg",
"type": "post"
}
}
}
}
Comment object properties
Properties | Type | Description |
---|---|---|
id | string | Comment ID |
type | string | Always comment |
attributes.content | string | Plain-text fallback of the comment |
attributes.htmlContent | string | Sanitized HTML body of the comment |
attributes.attachment | object | Attachment properties object with a url field, or null if none |
attributes.status | string | Moderation status. Can be "approved" or "pending_moderation" |
attributes.createdAt | string | Date and time when this comment was created. Formatted as an ISO 8601 date time string. |
attributes.updatedAt | string | Date and time when this comment was updated. Formatted as an ISO 8601 date time string. |
relationships.author | object | User who created the comment. Only contains type and id as per JSON:API specification. |
relationships.post | object | Post object that the comment belongs to. Only contains type and id as per JSON:API specification. |
Content requirements
At least one of
htmlContent
orattachment
must be present. You can include both in a single comment.