Skip to main content
POST
/
api
/
posts
/
{id}
/
repost
Toggle Post Repost
curl --request POST \
  --url https://api.example.com/api/posts/{id}/repost

Authentication

Requires authentication via session cookie.

Path Parameters

ParameterTypeDescription
idUUIDThe post ID

Behavior

  • If not reposted: creates a post_reposts record.
  • If already reposted: deletes the record (unrepost).
  • The repost_count on the post is updated automatically by a database trigger.

Response

{
  "message": "Post reposted",
  "isReposted": true
}

Error Responses

StatusCodeDescription
401UNAUTHORIZEDNot authenticated
404NOT_FOUNDPost not found or deleted