This section details the available endpoints for managing user data within the system.
Retrieves a list of all users. Supports pagination and filtering.
GET/api/v1.2/users
| Name | Type | Required | Description |
|---|---|---|---|
page |
integer | No | Page number for pagination. Defaults to 1. |
limit |
integer | No | Number of items per page. Defaults to 20. |
status |
string | No | Filter users by status (e.g., 'active', 'inactive'). |
[
{
"id": "usr_abc123",
"username": "alice_wonder",
"email": "alice@example.com",
"status": "active",
"created_at": "2023-10-27T10:00:00Z"
},
{
"id": "usr_def456",
"username": "bob_builder",
"email": "bob@example.com",
"status": "inactive",
"created_at": "2023-10-26T14:30:00Z"
}
]
Registers a new user in the system.
POST/api/v1.2/users
Requires a JSON object with user details.
| Name | Type | Required | Description |
|---|---|---|---|
username |
string | Yes | Unique username for the new user. |
email |
string | Yes | User's email address. |
password |
string | Yes | User's chosen password. |
{
"id": "usr_ghi789",
"username": "charlie_chap",
"email": "charlie@example.com",
"status": "pending",
"created_at": "2023-10-27T11:15:00Z"
}
Retrieves details for a single user by their ID.
GET/api/v1.2/users/{userId}
| Name | Type | Required | Description |
|---|---|---|---|
userId |
string | Yes | The unique identifier of the user to retrieve. |
{
"id": "usr_abc123",
"username": "alice_wonder",
"email": "alice@example.com",
"status": "active",
"created_at": "2023-10-27T10:00:00Z",
"last_login": "2023-10-27T12:05:00Z"
}
{
"error": "User not found",
"message": "The user with ID 'usr_nonexistent' could not be found."
}
Modifies existing user details. Only provided fields will be updated.
PUT/api/v1.2/users/{userId}
| Name | Type | Required | Description |
|---|---|---|---|
userId |
string | Yes | The unique identifier of the user to update. |
A JSON object containing the fields to update.
| Name | Type | Required | Description |
|---|---|---|---|
email |
string | No | New email address. |
status |
string | No | New status ('active', 'inactive'). |
{
"id": "usr_abc123",
"username": "alice_wonder",
"email": "alice.updated@example.com",
"status": "active",
"created_at": "2023-10-27T10:00:00Z",
"updated_at": "2023-10-27T13:00:00Z"
}
Removes a user from the system. This action is irreversible.
DELETE/api/v1.2/users/{userId}
| Name | Type | Required | Description |
|---|---|---|---|
userId |
string | Yes | The unique identifier of the user to delete. |
A successful deletion returns no content.
{
"error": "User not found",
"message": "The user with ID 'usr_nonexistent' could not be found."
}