Authentication
The API requires authentication to access its endpoints. You must include your API key in the request header:
Authorization: Bearer {API key}
Users
Create New User
POST /api/users
Creates a new user in the system. If no password is provided, a random one will be generated.
Parameters
Parameter | Description |
---|---|
Required. Email address of the user. Must be unique and have a valid domain extension. | |
first_name | First name of the user. Defaults to ‘Student’ if not provided. |
last_name | Last name of the user. Defaults to ‘Member’ if not provided. |
external_id | External ID of the user. Must be a number. |
source | String identifier of source. Defaults to ‘api’ if not set. |
password | Password for the user. If not provided, a random 12-character password will be generated. |
phone_number | Phone number of the user. Maximum 30 characters. |
live_scanner | Boolean value (true/false). |
Response
{
"message": "User created successfully",
"user_id": 123
}
Status Code: 201 Created
Update User
PUT /api/users/{user_id}
Updates an existing user’s information. All parameters are optional – only provided fields will be updated.
Parameters
Parameter | Description |
---|---|
Email address of the user. Must be unique and have a valid domain extension. | |
first_name | First name of the user. |
last_name | Last name of the user. |
external_id | External ID of the user. Must be a number. |
source | String identifier of source. |
password | New password for the user. |
phone_number | Phone number of the user. Maximum 30 characters. |
live_scanner | Boolean value (true/false). |
Response
{
"message": "User updated successfully"
}
Status Code: 200 OK
Get User Details
GET /api/users/{user_id}
Retrieves details for a specific user.
Response
Returns the user object with all available fields.
Error Responses
The API may return the following error responses:
Validation Errors
Status Code: 422 Unprocessable Entity
{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email field must be a valid email address.",
"The email must have a valid domain with an extension."
]
}
}
Authentication Error
Status Code: 403 Unauthorized
{}
Not Found Error
Status Code: 404 Not Found
{
"error": "User not found"
}
Notes
- The API uses JSON for request and response bodies
- All timestamps are returned in ISO 8601 format
- The DELETE and INDEX (list all users) endpoints are currently disabled and will return a 404 error
- Users with backend access cannot be modified through the API
- All users created through this API are automatically assigned the ‘Member’ role