# Create and Enroll Student **POST /classes/{classId}/students** Creates a new student and enrolls them in the specified class. ## 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) Request payload for creating a new student. The endpoint will create the student and enroll them in the class. - **firstName** (string) First name of the student - **lastName** (string) Last name of the student - **email** (string(email)) Email address of the student - **phoneNumber** (string | null) Phone number of student - **avatarUrl** (string | null) Avatar image URL ## Responses ### 200 Student created and enrolled successfully #### Body: application/json (object) - **success** (boolean) - **code** (integer(int32)) - **message** (string) - **data** (object) API response schema for student returned by student endpoints (includes profile and credentials when applicable) ### 400 Bad Request - Invalid input data #### Body: application/json (object) - **success** (boolean) - **code** (integer) - **errorCode** (string) - **message** (string) - **timestamp** (string(date-time)) ### 404 Class or student 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)