Check the current authentication status of the user.
| Name | Type | Required | Description |
|---|---|---|---|
token |
string | No | Authentication token for verification. |
| Status Code | Description | Schema |
|---|---|---|
| 200 OK | Authentication successful. | { authenticated: boolean, user_id: string | null } |
| 401 Unauthorized | Invalid or missing authentication token. | { error: string } |
{
"authenticated": true,
"user_id": "user-12345"
}
Log in a user with credentials.
| Name | Type | Required | Description |
|---|---|---|---|
username |
string | Yes | The user's username. |
password |
string | Yes | The user's password. |
| Status Code | Description | Schema |
|---|---|---|
| 200 OK | Login successful. | { token: string, user_id: string } |
| 401 Unauthorized | Invalid credentials. | { error: string } |
{
"token": "eyJhbGciOiJIUzI1NiIsIn...",
"user_id": "user-12345"
}
Retrieve details for a specific user.
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
string | Yes | The unique identifier of the user. |
| Status Code | Description | Schema |
|---|---|---|
| 200 OK | User details retrieved successfully. | { id: string, username: string, email: string, created_at: string } |
| 404 Not Found | User with the specified ID not found. | { error: string } |
{
"id": "user-12345",
"username": "john_doe",
"email": "john.doe@example.com",
"created_at": "2023-10-27T10:00:00Z"
}
Create a new user.
| Name | Type | Required | Description |
|---|---|---|---|
username |
string | Yes | The desired username. |
email |
string | Yes | The user's email address. |
password |
string | Yes | The user's password. |
| Status Code | Description | Schema |
|---|---|---|
| 201 Created | User created successfully. | { id: string, message: string } |
| 400 Bad Request | Invalid input data (e.g., missing fields, invalid email). | { error: string } |
| 409 Conflict | Username or email already exists. | { error: string } |
{
"id": "user-67890",
"message": "User created successfully."
}
Retrieve a list of items.
| Name | Type | Required | Description |
|---|---|---|---|
limit |
integer | No | Maximum number of items to return. Defaults to 20. |
offset |
integer | No | Number of items to skip. Defaults to 0. |
| Status Code | Description | Schema |
|---|---|---|
| 200 OK | List of items retrieved. | Array<{ id: string, name: string, value: any }> |
[
{
"id": "item-abc",
"name": "Sample Item 1",
"value": 100
},
{
"id": "item-def",
"name": "Sample Item 2",
"value": "Some Text"
}
]
Retrieve details for a specific item.
| Name | Type | Required | Description |
|---|---|---|---|
item_id |
string | Yes | The unique identifier of the item. |
| Status Code | Description | Schema |
|---|---|---|
| 200 OK | Item details retrieved successfully. | { id: string, name: string, value: any, created_at: string } |
| 404 Not Found | Item with the specified ID not found. | { error: string } |
{
"id": "item-abc",
"name": "Sample Item 1",
"value": 100,
"created_at": "2023-10-27T11:30:00Z"
}
Update an existing item.
| Name | Type | Required | Description |
|---|---|---|---|
item_id |
string | Yes | The unique identifier of the item to update. |
name |
string | No | The new name for the item. |
value |
any | No | The new value for the item. |
| Status Code | Description | Schema |
|---|---|---|
| 200 OK | Item updated successfully. | { id: string, message: string } |
| 400 Bad Request | Invalid input data. | { error: string } |
| 404 Not Found | Item with the specified ID not found. | { error: string } |
{
"id": "item-abc",
"message": "Item updated successfully."
}
Delete a specific item.
| Name | Type | Required | Description |
|---|---|---|---|
item_id |
string | Yes | The unique identifier of the item to delete. |
| Status Code | Description | Schema |
|---|---|---|
| 204 No Content | Item deleted successfully. | N/A |
| 404 Not Found | Item with the specified ID not found. | { error: string } |