Skip to main content
This guide starts from a referral you already created. If you do not have a referral_id, follow Submit a medical referral first. Auto-book is an opt-in capability. A request returns 403 until Scan enables referrals_auto_book for your account. What you send. A ranking strategy, plus an optional radius, search address, and completion URL. What Scan does. We rank eligible centers, find live availability, and start booking asynchronously. You do not select a timeslot.

Choose a strategy

  • closest — choose the nearest eligible center that has availability.
  • soonest — choose the earliest opening within the radius.
  • closest_soonest — choose the earliest nearby opening, using distance to break ties.
radius is measured in miles, defaults to 200, and accepts 1 through 250. address is a free-form search origin such as 200 Peachtree St, Atlanta, GA 30303. Omit it to use the patient address. An override changes this search only; it does not update the patient.

Request the booking

POST /api/v2/referrals/{referral_id}/book
The API returns 202 Accepted with an auto_book_request.id, a processing status, and the current referral snapshot. This means work started; it does not mean the visit is booked. A referral accepts one booking attempt at a time. While an attempt is in flight, or while Scan operations is booking the same visits, a second request returns 422.

Receive completion

Booking can take several minutes. Scan sends X-Scan-Event: referral.auto_book_completed after the attempt reaches a final result:
Delivery order:
  1. The request’s webhook_url, when provided.
  2. Your account’s configured api_credentials.webhook_url.
  3. No push when neither exists; poll GET /api/v2/referrals/{referral_id} and inspect auto_book_request.status and auto_book_request.outcome.
The completion outcome is one of booked, contacted_for_booking, no_availability, or booking_failed. Return any HTTP 2xx response. The normal status changed webhook remains active for accounts with a configured webhook and continues to report later visit changes. Full payload: Requests automatic booking.