Skip to main content
Retrieve profile information about the authenticated user. The response fields depend on the scopes granted during authorization. Requires a valid OAuth access token obtained from the token endpoint.
curl -X GET https://dhmad.tn/api/oauth/userinfo \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "sub": "507f1f77bcf86cd799439011",
  "name": "John Doe",
  "given_name": "John",
  "family_name": "Doe",
  "preferred_username": "john@example.com",
  "email": "john@example.com",
  "email_verified": true,
  "phone_number": "+21612345678",
  "phone_number_verified": true,
  "kyc_verified": true,
  "kyc_status": "approved"
}

Authorization

Include the OAuth access token as a Bearer token in the Authorization header.

Response Fields by Scope

Always included

profile scope

email scope

phone scope

Error Responses

Missing or invalid token:
{
  "error": "invalid_token",
  "error_description": "Missing or invalid access token"
}
Expired token:
{
  "error": "invalid_token",
  "error_description": "Invalid or expired access token"
}

The access token expires after 1 hour. If you receive a 401 error, the user needs to re-authenticate through the authorization flow.