Quickstart
This takes about five minutes and contacts nobody: a sandbox key only ever creates simulated requests.
1. Get a sandbox key
Section titled “1. Get a sandbox key”Sign in to the dashboard, open API keys and create a key with the mode Sandbox. Copy it now: it is shown once.
export SUNNY_KEY="sk_…"2. Create a request
Section titled “2. Create a request”curl https://api-staging.sunnyhealthai.com/v1/scheduling/requests \ -H "Authorization: Bearer $SUNNY_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "patient": { "first_name": "Alex", "last_name": "Sample", "date_of_birth": "1984-03-09", "sex": "female", "phone": "+14155550123", "email": "alex.sample@example.com", "address": { "line1": "1 Example St", "city": "San Francisco", "state": "CA", "zip": "94110" } }, "insurance": { "payer_name": "Example Health Plan", "member_id": "XYZ123456789" }, "visit": { "reason": "Annual physical" }, "search_area": { "zip": "94110", "radius_miles": 15 }, "consent": { "obtained_at": "2026-11-19T17:00:00Z" }, "reference_id": "your-own-id-123" }'The answer comes at once:
{ "id": "req_…", "status": "received", "created_at": "…", "reference_id": "your-own-id-123", "sandbox": true }The work continues in the background.
3. Watch it book
Section titled “3. Watch it book”curl https://api-staging.sunnyhealthai.com/v1/scheduling/requests/req_… \ -H "Authorization: Bearer $SUNNY_KEY"In the sandbox the status becomes planned after about 5 seconds and booked after about 30. The response then carries the confirmation:
{ "status": "booked", "booked_via": "phone", "confirmation": { "time": "2026-12-02T09:40:00", "timezone": "America/Los_Angeles", "provider": { "first_name": "Sam", "last_name": "Example" }, "location_name": "Example Endocrine Associates", "address": "100 Sample Ave, San Francisco, CA 94110", "phone": "+14155550188", "notes": "Arrive 15 minutes early. Bring insurance card." }}4. Receive webhooks
Section titled “4. Receive webhooks”Polling works for a first try. In your integration, add a webhook endpoint in the dashboard so that Sunny tells you when a request changes: request.planned, then request.booked.
- Create a request: every field and rule.
- Sandbox: make a request fail, then reschedule and cancel a booked one.
- Going live: what changes with a live key.