Availability

Get the availability calendar

GET
/api/v1/availability/calendar

Per-day bookability over a date range. Also callable with a publishable key (shyni_pk_...). Mirrors the customer booking widget's calendar step exactly (same allocator), scoped to the calling key's own studio. serviceIds is optional, omitted, the calendar reflects a single generic slot rather than a specific service combo. A given selection is checked like POST /orders checks it (add-ons alone answer 400 INVALID_INPUT, field: serviceIds); days more than a year ahead are always listed as unavailable.

Authorization

ApiKeyAuth catalog:read
headerAuthorizationBearer <shyni_sk_live_*>

An API key, issued once and never retrievable again: an organization key in the developer portal, or a studio key in the studio's admin (Moje studio → API). Send as Authorization: Bearer shyni_sk_live_....

Scope: catalog:read

Query Parameters

fromDate*string

First day of the range (YYYY-MM-DD).

Formatdate
daysCount*integer

Number of days to compute, starting at fromDate.

serviceIds?string

Optional comma-separated service ids.

variant?string

Variant code the order will be booked with (a code from the service variants). Its extraMinutes lengthen the work, so pass the same value you later send in POST /orders. Omitted, no variant minutes are added.

optionAnswers?string

Configurator answers, the POST /orders optionAnswers[] pairs as comma-separated questionId:optionId (the parameter may also repeat). The picked options' minutes lengthen the work, so pass the same answers you later send in POST /orders; without them a configurator service's window is too short and the order is refused. The same rules as the order apply: an unknown question or option, a question answered twice, an unanswered required question, or answers with no configurator service in the selection answer 400 INVALID_INPUT (field: optionAnswers); a malformed pair is 400 too.

Response Body

The calendar window.

application/json
  1. response
unavailableDays*array<>

Days with no bookable capacity for the requested selection, within the range.

earliestDate*string
Formatdate
latestDate*string
Formatdate
workDays*array<integer>

Weekdays the studio operates on (ISO-8601 day-of-week numbers, 1=Monday..7=Sunday).

closedDays*array<>

Days in the range on which the studio is fully closed (vacation, holiday, closure; a day closed only for part of it, by a timed block, is not listed), a subset of unavailableDays. Non-working weekdays are not listed here (see workDays).

Example Request
curl -X GET 'https://api.shyni.io/api/v1/availability/calendar?fromDate=2019-08-24&daysCount=0&serviceIds=3b7e9c52-81d4-4f6a-a0c3-2d9e5b8f1a47%2C7d2f4a10-5c96-4e83-b1a7-9f0e3c6d8b25&variant=MEDIUM&optionAnswers=9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f%3A5a6b7c8d-9e0f-1a2b-3c4d-5e6f7a8b9c0d' \  -H 'Authorization: Bearer shyni_sk_test_YOUR_KEY'

Response 200

The calendar window.

{  "unavailableDays": [    "2019-08-24"  ],  "earliestDate": "2019-08-24",  "latestDate": "2019-08-24",  "workDays": [    0  ],  "closedDays": [    "2019-08-24"  ]}

Response 400

A parameter, header or request body is missing, malformed, or out of range. A request body property the endpoint does not define answers UNKNOWN_FIELD instead, with field naming it.

{  "code": "INVALID_INPUT",  "message": "Parameter perPage must be between 1 and 100."}

Response 401

Missing, malformed, unknown, or revoked API key (INVALID_API_KEY).

{  "code": "INVALID_API_KEY",  "message": "Missing or invalid API key."}

Response 403

The key is valid but the request is refused. Branch on code: INSUFFICIENT_SCOPE (the key lacks the permission this endpoint requires), PLAN_REQUIRED (the studio is not on a plan that includes API keys, Pro and above), ORIGIN_NOT_ALLOWED, SECRET_KEY_IN_BROWSER, or DEMO_STUDIO on a write to the demo studio. See Authentication and Scopes above.

{  "code": "INSUFFICIENT_SCOPE",  "message": "This API key does not have the permission this endpoint requires."}

Response 409

The studio is not published, so its booking data is not available (STUDIO_NOT_PUBLISHED).

{  "code": "STUDIO_NOT_PUBLISHED",  "message": "The studio is not published; booking data is not available."}

Response 429

Burst rate limit exceeded.

{  "code": "RATE_LIMITED",  "message": "Too many requests. Retry after the time given in the Retry-After header."}