Overview
The resource hierarchy flows from the top-level Clinic down to individual transactions:- A Clinic is the root organization. All other resources belong to exactly one clinic.
- Professionals and Patients are registered under a clinic and can exist independently of one another.
- Appointments are the central connective tissue — each appointment links a Patient to a Professional at a specific time.
- Payments are attached to an Appointment and record the financial transaction for that visit.
- Webhooks are registered at the clinic level and receive real-time event notifications for changes to any of the above resources.
All API requests are automatically scoped to your clinic. You do not need to pass a
clinic_id query parameter — it is derived from your API key.Clinic
A Clinic is the top-level organization in ByDoctor. Every resource you read or write belongs to the clinic associated with your API key.Professional
A Professional is a healthcare provider registered under a clinic. Professionals can hold different roles that determine their permissions within the system.Patient
A Patient represents an individual receiving care at the clinic. Most personal fields are optional to accommodate walk-in and anonymous registrations.Appointment
An Appointment links a Patient to a Professional for a specific time slot. It is the central operational resource in ByDoctor and drives scheduling, billing, and clinical workflows.Payment
A Payment records the financial transaction for an Appointment. Amounts are always stored as integers in centavos (BRL cents) to avoid floating-point precision errors.Webhook
A Webhook registers a URL to receive real-time event notifications from ByDoctor. You can subscribe to specific event types and use the shared secret to verify that payloads originate from ByDoctor.Always verify incoming webhook payloads using the
secret. ByDoctor sends an X-ByDoctor-Signature header with each request containing the HMAC-SHA256 of the raw request body.Conventions
Timestamps
All timestamp fields in the API use ISO 8601 format in UTC, denoted by theZ suffix. For example:
timezone field (e.g. America/Sao_Paulo). Never assume a local timezone on the server side.