Skip to main content
GET
/
api
/
v1
/
auth
/
me
Get Current User
curl --request GET \
  --url https://api.example.com/api/v1/auth/me
{
  "user": {
    "id": 123,
    "name": "<string>",
    "email": "<string>",
    "email_verified_at": "<string>",
    "active": true,
    "last_login_at": "<string>",
    "last_login_ip": "<string>",
    "failed_login_attempts": 123,
    "locked_until": "<string>",
    "roles": [
      {}
    ],
    "permissions": [
      {}
    ]
  }
}
Retrieve the currently authenticated user’s information including their profile, roles, and permissions.

Authentication

This endpoint requires a valid Bearer token in the Authorization header.
Authorization: Bearer YOUR_TOKEN_HERE

Response

user
object
The authenticated user object

Code Examples

curl -X GET https://your-domain.com/api/v1/auth/me \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Accept: application/json"

Response Example

{
  "user": {
    "id": 1,
    "name": "Admin User",
    "email": "[email protected]",
    "email_verified_at": "2025-01-15T10:30:00.000000Z",
    "active": true,
    "last_login_at": "2025-03-05T14:22:00.000000Z",
    "last_login_ip": "192.168.1.100",
    "failed_login_attempts": 0,
    "locked_until": null,
    "roles": ["super_admin"],
    "permissions": [
      "manage_users",
      "manage_companies",
      "manage_invoices",
      "view_reports"
    ],
    "created_at": "2025-01-10T08:00:00.000000Z",
    "updated_at": "2025-03-05T14:22:00.000000Z"
  }
}

Error Responses

401 Unauthorized

Returned when the token is missing, invalid, or expired.
{
  "message": "Unauthenticated."
}

Use Cases

  • Profile Display: Show current user information in the application UI
  • Permission Checking: Determine what actions the user can perform
  • Session Validation: Verify that the user’s token is still valid
  • Role-Based UI: Conditionally render UI elements based on user roles
  • Login - Authenticate and obtain a token
  • Logout - Invalidate the current token

Build docs developers (and LLMs) love