Skip to main content

Toggle Pin Post

Toggle whether a post is pinned to the top of the group feed. Only group admins or platform admins can pin/unpin posts.

Endpoint

POST /api/posts/:id/pin

Authentication

Required. Must be a group admin or platform admin.

Path Parameters

ParameterTypeDescription
idintegerThe post ID

Response

Success Response

Status Code: 200 OK

{
"success": true,
"pinned": true,
"postId": 4212
}
FieldTypeDescription
pinnedbooleanThe new pin state after toggling
postIdintegerThe ID of the post that was toggled

Error Responses

Status CodeDescription
400Invalid post ID
403Only group admins can pin/unpin posts
404Post not found

Notes

  • A WebSocket postUpdated event is broadcast to the group.

Example

curl -X POST "https://api.tribesocial.io/api/posts/4212/pin" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"