{"openapi":"3.1.0","info":{"title":"Square Appointments API (Bowmark)","version":"e833508f87ff","description":"Square Appointments booking: find a business, its services, staff and open times, book, and manage the caller's own appointments and classes.\n\nEvery function Bowmark has for Square Appointments (book.squareup.com) as one HTTP call. Each runs on Bowmark's infrastructure with the same billing, rules and response envelope as `POST /v1/run`. The whole API: https://api.bowmark.ai/openapi.json. Guide: https://bowmark.ai/docs/api.","contact":{"email":"support@bowmark.ai","url":"https://bowmark.ai/docs/api"}},"servers":[{"url":"https://api.bowmark.ai"}],"security":[{"bearer":[]},{"apiKeyHeader":[]}],"paths":{"/v1/sites/square_appointments/findBusiness":{"post":{"operationId":"findBusiness","summary":"Finds Square Appointments businesses by name, e.g.","description":"Finds Square Appointments businesses by name, e.g. \"Matt The Barber\" or \"barber Clarion PA\" (a web search of Square's public booking pages), or resolves a booking link the caller holds (e.g. \"https://book.squareup.com/appointments/7o7ufdywy6ks8m/location/L6SCQ3SAWHBV0/services\", no request sent). Returns each business's `widgetId` and `unitToken`, the ids every other function takes. A business that sells no online booking will not appear.\n\nCalls `bowmark.providers.square_appointments.findBusiness`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareBusinessSearch>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"TypeScript: `string`"}},"required":["query"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/getBusiness":{"post":{"operationId":"getBusiness","summary":"Reads one Square business location: name, phone, email, timezone, address, weekly opening hours (day 0 = Sunday, seconds after local midnight), and its booking rules — instant or request booking, whet","description":"Reads one Square business location: name, phone, email, timezone, address, weekly opening hours (day 0 = Sunday, seconds after local midnight), and its booking rules — instant or request booking, whether customers may cancel, cutoff and how far ahead booking opens, deposits, no-show protection, waitlist. Ids come from `findBusiness`.\n\nCalls `bowmark.providers.square_appointments.getBusiness`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareBusiness>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"}},"required":["widgetId","unitToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/listServices":{"post":{"operationId":"listServices","summary":"Lists every service a Square business location books online, each with its variations: variation id, length in minutes, price in cents and price type, and which staff ids perform it.","description":"Lists every service a Square business location books online, each with its variations: variation id, length in minutes, price in cents and price type, and which staff ids perform it. A variation's `id` (not the service's) is what open-time lookups take. Ids come from `findBusiness`.\n\nCalls `bowmark.providers.square_appointments.listServices`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareServiceList>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"}},"required":["widgetId","unitToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/listStaff":{"post":{"operationId":"listStaff","summary":"Lists the staff a customer can book at a Square business location: id, name, bio, and the service variation ids each one performs.","description":"Lists the staff a customer can book at a Square business location: id, name, bio, and the service variation ids each one performs. A member's `id` is the `staffId` open-time lookups take. Ids come from `findBusiness`.\n\nCalls `bowmark.providers.square_appointments.listStaff`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareStaffList>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"}},"required":["widgetId","unitToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/checkAvailability":{"post":{"operationId":"checkAvailability","summary":"Returns the open appointment start times (ISO, UTC) for one service variation at a Square business location, e.g.","description":"Returns the open appointment start times (ISO, UTC) for one service variation at a Square business location, e.g. (\"7o7ufdywy6ks8m\", \"L6SCQ3SAWHBV0\", \"IHCY2Q7PBBH4VVSIL2XU5GQ3\", { from: \"2026-11-02\", to: \"2026-11-05\" }). Defaults to the next 7 days and anyone available; pass `staffId` from `listStaff` for one person. `variationId` is `listServices` services[].variations[].id, not the service id.\n\nCalls `bowmark.providers.square_appointments.checkAvailability`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareAvailability>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"},"variationId":{"type":"string","description":"TypeScript: `string`"},"options":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"staffId":{"type":"string"}},"additionalProperties":true,"description":"TypeScript: `{ from?: string; to?: string; staffId?: string }`"}},"required":["widgetId","unitToken","variationId"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/listLocations":{"post":{"operationId":"listLocations","summary":"Lists a Square business's active locations with address, map position (when the business has published one) and the unit token each booking page uses.","description":"Lists a Square business's active locations with address, map position (when the business has published one) and the unit token each booking page uses. Ids come from `findBusiness`.\n\nCalls `bowmark.providers.square_appointments.listLocations`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareLocationList>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"}},"required":["widgetId","unitToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/listCategories":{"post":{"operationId":"listCategories","summary":"Lists the categories a Square business groups its service menu under, with how many services sit in each.","description":"Lists the categories a Square business groups its service menu under, with how many services sit in each. A category's `id` matches `listServices` services[].categoryId. Ids come from `findBusiness`.\n\nCalls `bowmark.providers.square_appointments.listCategories`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareCategoryList>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"}},"required":["widgetId","unitToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/getService":{"post":{"operationId":"getService","summary":"Returns one service's variations, add-on modifiers (where the business sells any), and each variation's deposit and no-show fee.","description":"Returns one service's variations, add-on modifiers (where the business sells any), and each variation's deposit and no-show fee. `serviceId` is `listServices` services[].id.\n\nCalls `bowmark.providers.square_appointments.getService`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareServiceDetail>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"},"serviceId":{"type":"string","description":"TypeScript: `string`"}},"required":["widgetId","unitToken","serviceId"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/cancelBooking":{"post":{"operationId":"cancelBooking","summary":"Cancels one of the signed-in caller's Square appointments, where the business allows customer cancellation.","description":"Cancels one of the signed-in caller's Square appointments, where the business allows customer cancellation. Needs the caller signed in to Square (an authFunction, a write). UNMEASURED signed in — no fleet-held Square buyer session exists.\n\nCalls `bowmark.providers.square_appointments.cancelBooking`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<{ reservationId: string; cancelled: true }>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reservationId":{"type":"string","description":"TypeScript: `string`"},"occurrenceDateStart":{"type":"string","description":"TypeScript: `string`"},"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"required":["reservationId"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/cancelClassBooking":{"post":{"operationId":"cancelClassBooking","summary":"Cancels one of the signed-in caller's Square class bookings.","description":"Cancels one of the signed-in caller's Square class bookings. Needs the caller signed in to Square (an authFunction, a write). UNMEASURED signed in — no fleet-held Square buyer session exists.\n\nCalls `bowmark.providers.square_appointments.cancelClassBooking`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<{ classBookingId: string; cancelled: true }>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"classBookingId":{"type":"string","description":"TypeScript: `string`"},"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"required":["classBookingId"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/listClasses":{"post":{"operationId":"listClasses","summary":"Lists a Square business's scheduled classes between two dates (defaults to the next 30 days), each with its name, length, price, instructor and open capacity.","description":"Lists a Square business's scheduled classes between two dates (defaults to the next 30 days), each with its name, length, price, instructor and open capacity. Most Square Appointments businesses sell no classes at all and this returns an empty list for them. A session's `id` is what `cancelClassBooking` takes.\n\nCalls `bowmark.providers.square_appointments.listClasses`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareClassList>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"},"options":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"additionalProperties":true,"description":"TypeScript: `{ from?: string; to?: string }`"}},"required":["widgetId","unitToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/listMyBookings":{"post":{"operationId":"listMyBookings","summary":"Lists the signed-in caller's own appointments at one Square business, upcoming by default.","description":"Lists the signed-in caller's own appointments at one Square business, upcoming by default. Needs the caller signed in to Square (an authFunction, a read). UNMEASURED signed in — no fleet-held Square buyer session exists; field names are read off the booking bundle's own handling of a successful response, not captured from one.\n\nCalls `bowmark.providers.square_appointments.listMyBookings`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareReservationList>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"},"options":{"type":"object","properties":{"direction":{"anyOf":[{"const":"upcoming"},{"const":"past"}]},"offset":{"type":"number"}},"additionalProperties":true,"description":"TypeScript: `{ direction?: \"upcoming\" | \"past\"; offset?: number }`"},"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"required":["widgetId","unitToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/getBooking":{"post":{"operationId":"getBooking","summary":"Reads one of the signed-in caller's Square appointments by id.","description":"Reads one of the signed-in caller's Square appointments by id. Needs the caller signed in to Square (an authFunction, a read). UNMEASURED signed in — no fleet-held Square buyer session exists. `reservationId` comes from `listMyBookings`.\n\nCalls `bowmark.providers.square_appointments.getBooking`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareReservation>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reservationId":{"type":"string","description":"TypeScript: `string`"},"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"required":["reservationId"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/listMyClassBookings":{"post":{"operationId":"listMyClassBookings","summary":"Lists the signed-in caller's own class bookings at one Square business, upcoming by default.","description":"Lists the signed-in caller's own class bookings at one Square business, upcoming by default. Needs the caller signed in to Square (an authFunction, a read). UNMEASURED signed in — no fleet-held Square buyer session exists.\n\nCalls `bowmark.providers.square_appointments.listMyClassBookings`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareClassBookingList>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"},"options":{"type":"object","properties":{"direction":{"anyOf":[{"const":"upcoming"},{"const":"past"}]}},"additionalProperties":true,"description":"TypeScript: `{ direction?: \"upcoming\" | \"past\" }`"},"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"required":["widgetId","unitToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/square_appointments/listCreditPacks":{"post":{"operationId":"listCreditPacks","summary":"Lists the signed-in caller's own purchased credit packs at one Square business.","description":"Lists the signed-in caller's own purchased credit packs at one Square business. Needs the caller signed in to Square (an authFunction, a read). UNMEASURED signed in — no fleet-held Square buyer session exists. Buying a pack is money and is a separate, unbuilt function.\n\nCalls `bowmark.providers.square_appointments.listCreditPacks`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<SquareCreditPackList>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"TypeScript: `string`"},"unitToken":{"type":"string","description":"TypeScript: `string`"},"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"required":["widgetId","unitToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Your Bowmark API key."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Bowmark-Key"}},"responses":{"NotFound":{"description":"No such site or function.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}},"schemas":{"RunEnvelope":{"type":"object","description":"What a run returns. `status` says whether the SCRIPT succeeded. A script that threw or paused for a login is still HTTP 200. Branch on `status`, not on the HTTP code.","required":["ok","status","result","logs","error","ms"],"properties":{"runId":{"type":"string","description":"Stable id for this run. Quote it in a support or `report` message."},"ok":{"type":"boolean","description":"False only when the run produced nothing usable."},"status":{"type":"string","enum":["ok","error","partial","needs_user"],"description":"`partial`: the result is real but some calls failed (see `incomplete`); `ok` stays true. `needs_user`: a person must sign in to a site first. Relay `meta.handoff.url` to them, then run again."},"egress":{"type":"string","enum":["default","link"],"description":"The egress the run was given, present only when the request asked for one. `link`: every request went through the caller's own Chrome (Bowmark Buddy)."},"result":{"description":"Whatever the script `return`ed. Any JSON value."},"logs":{"type":"array","items":{"type":"string"},"description":"Lines the script wrote with `log(...)`."},"error":{"type":["string","null"],"description":"Why the run failed, in plain words. Null on success."},"ms":{"type":"integer","description":"How long the script itself ran, in milliseconds."},"queuedMs":{"type":"integer","description":"How long the run waited for a worker before starting. Present only when it was a second or more."},"needs":{"type":"array","description":"The sign-ins this script is waiting on. Present when `status` is `needs_user`.","items":{"type":"object","required":["capability","provider","providerTitle","kind"],"properties":{"capability":{"type":"string"},"provider":{"type":"string"},"providerTitle":{"type":"string","description":"The site's name, to show a person."},"kind":{"type":"string"}}}},"incomplete":{"type":"object","description":"Present only when `status` is `partial`: which calls did not answer.","properties":{"summary":{"type":"string"},"totalCalls":{"type":"integer"}},"additionalProperties":true},"emptyHanded":{"type":"object","description":"Present when the script returned nothing while its calls returned rows, usually a filter that matched none of the site's own labels. Lists the label values the calls actually returned.","additionalProperties":true},"notes":{"type":"array","description":"Caveats a call attached to a complete answer. Never changes `status`.","items":{"type":"object","properties":{"path":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}}}}},"meta":{"type":"object","properties":{"handoff":{"type":"object","description":"A single-use sign-in link for a person to open. Expires at `expiresAt`.","properties":{"ref":{"type":"string"},"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}}},"concurrency":{"type":"object","description":"On a 429: how many runs are in flight and when to retry.","properties":{"limit":{"type":"integer"},"inFlight":{"type":"integer"},"retryAfterSeconds":{"type":"integer"}}}},"additionalProperties":true},"notice":{"type":"object","description":"Set when the account owner has not accepted the current Terms. Relay it to them.","additionalProperties":true}}}}}}