Get User
Retrieve a single user by their unique ID.
GET
/api/v1/users/{id}
Retrieve the full details of a single user identified by {id}.
Path Parameters
* required
| Name | Type | Required | Description |
|---|
| id* | string | ✓ | The user’s unique identifier (e.g. usr_abc123). |
Query Parameters
| Name | Type | Required | Description |
|---|
| include | string | — | Comma-separated list of related resources to embed. Allowed: profile, roles. |
| Header | Type | Required | Description |
|---|
| Authorization* | string | ✓ | Bearer token. Format: Bearer <token>. |
Responses
| Status | Description |
|---|
| 200 | User found and returned.{
"id": "usr_abc123",
"name": "Alice Smith",
"email": "alice@example.com",
"createdAt": "2024-03-15T10:30:00Z",
"roles": ["admin", "editor"]
}
|
| 401 | Unauthorized. |
| 404 | User not found. |
Examples
curl -X GET "https://api.example.com/v1/users/usr_abc123" \
-H "Authorization: Bearer YOUR_TOKEN"
const res = await fetch('/api/v1/users/usr_abc123', {
headers: { 'Authorization': 'Bearer YOUR_TOKEN' }
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const user = await res.json();
import requests
r = requests.get(
'https://api.example.com/v1/users/usr_abc123',
headers={'Authorization': 'Bearer YOUR_TOKEN'}
)
r.raise_for_status()
user = r.json()