API Reference / Authentication
GET
/auth/meGet 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.
| Field | Type | Description |
|---|---|---|
| id | number | User id |
| string | Login email | |
| fullName | string | Owner/operator display name |
| role | string | Role within the platform |
| organizationId | number | Tenant the user belongs to (used for data scoping) |
| status | string | "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"
}