# Toggle Pin Status **PATCH /posts/{postId}/pin** Pins or unpins a post (only teacher/admin can perform this action). ## Servers - Local development server: http://localhost:8080/api (Local development server) - Production server: https://api.huy-devops.site/api (Production server) ## Authentication methods - Bearer auth ## Parameters ### Path parameters - **postId** (string) The post ID ### Body: application/json (object) - **isPinned** (boolean) Whether to pin or unpin the post ## Responses ### 200 Pin status toggled successfully #### Body: application/json (object) - **success** (boolean) - **code** (integer(int32)) - **message** (string) - **data** (object) Post representing announcements, schedule events, or general messages in a class ### 401 Unauthorized - Invalid or missing authentication token #### Body: application/json (object) - **success** (boolean) - **code** (integer) - **errorCode** (string) - **message** (string) - **timestamp** (string(date-time)) ### 403 Forbidden - Only teacher or admin can pin posts #### Body: application/json (object) - **success** (boolean) - **code** (integer) - **errorCode** (string) - **message** (string) - **timestamp** (string(date-time)) ### 404 Post not found #### Body: application/json (object) - **success** (boolean) - **code** (integer) - **errorCode** (string) - **message** (string) - **timestamp** (string(date-time)) ### 500 Internal Server Error #### Body: application/json (object) - **success** (boolean) - **code** (integer) - **errorCode** (string) - **message** (string) - **timestamp** (string(date-time)) [Powered by Bump.sh](https://bump.sh)