Skip to main content
GET
/
api
/
user
Get User Profile
curl --request GET \
  --url https://api.example.com/api/user \
  --header 'Authorization: <authorization>' \
  --header 'x-api-key: <x-api-key>'
{
  "success": true,
  "message": "Success fetching user data",
  "data": {
    "id": 1,
    "name": "John Doe",
    "email": "[email protected]",
    "profile_photo": "uploads/profile-photo/1234567890-123456789.jpg",
    "created_at": "2024-01-15T10:30:00.000Z",
    "updated_at": "2024-02-20T14:45:00.000Z"
  }
}
Retrieves the authenticated user’s profile information.

Authentication

This endpoint requires both API key and JWT authentication.

Required Headers

x-api-key
string
required
Your API key for accessing the API
Authorization
string
required
Bearer token in the format: Bearer <token>

Response

success
boolean
Indicates if the request was successful
message
string
Response message
data
object
User profile data

Example Request

cURL
curl --request GET \
  --url https://api.example.com/api/user \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
  --header 'x-api-key: your_api_key_here'

Example Response

{
  "success": true,
  "message": "Success fetching user data",
  "data": {
    "id": 1,
    "name": "John Doe",
    "email": "[email protected]",
    "profile_photo": "uploads/profile-photo/1234567890-123456789.jpg",
    "created_at": "2024-01-15T10:30:00.000Z",
    "updated_at": "2024-02-20T14:45:00.000Z"
  }
}

Error Responses

{
  "error": "Access Denied"
}

Build docs developers (and LLMs) love