Skip to main content
PUT
/
api
/
auth
/
seller-profile
Update Seller Profile
curl --request PUT \
  --url https://api.example.com/api/auth/seller-profile \
  --header 'Content-Type: application/json' \
  --data '
{
  "identity_document": "<string>",
  "selfie_url": "<string>"
}
'
{
  "400": {},
  "401": {},
  "403": {},
  "500": {},
  "success": true,
  "message": "<string>",
  "user": {
    "_id": "<string>",
    "email": "<string>",
    "role": "<string>",
    "full_name": "<string>",
    "phone": "<string>",
    "seller_profile": {
      "identity_document": "<string>",
      "selfie_url": "<string>",
      "verification_status": "<string>",
      "is_verified_badge": true
    },
    "created_at": "<string>",
    "updated_at": "<string>"
  }
}

Endpoint

PUT /api/auth/seller-profile

Authentication

Required. Must be authenticated as a seller. Include a valid JWT token in the Authorization header.
Authorization: Bearer <token>

Request Body

identity_document
string
required
URL or identifier for the seller’s identity document (e.g., government-issued ID, passport). Cannot be empty.
selfie_url
string
required
Valid URL to the seller’s selfie image for identity verification. Must be a valid URL format.

Response

success
boolean
Indicates whether the profile update was successful.
message
string
Human-readable message describing the result.
user
object
Updated user object with complete profile information (password hash is excluded).
_id
string
User’s unique identifier.
email
string
User’s email address.
role
string
User’s role (will be “seller”).
full_name
string
User’s full name.
phone
string
User’s phone number in international format.
seller_profile
object
Updated seller profile with new verification documents.
identity_document
string
The newly uploaded identity document URL or identifier.
selfie_url
string
The newly uploaded selfie URL.
verification_status
string
Will be set to “pending” after this update.
is_verified_badge
boolean
Whether the seller has a verified badge.
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 PUT https://api.horsetrust.com/api/auth/seller-profile \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "identity_document": "https://storage.example.com/docs/id-987654.pdf",
    "selfie_url": "https://storage.example.com/selfies/selfie-987654.jpg"
  }'

Example Response

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

Error Responses

400
error
Bad Request - Validation error.
{
  "success": false,
  "message": "Valid selfie URL required"
}
401
error
Unauthorized - Missing or invalid authentication token.
{
  "success": false,
  "message": "Authentication required"
}
403
error
Forbidden - User is not a seller (admin accounts cannot update seller profile).
{
  "success": false,
  "message": "Seller role required"
}
500
error
Server Error - Internal server error.
{
  "success": false,
  "message": "Server error"
}

Notes

  • This endpoint is only accessible to users with the “seller” role
  • Both identity_document and selfie_url must be provided
  • The selfie_url must be a valid URL format
  • After updating, the verification_status is automatically set to “pending”
  • Documents should be uploaded to a storage service (e.g., AWS S3, Cloudinary) before calling this endpoint
  • An admin will review the submitted documents and update the verification status
  • Sellers can update their documents multiple times (e.g., if rejected, they can resubmit)
  • The verification process is asynchronous - sellers should poll the /api/auth/me endpoint or wait for notifications to check verification status

Build docs developers (and LLMs) love