Reference
Blog comments API
Read, submit and moderate reader comments on PixelFox blog posts.
Reader comments on the PixelFox blog. These are the endpoints the marketing site uses; they
live on the dashboard surface (/api/*) of the backend, not the SDK's /v1 surface.
Comments are plain text. Render them as text, never as HTML. Emails are never returned by a public route, and the submitting IP is stored only as a salted hash.
Moderation
- A commenter whose email has no approved comment yet is held for approval. Their comment is not public until an admin approves it.
- Once an email has one approved comment, its later comments are published at once, unless the text holds more than two links, which holds it again.
- A reply to a reply attaches to the top-level comment, so threads are one level deep.
- A comment written by an admin is marked
by_staffand never counts toward trusting an email. - One IP may submit 5 comments per hour; more answer
429.
GET /api/public/blog/:slug/comments
Approved comments of a published post, oldest first. A draft or unknown slug answers 404.
{
"comments": [
{ "id": "…", "parent_id": null, "author_name": "Sam", "body": "Great post.", "created_at": "2026-11-10T09:00:00.000Z", "by_staff": false }
],
"total": 1
}POST /api/public/blog/:slug/comments
{ "author_name": "Sam", "author_email": "[email protected]", "body": "Great post.", "parent_id": null, "website": "" }website is a honeypot: leave it empty. Limits: name 80, email 200, comment 2000
characters; the request body is capped at 8 KB (413).
| Status | Body | Meaning |
|---|---|---|
201 | { "ok": true, "status": "approved", "comment": { … } } | Published. |
202 | { "ok": true, "status": "pending" } | Held for approval. |
400 | { "error": "…" } | Invalid name, email, comment or parent_id. |
404 | { "error": "post not found" } | No such published post. |
429 | { "error": "too many comments, try again later" } | Over the hourly budget. |
Admin endpoints
Require a signed-in admin (ADMIN_EMAILS).
| Route | Purpose |
|---|---|
GET /api/admin/blog/comments?status=pending|approved|spam&limit=&offset= | Moderation queue, newest first (default pending). Each item adds post_id, post_slug, post_title, author_email and status. Returns { comments, total }. |
PATCH /api/admin/blog/comments/:id | Body { "status": "approved" | "pending" | "spam" }. Returns { comment }. |
DELETE /api/admin/blog/comments/:id | Remove a comment and its replies. |
POST /api/admin/blog/:idOrSlug/comments | Reply as staff: { "body": "…", "parent_id": "…" }. Published at once, by_staff: true. Returns { comment }. |