Skip to main content
PATCH
/
api
/
user
Update User Profile
curl --request PATCH \
  --url https://api.example.com/api/user \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "name": "<string>",
  "email": "<string>"
}
'
{
  "success": true,
  "message": "User updated successfully"
}
Updates the authenticated user’s profile information (name and/or email).

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>
Content-Type
string
required
Must be application/json

Request Body

At least one field must be provided for the update.
name
string
New name for the user
email
string
New email address for the user. Must be unique and not already registered.

Response

success
boolean
Indicates if the request was successful
message
string
Response message indicating the result of the update operation

Example Request

cURL
curl --request PATCH \
  --url https://api.example.com/api/user \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: your_api_key_here' \
  --data '{
    "name": "Jane Doe",
    "email": "[email protected]"
  }'

Example Response

{
  "success": true,
  "message": "User updated successfully"
}

Error Responses

{
  "error": "Access Denied"
}

Notes

  • Both name and email fields are optional, but at least one must be provided
  • If updating email, the new email must not already be registered in the system
  • The update is performed atomically - either all changes succeed or none are applied

Build docs developers (and LLMs) love