Skip to main content
Saves a post to the user’s saved collection for later viewing.

Endpoint

POST /api/posts/{id}/save

Authentication

Required. User must be authenticated to save a post.

Path Parameters

id
integer
required
The unique identifier of the post to save (PostID)

Request Body

userName
string
required
The username of the authenticated user saving the post

Behavior

  • Creates a SavedPost record with composite key (SaverID, PostID)
  • Allows users to bookmark posts for later viewing
  • Prevents saving posts from blocked accounts
  • Each user can only save a post once

Request

curl -X POST https://api.example.com/api/posts/12345/save \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "userName": "johndoe"
  }'

Response

status
integer
201 Created - Post saved successfully
201 Created

Errors

404
error
Post or account does not exist, or action cannot be completed due to a block
409
error
The user already saved the post
{
  "error": "The user already saved post"
}

Build docs developers (and LLMs) love