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.
Reschedule
Section titled “Reschedule”Moves a booked visit to new dates at the same office. A different office is a cancel and a new request.
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.
Cancel
Section titled “Cancel”Cancels a booked visit with the office.
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.
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,
statusbecomesstoppedat once. - If a call is under way, it cannot be recalled.
stop_requested_atis set, no new call starts, and the request becomesstoppedwhen that call ends without a booking. - If that call books,
statusbecomesbookedandrequest.bookedis sent withstop_requested: true. A booking is never silently dropped: decide whether to keep it or cancel it.