Skip to content

Get User Information ​

GET /api/user ​

Retrieve information about the currently authenticated user account. This endpoint returns basic account details including the user ID, email address, and role.

Path Parameters ​

None.

Query Parameters ​

None.

Headers ​

KeyValue
x-api-keyYour API Key

Response ​

Status Code: 200 OK

Response Fields ​

FieldTypeDescription
_idstringUnique user identifier (MongoDB ObjectId)
emailstringUser's email address
rolestringUser role (typically "USER" for standard accounts)

Example Response ​

json
{
  "_id": "6603fcf18adc9203718db05b",
  "email": "user@example.com",
  "role": "USER"
}

Error Responses ​

401 Unauthorized ​

Returned when the API key is missing or invalid.

json
{
  "message": "Unauthorized"
}

Examples ​

python
import requests
response = requests.get('https://panel.cheapcarfax.net/api/user', headers={'x-api-key': 'YOUR_API_KEY'})
print(response.json())
bash
curl -X GET 'https://panel.cheapcarfax.net/api/user' \
-H 'x-api-key: YOUR_API_KEY'