API Reference / Authentication
GET/auth/me

Get the current user

Return the profile of the user identified by the supplied JWT.

πŸ”’ JWT BearerTry in Console β†’

Purpose

Use this to confirm a token is still valid and to fetch the caller’s profile (id, role, organization) for UI personalization or permission checks. Call it right after login or when restoring a session.

Authentication

Send your access token as a Bearer header: Authorization: Bearer <token>. Obtain it from Authenticate a user.

Request samples

bash
curl -X GET https://tourapi.nirajp.com.np/api/v1/auth/me \
  -H "Content-Type: application/json"

Success response

Returns 200 OK with the shape below.

FieldTypeDescription
idnumberUser id
emailstringLogin email
fullNamestringOwner/operator display name
rolestringRole within the platform
organizationIdnumberTenant the user belongs to (used for data scoping)
statusstring"active" | "pending" | "suspended"
json
{
  "success": true,
  "message": "Request successful.",
  "data": {
    "id": 12,
    "email": "owner@org.com",
    "fullName": "Jane Doe",
    "role": "owner",
    "organizationId": 9,
    "status": "active"
  }
}

Errors

All errors share the envelope { "success": false, "message": "..." }.

401No or invalid authentication token supplied.
json
{
  "success": false,
  "message": "Unauthorized"
}
500An unexpected error occurred on our side. Retry; if it persists, contact support.
json
{
  "success": false,
  "message": "Internal server error"
}