Skip to main content
PATCH
/
api
/
blog
/
{id}
curl -X PATCH https://api-verifier-2.onrender.com/api/blog/65a1b2c3d4e5f6g7h8i9j0k1 \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Trading Strategy",
    "contentRaw": "# Updated Introduction\n\nNew content here...",
    "summary": "Updated summary"
  }'
{
  "_id": "65a1b2c3d4e5f6g7h8i9j0k1",
  "title": "Updated Trading Strategy",
  "slug": "my-trading-strategy-xyz789",
  "summary": "Updated summary",
  "content": "# Updated Introduction\n\nNew content here...",
  "visibility": "pending",
  "updatedAt": "2024-01-16T14:00:00.000Z",
  "revisions": [
    {
      "revId": "rev-abc123",
      "editorId": "user-id",
      "editorRole": "user",
      "editedAt": "2024-01-16T14:00:00.000Z",
      "summary": "Updated summary"
    }
  ]
}
This endpoint requires authentication. Only the author or an admin can update a post.

Path parameters

id
string
required
The post ID

Request body

title
string
Updated post title
contentRaw
string
Updated post content
summary
string
Updated summary
tags
array
Updated tags array
coverImageUrl
string
Updated cover image URL

Response

Returns the updated blog post. A revision is automatically created to track changes.
If a regular user edits a public post, it will be set back to “pending” status for re-approval.
curl -X PATCH https://api-verifier-2.onrender.com/api/blog/65a1b2c3d4e5f6g7h8i9j0k1 \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Trading Strategy",
    "contentRaw": "# Updated Introduction\n\nNew content here...",
    "summary": "Updated summary"
  }'
{
  "_id": "65a1b2c3d4e5f6g7h8i9j0k1",
  "title": "Updated Trading Strategy",
  "slug": "my-trading-strategy-xyz789",
  "summary": "Updated summary",
  "content": "# Updated Introduction\n\nNew content here...",
  "visibility": "pending",
  "updatedAt": "2024-01-16T14:00:00.000Z",
  "revisions": [
    {
      "revId": "rev-abc123",
      "editorId": "user-id",
      "editorRole": "user",
      "editedAt": "2024-01-16T14:00:00.000Z",
      "summary": "Updated summary"
    }
  ]
}