Skip to main content

Overview

The Users API provides endpoints for retrieving authenticated user information. User authentication is handled via JWT tokens included in the Authorization header.
All endpoints require authentication via Bearer token in the Authorization header.

Get Current User

Response

user
object
User profile information extracted from the JWT token.

Example Request

curl -X GET https://api.example.com/me \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "user": {
    "sub": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "name": "John Doe",
    "email": "[email protected]",
    "iat": 1709982600,
    "exp": 1710069000
  }
}

Error Responses

401
object
Missing or invalid authentication token.
{
  "message": "Unauthorized"
}
This endpoint is useful for verifying token validity and retrieving the current user’s identity. The response contains all claims from the JWT token payload.

Authentication

Bearer Token Format

All API requests must include a valid JWT token in the Authorization header:
Authorization: Bearer <your_jwt_token>

Token Structure

The JWT token contains the following claims:
  • sub (subject): User’s unique identifier (UUID)
  • name: User’s full name
  • email: User’s email address
  • iat (issued at): Token creation timestamp
  • exp (expiration): Token expiration timestamp

Token Expiration

Tokens have a limited lifetime defined by the exp claim. When a token expires, you will receive a 401 Unauthorized error. You’ll need to obtain a new token through your authentication provider.
Never expose your JWT token in client-side code or public repositories. Treat it as a secret credential.

Build docs developers (and LLMs) love