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.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
A fixed id, so you can send the same request again safely. Leave it out and the server makes one up.
The user to post the comment as. They must exist.
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.
Stored exactly as sent and returned unchanged, with no cleaning. Defaults to an empty string, which is what normal comments have.
object
When the comment was made; updated_at is set to the same time.
Defaults to now.
Responses
Section titled “ Responses ”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
The local user who wrote the comment. Left out for comments received from another instance.
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.
object
The paired instance a received comment came from. Left out for comments written on this instance.
The author’s address on their home instance, for example https://studio-b.example/users/bob. Left out for comments written on this instance.
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.
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
The local user who wrote the comment. Left out for comments received from another instance.
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.
object
The paired instance a received comment came from. Left out for comments written on this instance.
The author’s address on their home instance, for example https://studio-b.example/users/bob. Left out for comments written on this instance.
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.
Malformed request
object
Human-readable error summary
Example
the request could not be completedAuthentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Authenticated but missing required capabilities
object
Human-readable error summary
Example
the request could not be completedThe author or the target doesn’t exist. A deleted post counts as missing; a deleted asset or collection doesn’t.
object
Human-readable error summary
Example
the request could not be completed