Skip to main content
GET
/
api
/
auth
/
me
Get Current User
curl --request GET \
  --url https://api.example.com/api/auth/me
{
  "401": {},
  "404": {},
  "500": {},
  "success": true,
  "user": {
    "_id": "<string>",
    "email": "<string>",
    "role": "<string>",
    "full_name": "<string>",
    "phone": "<string>",
    "is_email_verified": true,
    "is_phone_verified": true,
    "profile_picture_url": "<string>",
    "seller_profile": {
      "identity_document": "<string>",
      "selfie_url": "<string>",
      "verification_status": "<string>",
      "verification_method": "<string>",
      "verified_at": "<string>",
      "verified_by": "<string>",
      "rejection_reason": "<string>",
      "is_verified_badge": true
    },
    "is_active": true,
    "last_login": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>"
  }
}

Endpoint

GET /api/auth/me

Authentication

Required. Include a valid JWT token in the Authorization header.
Authorization: Bearer <token>

Request

No request parameters required. The user is identified from the JWT token.

Response

success
boolean
Indicates whether the request was successful.
user
object
Complete user profile information (password hash is excluded).
_id
string
User’s unique identifier.
email
string
User’s email address.
role
string
User’s role (“seller” or “admin”).
full_name
string
User’s full name.
phone
string
User’s phone number in international format.
is_email_verified
boolean
Whether the user’s email has been verified.
is_phone_verified
boolean
Whether the user’s phone number has been verified.
profile_picture_url
string
URL to the user’s profile picture.
seller_profile
object
Seller-specific profile information. Null for admin users.
identity_document
string
URL or identifier for the seller’s identity document.
selfie_url
string
URL to the seller’s selfie image.
verification_status
string
Verification status: “pending”, “verified”, or “rejected”.
verification_method
string
Method used for verification: “manual” or “automatic”.
verified_at
string
ISO 8601 timestamp of when verification was completed.
verified_by
string
User ID of the admin who verified this seller (for manual verification).
rejection_reason
string
Reason for rejection if verification_status is “rejected”.
is_verified_badge
boolean
Whether the seller has a verified badge displayed.
is_active
boolean
Whether the user account is active.
last_login
string
ISO 8601 timestamp of the user’s last login.
created_at
string
ISO 8601 timestamp of when the account was created.
updated_at
string
ISO 8601 timestamp of when the account was last updated.

Example Request

curl -X GET https://api.horsetrust.com/api/auth/me \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

200 Success
{
  "success": true,
  "user": {
    "_id": "507f1f77bcf86cd799439011",
    "email": "[email protected]",
    "role": "seller",
    "full_name": "John Smith",
    "phone": "+5491112345678",
    "is_email_verified": false,
    "is_phone_verified": false,
    "profile_picture_url": null,
    "seller_profile": {
      "identity_document": "https://storage.example.com/docs/id-123.pdf",
      "selfie_url": "https://storage.example.com/selfies/selfie-123.jpg",
      "verification_status": "pending",
      "is_verified_badge": false
    },
    "is_active": true,
    "last_login": "2026-03-05T10:30:00.000Z",
    "created_at": "2026-03-01T08:00:00.000Z",
    "updated_at": "2026-03-05T10:30:00.000Z"
  }
}

Error Responses

401
error
Unauthorized - Missing or invalid authentication token.
{
  "success": false,
  "message": "Authentication required"
}
404
error
Not Found - User not found (may have been deleted).
{
  "success": false,
  "message": "User not found"
}
500
error
Server Error - Internal server error.
{
  "success": false,
  "message": "Server error"
}

Notes

  • This endpoint requires a valid JWT token obtained from login or registration
  • The password hash is never included in the response for security
  • Use this endpoint to check if the current token is still valid
  • The response includes complete profile information including verification status
  • This is useful for maintaining user state in client applications

Build docs developers (and LLMs) love