Skip to content

Reschedule, cancel and stop

Action When Result arrives as
Reschedule status is booked request.rescheduled or request.reschedule_failed
Cancel status is booked request.cancelled or request.cancel_failed
Stop status is received, planned or in_progress request.stopped, or request.booked

An action the request’s state does not allow answers 409 invalid_state.

Moves a booked visit to new dates at the same office. A different office is a cancel and a new request.

Terminal window
curl -X POST https://api-staging.sunnyhealthai.com/v1/scheduling/requests/$ID/reschedule \
-H "Authorization: Bearer $SUNNY_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{ "earliest": "2026-12-08", "latest": "2026-12-20", "note": "Afternoons preferred" }'

earliest and latest are required and follow the same rules as in preferences. note is optional, up to 300 characters.

It answers 202 with the request, where pending_action.type is reschedule. The result arrives later, because it is a phone call to the office. If it fails, the original appointment stands.

Cancels a booked visit with the office.

Terminal window
curl -X POST https://api-staging.sunnyhealthai.com/v1/scheduling/requests/$ID/cancel \
-H "Authorization: Bearer $SUNNY_KEY" -H "Idempotency-Key: $(uuidgen)"

It answers 202. On success status becomes cancelled, and request.cancelled carries what the office said about a fee, if anything. If it fails, the appointment stands, pending_action.status is failed and pending_action.detail says why. You can ask again.

Only one reschedule or cancel can be under way for a request. A second answers 409 until the first has finished.

Stops a request that has not booked yet. No further offices are contacted.

Terminal window
curl -X POST https://api-staging.sunnyhealthai.com/v1/scheduling/requests/$ID/stop \
-H "Authorization: Bearer $SUNNY_KEY"

It answers 200 with the request.

  • If Sunny is not on a call with an office, status becomes stopped at once.
  • If a call is under way, it cannot be recalled. stop_requested_at is set, no new call starts, and the request becomes stopped when that call ends without a booking.
  • If that call books, status becomes booked and request.booked is sent with stop_requested: true. A booking is never silently dropped: decide whether to keep it or cancel it.