Scheduling
The Scheduling API lets telemedicine partners offer patient self-booking for video appointments. Public discovery endpoints can be called with ashop_uid. Booking and rebooking operations use either an organisation API key or a short-lived patient booking token.
Authentication
The Scheduling API accepts two credentials. Most endpoints accept either; some require a specific one.Patient booking tokens (recommended for patient flows)
A short-lived JWT minted by the partner backend for a specific patient. Sent in theX-RxScale-Booking-Token header. The token is verified against an organisation booking-token secret provisioned by RxScale.
Algorithm: HS256
JOSE header: must include kid — the key_id returned when you provisioned the booking-token secret.
Required claims:
| Claim | Type | Description |
|---|---|---|
aud | string | Must be rxscale-scheduling. |
exp | int | Expiration (Unix seconds). Keep this short — under 5 minutes is typical. |
nbf | int | Not-before (Unix seconds). |
iat | int | Issued-at (Unix seconds). |
shop_identifier | string | The shop identifier you configured in RxScale. |
shop_customer_id | string | Your stable customer identifier. RxScale uses it to deduplicate patients across booking sessions. |
patient_profile_fields | array | Patient profile fields to upsert. Each entry: { "field": "<field_key>", "value": <value>, "source": "shop" }. |
Booking-token secrets are stored encrypted at rest in the RxScale database. Only your
key_id is stored in plaintext for routing; the secret value is decrypted in-memory both at verification time and whenever an admin reads the value back through the admin portal or the secrets API. Rotate by provisioning a new secret and revoking the old one once your minter has switched over.Organisation API key
SendX-API-Key: <key> instead of the booking token for server-to-server flows. The key needs the scheduling:write permission. Use this for back-office tooling, scripted rebooking, or operational scripts.
List Appointment Types
Shop UID used to scope appointment types to the correct organisation.
Search Slots
0 minutes. Appointment
types configured as selected_doctors_only only return doctors with an active
doctor-specific setting.
Window start (Unix seconds).
Window end (Unix seconds). Max 31 days from
from.Restrict to a single doctor.
Create Booking Session
Use this endpoint when launching the hosted UI or script widget. The request can include the signed patient booking token either inX-RxScale-Booking-Token or in the JSON body as booking_token.
booking for a new appointment, rebooking for an existing one.Required for
booking mode.Window start (Unix seconds). Required for
booking mode.Window end (Unix seconds). Required for
booking mode.URL to redirect the patient to after a successful booking.
Patient booking JWT, if not sent via header.
Get Booking Session
The hosted UI calls this with just the launch code to load the booking context. No authentication header is needed — the launch code itself is the credential.patient_profile_uid and other patient identifiers, so the launch code can be safely passed through URLs in the patient’s browser.
Create and Confirm Holds
Authenticated integrations can create holds with an API key that hasscheduling:write. Hosted UI integrations use the booking_launch_code routes.
Unix seconds.
Optional. Repeating the same key with the same body returns the existing hold instead of creating a duplicate.
If a hold has expired but no other appointment has taken the slot, confirmation is still allowed and the appointment moves to
confirmed.Cancel Appointment
Cancel a confirmed or held appointment. Accepts either a booking token (patient-driven cancel) or an organisation API key (operations).Optional free-text reason. Stored on the appointment for audit.
cancellation_min_notice_minutes. If you cancel inside the notice window the API returns a 400 with the offending field; rebook the patient or call with an API key for an operational override.
Rebook Appointment
Move an existing appointment to a new slot. The rebook flow allocates a new appointment row (withprevious_meeting_uid set to the original) and cancels the old one atomically.
Unix seconds for the new slot.
Required when the appointment type’s
rebooking_mode is any_doctor. For same_doctor_only, the original doctor is reused.Optional. Defaults to the original appointment type.
Strongly recommended — protects against double-rebooks during retries.
allow_patient_rebooking: false, if rebooking_min_notice_minutes has not been met, or if the new slot is taken.
Get Join Token
Returns a short-lived Jitsi waiting-room JWT and the room name. Used by the patient hosted UI to launch the video call.Join window
The endpoint accepts join requests from 10 minutes before the appointmentstart_date until 60 minutes after the appointment end_date. Requests outside that window return:
Hosted UI
Redirect patients to thelaunch_url returned by the booking session endpoint, or embed the widget script:
Doctor Portal Endpoints
These endpoints are scoped to the authenticated doctor (Auth0 token), used by the RxScale Doctor Portal. Partners typically don’t need to call them directly.List Scheduled Appointments
status, from, to, patient_uid,
page, limit. The response is the doctor’s own appointments only.
Availability Rules CRUD
weekday (0 = Monday … 6 = Sunday), start_time and end_time in minutes since
midnight, an optional buffer_minutes between consecutive slots, and optional valid_from /
valid_until Unix-second bounds. PATCH bodies are partial; pass clear_valid_from: true or
clear_valid_until: true to drop a previously-set bound. DELETE is a soft delete.
Admin Endpoints
These endpoints are scoped to the authenticated organisation admin (Auth0 token).List Appointments
doctor_uid, patient_uid, status, from, to, page, limit. By default
returns active (held + confirmed) appointments scheduled from now onwards; pass status=all and
from=0 to see history.
Cancel Appointment
{"reason": "..."} in the body.
Appointment Type Reminders
recipient_role (patient / doctor / admin), minutes_before (positive
integer up to 60 days), send_email, send_sms, and active. Multiple reminders per
(appointment_type, recipient_role) are allowed as long as the minutes_before offset differs.
A maintenance job runs every minute, finds confirmed appointments whose firing window includes
“now”, and publishes one scheduling.appointment_reminder_due event per resolved recipient.
The published event always fires (partner webhook subscribers receive it); RxScale’s own
notification handler only dispatches email/SMS when the corresponding send_email / send_sms
flag is set on the reminder row.
Partners subscribe to the event via the existing organisation notification subscription endpoint
with notification_type=APPOINTMENT_REMINDER_DUE.
View Doctor Availability
404 if the doctor is not in
the admin’s organisation.
Booking-Token Secrets
POST provisions a new secret and returns {key_id, secret}. GET returns the secret value
decrypted — RxScale stores secrets encrypted at rest, but admins can re-read them any time from
this endpoint (and from the admin portal Settings → Booking secrets page) so a new minter can be
configured without re-provisioning. DELETE revokes the secret.
The legacy organisation-scoped paths
(/v1/admin/scheduling/organisations/{organisation_uid}/booking-token-secrets[/<key_id>]) are
still accepted and validate against the authenticated organisation.
Errors
The Scheduling API uses standard HTTP status codes:| Status | Meaning |
|---|---|
400 | Schema validation failed, or a business rule blocked the action (see the error body for the field/message). |
401 | Booking token or API key missing or invalid. |
404 | Resource not found, or the caller is not authorised to see it. The API returns 404 for unauthorised access to prevent resource enumeration. |
409 | Slot taken by another patient between hold and confirm. Re-search and try again. |
429 | Rate limit (10 requests per second per service). Back off and retry. |