Skip to main content
GET
/
api
/
auth
/
me
Get Current User
curl --request GET \
  --url https://api.example.com/api/auth/me
{
  "Id": {},
  "Username": "<string>",
  "Email": "<string>",
  "CreatedAt": {}
}

Description

Returns information about the currently authenticated user based on the provided JWT access token.

Authentication

Requires valid JWT access token in the Authorization header. Header: Authorization: Bearer <access_token>

Request

No request body or parameters required. User identity is extracted from the JWT token.

Response

Id
guid
Unique identifier for the user.
Username
string
The user’s username.
Email
string
The user’s email address.
CreatedAt
datetime
ISO 8601 timestamp indicating when the account was created.

Status Codes

  • 200 OK: Successfully retrieved user information
  • 401 Unauthorized: Missing, invalid, or expired access token

Example Request

cURL
curl -X GET http://localhost:5000/api/auth/me \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

200 OK
{
  "Id": "123e4567-e89b-12d3-a456-426614174000",
  "Username": "johndoe",
  "Email": "[email protected]",
  "CreatedAt": "2026-03-10T15:30:00Z"
}
401 Unauthorized
{
  "message": "Token inválido."
}

Usage Notes

  • This endpoint is useful for verifying token validity and retrieving current user context
  • The user ID is extracted from the JWT token’s NameIdentifier or sub claim
  • No sensitive information like password hashes is returned

Build docs developers (and LLMs) love