Skip to content

Create a new student

POST
/students

Create a new student account (student role required)

Student name and email are taken from authenticated user

object
class_code

Optional class code for the student

string

Student already exists

object
success
required

Indicates if the request was successful

boolean
message
required

Response message

string
success
boolean
message
string
Allowed values: OK
data
Array<object>
object
student_id
required

Unique identifier for the student

integer format: int64
student_name
required

Name of the student

string
email
required

Email address of the student

string format: email
class_code

Class code the student belongs to

string
nullable
created_at

Timestamp when the student was created

string format: date-time

Student created successfully

object
success
required

Indicates if the request was successful

boolean
message
required

Response message

string
success
boolean
message
string
Allowed values: CREATED
data
Array<object>
object
student_id
required

Unique identifier for the student

integer format: int64
student_name
required

Name of the student

string
email
required

Email address of the student

string format: email
class_code

Class code the student belongs to

string
nullable
created_at

Timestamp when the student was created

string format: date-time

Bad request - invalid input

object
success
required

Indicates if the request was successful

boolean
message
required

Response message

string
success
boolean
message
string
Allowed values: BAD_REQUEST

Unauthorized - authentication required

object
success
required

Indicates if the request was successful

boolean
message
required

Response message

string
success
boolean
message
string
Allowed values: UNAUTHORIZED

Forbidden - insufficient permissions

object
success
required

Indicates if the request was successful

boolean
message
required

Response message

string
success
boolean
message
string
Allowed values: FORBIDDEN

Internal server error

object
success
required

Indicates if the request was successful

boolean
message
required

Response message

string
success
boolean
message
string
Allowed values: INTERNAL_SERVER_ERROR