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
| Parameter | Type | Description |
|---|---|---|
id | integer | The post ID |
Response
Success Response
Status Code: 200 OK
{
"success": true,
"pinned": true,
"postId": 4212
}
| Field | Type | Description |
|---|---|---|
pinned | boolean | The new pin state after toggling |
postId | integer | The ID of the post that was toggled |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Invalid post ID |
| 403 | Only group admins can pin/unpin posts |
| 404 | Post not found |
Notes
- A WebSocket
postUpdatedevent is broadcast to the group.
Example
curl -X POST "https://api.tribesocial.io/api/posts/4212/pin" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"