Skip to main content
PATCH
/
professionals
/
:id
Update Professional
curl --request PATCH \
  --url https://api.example.com/professionals/:id \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "surname": "<string>",
  "dni": "<string>",
  "birthdate": "<string>",
  "gender": "<string>",
  "address": "<string>",
  "phone": "<string>",
  "email": "<string>",
  "specialityID": 123,
  "state": "<string>"
}
'
{
  "200": {},
  "400": {},
  "401": {},
  "403": {},
  "404": {},
  "500": {},
  "professional": {
    "id": 123,
    "name": "<string>",
    "surname": "<string>",
    "dni": 123,
    "birthdate": "<string>",
    "gender": "<string>",
    "address": "<string>",
    "phone": "<string>",
    "email": "<string>",
    "specialityID": 123,
    "state": "<string>"
  }
}
Updates an existing professional’s information.

Authentication & Authorization

Authorization
string
required
Bearer token (JWT) required for authentication.
This endpoint requires admin privileges. Only users with the admin role can update professional information.

Path Parameters

id
number
required
The unique identifier of the professional to update. Must be a numeric value.

Request Body

name
string
required
Professional’s first name. Cannot be empty.
surname
string
required
Professional’s last name. Cannot be empty.
dni
string
required
Professional’s national identification number (DNI).Validation:
  • Cannot be empty
  • Minimum length: 7 characters
  • Must be unique (or belong to the current professional being updated)
birthdate
string
required
Professional’s date of birth. Cannot be empty.Format: ISO 8601 date string (e.g., “1985-03-15”)
gender
string
required
Professional’s gender. Cannot be empty.
address
string
required
Professional’s address. Cannot be empty.
phone
string
required
Professional’s phone number.Validation:
  • Cannot be empty
  • Length: 10 to 20 characters
  • Can only contain numbers, hyphens, spaces, or plus signs
  • Pattern: /^[0-9\s\-\+]*$/
email
string
required
Professional’s email address.Validation:
  • Cannot be empty
  • Must be a valid email format
specialityID
number
required
ID of the professional’s specialty.Validation:
  • Cannot be empty
  • Must reference an existing specialty in the system
state
string
required
Current state of the professional. Cannot be empty.Valid values:
  • Activo/a - Active professional
  • Inactivo/a - Inactive professional
  • Licencia - On license

Response

professional
object
The updated professional object with all current information.

Status Codes

200
Success
Professional updated successfully.
400
Bad Request
Invalid ID (must be numeric) or validation error.
401
Unauthorized
Missing or invalid JWT token.
403
Forbidden
User does not have admin privileges.
404
Not Found
Professional not found in the system.
500
Server Error
Internal server error occurred.

Validation Errors

The API returns detailed validation errors in the following format:
{
  "errors": [
    {
      "msg": "El nombre es obligatorio",
      "param": "name",
      "location": "body"
    }
  ]
}
Common validation errors:
  • “El nombre es obligatorio” - Name is required
  • “El apellido es obligatorio” - Surname is required
  • “El DNI es obligatorio” - DNI is required
  • “DNI no válido” - DNI must be at least 7 characters
  • “El DNI ya está registrado” - DNI already exists for another professional
  • “La fecha de nacimiento es obligatoria” - Birthdate is required
  • “El genero es obligatorio” - Gender is required
  • “La dirección es obligatoria” - Address is required
  • “El teléfono es obligatorio” - Phone is required
  • “El teléfono debe tener entre 10 y 20 caracteres” - Phone must be 10-20 characters
  • “El teléfono solo puede contener números, guiones o espacios” - Phone contains invalid characters
  • “El email es obligatorio” - Email is required
  • “El email no es válido” - Email format is invalid
  • “La especialidad es obligatoria” - Specialty ID is required
  • “La especialidad no existe” - Specialty ID does not exist
  • “El estado es obligatorio” - State is required

Example Request

curl -X PATCH "https://api.clinicavitalis.com/professionals/1" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Juan",
    "surname": "Pérez García",
    "dni": "12345678",
    "birthdate": "1985-03-15",
    "gender": "Masculino",
    "address": "Av. Corrientes 5678, Buenos Aires",
    "phone": "+54 11 9876-5432",
    "email": "[email protected]",
    "specialityID": 1,
    "state": "Activo/a"
  }'

Example Response

{
  "professional": {
    "id": 1,
    "name": "Juan",
    "surname": "Pérez García",
    "dni": 12345678,
    "birthdate": "1985-03-15T00:00:00.000Z",
    "gender": "Masculino",
    "address": "Av. Corrientes 5678, Buenos Aires",
    "phone": "+54 11 9876-5432",
    "email": "[email protected]",
    "specialityID": 1,
    "state": "Activo/a"
  }
}

Error Examples

Invalid ID

{
  "msg": "Debe enviar un ID y debe ser numérico"
}

Professional Not Found

{
  "msg": "El profesional no está cargado en el sistema"
}

Build docs developers (and LLMs) love