Skip to content

Create a comment as another user

POST
/admin/seed/comments

Creates a comment as any existing user, with an optional fixed id and date. It’s for seed data and tests; the normal way to comment is POST /posts/{id}/comments, which posts as you.

It skips the normal comment rules: nothing checks that the author may comment on or see the target, comments don’t have to be enabled on it, and a reply’s parent only has to exist and not be deleted, even if it’s on a different target. The request still needs a non-empty body, an existing author and an existing target. A comment on a post adds to the post’s comment count, but no activity, notification or federation message is sent.

With a fixed id, sending the request again returns the existing comment with a 200 and doesn’t change it, even if this request names a different target or author. The response leaves out edited_at and the remote-author fields, even when the stored comment has them. The author, target and parent are still checked first, so a repeat can fail even though the comment exists.

body_html is stored exactly as sent, with no cleaning. Normal comments leave it empty, and the web app shows body as plain text, so don’t display body_html as HTML.

A new comment gets an admin.seed.comment_created audit event on a best-effort basis; a repeat doesn’t. You need system.admin; the endpoint works on any instance, not only demo ones.

object
id

A fixed id, so you can send the same request again safely. Leave it out and the server makes one up.

string format: uuid
nullable
target_kind
required
string
Allowed values: post asset collection
target_id
required
string format: uuid
author_user_ref
required

The user to post the comment as. They must exist.

integer format: int64
parent_id

The comment this one replies to. The reply joins the parent’s thread, one level deeper than the parent. It must exist and not be deleted, or the request fails with a 500. It isn’t checked against the target.

string format: uuid
nullable
body
required
string
>= 1 characters
body_html

Stored exactly as sent and returned unchanged, with no cleaning. Defaults to an empty string, which is what normal comments have.

string
nullable
annotation_type
string
nullable
Allowed values: point rect timestamp frame whiteboard text-range
annotation_data
object
key
additional properties
any
created_at

When the comment was made; updated_at is set to the same time. Defaults to now.

string format: date-time
nullable

A comment with this id already exists. It comes back unchanged, though it may not match this request, and without edited_at or the remote-author fields.

One comment. A reply has parent_id; root_id is the first comment in its thread and depth counts how far down the thread it is (0 for a top-level comment). Annotations also carry annotation_type and annotation_data.

A comment written on this instance has author_user_ref; one received from a paired instance has peer_id and actor_uri instead. Fields with no value are left out.

object
id
required
string format: uuid
target_kind
required
string
Allowed values: post asset collection
target_id
required
string format: uuid
parent_id
string format: uuid
nullable
root_id
required
string format: uuid
depth
required
integer
author_user_ref

The local user who wrote the comment. Left out for comments received from another instance.

integer format: int64
nullable
body
required
string
body_html
required

Normally an empty string: no endpoint except the seed endpoint stores HTML here, comments from other instances don’t carry any, and the web app shows body as plain text. The seed endpoint stores its value unchecked, so don’t display this field as HTML.

string
annotation_type
string
nullable
Allowed values: point rect timestamp frame whiteboard text-range
annotation_data
object
key
additional properties
any
like_count
required
integer format: int64
edited_at
string format: date-time
nullable
created_at
required
string format: date-time
updated_at
required
string format: date-time
peer_id

The paired instance a received comment came from. Left out for comments written on this instance.

string format: uuid
nullable
actor_uri

The author’s address on their home instance, for example https://studio-b.example/users/bob. Left out for comments written on this instance.

string
nullable
display_name

The remote author’s display name. It’s often left out, even for received comments; when it is, show the host and user name from actor_uri instead.

string
nullable

Comment created.

One comment. A reply has parent_id; root_id is the first comment in its thread and depth counts how far down the thread it is (0 for a top-level comment). Annotations also carry annotation_type and annotation_data.

A comment written on this instance has author_user_ref; one received from a paired instance has peer_id and actor_uri instead. Fields with no value are left out.

object
id
required
string format: uuid
target_kind
required
string
Allowed values: post asset collection
target_id
required
string format: uuid
parent_id
string format: uuid
nullable
root_id
required
string format: uuid
depth
required
integer
author_user_ref

The local user who wrote the comment. Left out for comments received from another instance.

integer format: int64
nullable
body
required
string
body_html
required

Normally an empty string: no endpoint except the seed endpoint stores HTML here, comments from other instances don’t carry any, and the web app shows body as plain text. The seed endpoint stores its value unchecked, so don’t display this field as HTML.

string
annotation_type
string
nullable
Allowed values: point rect timestamp frame whiteboard text-range
annotation_data
object
key
additional properties
any
like_count
required
integer format: int64
edited_at
string format: date-time
nullable
created_at
required
string format: date-time
updated_at
required
string format: date-time
peer_id

The paired instance a received comment came from. Left out for comments written on this instance.

string format: uuid
nullable
actor_uri

The author’s address on their home instance, for example https://studio-b.example/users/bob. Left out for comments written on this instance.

string
nullable
display_name

The remote author’s display name. It’s often left out, even for received comments; when it is, show the host and user name from actor_uri instead.

string
nullable

Malformed request

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}

Authenticated but missing required capabilities

object
error
required

Human-readable error summary

string
Example
the request could not be completed

The author or the target doesn’t exist. A deleted post counts as missing; a deleted asset or collection doesn’t.

object
error
required

Human-readable error summary

string
Example
the request could not be completed