Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/bentlyy/Clinica/llms.txt

Use this file to discover all available pages before exploring further.

The admin role is the highest-privilege account in Clinica. Admins are responsible for setting up doctor profiles and have full visibility into the doctor roster. Unlike doctors and patients, the admin account is not created through the API — it is seeded directly into the database when the application starts for the first time.

Default admin credentials

When Clinica starts and no admin account exists, seedAdmin runs automatically and inserts a default account:
FieldValue
Emailadmin@clinic.com
Passwordadmin123
Roleadmin
Change the default admin password immediately after your first deployment. The seed credentials are public and using them in production is a serious security risk. Update the password directly in the database or add a change-password endpoint.
The seed runs only once. If a row with role = 'admin' already exists in the users table, the seed skips silently.

What admins can do

Admins have access to two doctor-related endpoints, both requiring a valid admin JWT.

List all doctors

GET /api/doctors
Authorization: Bearer <token>
Returns the full list of doctor profiles in the system.

Create a doctor

POST /api/doctors
Authorization: Bearer <token>
Content-Type: application/json
Creates a new doctor profile. All four fields are required. The user_id must reference an existing user account that already has the doctor role — the API rejects any other role. Required fields:
FieldTypeDescription
namestringDoctor’s full name
specialtystringMedical specialty (e.g. "Cardiology")
emailstringDoctor’s contact email
user_idintegerID of an existing doctor-role user to link to this profile
Example:
curl -X POST http://localhost:3000/api/doctors \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Dr. Sofia Ramírez",
    "specialty": "Cardiology",
    "email": "sofia.ramirez@clinic.com",
    "user_id": 7
  }'

Getting an admin token

Log in with the admin credentials to receive a JWT:
curl -X POST http://localhost:3000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "admin@clinic.com",
    "password": "admin123"
  }'
Use the token from the response as the Bearer value in subsequent requests.

Build docs developers (and LLMs) love