Skip to main content
The ByDoctor API is organized around six core resources that reflect how a modern Brazilian clinic operates. Every resource belongs to a Clinic, and your API key determines which clinic’s data you can access. Understanding the shape of these resources and how they relate to one another will help you build integrations that are both correct and efficient.

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.
When the cpf field is present, ByDoctor uses it to deduplicate patients across registrations. You should provide it whenever available to avoid duplicate records.

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.
The API rejects overlapping appointments for the same professional. If you receive a 409 Conflict when creating an appointment, check the conflicting_appointment_id field in the error response for details.

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 the Z suffix. For example:
When displaying times to users, convert UTC to the clinic’s timezone field (e.g. America/Sao_Paulo). Never assume a local timezone on the server side.

Currency

Monetary amounts are always represented as integers in centavos (Brazilian BRL cents). This avoids floating-point rounding issues common with decimal representations.

IDs

All resource IDs are UUID v4 strings in the canonical hyphenated format:
Store and compare IDs as case-insensitive strings. Do not attempt to parse structure or ordering from UUIDs.