Skip to main content
GET
/
api
/
v2
/
admin
/
who_am_i
Get current user info
curl --request GET \
  --url https://faisalshop.mvp-apps.ae/api/v2/admin/who_am_i \
  --header 'Authorization: Bearer <token>'
{
  "user": {
    "id": 123,
    "name": "<string>",
    "email": "[email protected]",
    "user_type": "<string>",
    "is_active": "<string>",
    "created_at": "2023-11-07T05:31:56Z"
  },
  "tenants": [
    {
      "id": 123,
      "name": "<string>",
      "role": "ADMIN",
      "is_active": true
    }
  ]
}

Overview

Get information about the currently authenticated user, including their tenants and roles.

Authorization

  • User must be authenticated with a valid Bearer token

Response Details

Returns:
  • User profile information
  • List of tenants the user belongs to
  • Role in each tenant
  • Activity status

Use Cases

  • Verify authentication status
  • Get user’s tenant list for tenant selection
  • Check user’s role before performing actions
  • Display user profile information

Example Usage

curl -X GET \
  https://faisalshop.mvp-apps.ae/api/v2/admin/who_am_i \
  -H 'Authorization: Bearer YOUR_TOKEN'
const response = await axios.get(
  '/api/v2/admin/who_am_i',
  {
    headers: {
      Authorization: `Bearer ${token}`
    }
  }
);

console.log('User:', response.data.user);
console.log('Tenants:', response.data.tenants);

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

200 - application/json

User information with tenants

user
object
tenants
object[]