Get User
Get the current authenticated user's information.
Endpoint
GET /api/v3/auth/user
Description
Retrieves information about the currently authenticated user based on the provided access token.
Authentication
Requires Bearer token authentication.
Authorization: Bearer {access_token}
Request Parameters
No request parameters required.
Response
Returns the authenticated user's information.
| Field | Type | Description |
|---|---|---|
id | string | User UUID |
email | string | User email address |
emailConfirmedAt | string | Email confirmation timestamp (ISO 8601) |
phone | string | User phone number (nullable) |
phoneConfirmedAt | string | Phone confirmation timestamp (nullable) |
createdAt | string | Account creation timestamp (ISO 8601) |
updatedAt | string | Last update timestamp (ISO 8601) |
userMetadata | object | User-defined metadata |
appMetadata | object | Application-defined metadata |
Usage
import requests
headers = {"Authorization": f"Bearer {access_token}"}
response = requests.get(
"https://cadenza-api-uat.algo724.com/api/v3/auth/user",
headers=headers
)
user = response.json()["data"]
print(f"User ID: {user['id']}")
print(f"Email: {user['email']}")
curl https://cadenza-api-uat.algo724.com/api/v3/auth/user \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
Example Response
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"emailConfirmedAt": "2024-01-15T10:00:00Z",
"phone": null,
"phoneConfirmedAt": null,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z",
"userMetadata": {
"name": "John Doe"
},
"appMetadata": {
"provider": "email",
"roles": ["user"]
}
},
"success": true,
"errno": 0,
"error": null
}
Error Responses
| HTTP Code | Error | Description |
|---|---|---|
| 401 | Unauthorized | Invalid or expired access token |
Example Error
{
"data": null,
"success": false,
"errno": -100000,
"error": "Invalid or expired token"
}
Notes
- Use this endpoint to verify the user's identity after authentication
- The
userMetadatafield can contain custom user attributes - The
appMetadatafield contains system-managed attributes