# Create Post **POST /classes/{classId}/posts** Creates a new post in the class (announcement, event, or general discussion). ## 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 - **classId** (string) The class ID ### Body: application/json (object) - **classId** (string) ID of the class - **content** (string) Content of the post - **type** (string) Type of post - **attachments** (array[string(uri)] | null) Array of attachment URLs - **linkedResourceIds** (array[string] | null) Array of linked resource IDs (individual resource IDs, not lessons) - **linkedLessonId** (string | null) If linking a lesson, provide lesson ID. Lesson resources will be mapped to post automatically - **isPinned** (boolean | null) Whether to pin the post - **allowComments** (boolean | null) Whether comments are allowed ## Responses ### 201 Post created 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)) ### 404 Class 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)