{"openapi":"3.1.0","info":{"title":"Saybooked API","version":"1","description":"Calendar connection, free time and bookings for AI agents."},"servers":[{"url":"https://saybooked.com"}],"paths":{"/v1/trial":{"post":{"summary":"No key needed. Returns a trial key and a test calendar, so an AI assistant can build and test before a person signs up. The key lasts 7 days and cannot connect a real calendar.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[]}},"/v1/calendars":{"get":{"summary":"List connected calendars. Every account also has one sandbox calendar for testing.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}]}},"/v1/connect-links":{"post":{"summary":"Make a link that a calendar owner opens once to connect their Google Calendar.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"external_id":{"type":"string","description":"your own id for this client (optional)"},"redirect_url":{"type":"string","description":"where to send the owner afterwards (optional)"}}}}}}}},"/v1/connect-links/{id}":{"get":{"summary":"See whether a link was used, and the calendar id it produced.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/v1/calendars/{id}":{"get":{"summary":"One calendar with its booking rules.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"summary":"Change booking rules: time zone, opening hours, slot length, buffer, notice.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"object","description":"object with any of: timezone, hours, slot_minutes, step_minutes, buffer_minutes, min_notice_minutes, max_days_ahead, services (a list of {name, duration_minutes})"}}}}}}},"delete":{"summary":"Disconnect a calendar. The Google permission is withdrawn and stored tokens are erased.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/v1/calendars/{id}/availability":{"get":{"summary":"Free slots. Query: from, to, duration_minutes, limit. A day can be a date or plain words: today, tomorrow, friday, 27 october. Each slot comes with its day and time in words, and the answer says today's date in the owner's time zone.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/v1/availability":{"post":{"summary":"The same free slots, for tools that send a JSON body.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"calendar_id":{"type":"string","description":"required"},"from":{"type":"string","description":"a date, a time, or words such as today, friday or 27 october"},"to":{"type":"string","description":"optional"},"service":{"type":"string","description":"optional: one of the calendar's services; its length is used"},"duration_minutes":{"type":"integer","description":"optional"},"call_id":{"type":"string","description":"optional, the voice platform's id for this call"}},"required":["calendar_id"]}}}}}},"/v1/bookings":{"post":{"summary":"Book a slot. Send the caller's own words in day and time, or an ISO time in start. The time is always read in the calendar owner's time zone. The slot is checked again just before writing, the new event is read back from the calendar, and the answer carries a six-digit confirmation code and a sentence to say. Words that can be read two ways are refused with a question for the caller.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"calendar_id":{"type":"string","description":"required"},"day":{"type":"string","description":"friday, tomorrow, 27 october or 2027-01-15 (with time)"},"time":{"type":"string","description":"3pm, 3:30 pm or 15:00 (with day)"},"start":{"type":"string","description":"ISO 8601, instead of day and time"},"weekday":{"type":"string","description":"optional: the day name the caller said; a booking is refused when it does not match the date"},"service":{"type":"string","description":"optional: one of the calendar's services; sets the length and the name, and a word that fits none is refused with the list"},"duration_minutes":{"type":"integer","description":"optional, or send end"},"title":{"type":"string","description":"optional"},"attendee":{"type":"object","description":"{name, email, phone}, optional; no email is needed, and an email gets a calendar invitation"},"caller_phone":{"type":"string","description":"optional: the caller's number, kept as their phone when none is given"},"notes":{"type":"string","description":"optional"},"idempotency_key":{"type":"string","description":"optional, makes a retry safe"},"call_id":{"type":"string","description":"optional, the voice platform's id for this call"}},"required":["calendar_id"]}}}}},"get":{"summary":"List bookings. Query: calendar_id, from, to, status, limit, code, phone. from and to take a date or words, so from=tomorrow&to=tomorrow lists the bookings to remind.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}]}},"/v1/bookings/find":{"post":{"summary":"Find a caller's coming bookings by confirmation code or phone number. Without either, the caller's own number is used when the platform sends it.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"six-digit confirmation code"},"phone":{"type":"string","description":"the caller's phone number"},"calendar_id":{"type":"string","description":"optional"}}}}}}}},"/v1/bookings/{id}":{"get":{"summary":"One booking by id or confirmation code, checked against the owner's calendar first.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/v1/bookings/{id}/reschedule":{"post":{"summary":"Move a booking to a new time, if that time is free. The id can be the confirmation code.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"day":{"type":"string","description":"with time"},"time":{"type":"string","description":"with day"},"start":{"type":"string","description":"ISO 8601, instead of day and time"},"weekday":{"type":"string","description":"optional check"}}}}}}}},"/v1/bookings/{id}/cancel":{"post":{"summary":"Cancel a booking and remove it from the owner's calendar. The id can be the confirmation code.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/v1/calls/{id}":{"get":{"summary":"What one phone call really did: whether a booking was made, whether it was read back from the calendar, and every failed attempt. Use it after a call to check what the agent told the caller.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/v1/activity":{"get":{"summary":"The latest requests with their result. Query: call_id, calendar_id, limit.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}]}},"/v1/usage":{"get":{"summary":"Plan, connected calendars and the month's price.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}]}},"/v1/account":{"get":{"summary":"Your account. PATCH with {name} sets the name shown to calendar owners.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error object with code and message"}},"security":[{"bearer":[]}]}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}}}