basePath: /v1 definitions: types.APIAccount: properties: id: type: string name: description: Name is the specialist's or the organisation's name. type: string privacy_notice_url: description: |- PrivacyNoticeURL is Kusties' privacy notice to patients, which the website shows before it sends a booking ("" while there is none). example: https://kusties.com/legal/patient-notice type: string time_zone: example: Europe/Riga type: string type: description: 'Type is whose account it is: a specialist''s own or an organisation''s.' enum: - specialist - organization type: string type: object types.APIAvailability: properties: from: description: From and To are the days the answer covers (YYYY-MM-DD in time_zone, both included). example: "2026-11-23" type: string next_available: allOf: - $ref: '#/definitions/types.APINextAvailable' description: |- NextAvailable is the nearest free start after to, only while the range has none (within the booking window; left out when there is none). slots: description: Slots are the free starts in order (start, location, end). items: $ref: '#/definitions/types.APISlot' type: array time_zone: example: Europe/Riga type: string to: example: "2026-11-29" type: string type: object types.APIBooking: properties: can_cancel: type: boolean can_reschedule: type: boolean cancel_until: description: |- CancelUntil is the online cancelling deadline of a booking that is still open (requested or scheduled), also once it has passed (can_cancel then says false). Left out: cancelling online is off, or the booking is declined, cancelled or past. example: "2026-11-23T07:00:00Z" type: string created_at: example: "2026-11-20T10:15:00Z" type: string end_time: example: "2026-11-24T08:00:00Z" type: string format: description: |- Format is where the visit takes place: practice, home or online. Always present: practice for every visit while Kusties has visit formats off. enum: - practice - home - online type: string id: type: string location: allOf: - $ref: '#/definitions/types.APIBookingLocation' description: |- Location is the place: a practice place or branch, the main address, or for a home visit the address the patient gave. Left out for an online visit, or when there is none. service: allOf: - $ref: '#/definitions/types.APIBookingService' description: |- Service is what was booked, named as it was booked: a later rename, or the specialist's edit of the visit in the calendar, does not change it. specialist: allOf: - $ref: '#/definitions/types.APIBookingSpecialist' description: Specialist is whose visit it is. start_time: example: "2026-11-24T07:00:00Z" type: string status: enum: - requested - scheduled - declined - cancelled - past type: string time_zone: example: Europe/Riga type: string video_url: description: |- VideoURL is the specialist's video link of a confirmed online visit (never for a request, or a cancelled or deleted visit). type: string type: object types.APIBookingClient: properties: email: maxLength: 255 type: string first_name: maxLength: 100 type: string language: description: 'Language is the patient''s e-mails'' language; left out: lv.' enum: - lv - en type: string last_name: maxLength: 100 type: string phone: description: Phone is a Latvian number (8 digits) or + and the country code. maxLength: 30 type: string required: - email - first_name - last_name - phone type: object types.APIBookingList: properties: data: items: $ref: '#/definitions/types.APIBooking' type: array next_cursor: type: string type: object types.APIBookingLocation: properties: address: description: |- Address is the address as the patient's e-mails name it (a branch with its organisation), or the home visit's. type: string id: description: |- ID is the location's id (GET /v1/locations; the specialist's id for the main address); left out for a home visit. type: string name: type: string type: object types.APIBookingRequest: properties: client: allOf: - $ref: '#/definitions/types.APIBookingClient' description: Client is the patient. comment: description: |- Comment is the patient's note for the specialist, at most 300 characters (only the specialist reads it). type: string location_id: description: |- LocationID is the slot's location_id: when the start is now at another location, the booking is refused like a taken time. Left out or null: not checked. type: string privacy_notice_shown: description: |- PrivacyNoticeShown must be true: the website showed the patient the privacy notice (privacy_notice_url of GET /v1/me) before sending the booking. Nothing is stored about it. type: boolean service_id: description: ServiceID is one of GET /v1/services. type: string specialist_id: description: |- SpecialistID is one of the slot's specialist_ids; left out: the least busy specialist free then (an organisation's key), the key's own specialist (a specialist's key). type: string start_time: description: StartTime is a slot's start_time (RFC 3339, any offset). type: string visit_address: description: VisitAddress is where a home visit takes place, required for one, at most 200 characters. type: string required: - client - privacy_notice_shown - service_id - start_time type: object types.APIBookingService: properties: id: description: ID is the service_id the booking named; left out for a booking whose service is not known. type: string name: type: string type: object types.APIBookingSpecialist: properties: id: type: string name: type: string type: object types.APILocation: properties: address: description: |- Address is the address as patients see it (a branch of an organisation named with it on a specialist's list); left out while the main address is not set. type: string city: type: string id: description: |- ID is a slot's and a booking's location_id: a practice place's or a branch's id, or for the main address the specialist's id. type: string main: description: 'Main: the specialist''s main address (a specialist''s key only).' type: boolean name: description: Name is the place's name; left out for the main address. type: string time_zone: example: Europe/Riga type: string type: object types.APILocationList: properties: data: items: $ref: '#/definitions/types.APILocation' type: array next_cursor: type: string type: object types.APIMe: properties: account: $ref: '#/definitions/types.APIAccount' key: $ref: '#/definitions/types.APIMeKey' type: object types.APIMeKey: properties: expires_at: description: 'ExpiresAt is when the key stops working (UTC); null: it does not expire.' example: "2027-06-30T20:59:59Z" type: string id: type: string ip_restricted: description: 'IPRestricted: the key works only from its allowed addresses.' type: boolean name: type: string sandbox: description: |- Sandbox: a sandbox key (kst_test_) of the sandbox server, whose bookings send no reminders and e-mail only the sandbox's testers. type: boolean scopes: description: Scopes are what the key may do. items: enum: - specialists:read - locations:read - services:read - availability:read - bookings:read - bookings:create - bookings:update type: string type: array specialist_ids: description: |- SpecialistIDs are the specialists an organisation's key is limited to; empty: all of the organisation's (and always for a specialist's key). items: type: string type: array type: object types.APINextAvailable: properties: date: description: 'Date is its day (in time_zone): the from that shows it.' example: "2026-12-01" type: string start_time: example: "2026-12-01T07:00:00Z" type: string type: object types.APIRescheduleRequest: properties: start_time: type: string required: - start_time type: object types.APIService: properties: description: type: string duration_minutes: description: |- DurationMinutes is the visit's length (an organisation's service: its usual length; each specialist's own visit type sets a booking's, which the slots' and the booking's end show). type: integer formats: description: |- Formats are where it takes place: practice, home (the booking needs visit_address) or online. Always practice for an organisation's service, and for every service while Kusties has visit formats off. items: enum: - practice - home - online type: string type: array id: description: ID is a booking's and an availability search's service_id. type: string location_ids: description: LocationIDs are where it can be booked (empty for a home or online visit). items: type: string type: array name: type: string price_cents: description: |- PriceCents is the price in euro cents: an organisation's when it set one, a specialist's only where their public profile shows prices. type: integer specialist_ids: description: 'SpecialistIDs are who can be booked for it (a specialist''s key: itself).' items: type: string type: array type: object types.APIServiceList: properties: data: items: $ref: '#/definitions/types.APIService' type: array next_cursor: type: string type: object types.APISlot: properties: end_time: description: |- EndTime is the visit's end. An organisation's specialists may offer a service with visit types of different lengths: the same start is then a slot per length. example: "2026-11-24T08:00:00Z" type: string location_id: description: |- LocationID is where the start is (GET /v1/locations; the specialist's id for the main address); null for a home or online visit. Send it back as the booking's location_id. type: string specialist_ids: description: |- SpecialistIDs are the specialists free then (a specialist's key: itself). A booking with no specialist_id books the least busy of them. items: type: string type: array start_time: example: "2026-11-24T07:00:00Z" type: string type: object types.APISpecialist: properties: cancel_hours: description: |- CancelHours: a patient may cancel or reschedule the specialist's booking online until this many hours before the visit; left out: not online. type: integer id: description: 'ID is the specialist''s id: a booking''s or an availability search''s specialist_id.' type: string max_days_ahead: description: MaxDaysAhead is how many days ahead the specialist may be booked. type: integer name: type: string photo_url: type: string profession: type: string time_zone: example: Europe/Riga type: string type: object types.APISpecialistList: properties: data: items: $ref: '#/definitions/types.APISpecialist' type: array next_cursor: type: string type: object types.ErrorResponse: properties: code: type: string details: type: string error: $ref: '#/definitions/types.ErrorType' fields: items: $ref: '#/definitions/types.ValidationError' type: array message: type: string metadata: additionalProperties: {} type: object method: type: string path: type: string request_id: type: string success: type: boolean timestamp: type: string type: object types.ErrorType: enum: - validation - not_found - unauthorized - forbidden - conflict - internal_server - bad_request - timeout - rate_limit - payload_too_large - payment_required - unprocessable - service_unavailable - bad_gateway type: string x-enum-varnames: - ErrorTypeValidation - ErrorTypeNotFound - ErrorTypeUnauthorized - ErrorTypeForbidden - ErrorTypeConflict - ErrorTypeInternalServer - ErrorTypeBadRequest - ErrorTypeTimeout - ErrorTypeRateLimit - ErrorTypePayloadTooLarge - ErrorTypePaymentRequired - ErrorTypeUnprocessable - ErrorTypeServiceUnavailable - ErrorTypeBadGateway types.ValidationError: properties: code: type: string field: type: string message: type: string value: {} type: object host: api.kusties.app info: contact: {} description: |- Kusties API connects a specialist's or an organisation's own website or system to their Kusties account: the account's specialists, locations and services, the free times, and the bookings it makes, lists, cancels and reschedules. A booking follows the rules, limits and e-mails of the Kusties booking page. **Keys and scopes.** Call the API from your server only, with an API key from «API un integrācijas» in the Authorization header: Bearer kst_live_…. A browser is refused (a request with an Origin header is 403 api_browser_not_allowed): never put a key into code a browser loads. A key carries scopes, resource:action: specialists:read, locations:read, services:read, availability:read, bookings:read, bookings:create and bookings:update; a call without its scope is 403 api_key_scope_missing (metadata.scope). A key may expire (then 401 invalid_token, as an unknown or revoked key), may work only from its allowed IP addresses (otherwise 403 api_key_ip_not_allowed), and an organisation's key may be limited to some of its specialists (it reaches no other: a request naming another is 403 api_key_specialist_not_allowed, their bookings 404 booking_not_found). **Sandbox.** https://api-sandbox.kusties.app/v1 takes kst_test_ keys made on the sandbox (https://pa.kusties.app): its bookings send no reminders and e-mail only the sandbox's testers. A kst_test_ key on the live API, or a kst_live_ key on the sandbox, is 401 invalid_token. **Times.** Every timestamp is RFC 3339 in UTC (…Z); a time you send may have any offset. Specialists, locations, availability and bookings carry time_zone (IANA, Europe/Riga today): days (YYYY-MM-DD) and parts of the day are in it. **Ids.** A specialist is named by their id (specialist_id), a location by its id (location_id; a specialist's main address by the specialist's id), a service by its id (service_id: a visit type's for a specialist, a service's for an organisation). **Bookings people make themselves.** POST /bookings is for a booking the patient makes through your website or app, after seeing Kusties' privacy notice (privacy_notice_url of GET /me; privacy_notice_shown must be true). Bookings staff enter on someone's behalf are made in Kusties itself, not through the API. **Booking mode.** The catalog, the free times and a new booking answer only while the account's online booking is open to everyone (a specialist's booking set to «Ikviens», an approved organisation); otherwise 404 booking_unavailable (organization_unavailable for an organisation's catalog). The bookings the account made are read, cancelled and rescheduled in any mode, under their own cancelling rules. **Errors.** An error answers a JSON body (types.ErrorResponse) whose code is the one to act on, with fields[].code for a field and metadata where a code says so; its request_id, also in the X-Request-ID header, names the request when you contact Kusties. A 429 that can be retried (rate_limited, api_daily_limit_reached) carries Retry-After (seconds); booking_limit_reached has none. **Limits.** Per key: 120 requests a minute, 1,200 reads an hour, 60 booking requests an hour, 60 cancels and reschedules an hour; per calling address 6,000 requests an hour; per account 100 bookings through the API in 24 hours. **Lists.** A list is {data, next_cursor}: pass next_cursor as cursor for the next page; null means the last page. A single object is answered bare. **Retries.** Send an Idempotency-Key with POST /bookings: a retry with the same key and body is answered with the first booking (Idempotent-Replayed: true) and books nothing. **Versioning.** Version 1 only changes by adding: ignore fields and values you do not know. A change that is not additive comes as /v2. title: Kusties API version: "1.0" paths: /availability: get: description: 'Scope availability:read. Every free start of the service on the days from to (both included, at most 31 days), as the Kusties booking page offers them (the working hours, the visits and blocked times, the notice, the break, the booking window and the daily cap), in order. Each slot has its end, its location (null for a home or online visit) and the specialists free then: an organisation''s service may be offered with visit types of different lengths, and the same start is then a slot per length. While the range has no slot, next_available is the nearest free start after it. Narrow it to a location, a specialist or a part of the day. Days and parts of the day are in the location''s time zone (time_zone). Answers only while the account''s online booking is open to everyone. Cache the answer for up to 60 seconds.' parameters: - description: A service's id (GET /v1/services) format: uuid in: query name: service_id required: true type: string - description: 'The first day (YYYY-MM-DD); left out: today' format: date in: query name: from type: string - description: 'The last day (YYYY-MM-DD), at most 30 days after from; left out: from and 6 days' format: date in: query name: to type: string - description: Only this location's starts (GET /v1/locations; the specialist's id for the main address) format: uuid in: query name: location_id type: string - description: Only this specialist's starts (GET /v1/specialists); one the key does not reach is refused format: uuid in: query name: specialist_id type: string - description: 'A part of the day: morning (before 12:00), day (12:00-17:00) or evening (from 17:00)' enum: - morning - day - evening in: query name: part type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.APIAvailability' "400": description: 'validation_failed: service_id (required; uuid; oneof: not a service that can be booked online), location_id or specialist_id (uuid), from or to (date), to (range: before from, or more than 31 days in all) or part (oneof)' schema: $ref: '#/definitions/types.ErrorResponse' "401": description: No key (authentication_required), or one that does not work (invalid_token) schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), not from the key's allowed IP addresses (api_key_ip_not_allowed), a key without the scope availability:read (api_key_scope_missing; metadata.scope), or a specialist_id the key does not reach (api_key_specialist_not_allowed; metadata.specialist_id) schema: $ref: '#/definitions/types.ErrorResponse' "404": description: 'The account does not take online bookings from everyone now: a specialist''s booking is off or for their clients only, an organisation is not approved (booking_unavailable)' schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The key''s budget is used up: 120 requests a minute, 1,200 reads an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: A service's free start times tags: - availability /bookings: get: description: 'Scope bookings:read. The bookings any of the account''s keys made, in the order of their start (then id), a page at a time: next_cursor is the cursor of the next page, null on the last. Narrow them by status and by start. An organisation''s key limited to some specialists lists only theirs, and a booking whose specialist has left the organisation is left out. Works whatever the account''s booking mode.' parameters: - description: 'One status or several, comma separated (e.g. requested,scheduled); left out: all' enum: - requested - scheduled - declined - cancelled - past in: query name: status type: string - description: Only bookings that start at or after this time (RFC 3339, any offset, e.g. 2026-11-24T00:00:00Z; URL-encode a + in the offset as %2B) format: date-time in: query name: start_from type: string - description: Only bookings that start before this time (RFC 3339, any offset, e.g. 2026-12-01T00:00:00Z; URL-encode a + in the offset as %2B) format: date-time in: query name: start_to type: string - description: 'The page size, 1-100; left out: 20' in: query maximum: 100 minimum: 1 name: limit type: integer - description: 'The next_cursor of the page before; left out: the first page' in: query name: cursor type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.APIBookingList' "400": description: 'validation_failed: status (oneof), start_from or start_to (invalid), limit (range) or cursor (invalid)' schema: $ref: '#/definitions/types.ErrorResponse' "401": description: No key (authentication_required), or one that does not work (invalid_token) schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), not from the key's allowed IP addresses (api_key_ip_not_allowed), or a key without the scope bookings:read (api_key_scope_missing; metadata.scope) schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The key''s budget is used up: 120 requests a minute, 1,200 reads an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: The bookings the account made through the API tags: - bookings post: consumes: - application/json description: 'Scope bookings:create. For bookings people make themselves through the account''s website or app: the patient fills in the form and sees Kusties'' privacy notice before sending it. Version 1 takes no bookings staff enter on someone''s behalf (enter those in Kusties itself), so privacy_notice_shown must be true. Books a free start of GET /v1/availability for the patient, as the Kusties booking page does: the status is scheduled when the specialist confirms new clients automatically, else requested (the specialist, or the organisation''s reception, confirms or declines it), whoever the patient is; a patient the specialist already knows by e-mail and phone gets the visit on their record. An organisation''s booking goes to the chosen specialist, or (specialist_id left out) to the least busy specialist free then among those the key reaches. Kusties e-mails the patient (the confirmation or the request, with the cancel link) and notifies the specialist. Show the patient Kusties'' privacy notice (privacy_notice_url of GET /v1/me) before sending, and send privacy_notice_shown true. The answer never carries the patient''s name or contact. Send an Idempotency-Key to retry safely: a retry never books twice. Answers only while the account''s online booking is open to everyone.' parameters: - description: 'A unique key of this booking request, at most 120 characters (e.g. a UUID per form sent): a retry with the same key and body is answered with the first booking (Idempotent-Replayed: true) and books nothing; the same key with another body is 409 idempotency_key_reused' in: header name: Idempotency-Key type: string - description: The booking in: body name: body required: true schema: $ref: '#/definitions/types.APIBookingRequest' produces: - application/json responses: "201": description: 'The booking (for a retry of an Idempotency-Key: the first booking)' headers: Idempotent-Replayed: description: true when the answer is the first booking of the request's Idempotency-Key type: string schema: $ref: '#/definitions/types.APIBooking' "400": description: 'validation_failed (fields[]): a body field (required, email, max, oneof; type: a JSON value of the wrong type), privacy_notice_shown (required: it must be true), service_id (oneof: not a service that can be booked online), client.first_name or client.last_name (required), client.phone (phone), comment (max), visit_address (required for a home visit, max), location_id (uuid) or Idempotency-Key (max, characters); body when the body cannot be read: json (not JSON), required (empty) or invalid (a service_id, specialist_id or start_time that does not parse, e.g. a start_time without its offset; message says which)' schema: $ref: '#/definitions/types.ErrorResponse' "401": description: No key (authentication_required), or one that does not work (invalid_token) schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), not from the key's allowed IP addresses (api_key_ip_not_allowed), a key without the scope bookings:create (api_key_scope_missing; metadata.scope), or a specialist_id the key does not reach (api_key_specialist_not_allowed; metadata.specialist_id) schema: $ref: '#/definitions/types.ErrorResponse' "404": description: The account does not take online bookings from everyone now (booking_unavailable) schema: $ref: '#/definitions/types.ErrorResponse' "409": description: The start is not free (any more), not with the chosen specialist (also one who does not offer the service), or no longer at location_id (booking_slot_taken); the Idempotency-Key was used for another booking request (idempotency_key_reused) schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The booking page''s limits: 3 open bookings of one e-mail address or phone with the specialist, 30 online bookings a day (booking_limit_reached); the account made 100 bookings through the API in 24 hours (api_daily_limit_reached; metadata.limit, metadata.retry_after, Retry-After); the key''s budget is used up: 120 requests a minute, 60 booking requests an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: Book tags: - bookings /bookings/{id}: get: description: 'Scope bookings:read. The booking''s status (requested, scheduled, declined: the specialist declined the request or did not answer it in time, cancelled: by the patient, the specialist or the API, also a visit the specialist deleted, past: the visit''s time is over), its time, the service as it was booked, the specialist, its format and location (or the video link of a confirmed online visit), the online cancelling deadline while it is open and whether it can still be cancelled or rescheduled online. Never the patient''s name or contact; a home visit''s location is the address the patient gave. Only bookings any of the account''s keys made: another booking''s id answers 404, as an unknown one does. Works whatever the account''s booking mode.' parameters: - description: The booking's id format: uuid in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.APIBooking' "401": description: No key (authentication_required), or one that does not work (invalid_token) schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), not from the key's allowed IP addresses (api_key_ip_not_allowed), or a key without the scope bookings:read (api_key_scope_missing; metadata.scope) schema: $ref: '#/definitions/types.ErrorResponse' "404": description: The account made no booking with this id through the API, or (an organisation) its specialist has left the organisation or is not one the key is limited to (booking_not_found) schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The key''s budget is used up: 120 requests a minute, 1,200 reads an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: A booking the account made through the API tags: - bookings /bookings/{id}/availability: get: description: 'Scope bookings:update: the free starts of the booking''s specialist for its length (at its organisation''s branches while the specialist is still a member there), on the days from to as GET /v1/availability answers them, its own start left out, while the booking can still be rescheduled online (until the cancelling deadline, at most 3 times). Cache the answer for up to 60 seconds.' parameters: - description: The booking's id format: uuid in: path name: id required: true type: string - description: 'The first day (YYYY-MM-DD); left out: today' format: date in: query name: from type: string - description: 'The last day (YYYY-MM-DD), at most 30 days after from; left out: from and 6 days' format: date in: query name: to type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.APIAvailability' "400": description: 'validation_failed: from or to (date), to (range)' schema: $ref: '#/definitions/types.ErrorResponse' "401": description: No key (authentication_required), or one that does not work (invalid_token) schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), not from the key's allowed IP addresses (api_key_ip_not_allowed), or a key without the scope bookings:update (api_key_scope_missing; metadata.scope) schema: $ref: '#/definitions/types.ErrorResponse' "404": description: The account made no booking with this id through the API (booking_not_found); Kusties has rescheduling switched off (not_found) schema: $ref: '#/definitions/types.ErrorResponse' "409": description: 'It can no longer be rescheduled online: past the deadline, rescheduled 3 times, or the specialist does not allow it (booking_move_closed)' schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The key''s budget is used up: 120 requests a minute, 1,200 reads an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: The free start times a booking can be rescheduled to tags: - bookings /bookings/{id}/cancel: post: description: Scope bookings:update, under the booking's online cancelling rules (until the specialist's deadline, cancel_until). Kusties e-mails the patient and notifies the specialist, as when the patient cancels through their link. A booking cancelled or declined already is answered as it is (200), and nothing is sent again. Works whatever the account's booking mode. parameters: - description: The booking's id format: uuid in: path name: id required: true type: string produces: - application/json responses: "200": description: 'The booking, cancelled (or as it was: declined or cancelled before)' schema: $ref: '#/definitions/types.APIBooking' "401": description: No key (authentication_required), or one that does not work (invalid_token) schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), not from the key's allowed IP addresses (api_key_ip_not_allowed), or a key without the scope bookings:update (api_key_scope_missing; metadata.scope) schema: $ref: '#/definitions/types.ErrorResponse' "404": description: The account made no booking with this id through the API (booking_not_found) schema: $ref: '#/definitions/types.ErrorResponse' "409": description: 'It can no longer be cancelled online: past the deadline, the specialist does not allow cancelling online, or the visit is over (booking_cancel_closed)' schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The key''s budget is used up: 120 requests a minute, 60 cancels and reschedules an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: Cancel a booking the account made through the API tags: - bookings /bookings/{id}/reschedule: post: consumes: - application/json description: 'Scope bookings:update: to one of the starts of GET /v1/bookings/{id}/availability, with the same specialist and length. Kusties e-mails the patient the new time with a new cancel link (the old link stops working) and notifies the specialist. An open booking''s (requested or scheduled) own start is answered as it is (200), and nothing changes; so is a repeat of a reschedule that went through. A cancelled, declined or past booking is 409 booking_move_closed whatever the start, its own too.' parameters: - description: The booking's id format: uuid in: path name: id required: true type: string - description: The new start in: body name: body required: true schema: $ref: '#/definitions/types.APIRescheduleRequest' produces: - application/json responses: "200": description: The booking at its new time schema: $ref: '#/definitions/types.APIBooking' "400": description: 'validation_failed: start_time (required; type: not a JSON string); body when the body cannot be read: json (not JSON), required (empty) or invalid (a start_time that does not parse, e.g. without its offset; message says which)' schema: $ref: '#/definitions/types.ErrorResponse' "401": description: No key (authentication_required), or one that does not work (invalid_token) schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), not from the key's allowed IP addresses (api_key_ip_not_allowed), or a key without the scope bookings:update (api_key_scope_missing; metadata.scope) schema: $ref: '#/definitions/types.ErrorResponse' "404": description: The account made no booking with this id through the API (booking_not_found); Kusties has rescheduling switched off (not_found) schema: $ref: '#/definitions/types.ErrorResponse' "409": description: 'It can no longer be rescheduled online: past its deadline, moved 3 times already, or cancelled, declined or past (booking_move_closed); or the new start is not free (booking_slot_taken)' schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The key''s budget is used up: 120 requests a minute, 60 cancels and reschedules an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: Reschedule a booking the account made through the API tags: - bookings /locations: get: description: 'Scope locations:read. A specialist''s key: the main address first (main: true; its id is the specialist''s own, as a slot''s or a booking''s location_id), then the practice places, an organisation''s branch named with the organisation. An organisation''s key: its branches. Each with its time zone. Answers only while the account''s online booking is open to everyone. One page: next_cursor is always null.' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.APILocationList' "401": description: No key (authentication_required), or one that does not work (invalid_token) schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), not from the key's allowed IP addresses (api_key_ip_not_allowed), or a key without the scope locations:read (api_key_scope_missing; metadata.scope) schema: $ref: '#/definitions/types.ErrorResponse' "404": description: A specialist who does not take online bookings from everyone now (booking_unavailable); an organisation that is not approved, or suspended (organization_unavailable) schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The key''s budget is used up: 120 requests a minute, 1,200 reads an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: Where the account's visits take place tags: - locations /me: get: description: 'Any key, whatever its scopes and the account''s booking mode: the key (never the key itself) with its scopes, expiry, whether it works only from its allowed IP addresses, whether it is a sandbox key and the specialists an organisation''s key is limited to; the account it acts for (a specialist''s own or an organisation''s), its time zone and Kusties'' privacy notice to patients (show it before sending a booking). Use it to check a key once it is set up.' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.APIMe' "401": description: 'No key (authentication_required), or one that does not work: unknown, revoked, expired, mistyped, the other environment''s (a kst_test_ key on api.kusties.app, a kst_live_ key on the sandbox), or a specialist''s key whose account is blocked, closed or no longer a specialist''s (invalid_token)' schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), or not from the key's allowed IP addresses (api_key_ip_not_allowed) schema: $ref: '#/definitions/types.ErrorResponse' "404": description: An organisation's key while Kusties has organisations switched off (booking_unavailable) schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The key''s budget is used up: 120 requests a minute, 1,200 reads an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: The key and its account tags: - me /services: get: description: 'Scope services:read. A specialist''s key: the visit types everyone may book online, with their price where the specialist''s public profile shows prices. An organisation''s key: its services that at least one of its specialists the key reaches offers online, with the price the organisation set. Each with its length, formats (practice, home: the booking needs visit_address, online), the locations it can be booked at (none for a home or online visit) and the specialists who can be booked for it. Answers only while the account''s online booking is open to everyone. One page: next_cursor is always null.' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.APIServiceList' "401": description: No key (authentication_required), or one that does not work (invalid_token) schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), not from the key's allowed IP addresses (api_key_ip_not_allowed), or a key without the scope services:read (api_key_scope_missing; metadata.scope) schema: $ref: '#/definitions/types.ErrorResponse' "404": description: A specialist who does not take online bookings from everyone now (booking_unavailable); an organisation that is not approved, or suspended (organization_unavailable) schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The key''s budget is used up: 120 requests a minute, 1,200 reads an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: What can be booked tags: - services /specialists: get: description: 'Scope specialists:read. A specialist''s key: the specialist. An organisation''s key: the specialists on the organisation''s page who take online bookings from everyone, in its order (only those the key is limited to). Each with the name, profession, photo, time zone, the online cancelling deadline (cancel_hours; left out: no cancelling online) and how many days ahead they can be booked. Answers only while the account''s online booking is open to everyone. One page: next_cursor is always null.' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/types.APISpecialistList' "401": description: No key (authentication_required), or one that does not work (invalid_token) schema: $ref: '#/definitions/types.ErrorResponse' "403": description: A browser's request (api_browser_not_allowed), not from the key's allowed IP addresses (api_key_ip_not_allowed), or a key without the scope specialists:read (api_key_scope_missing; metadata.scope) schema: $ref: '#/definitions/types.ErrorResponse' "404": description: 'A specialist who does not take online bookings from everyone now: booking is off or for their clients only (booking_unavailable); an organisation that is not approved, or suspended (organization_unavailable)' schema: $ref: '#/definitions/types.ErrorResponse' "429": description: 'The key''s budget is used up: 120 requests a minute, 1,200 reads an hour (rate_limited; Retry-After)' schema: $ref: '#/definitions/types.ErrorResponse' security: - BearerKey: [] summary: The specialists the key reaches tags: - specialists schemes: - https securityDefinitions: BearerKey: description: 'An API key from «API un integrācijas»: "Bearer" followed by a space and the key (kst_live_…, or kst_test_… on the sandbox).' in: header name: Authorization type: apiKey swagger: "2.0" tags: - description: The key and the account it acts for. name: me - description: The specialists the key reaches. name: specialists - description: Where the account's visits take place. name: locations - description: What can be booked. name: services - description: The free start times. name: availability - description: The bookings the account makes, lists, reads, cancels and reschedules. name: bookings