> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vultlocal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Current User

> Get current logged-in user details

<Info>
  Returns details of the currently authenticated user.
</Info>

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer <token>` - JWT access token
</ParamField>

***

## Response

<ResponseField name="id" type="string">
  User ID
</ResponseField>

<ResponseField name="email" type="string">
  Email address
</ResponseField>

<ResponseField name="first_name" type="string">
  First name
</ResponseField>

<ResponseField name="last_name" type="string">
  Last name
</ResponseField>

<ResponseField name="role" type="string">
  User role
</ResponseField>

<ResponseField name="status" type="string">
  Account status (`active`, `inactive`, `suspended`)
</ResponseField>

<ResponseField name="phone_number" type="string">
  Phone number
</ResponseField>

<ResponseField name="last_login_at" type="string">
  Last login timestamp (ISO 8601)
</ResponseField>

<ResponseField name="created_at" type="string">
  Account creation timestamp
</ResponseField>

<ResponseField name="pep_access_authorized" type="boolean">
  Whether user has PEP account access
</ResponseField>

***

## Examples

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://demo.api.vultlocal.com/api/v1/admin/me" \
    -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "id": "123",
    "email": "admin@olive.sl",
    "first_name": "Admin",
    "last_name": "User",
    "role": "system_admin",
    "status": "active",
    "phone_number": "+23277123456",
    "last_login_at": "2025-01-15T09:30:00Z",
    "created_at": "2024-12-01T10:00:00Z",
    "agent_id": null,
    "pep_access_authorized": true
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "success": false,
    "error": "Invalid or expired token",
    "code": "UNAUTHORIZED"
  }
  ```
</ResponseExample>

***

## Use Cases

* Validate session on page load
* Display user info in dashboard header
* Check user permissions

***

## Errors

| Status | Code           | Description                        |
| ------ | -------------- | ---------------------------------- |
| 401    | `UNAUTHORIZED` | Not authenticated or token expired |
| 404    | `NOT_FOUND`    | User not found                     |


## OpenAPI

````yaml olive-openapi.json GET /admin/me
openapi: 3.0.0
info:
  description: >-
    API Gateway for OLIVE NFC Card Payment System - Comprehensive payment, card
    management, agent operations, and admin authentication. All /api/v1 routes
    require authentication using either API Key or JWT token.
  title: OLIVE NFC Card Payment API
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    email: support@olive.sl
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://olive-gateway-a6ba.onrender.com/api/v1
security: []
paths:
  /admin/me:
    get:
      tags:
        - Admin
      summary: Get current logged-in user details
      description: Returns details of the currently authenticated user
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.UserInfo'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
      security:
        - ApiKeyAuth: []
components:
  schemas:
    handler.UserInfo:
      type: object
      properties:
        account_id:
          description: For processors
          type: string
        agent_id:
          type: string
        created_at:
          type: string
        email:
          type: string
        first_name:
          type: string
        id:
          type: string
        last_login_at:
          type: string
        last_name:
          type: string
        name:
          description: For processors
          type: string
        pep_access_authorized:
          type: boolean
        phone_number:
          type: string
        role:
          type: string
        status:
          type: string
        user_type:
          description: '"admin" or "processor"'
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: >-
        API Key for third-party integrations (WhatsApp, Smart PAY, VULT).
        Format: 'Bearer olive_live_xxxxxxxxxxxxx'
      type: apiKey
      name: Authorization
      in: header

````