Skip to main content
GET
/
api
/
auth
/
me
curl -X GET https://api.example.com/api/auth/me \
  -H "Cookie: icl-session=<session-value>"
{
  "user": null
}
Returns information about the currently authenticated user based on the session cookie. Use this endpoint to verify authentication status and retrieve user details.

Request

No request body required. Authentication is determined from the icl-session cookie.

Response

user
object | null
The current user object, or null if not authenticated
id
number
User’s unique identifier
full_name
string
User’s full name
email
string
User’s email address
rol
string
User’s role (e.g., “admin”, “user”, “viewer”)
curl -X GET https://api.example.com/api/auth/me \
  -H "Cookie: icl-session=<session-value>"

Error Responses

{
  "user": null
}

Session Validation

The endpoint checks the isLoggedIn flag in the session data:
  • If isLoggedIn is true, returns user details
  • If isLoggedIn is false or undefined, returns user: null with 401 status

Notes

  • Requires a valid icl-session cookie
  • Does not validate the user still exists in the database (reads from session only)
  • Use this endpoint to check authentication status on page load

Build docs developers (and LLMs) love