Skip to main content
POST
/
doctor
/
create
Create Doctor
curl --request POST \
  --url https://api.example.com/doctor/create \
  --header 'Content-Type: application/json' \
  --data '
{
  "crm": "<string>",
  "email": "<string>",
  "password": "<string>",
  "name": "<string>",
  "specialty": "<string>",
  "telephone": "<string>",
  "consultationValue": 123
}
'
{
  "crm": "<string>",
  "email": "<string>",
  "password": "<string>",
  "name": "<string>",
  "specialty": "<string>",
  "telephone": "<string>",
  "consultationValue": 123,
  "400 Bad Request": {},
  "409 Conflict": {}
}
Create a new doctor account in the system.

Request Body

crm
string
required
Doctor’s CRM (Medical Registration) number. Must be unique and up to 9 characters.
email
string
required
Doctor’s email address. Must be unique.
password
string
required
Password for the doctor’s account.
name
string
required
Doctor’s full name.
specialty
string
required
Doctor’s medical specialty (e.g., Cardiology, Pediatrics, Dermatology).
telephone
string
required
Doctor’s contact telephone number.
consultationValue
number
required
Price for a consultation with this doctor (decimal value).

Response

crm
string
Doctor’s CRM number.
email
string
Doctor’s email address.
password
string
Doctor’s password.
name
string
Doctor’s full name.
specialty
string
Doctor’s medical specialty.
telephone
string
Doctor’s telephone number.
consultationValue
number
Consultation price.

Example Request

curl -X POST http://localhost:8080/doctor/create \
  -H "Content-Type: application/json" \
  -d '{
    "crm": "123456789",
    "email": "dr.silva@hospital.com",
    "password": "securePassword123",
    "name": "Dr. João Silva",
    "specialty": "Cardiology",
    "telephone": "+5534999887766",
    "consultationValue": 250.00
  }'

Example Response

{
  "crm": "123456789",
  "email": "dr.silva@hospital.com",
  "password": "securePassword123",
  "name": "Dr. João Silva",
  "specialty": "Cardiology",
  "telephone": "+5534999887766",
  "consultationValue": 250.00
}

Error Responses

400 Bad Request
error
Invalid request body or missing required fields.
409 Conflict
error
Doctor with this CRM or email already exists.

Build docs developers (and LLMs) love