curl --request PUT \
--url https://api.example.com/api/admin/users/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "<string>",
"role": "<string>"
}
'curl --request PUT \
--url https://api.example.com/api/admin/users/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "<string>",
"role": "<string>"
}
'ADMIN role.
ADMIN, PATIENT, DOCTORcurl -X PUT https://api.example.com/api/admin/users/42 \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Dr. Sarah Johnson",
"email": "[email protected]",
"role": "DOCTOR"
}'
{
"id": 42,
"name": "Dr. Sarah Johnson",
"email": "[email protected]",
"role": "DOCTOR",
"isActive": true,
"isSuspended": false,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-03-03T14:20:00.000Z"
}
{
"error": "Usuario no encontrado"
}
{
"error": "Email already exists"
}
{
"error": "Access denied"
}