Skip to main content

Overview

The blog system supports creating posts, a moderation workflow, and user engagement through likes.

Post visibility states

StateDescription
draftSaved but not submitted for review
pendingSubmitted and awaiting moderator approval
publicApproved and visible to everyone
rejectedRejected by moderator with feedback
deletedSoft-deleted (hidden but not removed)

Create a post

curl -X POST https://api-verifier-2.onrender.com/api/blog \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My Trading Strategy",
    "contentRaw": "# Introduction\n\nThis is my trading strategy...",
    "summary": "A detailed look at my trading approach",
    "tags": ["strategy", "trading"],
    "coverImageUrl": "https://example.com/cover.jpg",
    "publish": true
  }'
Set publish: false to save as draft, or publish: true to submit for approval.

Get all public posts

curl https://api-verifier-2.onrender.com/api/blog

Get a single post

curl https://api-verifier-2.onrender.com/api/blog/my-trading-strategy-abc123

Update a post

curl -X PATCH https://api-verifier-2.onrender.com/api/blog/<post-id> \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Title",
    "contentRaw": "Updated content..."
  }'
When a regular user edits a public post, it returns to pending status for re-approval.

Like a post

Toggle like on a post:
curl -X POST https://api-verifier-2.onrender.com/api/blog/<post-id>/toggle-like \
  -H "Authorization: Bearer <your-token>"

Moderation (moderator/admin only)

Approve a post

curl -X POST https://api-verifier-2.onrender.com/api/blog/<post-id>/approve \
  -H "Authorization: Bearer <your-token>"

Reject a post

curl -X POST https://api-verifier-2.onrender.com/api/blog/<post-id>/reject \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Content does not meet quality guidelines"
  }'

Delete a post

curl -X DELETE https://api-verifier-2.onrender.com/api/blog/<post-id> \
  -H "Authorization: Bearer <your-token>"
  • Draft/pending posts: Permanently deleted
  • Public posts by author: Soft deleted
  • Any post by admin: Permanently deleted