# Update Post **PUT /posts/{postId}** Updates a post (only author or 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) - **content** (string | null) Updated content of the post - **attachments** (array[string(uri)] | null) Array of attachment URLs - **linkedResourceIds** (array[string] | null) Array of linked resource IDs - **linkedLessonId** (string | null) If updating lesson link, provide lesson ID - **isPinned** (boolean | null) Whether to pin the post - **allowComments** (boolean | null) Whether comments are allowed ## Responses ### 200 Post updated 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 ### 400 Bad Request - Invalid input data or malformed request #### Body: application/json (object) - **success** (boolean) - **code** (integer) - **errorCode** (string) - **message** (string) - **timestamp** (string(date-time)) ### 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 post author or admin can update #### 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)