Base URL: /api/users
Retrieves a list of all users.
- URL:
/ - Method:
GET - Auth required: No
- Permissions required: None
- Code: 200 OK
- Content example:
{
"success": true,
"data": [
{
"id": 1,
"username": "johndoe",
"email": "john@example.com",
"created_at": "2024-02-20T10:00:00.000Z",
"updated_at": "2024-02-20T10:00:00.000Z"
}
]
}Creates a new user.
- URL:
/ - Method:
POST - Auth required: No
- Permissions required: None
{
"username": "johndoe",
"email": "john@example.com",
"password": "securepassword123"
}- Code: 201 CREATED
- Content example:
{
"success": true,
"data": {
"id": 1,
"username": "johndoe",
"email": "john@example.com",
"created_at": "2024-02-20T10:00:00.000Z",
"updated_at": "2024-02-20T10:00:00.000Z"
}
}- Code: 400 BAD REQUEST
- Content example:
{
"success": false,
"error": "Email already exists"
}Retrieves a specific user by their ID.
- URL:
/:id - Method:
GET - Auth required: No
- Permissions required: None
- URL Parameters:
id=[integer]
- Code: 200 OK
- Content example:
{
"success": true,
"data": {
"id": 1,
"username": "johndoe",
"email": "john@example.com",
"created_at": "2024-02-20T10:00:00.000Z",
"updated_at": "2024-02-20T10:00:00.000Z"
}
}- Code: 404 NOT FOUND
- Content example:
{
"success": false,
"error": "User not found"
}All endpoints may return the following error responses:
- Code: 500 INTERNAL SERVER ERROR
- Content example:
{
"success": false,
"error": "Internal server error"
}- All timestamps are returned in ISO 8601 format.
- The API returns JSON responses with a
successboolean flag. - Successful responses include a
datafield, while error responses include anerrorfield with a description.