{"openapi":"3.1.0","info":{"title":"ProSchedule Public API","version":"1.0","description":"Access to a company's **ProSchedule** data for other programs: the structure and the stores, aggregated sales,\nhours and productivity figures, the labour report of the dashboards, the state of the schedules and the action plans\nas counters — and sales planning: a plan made by the caller's own model saved as a draft, a turn of ProSchedule's\nplanner, and a reviewed plan written into the revenue forecast. The API is called server to server; it answers no\nbrowser origin (no CORS).\n\n## Authentication\n\nEvery call carries an API key, in either header:\n\n| Header | Value |\n| --- | --- |\n| `Authorization` | `Bearer psk_…` |\n| `X-API-Key` | `psk_…` |\n\nWhen both are sent, `Authorization` is used. A key in the query string is refused with 400\n`CREDENTIAL_IN_QUERY` and should be treated as exposed. Keys are issued in ProSchedule: a personal key acts as its\nowner, with the owner's current role and place in the company structure; a service key acts as a service, with the\nreach it was given. Every key carries scopes, and each operation below names the scopes it requires.\n\nThe key identifies the company. No request names a company and no response returns its id.\n\n## Reach\n\nEvery answer is computed inside the credential's reach: the whole company, or the structure nodes the credential is\nbound to and everything below them. Nothing above the reach is returned — no id, no name, no total. An id outside\nthe reach answers the same 404 as an id that does not exist. `GET /api/public/v1/me` says what the reach is; call it\nfirst.\n\n## Data the company opens\n\nLabour cost — COL and the cost of labour in money — is part of an answer only for a key that carries\n`labor_cost:read` in a company whose administrator opened labour cost. Without either, the same operation answers\nwithout those fields and says so (`laborCost: false`); it is not refused.\n\nSales planning is open only where the company's administrator switched «Sales planning» on, under its own consent;\nelsewhere its operations answer 403 `DATA_CATEGORY_DISABLED`. Its writes act for a person: a personal key, whose\nowner may plan sales and is not read-only in the planner; a service key never writes. Every write takes an\n`Idempotency-Key`; a write to a plan names the `version` it was made against and answers 409\n`VERSION_CONFLICT` when the plan changed since. A turn of ProSchedule's planner spends the company's AI credits,\nas in the app; when they do not cover it the answer is 402 `AI_TURN_NOT_COVERED` and nothing starts.\n\n## Webhooks\n\nAn integration's service key with `webhooks:manage` names the addresses ProSchedule POSTs the company's changes to\n(`/api/public/v1/webhooks/endpoints`); the company's administrators manage the same endpoints in the app. An event\nis `{ \"type\", \"timestamp\", \"data\" }` — identifiers and statuses, never a person's name — and an endpoint is told\nonly what its key could read itself: the event's scope, the stores of the key's reach. Every message is signed by\nStandard Webhooks v1 (`webhook-id`, `webhook-timestamp`, `webhook-signature`); verify it with any Standard\nWebhooks library and the endpoint's `whsec_…` secret, and drop a repeated `webhook-id`: a message is delivered at\nleast once. A 2xx within 5 seconds is a success; anything else is tried again after 5 s, 5 min, 30 min, 2 h, 5 h,\n10 h and 10 h. The addresses must be public: no private network, loopback or link-local address, and no redirect\nis followed. The events are listed in this document's `webhooks` section.\n\n## Answers\n\nA success is `{ \"data\": …, \"meta\": …, \"page\": … }`: `data` is the operation's own shape, `meta` says how the\nanswer was made (always `requestId` and `generatedAt`), and `page` is there on lists. Names are camelCase and\nids end in `Id`; enumeration values are lower case with underscores. A date is `YYYY-MM-DD`, a month `YYYY-MM`,\nan instant ISO 8601 in UTC. A business day starts at 06:00: sales before that hour belong to the day before. Money\nis a plain amount: the system does not know its currency.\n\n## Lists\n\nA list takes `limit` (default 50, at most 200) and `cursor`. While `page.hasMore` is true, pass\n`page.nextCursor` as `cursor` to read on — the same address is in the `Link` header with `rel=\"next\"`. A\ncursor belongs to its list and to the other parameters it was made with; with anything else it answers 400\n`INVALID_CURSOR`.\n\n## Conditional requests\n\nThe reference lists and the metrics catalogue carry an `ETag` and `Cache-Control: private, max-age=…`. Send the\ntag back in `If-None-Match` and an unchanged answer is a 304 without a body. Every other answer is\n`Cache-Control: no-store`.\n\n## Limits\n\nEach operation has a weight (`x-proschedule-weight`), and each credential its own allowance per weight. These\nare the starting numbers; the `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` headers of an\naccepted call state the allowance in force.\n\n| Weight | Calls a minute | At once | Answered within |\n| --- | --- | --- | --- |\n| `light` | 120 | 4 | 5 s |\n| `medium` | 30 | 2 | 15 s |\n| `heavy` | 6 | 1 | 25 s |\n| `write` | 10 | — | 10 s |\n| `job` | 10 | — | 10 s |\n\nPast the allowance of a minute the answer is 429 `RATE_LIMITED` with `Retry-After`; more calls at once than the\ncredential may run is 429 `CONCURRENCY_LIMITED`; a busy API is 429 `CAPACITY_EXCEEDED`. A call that is not\nanswered in its time is 504 `OPERATION_TIMEOUT`.\n\nAll keys and connections of a company share one more allowance: the time their calls run. They may run\n6 seconds a minute together, which ordinary use does not come near; past it a call is 429\n`COMPANY_WORK_LIMITED` with `Retry-After` — the seconds until the company's minute has refilled enough to start one.\n\nA heavy report is computed for the whole company and answered again for a minute to every key of the company that\nasks for the same thing. A company may have 300 heavy reports computed a day (UTC); past that, a report asked\nfor in the last minute is still answered, and a new one is 429 `HEAVY_DAILY_LIMIT_REACHED` with `Retry-After`\nto 00:00 UTC.\n\n## Errors\n\nAn error is an RFC 9457 problem document, `application/problem+json`:\n\n```json\n{\n  \"type\": \"https://proschedule.com/problems/invalid-request\",\n  \"title\": \"Invalid request\",\n  \"status\": 400,\n  \"detail\": \"The request has an unknown or malformed parameter or field.\",\n  \"code\": \"INVALID_REQUEST\",\n  \"requestId\": \"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c\",\n  \"errors\": [{ \"pointer\": null, \"parameter\": \"types\", \"code\": \"UNKNOWN_VALUE\", \"detail\": \"…\" }]\n}\n```\n\nBranch on `code`; `title` and `detail` are for people and never repeat the request back. `errors` is present\nwhen the problem is about particular fields, parameters or scopes, each with one of\n`REQUIRED`, `INVALID_TYPE`, `INVALID_FORMAT`, `UNKNOWN_FIELD`, `UNKNOWN_VALUE`, `OUT_OF_RANGE`, `TOO_LONG`, `TOO_MANY`, `NOT_ALLOWED_TOGETHER`, `NOT_AVAILABLE`, `NOT_FOUND`, `MISSING_SCOPE`, `CATEGORY_DISABLED`.\n\n| Status | Code | Meaning |\n| --- | --- | --- |\n| 400 | `INVALID_REQUEST` | The request has an unknown or malformed parameter or field. |\n| 400 | `MALFORMED_JSON` | The request body is not valid JSON. |\n| 400 | `INVALID_CURSOR` | The cursor is malformed or belongs to another query. Start again without a cursor. |\n| 400 | `CREDENTIAL_IN_QUERY` | API keys are not accepted in the query string. Send the key in the Authorization header as a Bearer token, or in X-API-Key, and treat a key that was sent in a URL as exposed. |\n| 401 | `UNAUTHENTICATED` | Send an API key in the Authorization header as a Bearer token, or in X-API-Key. |\n| 401 | `INVALID_CREDENTIAL` | The credential is not valid. |\n| 401 | `CREDENTIAL_EXPIRED` | The API key has expired. Rotate it or issue a new one. |\n| 401 | `CREDENTIAL_REVOKED` | The API key has been revoked. |\n| 403 | `API_ACCESS_DISABLED` | An administrator of the company has not switched external API access on. |\n| 403 | `API_CONSENT_REQUIRED` | An administrator of the company has to accept the current data consent before the API can be used. |\n| 403 | `PRINCIPAL_INACTIVE` | The person this key acts as is no longer active in the company. |\n| 403 | `ROLE_PERMISSION_REQUIRED` | The role of the person this key acts as does not allow API access. |\n| 403 | `INSUFFICIENT_SCOPE` | The credential lacks a scope this operation requires. |\n| 403 | `DATA_CATEGORY_DISABLED` | The company has not opened this category of data to the API. |\n| 403 | `APP_NOT_ALLOWED` | The company does not allow this application to connect. A company administrator can allow it in the API settings. |\n| 402 | `AI_TURN_NOT_COVERED` | The company's AI credits do not cover this model turn: the balance, the monthly limit of AI sales planning or the person's own limit. An administrator of the company manages them in ProSchedule. |\n| 403 | `AI_PLANNING_UNAVAILABLE` | AI sales planning is not available to this person: this server does not run it, the company has not switched it on with its consent, or the person's role does not have it. |\n| 403 | `IP_NOT_ALLOWED` | This key cannot be used from the caller's address. |\n| 403 | `READ_ONLY_ACCOUNT` | The account this key acts as has read-only access and cannot make this change. |\n| 403 | `FORBIDDEN` | The credential is not allowed to do this. |\n| 404 | `NOT_FOUND` | The requested resource does not exist. |\n| 404 | `STORE_NOT_FOUND` | No such store within the reach of this credential. |\n| 404 | `NODE_NOT_FOUND` | No such structure node within the reach of this credential. |\n| 404 | `SALES_PLAN_NOT_FOUND` | No such sales plan that this credential may read. |\n| 404 | `WEBHOOK_ENDPOINT_NOT_FOUND` | No such webhook endpoint that this key manages. |\n| 404 | `WEBHOOK_DELIVERY_NOT_FOUND` | No such delivery of an endpoint that this key manages. |\n| 409 | `VERSION_CONFLICT` | The plan changed since the version the request names. Read it again and decide on what it holds now. |\n| 409 | `PLAN_RUN_IN_PROGRESS` | The plan has a model turn in flight. Wait for it to end, then try again. |\n| 409 | `PLAN_NOT_READY` | The plan has no figures to write into the forecast yet. |\n| 409 | `WEBHOOK_ENDPOINT_LIMIT` | The company has as many webhook endpoints as it may. Delete one first. |\n| 409 | `WEBHOOK_ENDPOINT_DISABLED` | The endpoint is switched off and is sent nothing. Switch it on first. |\n| 409 | `IDEMPOTENCY_IN_PROGRESS` | A request with this Idempotency-Key is still running. Retry shortly. |\n| 409 | `CONFLICT` | The request conflicts with the current state. |\n| 413 | `PAYLOAD_TOO_LARGE` | The request body is larger than this API accepts. |\n| 415 | `UNSUPPORTED_MEDIA_TYPE` | Send the request body as application/json in UTF-8. |\n| 422 | `INVALID_QUERY` | The query cannot be run as it is written. |\n| 422 | `INVALID_PERIOD` | The period is not valid. |\n| 422 | `PERIOD_TOO_LONG` | The period is longer than this query allows. |\n| 422 | `WEBHOOK_URL_NOT_ALLOWED` | The address must be https, without credentials or a fragment, on port 443 or 1024 and above, and resolve to public addresses only. |\n| 422 | `TOO_MANY_STORES` | The call covers more stores than one call may read. Narrow it to a structure node. |\n| 422 | `DIMENSION_NOT_AVAILABLE` | A requested dimension is not available for the requested measures. |\n| 422 | `IDEMPOTENCY_KEY_REUSED` | This Idempotency-Key was already used with a different request. |\n| 429 | `RATE_LIMITED` | The request limit is spent. Retry after the time in the Retry-After header. |\n| 429 | `CONCURRENCY_LIMITED` | This credential already runs as many requests at once as it may. Retry shortly. |\n| 429 | `CAPACITY_EXCEEDED` | The API is busy. Retry shortly. |\n| 429 | `COMPANY_WORK_LIMITED` | The company's keys and connections together have run as long this minute as the API allows one company. Retry after the time in the Retry-After header. |\n| 429 | `HEAVY_DAILY_LIMIT_REACHED` | The company has had as many heavy reports computed today as this server allows. A report asked for in the last minute is still answered; new ones are computed again from 00:00 UTC. |\n| 500 | `INTERNAL_ERROR` | The request failed on our side. Quote the requestId when you report it. |\n| 503 | `SERVICE_UNAVAILABLE` | The API is temporarily unavailable. Retry shortly. |\n| 504 | `OPERATION_TIMEOUT` | The operation did not finish in time. Narrow the request and retry. |"},"servers":[{"url":"/","description":"Current host"}],"tags":[{"name":"Context","description":"Who the credential acts as and what it can see."},{"name":"Directory","description":"Stores, structure nodes and reference values: the ids every other operation takes."},{"name":"Metrics","description":"Aggregated sales, hours and productivity figures."},{"name":"Schedules","description":"The state of the stores' schedules, and a store's crew schedule of a week."},{"name":"Reports","description":"The heavy reports of the dashboards: labour, managers' hours, sales and productivity by structure node."},{"name":"Time sheets","description":"The stores' time sheets: their approval by level and the edits that wait for a decision; and the time sheet by person, which is data about people — open only where the company switched «People data» on."},{"name":"Team","description":"The stores' people: their absences. Data about people — open only where the company switched «People data» on, and only to a credential with `team:read`."},{"name":"Team development","description":"The team development section: the action plans of the stores, as counters; and the actions one by one with the people they are for — data about people, open only where the company switched «People data» on."},{"name":"Sales planning","description":"Planning a month of sales: the planning dataset of the stores and the plans with their figures. Open only where the company switched «Sales planning» on, under its own consent."},{"name":"Webhooks","description":"The webhook endpoints of an integration's service key: where ProSchedule POSTs the company's changes as they happen, signed by Standard Webhooks; their secrets, a test, the delivery history and its retries. The events themselves are in the document's `webhooks` section."},{"name":"Staffing","description":"The staff hours the stores' deployment asks for a revenue the caller names, day by day and position by position, beside those of the saved forecast. Reads only."}],"paths":{"/api/public/v1/me":{"get":{"operationId":"get_context","summary":"Company context and the caller's access","description":"Who the credential acts as and what it can see: the company's language and first day of the week, today's date, the credential's scopes and expiry, the caller's role, the reach in the structure (the whole company, or the listed root nodes and everything below them) and the data categories the company has opened. Call it first: every other operation answers inside this reach. The company's name, currency and time zone are not known to the system and are always null; `today` is the UTC date, and a business day starts at 06:00 (sales before that hour belong to the previous day).\n\n**Scopes:** none — any valid credential. **Weight:** light.","tags":["Context"],"security":[{"ApiKeyBearer":[]},{"ApiKeyHeader":[]}],"x-proschedule-weight":"light","parameters":[],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetContextData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"company":{"name":null,"locale":"ru","firstDayOfWeek":"monday","currency":null,"timeZone":null},"today":{"date":"2026-11-12","basis":"utc"},"businessDay":{"startsAt":"06:00"},"credential":{"kind":"personal_key","name":"Power BI reports","keyId":"1a2b3c4d5e6f7a8b","scopes":["org:read","analytics:read"],"expiresAt":"2027-02-10T09:30:00.000Z"},"subject":{"kind":"person","name":"Aziz Karimov","role":{"id":"2","name":"Regional manager"},"isAdministrator":false},"reach":{"kind":"nodes","roots":[{"id":"n_tashkent","name":"Ташкент","isStore":false}]},"access":{"peopleData":false,"laborCost":false}},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/directory/search":{"get":{"operationId":"search_directory","summary":"Find stores, structure nodes and reference values by name","description":"Turns a name into an id. Searches the names of stores, structure nodes (a `node` is a group of the structure, such as a region or a city; a store is its own type), positions, roles, store concepts and order channels, and returns the closest matches with a score from 0 to 1, best first. Use the ids in the filters of the other operations. Stores and nodes are searched inside the credential's reach only; `context` is the name of the parent node within that reach, or null. The match is fuzzy: it ignores case and word endings and tolerates small typos; a name with no close match returns an empty list. `types` narrows the search (a comma list, default all); `limit` is 1 to 50, default 10.\n\n**Scopes:** `org:read`. **Weight:** light.","tags":["Directory"],"security":[{"ApiKeyBearer":["org:read"]},{"ApiKeyHeader":["org:read"]}],"x-proschedule-weight":"light","parameters":[{"name":"q","in":"query","required":true,"description":"The name to look for, or a part of it.","schema":{"type":"string","minLength":1,"maxLength":100},"example":"чиланзар"},{"name":"types","in":"query","required":false,"description":"What to search, as a comma list. Default: every type.","style":"form","explode":false,"schema":{"default":["store","node","position","role","store_concept","order_channel"],"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["store","node","position","role","store_concept","order_channel"]}},"example":["store"]},{"name":"limit","in":"query","required":false,"description":"The most results to return.","schema":{"default":10,"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SearchDirectoryData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"results":[{"type":"store","id":"n_184","name":"Evos Чиланзар","context":"Ташкент","score":0.9}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/stores":{"get":{"operationId":"list_stores","summary":"List stores","description":"The stores within the credential's reach, ordered by name, 50 per page (`limit` up to 200; pass `page.nextCursor` as `cursor` for the next page). `nodeId` keeps the stores below that structure node; `conceptId` keeps the stores of that store concept. Each store has its place in the structure as the credential sees it (`parentNodeId`, `path` from the top of the reach down to the parent), its concept and its coordinates when they are set. A `nodeId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND.\n\n**Scopes:** `org:read`. **Weight:** light.","tags":["Directory"],"security":[{"ApiKeyBearer":["org:read"]},{"ApiKeyHeader":["org:read"]}],"x-proschedule-weight":"light","parameters":[{"name":"nodeId","in":"query","required":false,"description":"Keeps the stores below this structure node.","schema":{"type":"string","minLength":1,"maxLength":200},"example":"n_tashkent"},{"name":"conceptId","in":"query","required":false,"description":"Keeps the stores of this store concept.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"limit","in":"query","required":false,"description":"The size of a page.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"example":50},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` of the page before; leave it out for the first page. A cursor belongs to its list and to the other parameters it was made with.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"ETag":{"$ref":"#/components/headers/ETag"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListStoresData"},"meta":{"$ref":"#/components/schemas/Meta"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","meta","page"],"additionalProperties":false},"example":{"data":{"items":[{"id":"n_184","name":"Evos Чиланзар","parentNodeId":"n_tashkent","path":[{"id":"n_tashkent","name":"Ташкент"}],"concept":{"id":"1","name":"Restaurant"},"location":{"latitude":41.2756,"longitude":69.2034}}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"},"page":{"limit":50,"hasMore":false,"nextCursor":null}}}}},"304":{"description":"Not modified: `If-None-Match` named the current answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"ETag":{"$ref":"#/components/headers/ETag"}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/structure/nodes":{"get":{"operationId":"list_structure_nodes","summary":"List structure nodes","description":"The nodes of the company structure within the credential's reach — groups (regions, cities) and stores — ordered by name, 50 per page (`limit` up to 200; pass `page.nextCursor` as `cursor` for the next page). `parentId` keeps the direct children of that node; `kind` keeps stores or groups. `level` is the depth in the tree the credential sees: 0 is a top node of the reach, and it is the number `nodeLevel` of the metrics query takes. `path` lists the ancestors from the top of the reach down to the parent. A `parentId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND.\n\n**Scopes:** `org:read`. **Weight:** light.","tags":["Directory"],"security":[{"ApiKeyBearer":["org:read"]},{"ApiKeyHeader":["org:read"]}],"x-proschedule-weight":"light","parameters":[{"name":"parentId","in":"query","required":false,"description":"Keeps the direct children of this node.","schema":{"type":"string","minLength":1,"maxLength":200},"example":"n_tashkent"},{"name":"kind","in":"query","required":false,"description":"Keeps the stores, or the groups (every node that is not a store).","schema":{"type":"string","enum":["store","group"]},"example":"store"},{"name":"limit","in":"query","required":false,"description":"The size of a page.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` of the page before; leave it out for the first page. A cursor belongs to its list and to the other parameters it was made with.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"ETag":{"$ref":"#/components/headers/ETag"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListStructureNodesData"},"meta":{"$ref":"#/components/schemas/Meta"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","meta","page"],"additionalProperties":false},"example":{"data":{"items":[{"id":"n_184","name":"Evos Чиланзар","parentNodeId":"n_tashkent","isStore":true,"level":1,"path":[{"id":"n_tashkent","name":"Ташкент"}]}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"},"page":{"limit":50,"hasMore":false,"nextCursor":null}}}}},"304":{"description":"Not modified: `If-None-Match` named the current answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"ETag":{"$ref":"#/components/headers/ETag"}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/metrics/catalog":{"get":{"operationId":"list_metrics","summary":"List the metrics a query can ask for","description":"The catalogue of the metrics query: every measure with its value format, whether its values add up (`additive`), whether a higher value is better, and the dimensions and filters it takes; every dimension and filter; the preset periods and the comparisons; and the limits of one query. Call it before the first query, and build queries from these ids only. It lists what this credential may use: the cuts by position and role appear only for a company that has opened people data to the API, to a credential with `team:read` — and so do the cut and the filter by employee. Labels come in English or Russian (`lang`, default `en`); descriptions are in English. `filters[].directoryType` is the `types` value of the directory search that finds the ids for that filter; null for `employeeIds` — people are in no directory, and their ids come from the answers that name them.\n\n**Scopes:** `analytics:read`. **Weight:** light.","tags":["Metrics"],"security":[{"ApiKeyBearer":["analytics:read"]},{"ApiKeyHeader":["analytics:read"]}],"x-proschedule-weight":"light","parameters":[{"name":"lang","in":"query","required":false,"description":"The language of the labels.","schema":{"type":"string","default":"en","enum":["en","ru"]},"example":"en"}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"ETag":{"$ref":"#/components/headers/ETag"},"Cache-Control":{"$ref":"#/components/headers/Cache-Control"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListMetricsData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"measures":[{"id":"sales.revenue","label":"Revenue","description":"Sales revenue (the sum of sales) from the sales history.","format":"money","additive":true,"higherIsBetter":true,"dimensions":["time.day","time.week","time.month","time.quarter","store","node","weekday","hour","order_channel","store_concept"],"filters":["nodeIds","storeIds","storeConceptIds","orderChannelIds"]}],"dimensions":[{"id":"store","label":"Store","description":"The store the figure belongs to.","kind":"category"}],"filters":[{"key":"storeIds","label":"Stores","description":"Ids of stores (GET /stores).","directoryType":"store"}],"periods":["last_7d","last_30d","last_90d","last_3_months","last_12_months","this_month","prev_month","this_year"],"comparisons":["previous_period","same_period_last_year"],"limits":{"maxMeasures":6,"maxDimensions":3,"defaultRows":50,"maxRows":200,"maxCustomPeriodDays":1830,"maxShiftBreakdownDays":92,"maxHourBreakdownDays":92,"maxFilterValues":50}},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"304":{"description":"Not modified: `If-None-Match` named the current answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"ETag":{"$ref":"#/components/headers/ETag"}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/metrics/query":{"post":{"operationId":"query_metrics","summary":"Query metrics","description":"Computes measures over a period, broken down by up to 3 dimensions, inside the credential's reach — the figures the dashboards show. Take the ids of measures, dimensions and filters from the metrics catalogue, and the ids of stores, nodes and reference values from the directory. `period` is a preset (`{ \"preset\": \"prev_month\" }`) or the caller's own dates (`{ \"from\", \"to\" }`, both included, at most 1830 days); presets are counted from `today` (the caller's local date; default the UTC date). `compareWith` adds the same measures for the previous period or the same period a year earlier. The answer is a table: `columns` says what each cell of a row is — a dimension cell is `{ id, label }`, a measure or comparison cell is a number or null. Rows are ordered by `sort` (default: the first measure, largest first) and cut at `limit` (default 50, at most 200); `meta.truncated` is true when there were more rows than that. A time bucket is always the first dimension, and such a query is a calendar: its rows go by the bucket, earliest first (inside one bucket by the first measure, largest first), it takes no `sort`, and a cut at `limit` leaves out the latest rows — for a whole series ask for a `limit` of at least the number of buckets, or split the period. A bucket too fine for the period (more than 400 buckets) is replaced by the next one that fits — `columns` names the one used. With a time bucket and another dimension together the comparison cells are null. Without dimensions the answer is one row of totals. Money has no currency: the system does not know it. A filter that a measure does not take is ignored for that measure and listed in `meta.ignoredFilters`. A store or node id that does not exist or lies outside the reach answers 404. The cuts by person — `employee`, `position` and `role`, as dimensions or as filters (`employeeIds`, `positionIds`, `roleIds`), at most 92 days as dimensions — answer 403 DATA_CATEGORY_DISABLED until the company opens people data, and 403 INSUFFICIENT_SCOPE to a credential without `team:read`.\n\n**Scopes:** `analytics:read`. **Weight:** medium.","tags":["Metrics"],"security":[{"ApiKeyBearer":["analytics:read"]},{"ApiKeyHeader":["analytics:read"]}],"x-proschedule-weight":"medium","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryMetricsInput"},"example":{"measures":["sales.revenue","fact.hours"],"dimensions":["store"],"period":{"preset":"prev_month"},"limit":3}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QueryMetricsData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"columns":[{"key":"store","role":"dimension","label":"Store","format":null},{"key":"sales.revenue","role":"measure","label":"Revenue","format":"money"},{"key":"fact.hours","role":"measure","label":"Worked hours","format":"hours"}],"rows":[[{"id":"n_184","label":"Evos Чиланзар"},412500000,3120.5]]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/schedules/status":{"get":{"operationId":"get_schedule_status","summary":"Schedule status by store","description":"Which stores have their schedule ready. Give exactly one of `weekStart` — a date, any day of the week: it reads the crew schedules of the company's week that contains it, and `period` says which week that is — and `month` (YYYY-MM): it reads the managers' schedules of that month. Each store of the credential's reach is listed with its status: `not_created` (no schedule yet), `draft`, `submitted` (waiting for approval) or `approved`. `summary` counts the stores in each status over the whole reach — or below `nodeId`, when given — whatever the page and whatever `statuses` keeps. `statuses` keeps the stores in the listed statuses (a comma list). Stores are ordered by name, 50 per page (`limit` up to 200; pass `page.nextCursor` as `cursor` for the next page). A `nodeId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND.\n\n**Scopes:** `schedules:read`. **Weight:** light.","tags":["Schedules"],"security":[{"ApiKeyBearer":["schedules:read"]},{"ApiKeyHeader":["schedules:read"]}],"x-proschedule-weight":"light","parameters":[{"name":"weekStart","in":"query","required":false,"description":"A date, any day of the week: reads the crew schedules of the company's week that contains it. Give this or `month`, not both.","schema":{"type":"string","format":"date"},"example":"2026-11-11"},{"name":"month","in":"query","required":false,"description":"A month (YYYY-MM): reads the managers' schedules of that month. Give this or `weekStart`, not both.","schema":{"pattern":"^(\\d{4})-(0[1-9]|1[0-2])$","type":"string"}},{"name":"nodeId","in":"query","required":false,"description":"Keeps the stores below this structure node.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"statuses","in":"query","required":false,"description":"Keeps the stores in these statuses, as a comma list. Default: every status.","style":"form","explode":false,"schema":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["not_created","draft","submitted","approved"]}},"example":["draft","not_created"]},{"name":"limit","in":"query","required":false,"description":"The size of a page.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` of the page before; leave it out for the first page. A cursor belongs to its list and to the other parameters it was made with.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetScheduleStatusData"},"meta":{"$ref":"#/components/schemas/Meta"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","meta","page"],"additionalProperties":false},"example":{"data":{"kind":"crew_week","period":{"weekStart":"2026-11-09","weekEnd":"2026-11-15","weekNumber":46,"year":2026},"summary":{"notCreated":2,"draft":5,"submitted":3,"approved":31},"items":[{"storeId":"n_184","storeName":"Evos Чиланзар","status":"draft"}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"},"page":{"limit":50,"hasMore":false,"nextCursor":null}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/schedules/week":{"get":{"operationId":"get_store_week_schedule","summary":"A store's crew schedule for a week, with its warnings","description":"One store's crew schedule of a week, as the schedule editor shows it. `weekStart` is any date of the week; `period` says which week that is. `status` is `not_created` (then `summary` is null and the lists are empty), `draft`, `submitted` or `approved`; `readyToApprove` says whether the schedule meets the company's accuracy goal, and `statusHistory` when its status changed. `summary` is the week: `hours.scheduled` and `hours.recommended` are the scheduled hours and the hours the deployment recommends for the forecast, `hours.training` the training shifts' hours — each the sum of the days — and `hours.net` the week's hours with each shift's lunch break taken off, the total the week card shows. `accuracy` (0 to 1) is how well the schedule matches the recommendation, averaged over the open days. Each of `days` gives the opening hours (`open`, null when the store is closed), its hours, accuracy, how much of the recommendation the busiest hours get (`peakHoursCoverage`), the forecast, the sales and transactions per scheduled hour, the number of shifts, and by position the person-hours the recommendation asks for, those missing (`shortHours`) and those above it (`excessHours`), half hour by half hour. `alerts` are the editor's warnings by day, kind and position, with the number of `people` each concerns: `absent` (scheduled on a day of absence), `day_blocked` (a weekday they may not work), `night_restricted`, `over_weekly_hours`, `overlaps_other_position`, and in the certificates mode `position_not_certified`, `training_without_trainer`, `certificate_expired`. `positions` names the positions the answer mentions. With `day` (a date of that week), `shifts` lists that day's shifts: position, periods (times on the clock; `endsNextDay` past midnight), clock hours, whether it is a training shift and its warnings; without it `shifts` is null. The people are named only where the company opened «People data» and the credential carries `team:read` (`peopleData` says whether they are): then each shift has its `employee` (id and name), each warning the `employees` it concerns, and `people` lists who has shifts this week with their role, number of shifts and clock hours in this store; otherwise nobody is named and the call is not refused. `laborCost` — the cost of the scheduled and of the recommended hours and their share of the forecast sales — is in `summary` and in each day only when the credential carries `labor_cost:read` and the company opened labour cost; `laborCost` at the top says whether it is. A store that does not exist or lies outside the reach answers 404 STORE_NOT_FOUND.\n\n**Scopes:** `schedules:read`. **Weight:** medium.","tags":["Schedules"],"security":[{"ApiKeyBearer":["schedules:read"]},{"ApiKeyHeader":["schedules:read"]}],"x-proschedule-weight":"medium","parameters":[{"name":"storeId","in":"query","required":true,"description":"The store (`search_directory` finds its id by name).","schema":{"type":"string","minLength":1,"maxLength":200},"example":"n_184"},{"name":"weekStart","in":"query","required":true,"description":"A date, any day of the week: reads the store's crew schedule of the company's week that contains it; `period` of the answer says which week that is.","schema":{"type":"string","format":"date"},"example":"2026-11-16"},{"name":"day","in":"query","required":false,"description":"A day of that week: adds `shifts`, that day's shifts (with who works them only where people data reach the caller). Default: no shifts.","schema":{"type":"string","format":"date"},"example":"2026-11-20"}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetStoreWeekScheduleData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"storeId":"n_184","storeName":"Evos Чиланзар","period":{"weekStart":"2026-11-16","weekEnd":"2026-11-22","weekNumber":47,"year":2026},"status":"submitted","readyToApprove":true,"statusHistory":[{"status":"submitted","at":"2026-11-13T15:04:11.000Z"}],"laborCost":false,"peopleData":true,"summary":{"hours":{"scheduled":612,"recommended":598.5,"training":24,"net":571},"accuracy":0.9312,"forecast":{"sales":412500000,"transactions":9840},"shifts":104,"alerts":2},"days":[{"date":"2026-11-20","weekday":"friday","open":{"start":"10:00","end":"02:00","startsNextDay":false,"endsNextDay":true},"hours":{"scheduled":96,"recommended":93.5,"training":4},"accuracy":0.9205,"peakHoursCoverage":0.97,"forecast":{"sales":71200000,"transactions":1690},"productivity":{"salesPerHour":774000,"transactionsPerHour":18.37},"shifts":16,"positions":[{"positionId":"pos_cashier","recommendedHours":28,"shortHours":2.5,"excessHours":0.5}]}],"alerts":[{"date":"2026-11-20","code":"over_weekly_hours","positionId":null,"people":1,"employees":[{"id":"e_2207","name":"Dilnoza Karimova"}]}],"positions":[{"positionId":"pos_cashier","name":"Касса"}],"shifts":[{"positionId":"pos_cashier","periods":[{"start":"17:00","end":"02:00","startsNextDay":false,"endsNextDay":true}],"hours":9,"training":false,"alerts":["over_weekly_hours"],"employee":{"id":"e_2207","name":"Dilnoza Karimova"}}],"people":[{"employeeId":"e_2207","name":"Dilnoza Karimova","role":{"id":"3","name":"Crew"},"shifts":6,"hours":51}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/team-development/action-plans/summary":{"get":{"operationId":"get_action_plan_summary","summary":"Action plans by store, as counters","description":"The action plans of the team development section, as counters by store: how many actions each store has on its plan for a month, and how many of them are planned, in progress, done, cancelled and overdue. It names no person and returns no text of an action — numbers only. `month` (YYYY-MM) is the month of the plans; left out, it is the current month, and `month` of the answer says which. A month's plan holds every action planned in that month or earlier and not closed before it, so an unfinished action is on the plan of every later month too: `carriedOver` counts the actions planned in an earlier month. The statuses are today's, also on the plan of a past month: `doneInMonth` and `cancelledInMonth` were closed in that very month, `closedLater` in a later one, `planned` and `inProgress` are still open. `planned + inProgress + doneInMonth + cancelledInMonth + closedLater = total`. `overdue` is part of `planned + inProgress`: the open actions whose deadline is before `asOf`, today by UTC. An action is on the plan of the store its person works in now; the actions of people who have left are not counted. Every store of the credential's reach is listed, with zeros when it has no actions. `summary` adds up the whole reach — or what is below `nodeId`, when given — whatever the page: `stores` of them, `storesWithActions` with at least one action on the plan. Stores are ordered by name, 50 per page (`limit` up to 200; pass `page.nextCursor` as `cursor` for the next page). A `nodeId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND.\n\n**Scopes:** `team_development:read`. **Weight:** light.","tags":["Team development"],"security":[{"ApiKeyBearer":["team_development:read"]},{"ApiKeyHeader":["team_development:read"]}],"x-proschedule-weight":"light","parameters":[{"name":"month","in":"query","required":false,"description":"The month of the plans (YYYY-MM). Default: the current month — `month` of the answer says which.","schema":{"pattern":"^(\\d{4})-(0[1-9]|1[0-2])$","type":"string"},"example":"2026-11"},{"name":"nodeId","in":"query","required":false,"description":"Keeps the stores below this structure node.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"limit","in":"query","required":false,"description":"The size of a page.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` of the page before; leave it out for the first page. A cursor belongs to its list and to the other parameters it was made with.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetActionPlanSummaryData"},"meta":{"$ref":"#/components/schemas/Meta"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","meta","page"],"additionalProperties":false},"example":{"data":{"month":"2026-11","asOf":"2026-11-18","summary":{"stores":34,"storesWithActions":29,"total":212,"planned":48,"inProgress":61,"doneInMonth":97,"cancelledInMonth":6,"closedLater":0,"overdue":31,"carriedOver":74},"items":[{"storeId":"n_184","storeName":"Evos Чиланзар","total":9,"planned":2,"inProgress":3,"doneInMonth":4,"cancelledInMonth":0,"closedLater":0,"overdue":2,"carriedOver":3}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"},"page":{"limit":50,"hasMore":false,"nextCursor":null}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/reports/labor":{"get":{"operationId":"get_labor_report","summary":"Labour report: hours, sales, productivity and COL","description":"The labour report of the crew dashboard for a period: for a structure node and each of its direct children, the hours, sales and productivity on three bases — `forecast` (what the sales forecast calls for), `deployment` (what the schedules plan) and `fact` (what was worked) — the same figures the dashboard shows for the same period. `from` and `to` (YYYY-MM-DD) are both included, at most 62 days apart. `summary` is the node itself — `nodeId`, or the whole company (`kind: company`, no id) for a credential that sees all of it — and `items` are its direct children, nodes and stores. Without `nodeId`, a credential that sees only part of the company gets no `summary` and its top reach nodes as `items`. A `nodeId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND. `hours` are all crew hours, `nohHours` the non-operational hours among them, `trainingHours` the training hours of the schedules. `sales.forecast` is the sales forecast of the period, `sales.fact` the sales. `spmh` is sales per man-hour, `tplh` transactions per labour hour, `iplh` items per labour hour, all over productive hours. `accuracy` (0 to 1) is how closely the schedules' staffing follows, slot by slot, what the sales forecast calls for, averaged over the open days. `hoursCapacity` is the hours the stores' teams can work in the period by their weekly hour limits, null when unknown. `laborCost` — COL as a fraction of sales (`col`) and the cost in money of the company's currency (`amount`), for the crew and for the managers — is in the answer only when the credential carries `labor_cost:read` and the company opened labour cost; `laborCost` at the top says whether it is. `deployment` COL divides by the forecast sales, `deploymentVsFactSales` by the fact sales. `factShifts` picks whether the fact counts approved shifts only (default) or the pending edits too. The report is computed for the whole company and kept for 60 seconds: `computedAt` says when it was computed. Heavy: allow several seconds for an answer.\n\n**Scopes:** `analytics:read`. **Weight:** heavy.","tags":["Reports"],"security":[{"ApiKeyBearer":["analytics:read"]},{"ApiKeyHeader":["analytics:read"]}],"x-proschedule-weight":"heavy","parameters":[{"name":"from","in":"query","required":true,"description":"The first day of the period (YYYY-MM-DD), included.","schema":{"type":"string","format":"date"},"example":"2026-11-02"},{"name":"to","in":"query","required":true,"description":"The last day of the period (YYYY-MM-DD), included. At most 62 days from `from`.","schema":{"type":"string","format":"date"},"example":"2026-11-08"},{"name":"nodeId","in":"query","required":false,"description":"The structure node to report on, with its direct children as `items`. Default: the company for a credential that sees all of it; otherwise the top nodes of the credential's reach.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"factShifts","in":"query","required":false,"description":"Which fact shifts the fact figures count: `approved` (default, as the dashboard shows them) or `with_pending` — the pending edits too.","schema":{"type":"string","default":"approved","enum":["approved","with_pending"]}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetLaborReportData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"from":"2026-11-02","to":"2026-11-08","factShifts":"approved","computedAt":"2026-11-09T07:12:41.000Z","laborCost":true,"summary":{"nodeId":"n_12","name":"Ташкент","kind":"node","sales":{"forecast":1840000000,"fact":1912500000},"transactions":{"forecast":41200,"fact":42870},"hours":{"forecast":9640,"deployment":9812,"fact":9705},"nohHours":{"forecast":410,"deployment":422,"fact":431},"trainingHours":186,"hoursCapacity":11200,"spmh":{"forecast":199500,"deployment":196100,"fact":205300},"tplh":{"forecast":4.47,"deployment":4.39,"fact":4.6},"iplh":{"forecast":11.9,"deployment":11.7,"fact":12.2},"accuracy":0.94,"laborCost":{"crew":{"col":{"forecast":0.118,"deployment":0.121,"deploymentVsFactSales":0.116,"fact":0.117},"amount":{"forecast":217120000,"deployment":222640000,"fact":223760000}},"managers":{"col":{"forecast":0.031,"deployment":0.031,"deploymentVsFactSales":0.03,"fact":0.03},"amount":{"forecast":57040000,"deployment":57040000,"fact":57380000}}}},"items":[]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/reports/managers":{"get":{"operationId":"get_managers_report","summary":"Managers report: hours against the norm, sales and COL","description":"The managers dashboard for a month: for a structure node and each of its direct children, the managers' hours — `scheduled` in the month's managers' schedules, the `norm` of the norm calendar for the same people and `fact` worked — the same figures the dashboard shows. `month` (YYYY-MM) defaults to the current month by UTC; `month` of the answer says which. `overNormHours` and `underNormHours` add up, manager by manager, how far each one's scheduled hours are above or below their own norm (so they do not cancel out between people); `overHoursYearToDate` is the overtime of the year so far. `sales.plan` is the month's sales plan, `sales.fact` the sales. `accuracy` (0 to 1) is how well the managers' schedules cover the days, averaged over the days that could be judged. `summary` is the node itself — `nodeId`, or the whole company (`kind: company`, no id) for a credential that sees all of it — and `items` are its direct children, nodes and stores. Without `nodeId`, a credential that sees only part of the company gets no `summary` and its top reach nodes as `items`. A `nodeId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND. `laborCost.col` — the managers' labour cost as a fraction of sales on each basis (`scheduled` and `norm` over the sales plan, `normVsFactSales` and `fact` over the sales) — is in the answer only when the credential carries `labor_cost:read` and the company opened labour cost; `laborCost` at the top says whether it is. `factShifts` picks whether the fact counts approved shifts only (default) or the pending edits too. The report is computed for the whole company and kept for 60 seconds: `computedAt` says when it was computed. Heavy: allow several seconds for an answer.\n\n**Scopes:** `analytics:read`. **Weight:** heavy.","tags":["Reports"],"security":[{"ApiKeyBearer":["analytics:read"]},{"ApiKeyHeader":["analytics:read"]}],"x-proschedule-weight":"heavy","parameters":[{"name":"month","in":"query","required":false,"description":"The month of the report (YYYY-MM). Default: the current month by UTC — `month` of the answer says which.","schema":{"pattern":"^(\\d{4})-(0[1-9]|1[0-2])$","type":"string"},"example":"2026-11"},{"name":"nodeId","in":"query","required":false,"description":"The structure node to report on, with its direct children as `items`. Default: the company for a credential that sees all of it; otherwise the top nodes of the credential's reach.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"factShifts","in":"query","required":false,"description":"Which fact shifts the fact hours count: `approved` (default, as the dashboard shows them) or `with_pending` — the pending edits too.","schema":{"type":"string","default":"approved","enum":["approved","with_pending"]}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetManagersReportData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"month":"2026-11","factShifts":"approved","computedAt":"2026-11-18T07:12:41.000Z","laborCost":false,"summary":{"nodeId":"n_12","name":"Ташкент","kind":"node","hours":{"scheduled":6240,"norm":6120,"fact":4310},"overNormHours":186,"underNormHours":66,"overHoursYearToDate":412,"sales":{"plan":7900000000,"fact":5120000000},"accuracy":0.91},"items":[]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/timesheets/approvals":{"get":{"operationId":"get_timesheet_approval_status","summary":"Time sheet approval by store","description":"Where the stores' time sheets of a month stand: for every store of the credential's reach, the approval levels that signed the month (or cancelled their signature) and how many edits of worked shifts still wait for a decision. It names no person — no approver, no employee. `month` (YYYY-MM) defaults to the current month by UTC; `month` of the answer says which. A time sheet is approved level by level: `level` 1 is the first rung, 2 and 3 the rungs above, as the company's roles are set up; a rung signs only while no rung above it has. In `levels`, `approved` is the rung's current state, `changedOn` the day it last changed and `approvedThrough` the last day of the month its signature covers (either null when it was not recorded). `highestApprovedLevel` is the highest rung that stands approved, null when none does. `pendingEdits` counts the shifts of the month whose last edit waits for approval. Every store of the reach is listed, also one with no approval yet. `summary` counts the whole reach — or what is below `nodeId`, when given — whatever the page: the stores by their highest approved rung, and the pending edits. Stores are ordered by name, 50 per page (`limit` up to 200; pass `page.nextCursor` as `cursor` for the next page). A `nodeId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND.\n\n**Scopes:** `timesheets:read`. **Weight:** medium.","tags":["Time sheets"],"security":[{"ApiKeyBearer":["timesheets:read"]},{"ApiKeyHeader":["timesheets:read"]}],"x-proschedule-weight":"medium","parameters":[{"name":"month","in":"query","required":false,"description":"The month of the time sheets (YYYY-MM). Default: the current month by UTC — `month` of the answer says which.","schema":{"pattern":"^(\\d{4})-(0[1-9]|1[0-2])$","type":"string"},"example":"2026-10"},{"name":"nodeId","in":"query","required":false,"description":"Keeps the stores below this structure node.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"limit","in":"query","required":false,"description":"The size of a page.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` of the page before; leave it out for the first page. A cursor belongs to its list and to the other parameters it was made with.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetTimesheetApprovalStatusData"},"meta":{"$ref":"#/components/schemas/Meta"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","meta","page"],"additionalProperties":false},"example":{"data":{"month":"2026-10","summary":{"stores":34,"byHighestApprovedLevel":{"none":6,"level1":19,"level2":9,"level3":0},"pendingEdits":41},"items":[{"storeId":"n_184","storeName":"Evos Чиланзар","highestApprovedLevel":2,"levels":[{"level":1,"approved":true,"changedOn":"2026-11-02","approvedThrough":"2026-10-31"},{"level":2,"approved":true,"changedOn":"2026-11-04","approvedThrough":"2026-10-31"}],"pendingEdits":0}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"},"page":{"limit":50,"hasMore":false,"nextCursor":null}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/timesheets":{"get":{"operationId":"get_timesheet","summary":"Time sheet by person","description":"The stores' time sheet for a period of at most 31 days (`from`–`to`, both included), as the time sheet page counts it: the worked shifts recorded in the stores of the credential's reach — or below `nodeId` (a store's own id keeps that store) — each under the store it was worked in, borrowed staff included, people who have left since included. Hours count only the APPROVED part of a shift: a shift whose edit waits for a decision or was rejected is counted in `shifts` and adds no hours, and a shift booked before the person's hire date adds none either. `view=summary` (default) answers `people`: one row per person and store with the shifts by status and the hours added up — worked hours, of them night, holiday and holiday-night hours, and the breaks deducted, to the hundredth. `view=shifts` answers `shifts`: one row per shift with its day, its times on the clock (`startsNextDay` / `endsNextDay` when they fall after midnight), its status and its hours. Ordered by store name, then person name (`summary`) or day and start (`shifts`); 50 rows per page (`limit` up to 200; pass `page.nextCursor` as `cursor` for the next page). No contact, no rate, no pay. This is data about people: it needs the scope `timesheets:read` and the company's «People data» switched on — otherwise 403 DATA_CATEGORY_DISABLED (the approval of the time sheets by store, `get_timesheet_approval_status`, needs no such switch). A `nodeId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND; a longer period, 422 PERIOD_TOO_LONG.\n\n**Scopes:** `timesheets:read`. **Weight:** medium. **CSV:** send `Accept: text/csv` for the same rows as a table (UTF-8 with a byte order mark; a page stays a page, the next one is in `Link`).","tags":["Time sheets"],"security":[{"ApiKeyBearer":["timesheets:read"]},{"ApiKeyHeader":["timesheets:read"]}],"x-proschedule-weight":"medium","parameters":[{"name":"from","in":"query","required":true,"description":"The first day of the period (YYYY-MM-DD), included.","schema":{"type":"string","format":"date"},"example":"2026-11-01"},{"name":"to","in":"query","required":true,"description":"The last day of the period (YYYY-MM-DD), included. At most 31 days from `from`.","schema":{"type":"string","format":"date"},"example":"2026-11-15"},{"name":"nodeId","in":"query","required":false,"description":"Keeps the stores below this structure node — or this store.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"view","in":"query","required":false,"description":"`summary` (default): one row per person and store with the shifts counted and the hours added up. `shifts`: one row per worked shift.","schema":{"type":"string","default":"summary","enum":["summary","shifts"]}},{"name":"limit","in":"query","required":false,"description":"The size of a page.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` of the page before; leave it out for the first page. A cursor belongs to its list and to the other parameters it was made with.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetTimesheetData"},"meta":{"$ref":"#/components/schemas/Meta"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","meta","page"],"additionalProperties":false},"example":{"data":{"from":"2026-11-01","to":"2026-11-15","view":"summary","people":[{"storeId":"n_184","storeName":"Evos Чиланзар","employeeId":"e_2207","name":"Dilnoza Karimova","role":{"id":"1","name":"Crew"},"shifts":{"total":11,"approved":10,"pending":1,"rejected":0},"hours":{"worked":86.5,"night":12,"holiday":0,"holidayNight":0,"breaks":5}}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"},"page":{"limit":50,"hasMore":false,"nextCursor":null}}},"text/csv":{"schema":{"type":"string"},"example":"storeId,storeName,employeeId,name,roleId,roleName,shifts,approvedShifts,pendingShifts,rejectedShifts,workedHours,nightHours,holidayHours,holidayNightHours,breakHours\r\nn_184,Evos Чиланзар,e_2207,Dilnoza Karimova,1,Crew,11,10,1,0,86.5,12,0,0,5\r\n"}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/absences":{"get":{"operationId":"get_absences","summary":"Absences of the stores' people","description":"Who of the stores' people is absent in a period: every absence recorded on an employee's card that overlaps `from`–`to` (both included, at most 92 days), for the people of the stores of the credential's reach — or of the stores below `nodeId` (a store's own id keeps that store). People are those a store has today: not dismissed, and not hidden by the company. Each item is one period as the card stores it — `from` and `to` are its own first and last day and may reach outside the period asked for — with the person's id, name and store. `kind` is `vacation` for a vacation and `absence` for every other kind: sick leave and the company's own kinds are not told apart, and the reason or a note is never returned. `summary` counts the whole reach (or what is below `nodeId`), whatever the page: the absences and the people they belong to. Ordered by the first day, 50 per page (`limit` up to 200; pass `page.nextCursor` as `cursor` for the next page). This is data about people: it needs the scope `team:read` and the company's «People data» switched on — otherwise 403 DATA_CATEGORY_DISABLED. A `nodeId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND; a longer period, 422 PERIOD_TOO_LONG.\n\n**Scopes:** `team:read`. **Weight:** light. **CSV:** send `Accept: text/csv` for the same rows as a table (UTF-8 with a byte order mark; a page stays a page, the next one is in `Link`).","tags":["Team"],"security":[{"ApiKeyBearer":["team:read"]},{"ApiKeyHeader":["team:read"]}],"x-proschedule-weight":"light","parameters":[{"name":"from","in":"query","required":true,"description":"The first day of the period (YYYY-MM-DD), included.","schema":{"type":"string","format":"date"},"example":"2026-11-01"},{"name":"to","in":"query","required":true,"description":"The last day of the period (YYYY-MM-DD), included. At most 92 days from `from`.","schema":{"type":"string","format":"date"},"example":"2026-11-30"},{"name":"nodeId","in":"query","required":false,"description":"Keeps the people of the stores below this structure node — or of this store.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"limit","in":"query","required":false,"description":"The size of a page.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` of the page before; leave it out for the first page. A cursor belongs to its list and to the other parameters it was made with.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetAbsencesData"},"meta":{"$ref":"#/components/schemas/Meta"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","meta","page"],"additionalProperties":false},"example":{"data":{"from":"2026-11-01","to":"2026-11-30","summary":{"absences":12,"people":11},"items":[{"storeId":"n_184","storeName":"Evos Чиланзар","employeeId":"e_2207","name":"Dilnoza Karimova","from":"2026-10-27","to":"2026-11-09","kind":"vacation"},{"storeId":"n_184","storeName":"Evos Чиланзар","employeeId":"e_2319","name":"Javlon Rahimov","from":"2026-11-03","to":"2026-11-05","kind":"absence"}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"},"page":{"limit":50,"hasMore":false,"nextCursor":null}}},"text/csv":{"schema":{"type":"string"},"example":"storeId,storeName,employeeId,name,from,to,kind\r\nn_184,Evos Чиланзар,e_2207,Dilnoza Karimova,2026-10-27,2026-11-09,vacation\r\nn_184,Evos Чиланзар,e_2319,Javlon Rahimov,2026-11-03,2026-11-05,absence\r\n"}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/team-development/action-items":{"get":{"operationId":"list_action_items","summary":"Actions of the team development plans","description":"The actions on the stores' team development plans of a month, one by one — the action-plan tab of each store: the person the action is for (id and name), its text, its deadline and state, and who carries it out. `month` (YYYY-MM) defaults to the current month by UTC. An action is on a month's plan from the month it was planned in until the month it was closed in. `text` is the action's title, at most 120 characters (`textCut` says it was cut); the details written under it are never returned. `overdue` is an open action whose deadline has passed as of `asOf` (the UTC day); `carriedOver`, one planned in an earlier month; `closedMonth`, the month a done or cancelled action was closed in. An action is on the plan of the store its person works in now. `status` narrows the list (`open`, `overdue` or a state). `summary.items` counts the whole list, whatever the page. Ordered by store name, then the person's name; 50 per page (`limit` up to 200; pass `page.nextCursor` as `cursor` for the next page). For the counters by store without people, use get_action_plan_summary. This is data about people: it needs the scopes `team_development:read` and `team:read` and the company's «People data» switched on — otherwise 403 DATA_CATEGORY_DISABLED. A `nodeId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND.\n\n**Scopes:** `team_development:read`, `team:read`. **Weight:** light. **CSV:** send `Accept: text/csv` for the same rows as a table (UTF-8 with a byte order mark; a page stays a page, the next one is in `Link`).","tags":["Team development"],"security":[{"ApiKeyBearer":["team_development:read","team:read"]},{"ApiKeyHeader":["team_development:read","team:read"]}],"x-proschedule-weight":"light","parameters":[{"name":"month","in":"query","required":false,"description":"The month of the plans (YYYY-MM). Default: the current month by UTC — `month` of the answer says which.","schema":{"pattern":"^(\\d{4})-(0[1-9]|1[0-2])$","type":"string"},"example":"2026-11"},{"name":"nodeId","in":"query","required":false,"description":"Keeps the actions of the people of the stores below this structure node — or of this store.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"status","in":"query","required":false,"description":"Keeps the actions in this state: `planned`, `in_progress`, `done`, `cancelled`; `open` (planned or in progress) or `overdue` (open, the deadline passed). Default: every action of the month's plans.","schema":{"type":"string","enum":["open","overdue","planned","in_progress","done","cancelled"]},"example":"open"},{"name":"limit","in":"query","required":false,"description":"The size of a page.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` of the page before; leave it out for the first page. A cursor belongs to its list and to the other parameters it was made with.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListActionItemsData"},"meta":{"$ref":"#/components/schemas/Meta"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","meta","page"],"additionalProperties":false},"example":{"data":{"month":"2026-11","asOf":"2026-11-20","summary":{"items":23},"items":[{"id":"act_5521","storeId":"n_184","storeName":"Evos Чиланзар","employee":{"id":"e_2207","name":"Dilnoza Karimova"},"text":"Пройти обучение на кухне и сдать сертификацию до конца месяца","textCut":false,"deadline":"2026-11-15","status":"in_progress","overdue":true,"carriedOver":false,"closedMonth":null,"assignee":{"id":"e_1044","name":"Javlon Rahimov"}}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"},"page":{"limit":50,"hasMore":false,"nextCursor":null}}},"text/csv":{"schema":{"type":"string"},"example":"storeId,storeName,employeeId,employeeName,id,text,textCut,deadline,status,overdue,carriedOver,closedMonth,assigneeId,assigneeName\r\nn_184,Evos Чиланзар,e_2207,Dilnoza Karimova,act_5521,Пройти обучение на кухне и сдать сертификацию до конца месяца,false,2026-11-15,in_progress,true,false,,e_1044,Javlon Rahimov\r\n"}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/sales-plans/dataset":{"get":{"operationId":"get_sales_planning_dataset","summary":"Sales planning dataset","description":"What a model needs to plan a month of sales for the stores of the credential's reach — or the stores below `nodeId` (a store's own id keeps that store): each store's name, its path in the structure, concept, location and opening hours by weekday (a store with no hours on record counts as open all day); its last day with sales; the mean daily sales by weekday over the last 8 complete weeks (the profile a monthly total is split by); and the revenue forecast already stored for `month`, summed (`daysFilled` = the days that have one). `monthlySales` holds the complete months with sales of the last 24 months and the same month one and two years before `month`; `weeklySales` the last 8 complete weeks (`weekStart` is a Monday). `calendar` gives the company's closed days and holidays of `month`. Money is in whole currency units; no person is named. `month` is the current month (UTC) or one of the next 12 — otherwise 422 INVALID_PERIOD; at most 60 stores per call — more is 422 TOO_MANY_STORES (plan by structure node). A `nodeId` that does not exist or lies outside the reach answers 404 NODE_NOT_FOUND. Needs the scope `sales_plans:read` and the company's «Sales planning» switched on — otherwise 403 DATA_CATEGORY_DISABLED.\n\n**Scopes:** `sales_plans:read`. **Weight:** medium.","tags":["Sales planning"],"security":[{"ApiKeyBearer":["sales_plans:read"]},{"ApiKeyHeader":["sales_plans:read"]}],"x-proschedule-weight":"medium","parameters":[{"name":"month","in":"query","required":true,"description":"The month to plan, `YYYY-MM`: the current month (UTC) or one of the next 12.","schema":{"type":"string","format":"regex","pattern":"^(\\d{4})-(0[1-9]|1[0-2])$"},"example":"2026-12"},{"name":"nodeId","in":"query","required":false,"description":"Keeps the stores below this structure node — or this store. Absent: every store of the reach.","schema":{"type":"string","minLength":1,"maxLength":200},"example":"n_184"}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetSalesPlanningDatasetData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"month":"2026-12","currency":null,"calendar":{"days":31,"closedDays":[],"holidays":[{"date":"2026-12-31","name":"New Year's Eve"}]},"stores":[{"storeId":"n_184","name":"Evos Чиланзар","path":[{"id":"n_12","name":"Ташкент"}],"concept":"Restaurant","location":{"latitude":41.2856,"longitude":69.2034},"openHours":[{"weekday":"monday","start":"09:00","end":"23:00","endsNextDay":false},{"weekday":"saturday","start":"09:00","end":"01:00","endsNextDay":true}],"lastSaleDate":"2026-11-22","weekdayMeanSales":{"monday":18400000,"tuesday":18100000,"wednesday":18900000,"thursday":19300000,"friday":23800000,"saturday":27600000,"sunday":25200000},"currentForecast":{"sales":640000000,"transactions":9800,"daysFilled":31}}],"monthlySales":{"columns":["storeId","month","sales","transactions","days"],"rows":[["n_184","2025-12",655300000,10120,31],["n_184","2026-10",598700000,9310,31]]},"weeklySales":{"columns":["storeId","weekStart","sales","transactions"],"rows":[["n_184","2026-11-16",151300000,2310]]}},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/sales-plans":{"get":{"operationId":"list_sales_plans","summary":"Sales plans","description":"The sales plans the caller may open, the most recently changed first: for a planner — an administrator or a role with the revenue forecast permissions — every plan of the company, for anyone else their own; never a plan that covers a store outside the credential's reach. Each item says the plan's month, state (`draft` — no figures yet, `ready` — figures to review, `applied` — written into the revenue forecast), what it covers, how many of its stores have figures and their totals, whether a model turn is running, whether the caller made it (`mine`) and its `version`. `month` and `status` narrow the list. 50 per page (`limit` up to 200; pass `page.nextCursor` as `cursor` for the next page). The figures of one plan: get_sales_plan. Needs the scope `sales_plans:read` and the company's «Sales planning» switched on — otherwise 403 DATA_CATEGORY_DISABLED.\n\n**Scopes:** `sales_plans:read`. **Weight:** light.","tags":["Sales planning"],"security":[{"ApiKeyBearer":["sales_plans:read"]},{"ApiKeyHeader":["sales_plans:read"]}],"x-proschedule-weight":"light","parameters":[{"name":"month","in":"query","required":false,"description":"Keeps the plans of this month, `YYYY-MM`.","schema":{"type":"string","format":"regex","pattern":"^(\\d{4})-(0[1-9]|1[0-2])$"},"example":"2026-12"},{"name":"status","in":"query","required":false,"description":"Keeps the plans in this state.","schema":{"type":"string","enum":["draft","ready","applied"]}},{"name":"limit","in":"query","required":false,"description":"The size of a page.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` of the page before; leave it out for the first page. A cursor belongs to its list and to the other parameters it was made with.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListSalesPlansData"},"meta":{"$ref":"#/components/schemas/Meta"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","meta","page"],"additionalProperties":false},"example":{"data":{"items":[{"planId":"5b0f6a3e-2d1c-4f8e-9a7b-1c2d3e4f5a6b","title":"Ташкент · 2026-12","month":"2026-12","status":"ready","scope":{"kind":"node","nodeId":"n_12"},"storeCount":14,"storesWithFigures":14,"totalSales":8960000000,"totalTransactions":137200,"running":false,"mine":true,"version":3,"createdAt":"2026-11-23T09:12:40.000Z","updatedAt":"2026-11-23T09:15:02.000Z"}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"},"page":{"limit":50,"hasMore":false,"nextCursor":null}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}},"post":{"operationId":"create_sales_plan_draft","summary":"Create a sales plan draft","description":"Saves the caller's own model's sales figures as a sales plan in ProSchedule — a draft for a person to review: nothing goes into the revenue forecast until a person writes it there (the app's «Write to forecast», or apply_sales_plan with a personal key). Give the month's sales and receipts by store; ProSchedule splits each month over its days by the store's weekday profile, its closed days and holidays — the split read from get_sales_planning_dataset — so never send days. A new plan: `month` (the current one or one of the next 12) and `scope` (`network`, a `node` or a `store`, inside the credential's reach; at most 60 stores), and figures for any of its stores. New figures for an existing plan: `planId` and the `version` they were made against — a plan changed since answers 409 VERSION_CONFLICT; the stores named take the new figures, the others keep theirs. Every store must be the plan's, at most once, or nothing is saved (400 with the field). Answers the plan as get_sales_plan does, its figures marked `external`. Needs the scope `sales_plans:write`, a person who may plan sales (an administrator or the revenue forecast permissions; 403 otherwise) and the company's «Sales planning» switched on. Runs no model of ProSchedule's.\n\n**Scopes:** `sales_plans:write`. **Weight:** write.","tags":["Sales planning"],"security":[{"ApiKeyBearer":["sales_plans:write"]},{"ApiKeyHeader":["sales_plans:write"]}],"x-proschedule-weight":"write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSalesPlanDraftInput"},"example":{"month":"2026-12","scope":{"kind":"store","storeId":"n_184"},"summary":"December 4% above last December: the New Year week carries a quarter of the month.","stores":[{"storeId":"n_184","monthSales":681500000,"monthTransactions":10480,"confidence":"medium","rationale":"Last December plus the growth of the last three months.","risks":["Weather in the last week of the month"]}]}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreateSalesPlanDraftData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"planId":"5b0f6a3e-2d1c-4f8e-9a7b-1c2d3e4f5a6b","title":"Evos Чиланзар · 2026-12","month":"2026-12","status":"ready","scope":{"kind":"store","storeId":"n_184"},"version":1,"mine":true,"summary":"December 4% above last December: the New Year week carries a quarter of the month.","run":null,"stores":[{"storeId":"n_184","name":"Evos Чиланзар","monthSales":681500000,"monthTransactions":10480,"confidence":"medium","source":"external","rationale":"Last December plus the growth of the last three months.","assumptions":[],"risks":["Weather in the last week of the month"],"reference":{"lastMonth":{"month":"2026-10","sales":598700000,"transactions":9310},"sameMonthLastYear":{"sales":655300000,"transactions":10120},"forecastWhenPlanned":{"sales":640000000,"transactions":9800}}}],"storesWithoutFigures":[],"daily":null,"applied":null,"createdAt":"2026-11-23T09:12:40.000Z","updatedAt":"2026-11-23T09:15:02.000Z"},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"409":{"$ref":"#/components/responses/Problem409"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/sales-plans/{planId}":{"get":{"operationId":"get_sales_plan","summary":"Sales plan","description":"One sales plan the caller may open (the rule of list_sales_plans): its month, state, what it covers, its `version` (a change of the plan bumps it), the model's summary, and for each store with figures the month's sales and transactions, the confidence, where the figures come from (`model` — the planner's model, `manual` — a person's own total, `external` — a client's own model through create_sales_plan_draft), the rationale, assumptions and risks (cut to a few hundred characters), and what the figures were compared with when they were made — the last complete month, the same month a year earlier and the forecast stored then. `storesWithoutFigures` lists the stores the plan covers that have none yet. `run` tells a model turn in flight (`running` — ask again in a few seconds) or how the last one ended. `include=daily` adds the split by day — the one written into the forecast when the plan is applied. `applied` is the report of the last write into the forecast: the open days each store took and the locked days it kept. What people wrote to the planner is never returned. A plan that does not exist, was deleted or is not the caller's to open answers 404 SALES_PLAN_NOT_FOUND. Needs the scope `sales_plans:read` and the company's «Sales planning» switched on — otherwise 403 DATA_CATEGORY_DISABLED.\n\n**Scopes:** `sales_plans:read`. **Weight:** light.","tags":["Sales planning"],"security":[{"ApiKeyBearer":["sales_plans:read"]},{"ApiKeyHeader":["sales_plans:read"]}],"x-proschedule-weight":"light","parameters":[{"name":"planId","in":"path","required":true,"description":"The plan's id (list_sales_plans, or the answer that made it).","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"example":"5b0f6a3e-2d1c-4f8e-9a7b-1c2d3e4f5a6b"},{"name":"include","in":"query","required":false,"description":"`daily` adds the day-by-day split of every store's figures (`daily`): up to 31 rows a store.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["daily"]}}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetSalesPlanData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"planId":"5b0f6a3e-2d1c-4f8e-9a7b-1c2d3e4f5a6b","title":"Evos Чиланзар · 2026-12","month":"2026-12","status":"ready","scope":{"kind":"store","storeId":"n_184"},"version":3,"mine":true,"summary":"December is planned 4% above last December: New Year's week carries a quarter of the month.","run":{"status":"plan","questions":[]},"stores":[{"storeId":"n_184","name":"Evos Чиланзар","monthSales":681500000,"monthTransactions":10480,"confidence":"medium","source":"model","rationale":"Last December plus the growth of the last three months; the 31st is a short day.","assumptions":["No new competitor opens nearby"],"risks":["Weather in the last week of the month"],"reference":{"lastMonth":{"month":"2026-10","sales":598700000,"transactions":9310},"sameMonthLastYear":{"sales":655300000,"transactions":10120},"forecastWhenPlanned":{"sales":640000000,"transactions":9800}}}],"storesWithoutFigures":[],"daily":null,"applied":null,"createdAt":"2026-11-23T09:12:40.000Z","updatedAt":"2026-11-23T09:15:02.000Z"},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/sales-plans/ai-runs":{"post":{"operationId":"start_ai_sales_plan","summary":"Start the AI sales planner","description":"Asks ProSchedule's own AI sales planner — the one of the app's «Sales planning» — to plan a month, or to refine a plan, and answers at once with the plan's id: the turn runs on its own for up to a few minutes. Read the plan with get_sales_plan after `pollAfterSeconds`: `run.status` is `running` until the turn ends with figures (`plan`), questions for the planner (`questions`, to answer in the next call with `planId`), a refusal or an error. A new plan: `month` and `scope` (inside the credential's reach, at most 60 stores); a refinement: `planId`. One turn at a time per plan (409 PLAN_RUN_IN_PROGRESS). The turn spends the company's AI credits as in the app (`estimatedCredits`); a balance or limit that does not cover it answers 402 AI_TURN_NOT_COVERED and nothing starts. Needs the scope `sales_plans:write`, a person who may plan sales, AI sales planning open to them (403 AI_PLANNING_UNAVAILABLE otherwise) and the company's «Sales planning» switched on. Nothing is written into the revenue forecast.\n\n**Scopes:** `sales_plans:write`. **Weight:** job.","tags":["Sales planning"],"security":[{"ApiKeyBearer":["sales_plans:write"]},{"ApiKeyHeader":["sales_plans:write"]}],"x-proschedule-weight":"job","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartAiSalesPlanInput"},"example":{"prompt":"Plan December for Chilanzar: the New Year week is busy.","month":"2026-12","scope":{"kind":"store","storeId":"n_184"}}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StartAiSalesPlanData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"planId":"5b0f6a3e-2d1c-4f8e-9a7b-1c2d3e4f5a6b","turn":1,"status":"running","estimatedCredits":40,"pollAfterSeconds":15},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"402":{"$ref":"#/components/responses/Problem402"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"409":{"$ref":"#/components/responses/Problem409"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/sales-plans/{planId}/apply":{"post":{"operationId":"apply_sales_plan","summary":"Write a sales plan into the revenue forecast","description":"Writes a plan's figures into the revenue forecast of its stores, day by day, as the app's «Write to forecast» does: every open day of a store takes the plan's figure, and the days beyond the schedule's editing depth or in a week with an approved crew schedule keep what is stored — the answer's `applied` tells, store by store, the days written and the days kept; a store with every day locked, or without figures, is skipped. The forecast's other values (menu items, the hourly profile) do not change. It cannot be undone: the forecast is corrected by hand or by another plan. `version` is the plan's version the caller reviewed — a plan changed since answers 409 VERSION_CONFLICT and nothing is written; a plan without figures 409 PLAN_NOT_READY; one with a model turn running 409 PLAN_RUN_IN_PROGRESS. Only the plan's author or an administrator may apply it. REST only, with a personal key that carries `forecast:write` and an Idempotency-Key; the company's «Sales planning» switched on.\n\n**Scopes:** `forecast:write`. **Weight:** write.","tags":["Sales planning"],"security":[{"ApiKeyBearer":["forecast:write"]},{"ApiKeyHeader":["forecast:write"]}],"x-proschedule-weight":"write","parameters":[{"name":"planId","in":"path","required":true,"description":"The plan to write into the forecast.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"example":"5b0f6a3e-2d1c-4f8e-9a7b-1c2d3e4f5a6b"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplySalesPlanInput"},"example":{"version":3}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApplySalesPlanData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"planId":"5b0f6a3e-2d1c-4f8e-9a7b-1c2d3e4f5a6b","title":"Evos Чиланзар · 2026-12","month":"2026-12","status":"applied","scope":{"kind":"store","storeId":"n_184"},"version":4,"mine":true,"summary":"December is planned 4% above last December: New Year's week carries a quarter of the month.","run":{"status":"plan","questions":[]},"stores":[{"storeId":"n_184","name":"Evos Чиланзар","monthSales":681500000,"monthTransactions":10480,"confidence":"medium","source":"model","rationale":"Last December plus the growth of the last three months; the 31st is a short day.","assumptions":["No new competitor opens nearby"],"risks":["Weather in the last week of the month"],"reference":{"lastMonth":{"month":"2026-10","sales":598700000,"transactions":9310},"sameMonthLastYear":{"sales":655300000,"transactions":10120},"forecastWhenPlanned":{"sales":640000000,"transactions":9800}}}],"storesWithoutFigures":[],"daily":null,"applied":{"at":"2026-11-23T09:20:00.000Z","stores":[{"storeId":"n_184","openDays":31,"lockedDays":0}],"skipped":[]},"createdAt":"2026-11-23T09:12:40.000Z","updatedAt":"2026-11-23T09:15:02.000Z"},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"409":{"$ref":"#/components/responses/Problem409"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/staffing/estimates":{"post":{"operationId":"estimate_required_hours","summary":"Estimate the staff hours a revenue needs","description":"The person-hours a store's deployment asks for a revenue the caller names, by day and by position, beside the same hours for the forecast saved for those days. Give one store and 1 to 31 days (none more than 30 days from another) with the day's `sales` and `transactions` (`menuItems` too where positions are measured by them). Each day is counted as the schedule editor recommends it: the deployment's steps of every position of the store's concept, half hour by half hour over the opening hours and the store's prep and cleanup hours, the day's revenue spread by the shape of the store's sales history (`profile` `sales_history`: the five weeks before the week, or the period the schedule was set to analyse) or evenly where there is none (`even`), sales divided by the store's price clustering. Positions budgeted on the WEEK's revenue (`weekly`) are matched once against the week and give each day a seventh of their hours; for `estimate` that week is the days asked about plus the saved forecast of its other days. A closed day (`closed`: `store` — no opening hours that weekday; `company` — a company holiday) needs only the weekly positions. `saved.hours` is what the editor shows as the day's recommended hours; asking for the saved figures answers the same hours. `positions` of a day lists each position with hours on either side. `totals` adds up the days. Reads only and needs `analytics:read`; a store that does not exist or lies outside the reach answers 404 STORE_NOT_FOUND. It estimates hours for a revenue: no schedule is read or changed.\n\n**Scopes:** `analytics:read`. **Weight:** medium.","tags":["Staffing"],"security":[{"ApiKeyBearer":["analytics:read"]},{"ApiKeyHeader":["analytics:read"]}],"x-proschedule-weight":"medium","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateRequiredHoursInput"},"example":{"storeId":"n_184","days":[{"date":"2026-12-05","sales":80000000,"transactions":1900},{"date":"2026-12-06","sales":64000000,"transactions":1520}]}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EstimateRequiredHoursData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"storeId":"n_184","storeName":"Evos Чиланзар","positions":[{"positionId":"pos_cashier","name":"Касса","measure":"sales","weekly":false},{"positionId":"pos_kitchen","name":"Кухня","measure":"transactions","weekly":false},{"positionId":"pos_cleaning","name":"Уборка","measure":"sales","weekly":true}],"days":[{"date":"2026-12-05","weekday":"saturday","open":{"start":"10:00","end":"02:00","startsNextDay":false,"endsNextDay":true},"closed":null,"profile":"sales_history","estimate":{"sales":80000000,"transactions":1900,"menuItems":null,"hours":104.5},"saved":{"sales":71200000,"transactions":1690,"menuItems":null,"hours":93.5},"positions":[{"positionId":"pos_cashier","hours":38,"savedHours":33.5},{"positionId":"pos_kitchen","hours":63.5,"savedHours":57},{"positionId":"pos_cleaning","hours":3,"savedHours":3}]},{"date":"2026-12-06","weekday":"sunday","open":{"start":"10:00","end":"23:00","startsNextDay":false,"endsNextDay":false},"closed":null,"profile":"sales_history","estimate":{"sales":64000000,"transactions":1520,"menuItems":null,"hours":86},"saved":{"sales":60500000,"transactions":1430,"menuItems":null,"hours":81.5},"positions":[{"positionId":"pos_cashier","hours":31,"savedHours":29.5},{"positionId":"pos_kitchen","hours":52,"savedHours":49},{"positionId":"pos_cleaning","hours":3,"savedHours":3}]}],"totals":{"estimate":{"sales":144000000,"transactions":3420,"hours":190.5},"saved":{"sales":131700000,"transactions":3120,"hours":175}}},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/webhooks/endpoints":{"get":{"operationId":"list_webhook_endpoints","summary":"Webhook endpoints","description":"The webhook endpoints this key created, oldest first: address, subscriptions, switch, when the secret was made and how the last attempts went. A company has at most 10. Needs a service key with `webhooks:manage` (a person's key or an assistant never gets it); the key sees the endpoints it created.\n\n**Scopes:** `webhooks:manage`. **Weight:** light.","tags":["Webhooks"],"security":[{"ApiKeyBearer":["webhooks:manage"]},{"ApiKeyHeader":["webhooks:manage"]}],"x-proschedule-weight":"light","parameters":[],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListWebhookEndpointsData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"items":[{"id":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f","url":"https://hooks.example.com/proschedule","description":"Payroll sync","eventTypes":["schedule.week.approved"],"enabled":true,"owner":{"kind":"service_key","keyId":"a1b2c3d4e5f6","keyName":"Payroll"},"secret":{"createdAt":"2026-11-23T09:00:00.000Z","previousExpiresAt":null},"createdAt":"2026-11-23T09:00:00.000Z","updatedAt":"2026-11-23T09:00:00.000Z","lastSucceededAt":"2026-11-23T09:00:01.000Z","lastFailedAt":null,"failingSince":null,"disabledReason":null,"disabledAt":null}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}},"post":{"operationId":"create_webhook_endpoint","summary":"Add a webhook endpoint","description":"Adds an endpoint, switched on, and answers its signing secret — once. The address is checked before it is stored: its form, and that its name resolves to public addresses only (422 WEBHOOK_URL_NOT_ALLOWED with the reason in `detail`); it is checked again before every attempt. The endpoint is sent a `webhook.test` at once. A company has at most 10 endpoints (409 WEBHOOK_ENDPOINT_LIMIT). An event that fails is tried again after 5 s, 5 min, 30 min, 2 h, 5 h, 10 h and 10 h (eight attempts, about 27.5 hours); a 2xx answer within 5 s is a success. Every message is signed by Standard Webhooks v1: the headers `webhook-id` (the delivery's `msg_…`, the same on every attempt), `webhook-timestamp` (seconds) and `webhook-signature` (`v1,<base64 HMAC-SHA256 of \"{id}.{timestamp}.{body}\">` with the secret's bytes after `whsec_`; two signatures, space-separated, while a rotation's overlap lasts). Any Standard Webhooks library verifies it. Idempotency-Key required. Needs a service key with `webhooks:manage` (a person's key or an assistant never gets it); the key sees the endpoints it created.\n\n**Scopes:** `webhooks:manage`. **Weight:** light.","tags":["Webhooks"],"security":[{"ApiKeyBearer":["webhooks:manage"]},{"ApiKeyHeader":["webhooks:manage"]}],"x-proschedule-weight":"light","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointInput"},"example":{"url":"https://hooks.example.com/proschedule","description":"Payroll sync","eventTypes":["schedule.week.approved"]}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreateWebhookEndpointData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"endpoint":{"id":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f","url":"https://hooks.example.com/proschedule","description":"Payroll sync","eventTypes":["schedule.week.approved"],"enabled":true,"owner":{"kind":"service_key","keyId":"a1b2c3d4e5f6","keyName":"Payroll"},"secret":{"createdAt":"2026-11-23T09:00:00.000Z","previousExpiresAt":null},"createdAt":"2026-11-23T09:00:00.000Z","updatedAt":"2026-11-23T09:00:00.000Z","lastSucceededAt":null,"lastFailedAt":null,"failingSince":null,"disabledReason":null,"disabledAt":null},"secret":"whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"409":{"$ref":"#/components/responses/Problem409"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/webhooks/endpoints/{endpointId}":{"get":{"operationId":"get_webhook_endpoint","summary":"A webhook endpoint","description":"One endpoint this key created; another's, or one that does not exist, is 404 WEBHOOK_ENDPOINT_NOT_FOUND. Needs a service key with `webhooks:manage` (a person's key or an assistant never gets it); the key sees the endpoints it created.\n\n**Scopes:** `webhooks:manage`. **Weight:** light.","tags":["Webhooks"],"security":[{"ApiKeyBearer":["webhooks:manage"]},{"ApiKeyHeader":["webhooks:manage"]}],"x-proschedule-weight":"light","parameters":[{"name":"endpointId","in":"path","required":true,"description":"The endpoint, as `id` of an endpoint names it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"example":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f"}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GetWebhookEndpointData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"id":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f","url":"https://hooks.example.com/proschedule","description":"Payroll sync","eventTypes":["schedule.week.approved"],"enabled":true,"owner":{"kind":"service_key","keyId":"a1b2c3d4e5f6","keyName":"Payroll"},"secret":{"createdAt":"2026-11-23T09:00:00.000Z","previousExpiresAt":null},"createdAt":"2026-11-23T09:00:00.000Z","updatedAt":"2026-11-23T09:00:00.000Z","lastSucceededAt":"2026-11-23T09:00:01.000Z","lastFailedAt":null,"failingSince":null,"disabledReason":null,"disabledAt":null},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}},"patch":{"operationId":"update_webhook_endpoint","summary":"Change a webhook endpoint","description":"Changes what the body names — the address (checked as on creation), the description, the subscriptions, the switch — and keeps the rest; the same PATCH again changes nothing. Answers the endpoint as it is now. Needs a service key with `webhooks:manage` (a person's key or an assistant never gets it); the key sees the endpoints it created.\n\n**Scopes:** `webhooks:manage`. **Weight:** light.","tags":["Webhooks"],"security":[{"ApiKeyBearer":["webhooks:manage"]},{"ApiKeyHeader":["webhooks:manage"]}],"x-proschedule-weight":"light","parameters":[{"name":"endpointId","in":"path","required":true,"description":"The endpoint, as `id` of an endpoint names it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"example":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookEndpointInput"},"example":{"enabled":false}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UpdateWebhookEndpointData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"id":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f","url":"https://hooks.example.com/proschedule","description":"Payroll sync","eventTypes":["schedule.week.approved"],"enabled":false,"owner":{"kind":"service_key","keyId":"a1b2c3d4e5f6","keyName":"Payroll"},"secret":{"createdAt":"2026-11-23T09:00:00.000Z","previousExpiresAt":null},"createdAt":"2026-11-23T09:00:00.000Z","updatedAt":"2026-11-23T09:00:00.000Z","lastSucceededAt":"2026-11-23T09:00:01.000Z","lastFailedAt":null,"failingSince":null,"disabledReason":null,"disabledAt":null},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}},"delete":{"operationId":"delete_webhook_endpoint","summary":"Delete a webhook endpoint","description":"Deletes the endpoint and its delivery history; what was still to be sent to it is not sent. It cannot be undone. A second DELETE is 404. Needs a service key with `webhooks:manage` (a person's key or an assistant never gets it); the key sees the endpoints it created.\n\n**Scopes:** `webhooks:manage`. **Weight:** light.","tags":["Webhooks"],"security":[{"ApiKeyBearer":["webhooks:manage"]},{"ApiKeyHeader":["webhooks:manage"]}],"x-proschedule-weight":"light","parameters":[{"name":"endpointId","in":"path","required":true,"description":"The endpoint, as `id` of an endpoint names it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"example":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f"}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteWebhookEndpointData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"id":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f","deleted":true},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/webhooks/endpoints/{endpointId}/rotate-secret":{"post":{"operationId":"rotate_webhook_secret","summary":"Rotate a webhook endpoint's secret","description":"Makes a new signing secret and answers it once. For `overlapHours` (1–168, default 24) every message carries two signatures — the new secret's and the old one's — so the receiver switches in its own time; then the old secret is dropped. A rotation during an overlap ends the older one at once. Idempotency-Key required. Needs a service key with `webhooks:manage` (a person's key or an assistant never gets it); the key sees the endpoints it created.\n\n**Scopes:** `webhooks:manage`. **Weight:** light.","tags":["Webhooks"],"security":[{"ApiKeyBearer":["webhooks:manage"]},{"ApiKeyHeader":["webhooks:manage"]}],"x-proschedule-weight":"light","parameters":[{"name":"endpointId","in":"path","required":true,"description":"The endpoint, as `id` of an endpoint names it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"example":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateWebhookSecretInput"},"example":{"overlapHours":24}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RotateWebhookSecretData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"endpoint":{"id":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f","url":"https://hooks.example.com/proschedule","description":"Payroll sync","eventTypes":["schedule.week.approved"],"enabled":true,"owner":{"kind":"service_key","keyId":"a1b2c3d4e5f6","keyName":"Payroll"},"secret":{"createdAt":"2026-11-24T08:00:00.000Z","previousExpiresAt":"2026-11-25T08:00:00.000Z"},"createdAt":"2026-11-23T09:00:00.000Z","updatedAt":"2026-11-23T09:00:00.000Z","lastSucceededAt":"2026-11-23T09:00:01.000Z","lastFailedAt":null,"failingSince":null,"disabledReason":null,"disabledAt":null},"secret":"whsec_Y2FmZWJhYmVjYWZlYmFiZWNhZmViYWJlY2FmZWI="},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"409":{"$ref":"#/components/responses/Problem409"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/webhooks/endpoints/{endpointId}/test":{"post":{"operationId":"send_webhook_test","summary":"Send a test event","description":"Queues a `webhook.test` for the endpoint — `{ type: \"webhook.test\", timestamp, data: { endpointId } }`, signed like every message — to check that it arrives and its signature verifies. It goes out within seconds, with the same retries as any event; its attempts are in the delivery history. A switched-off endpoint is sent nothing (409 WEBHOOK_ENDPOINT_DISABLED). Idempotency-Key required. Needs a service key with `webhooks:manage` (a person's key or an assistant never gets it); the key sees the endpoints it created.\n\n**Scopes:** `webhooks:manage`. **Weight:** light.","tags":["Webhooks"],"security":[{"ApiKeyBearer":["webhooks:manage"]},{"ApiKeyHeader":["webhooks:manage"]}],"x-proschedule-weight":"light","parameters":[{"name":"endpointId","in":"path","required":true,"description":"The endpoint, as `id` of an endpoint names it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"example":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendWebhookTestInput"},"example":{}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SendWebhookTestData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"queued":true},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"409":{"$ref":"#/components/responses/Problem409"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/webhooks/endpoints/{endpointId}/deliveries":{"get":{"operationId":"list_webhook_deliveries","summary":"Webhook delivery history","description":"The endpoint's deliveries of the last 30 days, newest first: the event's type, when it was made, its state, how many attempts it took, when the next one is due, and its last ten attempts — status code, error class, duration. The receiver's answer body is never kept. 50 per page (`limit` up to 200; `page.nextCursor` as `cursor` for the next). Needs a service key with `webhooks:manage` (a person's key or an assistant never gets it); the key sees the endpoints it created.\n\n**Scopes:** `webhooks:manage`. **Weight:** light.","tags":["Webhooks"],"security":[{"ApiKeyBearer":["webhooks:manage"]},{"ApiKeyHeader":["webhooks:manage"]}],"x-proschedule-weight":"light","parameters":[{"name":"endpointId","in":"path","required":true,"description":"The endpoint, as `id` of an endpoint names it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"example":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f"},{"name":"status","in":"query","required":false,"description":"Keeps the deliveries in these states, as a comma list. Default: every state.","style":"form","explode":false,"schema":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["pending","sending","succeeded","failed"]}},"example":["failed"]},{"name":"limit","in":"query","required":false,"description":"The size of a page.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` of the page before; leave it out for the first page. A cursor belongs to its list and to the other parameters it was made with.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ListWebhookDeliveriesData"},"meta":{"$ref":"#/components/schemas/Meta"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","meta","page"],"additionalProperties":false},"example":{"data":{"items":[{"id":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b","eventType":"schedule.week.approved","createdAt":"2026-11-23T09:10:00.000Z","status":"failed","attempts":8,"nextAttemptAt":null,"finishedAt":"2026-11-24T12:40:00.000Z","recentAttempts":[{"at":"2026-11-24T12:40:00.000Z","durationMs":5003,"httpStatus":null,"error":"timeout"}]}]},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"},"page":{"limit":50,"hasMore":false,"nextCursor":null}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/webhooks/deliveries/{deliveryId}/retry":{"post":{"operationId":"retry_webhook_delivery","summary":"Retry a delivery","description":"Tries a delivery again now — a failed one, or one that succeeded and is wanted again — with a fresh round of attempts and the same `webhook-id`, so a receiver that already has it can tell. A pending one is brought forward to now. Idempotency-Key required. Needs a service key with `webhooks:manage` (a person's key or an assistant never gets it); the key sees the endpoints it created.\n\n**Scopes:** `webhooks:manage`. **Weight:** light.","tags":["Webhooks"],"security":[{"ApiKeyBearer":["webhooks:manage"]},{"ApiKeyHeader":["webhooks:manage"]}],"x-proschedule-weight":"light","parameters":[{"name":"deliveryId","in":"path","required":true,"description":"The delivery, by the `webhook-id` its attempts carried (`msg_…`).","schema":{"type":"string","format":"regex","pattern":"^msg_[0-9a-f]{32}$"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryWebhookDeliveryInput"},"example":{}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RetryWebhookDeliveryData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"requeued":true},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"409":{"$ref":"#/components/responses/Problem409"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}},"/api/public/v1/webhooks/endpoints/{endpointId}/retry":{"post":{"operationId":"retry_webhook_deliveries","summary":"Retry the failed deliveries since a moment","description":"After an outage longer than the retries: every failed delivery of the endpoint made since `since` (at most 30 days back — older ones are gone) starts a fresh round of attempts now. Answers how many. Idempotency-Key required. Needs a service key with `webhooks:manage` (a person's key or an assistant never gets it); the key sees the endpoints it created.\n\n**Scopes:** `webhooks:manage`. **Weight:** light.","tags":["Webhooks"],"security":[{"ApiKeyBearer":["webhooks:manage"]},{"ApiKeyHeader":["webhooks:manage"]}],"x-proschedule-weight":"light","parameters":[{"name":"endpointId","in":"path","required":true,"description":"The endpoint, as `id` of an endpoint names it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"example":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryWebhookDeliveriesInput"},"example":{"since":"2026-11-22T00:00:00.000Z"}}}},"responses":{"200":{"description":"The answer.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RetryWebhookDeliveriesData"},"meta":{"$ref":"#/components/schemas/Meta"}},"required":["data","meta"],"additionalProperties":false},"example":{"data":{"requeued":12},"meta":{"requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c","generatedAt":"2026-11-12T09:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Problem400"},"401":{"$ref":"#/components/responses/Problem401"},"403":{"$ref":"#/components/responses/Problem403"},"404":{"$ref":"#/components/responses/Problem404"},"409":{"$ref":"#/components/responses/Problem409"},"413":{"$ref":"#/components/responses/Problem413"},"415":{"$ref":"#/components/responses/Problem415"},"422":{"$ref":"#/components/responses/Problem422"},"429":{"$ref":"#/components/responses/Problem429"},"500":{"$ref":"#/components/responses/Problem500"},"503":{"$ref":"#/components/responses/Problem503"},"504":{"$ref":"#/components/responses/Problem504"}}}}},"webhooks":{"schedule.week.submitted":{"post":{"summary":"A store's crew schedule of a week was submitted for approval","description":"Sent to the endpoints subscribed to it whose key holds `schedules:read` and reaches the store (or that the company's administrators made). Read the schedule itself with get_store_week_schedule.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleWeekSubmittedEvent"},"example":{"type":"schedule.week.submitted","timestamp":"2026-11-23T09:10:00.000Z","data":{"storeId":"n_184","weekStart":"2026-11-23","year":2026,"week":48,"changeOrder":3}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"schedule.week.approved":{"post":{"summary":"A store's crew schedule of a week was approved","description":"The schedule is final for now: the moment to take it into payroll or a time clock. Same audience as `schedule.week.submitted`. A schedule returned to draft afterwards sends `schedule.week.returned`.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleWeekApprovedEvent"},"example":{"type":"schedule.week.approved","timestamp":"2026-11-23T09:10:00.000Z","data":{"storeId":"n_184","weekStart":"2026-11-23","year":2026,"week":48,"changeOrder":4}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"schedule.week.returned":{"post":{"summary":"A store's crew schedule of a week was returned to draft","description":"From approval or from the approved state: whatever was taken from it may change again. Same audience as `schedule.week.submitted`.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleWeekReturnedEvent"},"example":{"type":"schedule.week.returned","timestamp":"2026-11-23T09:10:00.000Z","data":{"storeId":"n_184","weekStart":"2026-11-23","year":2026,"week":48,"changeOrder":5}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"schedule.month.submitted":{"post":{"summary":"A store's managers' schedule of a month was submitted for approval","description":"Sent to the endpoints subscribed to it whose key holds `schedules:read` and reaches the store (or that the company's administrators made). The managers' month schedule is the app's; read the crew weeks with get_store_week_schedule.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleMonthSubmittedEvent"},"example":{"type":"schedule.month.submitted","timestamp":"2026-11-23T09:10:00.000Z","data":{"storeId":"n_184","month":"2026-12","changeOrder":1}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"schedule.month.approved":{"post":{"summary":"A store's managers' schedule of a month was approved","description":"Same audience as `schedule.month.submitted`. A schedule returned to draft afterwards sends `schedule.month.returned`.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleMonthApprovedEvent"},"example":{"type":"schedule.month.approved","timestamp":"2026-11-23T09:10:00.000Z","data":{"storeId":"n_184","month":"2026-12","changeOrder":2}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"schedule.month.returned":{"post":{"summary":"A store's managers' schedule of a month was returned to draft","description":"From approval or from the approved state. Same audience as `schedule.month.submitted`.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleMonthReturnedEvent"},"example":{"type":"schedule.month.returned","timestamp":"2026-11-23T09:10:00.000Z","data":{"storeId":"n_184","month":"2026-12","changeOrder":3}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"timesheet.month.approved":{"post":{"summary":"A store's time sheet of a month was signed at a level","description":"One signature of the approval ladder: `level` is the rung that signed (1 the first), `approvedThrough` the last day of the month it covers, `final` whether no role of the company approves time sheets above it — the moment to take the month into payroll. Sent to the endpoints whose key holds `timesheets:read` and reaches the store (or the administrators'). A cancelled signature sends nothing; read where the month stands with get_timesheet_approval_status.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimesheetMonthApprovedEvent"},"example":{"type":"timesheet.month.approved","timestamp":"2026-11-23T09:10:00.000Z","data":{"storeId":"n_184","month":"2026-11","level":2,"approvedThrough":"2026-11-30","final":true}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"sales_plan.ready":{"post":{"summary":"A sales plan has figures to look at","description":"Our planner finished a turn with a plan (`source` `model`), or a client's model sent its figures (create_sales_plan_draft, `source` `external`). Read the plan with get_sales_plan. Sent to the endpoints whose key holds `sales_plans:read` and reaches every store of the plan (or the administrators'), while the company's «Планирование продаж» is open.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesPlanReadyEvent"},"example":{"type":"sales_plan.ready","timestamp":"2026-11-23T09:10:00.000Z","data":{"planId":"5f0c2a8e-1b7d-4e2a-9c3f-7a1e2d4b6c8a","month":"2026-12","version":3,"storeIds":["n_184","n_185"],"source":"external"}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"sales_plan.applied":{"post":{"summary":"A sales plan was written into the revenue forecast","description":"At least one store's forecast took the plan's figures (in the app or by apply_sales_plan); every such store also sends `forecast.updated`. Same audience as `sales_plan.ready`.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesPlanAppliedEvent"},"example":{"type":"sales_plan.applied","timestamp":"2026-11-23T09:10:00.000Z","data":{"planId":"5f0c2a8e-1b7d-4e2a-9c3f-7a1e2d4b6c8a","month":"2026-12","version":4,"storeIds":["n_184","n_185"]}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"forecast.updated":{"post":{"summary":"A store's revenue forecast of a month changed","description":"Whatever changed it: the forecast editor, its generation, a sales plan written into it, an upload of the integration API. The changes of one store and month within five minutes make one event, sent when the five minutes are over, with `timestamp` = the first change; re-read the month then. Sent to the endpoints whose key holds `analytics:read` and reaches the store (or the administrators'). Read the figures with query_metrics (`forecast.revenue`).","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastUpdatedEvent"},"example":{"type":"forecast.updated","timestamp":"2026-11-23T09:10:00.000Z","data":{"storeId":"n_184","month":"2026-12"}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"ai_credits.low":{"post":{"summary":"The company's AI credits are running low","description":"The company's administrators were just told so in the app: the balance fell below the company's threshold (`reason` `low_balance`), or an AI feature skipped its work for lack of credits (`reason` `shortfall`, `feature` names it). At most once a day. A connected assistant's calls spend these credits; API keys do not. Sent only to endpoints that reach the whole company (the administrators', or a key with `org:read` and the whole structure). No figures: the balance is the app's.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiCreditsLowEvent"},"example":{"type":"ai_credits.low","timestamp":"2026-11-23T09:10:00.000Z","data":{"reason":"low_balance","feature":null}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}},"webhook.test":{"post":{"summary":"A test, to check that the endpoint receives and verifies","description":"Sent once when the endpoint is created and whenever send_webhook_test asks for one; it cannot be subscribed to.","tags":["Webhooks"],"parameters":[{"name":"webhook-id","in":"header","required":true,"description":"The delivery's id, the same on every attempt: drop a message whose id you already have.","schema":{"type":"string"},"example":"msg_5b0f6a3e2d1c4f8e9a7b1c2d3e4f5a6b"},{"name":"webhook-timestamp","in":"header","required":true,"description":"The attempt's time in seconds since the epoch; refuse one far from your clock.","schema":{"type":"string"},"example":"1795000000"},{"name":"webhook-signature","in":"header","required":true,"description":"`v1,` + base64 of HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's secret after `whsec_`. During a rotation's overlap two signatures, separated by a space: one of them verifies.","schema":{"type":"string"},"example":"v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestEvent"},"example":{"type":"webhook.test","timestamp":"2026-11-23T09:10:00.000Z","data":{"endpointId":"0b8f2c4e-6a1d-4c3b-9e7f-5a2d1c0b9e8f"}}}}},"responses":{"2XX":{"description":"Received. Answer within 5 seconds; do the work after answering."},"default":{"description":"Anything else — or no answer — is tried again later with the same `webhook-id`."}}}}},"components":{"securitySchemes":{"ApiKeyBearer":{"type":"http","scheme":"bearer","description":"An API key as a bearer token: `Authorization: Bearer psk_…`."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key","description":"The same API key in a header of its own, for clients that cannot set `Authorization`."}},"schemas":{"Problem":{"type":"object","description":"An error, as an RFC 9457 problem document. `code` is the stable identifier to branch on; `title` and `detail` are for people.","properties":{"type":{"type":"string","format":"uri","description":"An identifier of the kind of problem, the same on every installation."},"title":{"type":"string"},"status":{"type":"integer","description":"The HTTP status of the response."},"detail":{"type":"string","description":"What was expected or what to do. It never repeats the request back."},"code":{"type":"string","enum":["INVALID_REQUEST","MALFORMED_JSON","INVALID_CURSOR","CREDENTIAL_IN_QUERY","UNAUTHENTICATED","INVALID_CREDENTIAL","CREDENTIAL_EXPIRED","CREDENTIAL_REVOKED","API_ACCESS_DISABLED","API_CONSENT_REQUIRED","PRINCIPAL_INACTIVE","ROLE_PERMISSION_REQUIRED","INSUFFICIENT_SCOPE","DATA_CATEGORY_DISABLED","APP_NOT_ALLOWED","AI_TURN_NOT_COVERED","AI_PLANNING_UNAVAILABLE","IP_NOT_ALLOWED","READ_ONLY_ACCOUNT","FORBIDDEN","NOT_FOUND","STORE_NOT_FOUND","NODE_NOT_FOUND","SALES_PLAN_NOT_FOUND","WEBHOOK_ENDPOINT_NOT_FOUND","WEBHOOK_DELIVERY_NOT_FOUND","VERSION_CONFLICT","PLAN_RUN_IN_PROGRESS","PLAN_NOT_READY","WEBHOOK_ENDPOINT_LIMIT","WEBHOOK_ENDPOINT_DISABLED","IDEMPOTENCY_IN_PROGRESS","CONFLICT","PAYLOAD_TOO_LARGE","UNSUPPORTED_MEDIA_TYPE","INVALID_QUERY","INVALID_PERIOD","PERIOD_TOO_LONG","WEBHOOK_URL_NOT_ALLOWED","TOO_MANY_STORES","DIMENSION_NOT_AVAILABLE","IDEMPOTENCY_KEY_REUSED","RATE_LIMITED","CONCURRENCY_LIMITED","CAPACITY_EXCEEDED","COMPANY_WORK_LIMITED","HEAVY_DAILY_LIMIT_REACHED","INTERNAL_ERROR","SERVICE_UNAVAILABLE","OPERATION_TIMEOUT"]},"requestId":{"type":["string","null"],"description":"The id of the call. Quote it when reporting a problem."},"errors":{"type":"array","description":"Present when the problem is about particular fields, parameters or scopes: one entry for each, 20 at most.","items":{"type":"object","properties":{"pointer":{"type":["string","null"],"description":"A JSON Pointer (RFC 6901) into the request body; null when the entry is not about a body field."},"parameter":{"type":["string","null"],"description":"The query parameter; null when the entry is not about one."},"code":{"type":"string","enum":["REQUIRED","INVALID_TYPE","INVALID_FORMAT","UNKNOWN_FIELD","UNKNOWN_VALUE","OUT_OF_RANGE","TOO_LONG","TOO_MANY","NOT_ALLOWED_TOGETHER","NOT_AVAILABLE","NOT_FOUND","MISSING_SCOPE","CATEGORY_DISABLED"]},"detail":{"type":"string"}},"required":["pointer","parameter","code","detail"],"additionalProperties":false}}},"required":["type","title","status","detail","code","requestId"],"additionalProperties":false},"Meta":{"type":"object","description":"What an answer says about itself. `requestId` and `generatedAt` are always present; the other members appear on the operations they apply to.","properties":{"requestId":{"type":"string","description":"The id of the call: the `X-Request-Id` the request carried, or one the API gave it."},"generatedAt":{"type":"string","format":"date-time"},"reach":{"type":"object","description":"Whether the answer covers the whole company (`full`) or the part of its structure the credential reaches (`nodes`).","properties":{"kind":{"type":"string","enum":["full","nodes"]}},"required":["kind"]},"period":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}},"required":["from","to"],"description":"The dates a metrics query was computed for, both included."},"comparisonPeriod":{"anyOf":[{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}},"required":["from","to"]},{"type":"null"}],"description":"The dates of the comparison a metrics query asked for; null without one."},"currency":{"type":"null","description":"Always null: the system does not know the currency of money amounts."},"truncated":{"type":"boolean","description":"The table of a metrics query is not the whole answer: there were more rows than `limit`, or the query read more data than one answer may be computed from."},"ignoredFilters":{"type":"array","items":{"type":"string"},"description":"The filters of a metrics query that at least one of its measures does not take."},"unavailableMeasures":{"type":"array","items":{"type":"string"},"description":"The measures of a metrics query that could not be computed; their cells are null."},"weekStartsOn":{"type":"string","enum":["sunday","monday","tuesday"],"description":"The first day of the weeks the answer is counted in."}},"required":["requestId","generatedAt"]},"Page":{"type":"object","description":"Where a list stands. Pass `nextCursor` as `cursor` to read the next page.","properties":{"limit":{"type":"integer"},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["limit","hasMore","nextCursor"],"additionalProperties":false},"GetContextData":{"type":"object","properties":{"company":{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"type":"string","enum":["ru","en","he","uz","es","pt","de","fr","ja","ar"]},"firstDayOfWeek":{"type":"string","enum":["sunday","monday","tuesday"]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"timeZone":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","locale","firstDayOfWeek","currency","timeZone"],"additionalProperties":false},"today":{"type":"object","properties":{"date":{"type":"string","format":"date"},"basis":{"const":"utc"}},"required":["date","basis"],"additionalProperties":false},"businessDay":{"type":"object","properties":{"startsAt":{"const":"06:00"}},"required":["startsAt"],"additionalProperties":false},"credential":{"type":"object","properties":{"kind":{"type":"string","enum":["personal_key","service_key","oauth_token","session"]},"name":{"type":"string"},"keyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string","enum":["org:read","analytics:read","labor_cost:read","schedules:read","timesheets:read","team:read","team_development:read","sales_plans:read","sales_plans:write","forecast:write","webhooks:manage"]}},"expiresAt":{"type":"string","format":"date-time"}},"required":["kind","name","keyId","scopes","expiresAt"],"additionalProperties":false},"subject":{"anyOf":[{"type":"object","properties":{"kind":{"const":"person"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"isAdministrator":{"type":"boolean"}},"required":["kind","name","role","isAdministrator"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"service"}},"required":["kind"],"additionalProperties":false}]},"reach":{"anyOf":[{"type":"object","properties":{"kind":{"const":"full"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"nodes"},"roots":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isStore":{"type":"boolean"}},"required":["id","name","isStore"],"additionalProperties":false}}},"required":["kind","roots"],"additionalProperties":false}]},"access":{"type":"object","properties":{"peopleData":{"type":"boolean"},"laborCost":{"type":"boolean"}},"required":["peopleData","laborCost"],"additionalProperties":false}},"required":["company","today","businessDay","credential","subject","reach","access"],"additionalProperties":false},"SearchDirectoryData":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["store","node","position","role","store_concept","order_channel"]},"id":{"type":"string"},"name":{"type":"string"},"context":{"anyOf":[{"type":"string"},{"type":"null"}]},"score":{"type":"number"}},"required":["type","id","name","context","score"],"additionalProperties":false}}},"required":["results"],"additionalProperties":false},"ListStoresData":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"parentNodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"path":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"concept":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"location":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","parentNodeId","path","concept","location"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"ListStructureNodesData":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"parentNodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isStore":{"type":"boolean"},"level":{"type":"integer","minimum":0},"path":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["id","name","parentNodeId","isStore","level","path"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"ListMetricsData":{"type":"object","properties":{"measures":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["sales.revenue","sales.transactions","sales.items","sales.avg_check","sales.items_per_check","forecast.revenue","forecast.transactions","schedule.hours","schedule.shifts","schedule.employees","schedule.training_hours","fact.hours","fact.shifts","fact.employees","productivity.spmh","productivity.tplh","productivity.fact_spmh","productivity.hours_variance","team.headcount","team.hires","team.leavers"]},"label":{"type":"string"},"description":{"type":"string"},"format":{"type":"string","enum":["count","money","hours","percent","decimal"]},"additive":{"type":"boolean"},"higherIsBetter":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"dimensions":{"type":"array","items":{"type":"string","enum":["time.day","time.week","time.month","time.quarter","store","node","weekday","hour","order_channel","store_concept","position","role","employee"]}},"filters":{"type":"array","items":{"type":"string","enum":["nodeIds","storeIds","storeConceptIds","orderChannelIds","positionIds","roleIds","employeeIds"]}}},"required":["id","label","description","format","additive","higherIsBetter","dimensions","filters"],"additionalProperties":false}},"dimensions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["time.day","time.week","time.month","time.quarter","store","node","weekday","hour","order_channel","store_concept","position","role","employee"]},"label":{"type":"string"},"description":{"type":"string"},"kind":{"type":"string","enum":["time","category"]}},"required":["id","label","description","kind"],"additionalProperties":false}},"filters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["nodeIds","storeIds","storeConceptIds","orderChannelIds","positionIds","roleIds","employeeIds"]},"label":{"type":"string"},"description":{"type":"string"},"directoryType":{"anyOf":[{"type":"string","enum":["store","node","position","role","store_concept","order_channel"]},{"type":"null"}]}},"required":["key","label","description","directoryType"],"additionalProperties":false}},"periods":{"type":"array","items":{"type":"string","enum":["last_7d","last_30d","last_90d","last_3_months","last_12_months","this_month","prev_month","this_year"]}},"comparisons":{"type":"array","items":{"type":"string","enum":["previous_period","same_period_last_year"]}},"limits":{"type":"object","properties":{"maxMeasures":{"type":"integer"},"maxDimensions":{"type":"integer"},"defaultRows":{"type":"integer"},"maxRows":{"type":"integer"},"maxCustomPeriodDays":{"type":"integer"},"maxShiftBreakdownDays":{"type":"integer"},"maxHourBreakdownDays":{"type":"integer"},"maxFilterValues":{"type":"integer"}},"required":["maxMeasures","maxDimensions","defaultRows","maxRows","maxCustomPeriodDays","maxShiftBreakdownDays","maxHourBreakdownDays","maxFilterValues"],"additionalProperties":false}},"required":["measures","dimensions","filters","periods","comparisons","limits"],"additionalProperties":false},"QueryMetricsData":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"role":{"type":"string","enum":["dimension","measure","comparison"]},"label":{"type":"string"},"format":{"anyOf":[{"type":"string","enum":["count","money","hours","percent","decimal"]},{"type":"null"}]}},"required":["key","role","label","format"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextDay":{"type":"boolean"}},"required":["id","label"],"additionalProperties":false},{"type":"number"},{"type":"null"}]}}}},"required":["columns","rows"],"additionalProperties":false},"QueryMetricsInput":{"type":"object","properties":{"measures":{"description":"What to compute: ids of measures from the metrics catalogue.","minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["sales.revenue","sales.transactions","sales.items","sales.avg_check","sales.items_per_check","forecast.revenue","forecast.transactions","schedule.hours","schedule.shifts","schedule.employees","schedule.training_hours","fact.hours","fact.shifts","fact.employees","productivity.spmh","productivity.tplh","productivity.fact_spmh","productivity.hours_variance","team.headcount","team.hires","team.leavers"]}},"dimensions":{"description":"What to break the figures down by: ids of dimensions from the metrics catalogue. Default: none, one row of totals.","default":[],"maxItems":3,"type":"array","items":{"type":"string","enum":["time.day","time.week","time.month","time.quarter","store","node","weekday","hour","order_channel","store_concept","position","role","employee"]}},"period":{"description":"A preset, counted from `today`, or the caller's own dates, both included.","anyOf":[{"type":"object","properties":{"preset":{"type":"string","enum":["last_7d","last_30d","last_90d","last_3_months","last_12_months","this_month","prev_month","this_year"]}},"required":["preset"],"additionalProperties":false},{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}},"required":["from","to"],"additionalProperties":false}]},"compareWith":{"description":"Adds each measure once more, for the previous period or for the same period a year earlier.","default":null,"anyOf":[{"type":"string","enum":["previous_period","same_period_last_year"]},{"type":"null"}]},"filters":{"description":"Keeps the figures of the listed ids; the metrics catalogue says what each filter takes.","default":{},"type":"object","properties":{"nodeIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"storeIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"storeConceptIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"orderChannelIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"positionIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"roleIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"employeeIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":[],"additionalProperties":false},"sort":{"description":"The order of the rows: by a requested measure or by the label of the first dimension. Not taken with a time bucket.","default":null,"anyOf":[{"type":"object","properties":{"by":{"type":"string","enum":["sales.revenue","sales.transactions","sales.items","sales.avg_check","sales.items_per_check","forecast.revenue","forecast.transactions","schedule.hours","schedule.shifts","schedule.employees","schedule.training_hours","fact.hours","fact.shifts","fact.employees","productivity.spmh","productivity.tplh","productivity.fact_spmh","productivity.hours_variance","team.headcount","team.hires","team.leavers","label"]},"direction":{"type":"string","enum":["asc","desc"]}},"required":["by","direction"],"additionalProperties":false},{"type":"null"}]},"limit":{"description":"The most rows to return.","default":50,"type":"integer","minimum":1,"maximum":200},"nodeLevel":{"description":"With the dimension `node`: the `level` (GET /structure/nodes) of the nodes to group by. Default: each store's parent.","default":null,"anyOf":[{"type":"integer","minimum":0,"maximum":12},{"type":"null"}]},"today":{"description":"The caller's local date, which a preset is counted from. Default: the UTC date.","type":"string","format":"date"}},"required":["measures","period"],"additionalProperties":false},"GetScheduleStatusData":{"type":"object","properties":{"kind":{"type":"string","enum":["crew_week","manager_month"]},"period":{"anyOf":[{"type":"object","properties":{"weekStart":{"type":"string","format":"date"},"weekEnd":{"type":"string","format":"date"},"weekNumber":{"type":"integer"},"year":{"type":"integer"}},"required":["weekStart","weekEnd","weekNumber","year"],"additionalProperties":false},{"type":"object","properties":{"month":{"type":"string"}},"required":["month"],"additionalProperties":false}]},"summary":{"type":"object","properties":{"notCreated":{"type":"integer","minimum":0},"draft":{"type":"integer","minimum":0},"submitted":{"type":"integer","minimum":0},"approved":{"type":"integer","minimum":0}},"required":["notCreated","draft","submitted","approved"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"storeName":{"type":"string"},"status":{"type":"string","enum":["not_created","draft","submitted","approved"]}},"required":["storeId","storeName","status"],"additionalProperties":false}}},"required":["kind","period","summary","items"],"additionalProperties":false},"GetStoreWeekScheduleData":{"type":"object","properties":{"storeId":{"type":"string"},"storeName":{"type":"string"},"period":{"type":"object","properties":{"weekStart":{"type":"string","format":"date"},"weekEnd":{"type":"string","format":"date"},"weekNumber":{"type":"integer"},"year":{"type":"integer"}},"required":["weekStart","weekEnd","weekNumber","year"],"additionalProperties":false},"status":{"type":"string","enum":["not_created","draft","submitted","approved"]},"readyToApprove":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"statusHistory":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["not_created","draft","submitted","approved"]},"at":{"type":"string","format":"date-time"}},"required":["status","at"],"additionalProperties":false}},"laborCost":{"type":"boolean"},"peopleData":{"type":"boolean"},"summary":{"anyOf":[{"type":"object","properties":{"hours":{"type":"object","properties":{"scheduled":{"type":"number"},"recommended":{"type":"number"},"training":{"type":"number"},"net":{"type":"number"}},"required":["scheduled","recommended","training","net"],"additionalProperties":false},"accuracy":{"type":"number"},"forecast":{"type":"object","properties":{"sales":{"type":"number"},"transactions":{"type":"number"}},"required":["sales","transactions"],"additionalProperties":false},"shifts":{"type":"integer","minimum":0},"alerts":{"type":"integer","minimum":0},"laborCost":{"type":"object","properties":{"amount":{"type":"number"},"col":{"anyOf":[{"type":"number"},{"type":"null"}]},"recommendedAmount":{"type":"number"},"recommendedCol":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["amount","col","recommendedAmount","recommendedCol"],"additionalProperties":false}},"required":["hours","accuracy","forecast","shifts","alerts"],"additionalProperties":false},{"type":"null"}]},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"weekday":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},"open":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"startsNextDay":{"type":"boolean"},"endsNextDay":{"type":"boolean"}},"required":["start","end","startsNextDay","endsNextDay"],"additionalProperties":false},{"type":"null"}]},"hours":{"type":"object","properties":{"scheduled":{"type":"number"},"recommended":{"type":"number"},"training":{"type":"number"}},"required":["scheduled","recommended","training"],"additionalProperties":false},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}]},"peakHoursCoverage":{"anyOf":[{"type":"number"},{"type":"null"}]},"forecast":{"type":"object","properties":{"sales":{"type":"number"},"transactions":{"type":"number"}},"required":["sales","transactions"],"additionalProperties":false},"productivity":{"type":"object","properties":{"salesPerHour":{"type":"number"},"transactionsPerHour":{"type":"number"}},"required":["salesPerHour","transactionsPerHour"],"additionalProperties":false},"shifts":{"type":"integer","minimum":0},"positions":{"type":"array","items":{"type":"object","properties":{"positionId":{"type":"string"},"recommendedHours":{"type":"number"},"shortHours":{"type":"number"},"excessHours":{"type":"number"}},"required":["positionId","recommendedHours","shortHours","excessHours"],"additionalProperties":false}},"laborCost":{"type":"object","properties":{"amount":{"type":"number"},"col":{"anyOf":[{"type":"number"},{"type":"null"}]},"recommendedAmount":{"type":"number"},"recommendedCol":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["amount","col","recommendedAmount","recommendedCol"],"additionalProperties":false}},"required":["date","weekday","open","hours","accuracy","peakHoursCoverage","forecast","productivity","shifts","positions"],"additionalProperties":false}},"alerts":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"code":{"type":"string","enum":["absent","day_blocked","night_restricted","over_weekly_hours","insufficient_rest","overlaps_other_position","position_not_certified","training_without_trainer","certificate_expired","other"]},"positionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"people":{"type":"integer","minimum":0},"employees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["date","code","positionId","people"],"additionalProperties":false}},"positions":{"type":"array","items":{"type":"object","properties":{"positionId":{"type":"string"},"name":{"type":"string"}},"required":["positionId","name"],"additionalProperties":false}},"shifts":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"positionId":{"type":"string"},"periods":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"startsNextDay":{"type":"boolean"},"endsNextDay":{"type":"boolean"}},"required":["start","end","startsNextDay","endsNextDay"],"additionalProperties":false}},"hours":{"type":"number"},"training":{"type":"boolean"},"alerts":{"type":"array","items":{"type":"string","enum":["absent","day_blocked","night_restricted","over_weekly_hours","insufficient_rest","overlaps_other_position","position_not_certified","training_without_trainer","certificate_expired","other"]}},"employee":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"required":["positionId","periods","hours","training","alerts"],"additionalProperties":false}},{"type":"null"}]},"people":{"type":"array","items":{"type":"object","properties":{"employeeId":{"type":"string"},"name":{"type":"string"},"role":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"shifts":{"type":"integer","minimum":0},"hours":{"type":"number"}},"required":["employeeId","name","role","shifts","hours"],"additionalProperties":false}}},"required":["storeId","storeName","period","status","readyToApprove","statusHistory","laborCost","peopleData","summary","days","alerts","positions","shifts"],"additionalProperties":false},"GetActionPlanSummaryData":{"type":"object","properties":{"month":{"type":"string"},"asOf":{"type":"string","format":"date"},"summary":{"type":"object","properties":{"stores":{"type":"integer","minimum":0},"storesWithActions":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0},"planned":{"type":"integer","minimum":0},"inProgress":{"type":"integer","minimum":0},"doneInMonth":{"type":"integer","minimum":0},"cancelledInMonth":{"type":"integer","minimum":0},"closedLater":{"type":"integer","minimum":0},"overdue":{"type":"integer","minimum":0},"carriedOver":{"type":"integer","minimum":0}},"required":["stores","storesWithActions","total","planned","inProgress","doneInMonth","cancelledInMonth","closedLater","overdue","carriedOver"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"storeName":{"type":"string"},"total":{"type":"integer","minimum":0},"planned":{"type":"integer","minimum":0},"inProgress":{"type":"integer","minimum":0},"doneInMonth":{"type":"integer","minimum":0},"cancelledInMonth":{"type":"integer","minimum":0},"closedLater":{"type":"integer","minimum":0},"overdue":{"type":"integer","minimum":0},"carriedOver":{"type":"integer","minimum":0}},"required":["storeId","storeName","total","planned","inProgress","doneInMonth","cancelledInMonth","closedLater","overdue","carriedOver"],"additionalProperties":false}}},"required":["month","asOf","summary","items"],"additionalProperties":false},"GetLaborReportData":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"factShifts":{"type":"string","enum":["approved","with_pending"]},"computedAt":{"type":"string","format":"date-time"},"laborCost":{"type":"boolean"},"summary":{"anyOf":[{"type":"object","properties":{"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string","enum":["company","node","store"]},"sales":{"type":"object","properties":{"forecast":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","fact"],"additionalProperties":false},"transactions":{"type":"object","properties":{"forecast":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","fact"],"additionalProperties":false},"hours":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false},"nohHours":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false},"trainingHours":{"type":"number"},"hoursCapacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"spmh":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false},"tplh":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false},"iplh":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false},"accuracy":{"type":"number"},"laborCost":{"type":"object","properties":{"crew":{"type":"object","properties":{"col":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"deploymentVsFactSales":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","deploymentVsFactSales","fact"],"additionalProperties":false},"amount":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false}},"required":["col","amount"],"additionalProperties":false},"managers":{"type":"object","properties":{"col":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"deploymentVsFactSales":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","deploymentVsFactSales","fact"],"additionalProperties":false},"amount":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false}},"required":["col","amount"],"additionalProperties":false}},"required":["crew","managers"],"additionalProperties":false}},"required":["nodeId","name","kind","sales","transactions","hours","nohHours","trainingHours","hoursCapacity","spmh","tplh","iplh","accuracy"],"additionalProperties":false},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string","enum":["company","node","store"]},"sales":{"type":"object","properties":{"forecast":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","fact"],"additionalProperties":false},"transactions":{"type":"object","properties":{"forecast":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","fact"],"additionalProperties":false},"hours":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false},"nohHours":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false},"trainingHours":{"type":"number"},"hoursCapacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"spmh":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false},"tplh":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false},"iplh":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false},"accuracy":{"type":"number"},"laborCost":{"type":"object","properties":{"crew":{"type":"object","properties":{"col":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"deploymentVsFactSales":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","deploymentVsFactSales","fact"],"additionalProperties":false},"amount":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false}},"required":["col","amount"],"additionalProperties":false},"managers":{"type":"object","properties":{"col":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"deploymentVsFactSales":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","deploymentVsFactSales","fact"],"additionalProperties":false},"amount":{"type":"object","properties":{"forecast":{"type":"number"},"deployment":{"type":"number"},"fact":{"type":"number"}},"required":["forecast","deployment","fact"],"additionalProperties":false}},"required":["col","amount"],"additionalProperties":false}},"required":["crew","managers"],"additionalProperties":false}},"required":["nodeId","name","kind","sales","transactions","hours","nohHours","trainingHours","hoursCapacity","spmh","tplh","iplh","accuracy"],"additionalProperties":false}}},"required":["from","to","factShifts","computedAt","laborCost","summary","items"],"additionalProperties":false},"GetManagersReportData":{"type":"object","properties":{"month":{"type":"string"},"factShifts":{"type":"string","enum":["approved","with_pending"]},"computedAt":{"type":"string","format":"date-time"},"laborCost":{"type":"boolean"},"summary":{"anyOf":[{"type":"object","properties":{"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string","enum":["company","node","store"]},"hours":{"type":"object","properties":{"scheduled":{"type":"number"},"norm":{"type":"number"},"fact":{"type":"number"}},"required":["scheduled","norm","fact"],"additionalProperties":false},"overNormHours":{"type":"number"},"underNormHours":{"type":"number"},"overHoursYearToDate":{"type":"number"},"sales":{"type":"object","properties":{"plan":{"type":"number"},"fact":{"type":"number"}},"required":["plan","fact"],"additionalProperties":false},"accuracy":{"type":"number"},"laborCost":{"type":"object","properties":{"col":{"type":"object","properties":{"scheduled":{"type":"number"},"norm":{"type":"number"},"normVsFactSales":{"type":"number"},"fact":{"type":"number"}},"required":["scheduled","norm","normVsFactSales","fact"],"additionalProperties":false}},"required":["col"],"additionalProperties":false}},"required":["nodeId","name","kind","hours","overNormHours","underNormHours","overHoursYearToDate","sales","accuracy"],"additionalProperties":false},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"type":"string","enum":["company","node","store"]},"hours":{"type":"object","properties":{"scheduled":{"type":"number"},"norm":{"type":"number"},"fact":{"type":"number"}},"required":["scheduled","norm","fact"],"additionalProperties":false},"overNormHours":{"type":"number"},"underNormHours":{"type":"number"},"overHoursYearToDate":{"type":"number"},"sales":{"type":"object","properties":{"plan":{"type":"number"},"fact":{"type":"number"}},"required":["plan","fact"],"additionalProperties":false},"accuracy":{"type":"number"},"laborCost":{"type":"object","properties":{"col":{"type":"object","properties":{"scheduled":{"type":"number"},"norm":{"type":"number"},"normVsFactSales":{"type":"number"},"fact":{"type":"number"}},"required":["scheduled","norm","normVsFactSales","fact"],"additionalProperties":false}},"required":["col"],"additionalProperties":false}},"required":["nodeId","name","kind","hours","overNormHours","underNormHours","overHoursYearToDate","sales","accuracy"],"additionalProperties":false}}},"required":["month","factShifts","computedAt","laborCost","summary","items"],"additionalProperties":false},"GetTimesheetApprovalStatusData":{"type":"object","properties":{"month":{"type":"string"},"summary":{"type":"object","properties":{"stores":{"type":"integer","minimum":0},"byHighestApprovedLevel":{"type":"object","properties":{"none":{"type":"integer","minimum":0},"level1":{"type":"integer","minimum":0},"level2":{"type":"integer","minimum":0},"level3":{"type":"integer","minimum":0}},"required":["none","level1","level2","level3"],"additionalProperties":false},"pendingEdits":{"type":"integer","minimum":0}},"required":["stores","byHighestApprovedLevel","pendingEdits"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"storeName":{"type":"string"},"highestApprovedLevel":{"anyOf":[{"anyOf":[{"const":1},{"const":2},{"const":3}]},{"type":"null"}]},"levels":{"type":"array","items":{"type":"object","properties":{"level":{"anyOf":[{"const":1},{"const":2},{"const":3}]},"approved":{"type":"boolean"},"changedOn":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"approvedThrough":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]}},"required":["level","approved","changedOn","approvedThrough"],"additionalProperties":false}},"pendingEdits":{"type":"integer","minimum":0}},"required":["storeId","storeName","highestApprovedLevel","levels","pendingEdits"],"additionalProperties":false}}},"required":["month","summary","items"],"additionalProperties":false},"GetTimesheetData":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"view":{"type":"string","enum":["summary","shifts"]},"people":{"description":"With `view=summary`.","type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"storeName":{"type":"string"},"employeeId":{"type":"string"},"name":{"type":"string"},"role":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"shifts":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"approved":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"rejected":{"type":"integer","minimum":0}},"required":["total","approved","pending","rejected"],"additionalProperties":false},"hours":{"description":"Hours of the APPROVED part, as the time sheet counts them: worked hours, of them at night, on holidays, on holiday nights; and the breaks deducted.","type":"object","properties":{"worked":{"type":"number"},"night":{"type":"number"},"holiday":{"type":"number"},"holidayNight":{"type":"number"},"breaks":{"type":"number"}},"required":["worked","night","holiday","holidayNight","breaks"],"additionalProperties":false}},"required":["storeId","storeName","employeeId","name","role","shifts","hours"],"additionalProperties":false}},"shifts":{"description":"With `view=shifts`.","type":"array","items":{"type":"object","properties":{"shiftId":{"type":"string"},"date":{"type":"string","format":"date"},"storeId":{"type":"string"},"storeName":{"type":"string"},"employeeId":{"type":"string"},"name":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"},"startsNextDay":{"type":"boolean"},"endsNextDay":{"type":"boolean"},"status":{"type":"string","enum":["approved","pending","rejected"]},"beforeHireDate":{"type":"boolean"},"hours":{"description":"Hours of the APPROVED part, as the time sheet counts them: worked hours, of them at night, on holidays, on holiday nights; and the breaks deducted.","type":"object","properties":{"worked":{"type":"number"},"night":{"type":"number"},"holiday":{"type":"number"},"holidayNight":{"type":"number"},"breaks":{"type":"number"}},"required":["worked","night","holiday","holidayNight","breaks"],"additionalProperties":false}},"required":["shiftId","date","storeId","storeName","employeeId","name","start","end","startsNextDay","endsNextDay","status","beforeHireDate","hours"],"additionalProperties":false}}},"required":["from","to","view"],"additionalProperties":false},"GetAbsencesData":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"summary":{"type":"object","properties":{"absences":{"type":"integer","minimum":0},"people":{"type":"integer","minimum":0}},"required":["absences","people"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"storeName":{"type":"string"},"employeeId":{"type":"string"},"name":{"type":"string"},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"kind":{"type":"string","enum":["vacation","absence"]}},"required":["storeId","storeName","employeeId","name","from","to","kind"],"additionalProperties":false}}},"required":["from","to","summary","items"],"additionalProperties":false},"ListActionItemsData":{"type":"object","properties":{"month":{"type":"string"},"asOf":{"type":"string","format":"date"},"summary":{"type":"object","properties":{"items":{"type":"integer","minimum":0}},"required":["items"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"storeId":{"type":"string"},"storeName":{"type":"string"},"employee":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"text":{"type":"string"},"textCut":{"type":"boolean"},"deadline":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"status":{"type":"string","enum":["planned","in_progress","done","cancelled"]},"overdue":{"type":"boolean"},"carriedOver":{"type":"boolean"},"closedMonth":{"pattern":"^(\\d{4})-(0[1-9]|1[0-2])$","anyOf":[{"type":"string"},{"type":"null"}]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","storeId","storeName","employee","text","textCut","deadline","status","overdue","carriedOver","closedMonth","assignee"],"additionalProperties":false}}},"required":["month","asOf","summary","items"],"additionalProperties":false},"GetSalesPlanningDatasetData":{"type":"object","properties":{"month":{"type":"string"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"calendar":{"type":"object","properties":{"days":{"type":"integer","minimum":0},"closedDays":{"type":"array","items":{"type":"string","format":"date"}},"holidays":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["date","name"],"additionalProperties":false}}},"required":["days","closedDays","holidays"],"additionalProperties":false},"stores":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"name":{"type":"string"},"path":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"concept":{"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}]},"openHours":{"type":"array","items":{"type":"object","properties":{"weekday":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},"start":{"type":"string"},"end":{"type":"string"},"endsNextDay":{"type":"boolean"}},"required":["weekday","start","end","endsNextDay"],"additionalProperties":false}},"lastSaleDate":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"weekdayMeanSales":{"type":"object","properties":{"monday":{"type":"number","minimum":0},"tuesday":{"type":"number","minimum":0},"wednesday":{"type":"number","minimum":0},"thursday":{"type":"number","minimum":0},"friday":{"type":"number","minimum":0},"saturday":{"type":"number","minimum":0},"sunday":{"type":"number","minimum":0}},"required":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"additionalProperties":false},"currentForecast":{"anyOf":[{"type":"object","properties":{"sales":{"type":"number","minimum":0},"transactions":{"type":"integer","minimum":0},"daysFilled":{"type":"integer","minimum":0}},"required":["sales","transactions","daysFilled"],"additionalProperties":false},{"type":"null"}]}},"required":["storeId","name","path","concept","location","openHours","lastSaleDate","weekdayMeanSales","currentForecast"],"additionalProperties":false}},"monthlySales":{"description":"Columns `storeId`, `month` (YYYY-MM), `sales`, `transactions`, `days` (days with sales).","type":"object","properties":{"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}}}},"required":["columns","rows"],"additionalProperties":false},"weeklySales":{"description":"Columns `storeId`, `weekStart` (a Monday), `sales`, `transactions`.","type":"object","properties":{"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}}}},"required":["columns","rows"],"additionalProperties":false}},"required":["month","currency","calendar","stores","monthlySales","weeklySales"],"additionalProperties":false},"ListSalesPlansData":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"planId":{"type":"string"},"title":{"type":"string"},"month":{"type":"string"},"status":{"type":"string","enum":["draft","ready","applied"]},"scope":{"description":"What the plan covers: the whole company, a structure node's stores, or one store.","anyOf":[{"type":"object","properties":{"kind":{"const":"network"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"node"},"nodeId":{"type":"string"}},"required":["kind","nodeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"store"},"storeId":{"type":"string"}},"required":["kind","storeId"],"additionalProperties":false}]},"storeCount":{"type":"integer","minimum":0},"storesWithFigures":{"type":"integer","minimum":0},"totalSales":{"type":"number","minimum":0},"totalTransactions":{"type":"number","minimum":0},"running":{"type":"boolean"},"mine":{"type":"boolean"},"version":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["planId","title","month","status","scope","storeCount","storesWithFigures","totalSales","totalTransactions","running","mine","version","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"GetSalesPlanData":{"type":"object","properties":{"planId":{"type":"string"},"title":{"type":"string"},"month":{"type":"string"},"status":{"type":"string","enum":["draft","ready","applied"]},"scope":{"description":"What the plan covers: the whole company, a structure node's stores, or one store.","anyOf":[{"type":"object","properties":{"kind":{"const":"network"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"node"},"nodeId":{"type":"string"}},"required":["kind","nodeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"store"},"storeId":{"type":"string"}},"required":["kind","storeId"],"additionalProperties":false}]},"version":{"type":"integer","minimum":0},"mine":{"type":"boolean"},"summary":{"type":"string"},"run":{"description":"The plan's model turn: `running` while one is in flight; else how the last one ended — `plan` (figures), `questions` (the model asks before it plans; `questions` lists them), `refusal` or `error`. Null when no model turn was ever made.","anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["running","plan","questions","refusal","error"]},"questions":{"type":"array","items":{"type":"string"}}},"required":["status","questions"],"additionalProperties":false},{"type":"null"}]},"stores":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"name":{"type":"string"},"monthSales":{"type":"number","minimum":0},"monthTransactions":{"type":"number","minimum":0},"confidence":{"type":"string","enum":["low","medium","high"]},"source":{"type":"string","enum":["model","manual","external"]},"rationale":{"type":"string"},"assumptions":{"type":"array","items":{"type":"string"}},"risks":{"type":"array","items":{"type":"string"}},"reference":{"type":"object","properties":{"lastMonth":{"anyOf":[{"type":"object","properties":{"sales":{"type":"number","minimum":0},"transactions":{"type":"number","minimum":0},"month":{"type":"string"}},"required":["sales","transactions","month"],"additionalProperties":false},{"type":"null"}]},"sameMonthLastYear":{"anyOf":[{"type":"object","properties":{"sales":{"type":"number","minimum":0},"transactions":{"type":"number","minimum":0}},"required":["sales","transactions"],"additionalProperties":false},{"type":"null"}]},"forecastWhenPlanned":{"anyOf":[{"type":"object","properties":{"sales":{"type":"number","minimum":0},"transactions":{"type":"number","minimum":0}},"required":["sales","transactions"],"additionalProperties":false},{"type":"null"}]}},"required":["lastMonth","sameMonthLastYear","forecastWhenPlanned"],"additionalProperties":false}},"required":["storeId","name","monthSales","monthTransactions","confidence","source","rationale","assumptions","risks","reference"],"additionalProperties":false}},"storesWithoutFigures":{"type":"array","items":{"type":"string"}},"daily":{"description":"Columns `storeId`, `date`, `sales`, `transactions`; null unless `include=daily`.","anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}}}},"required":["columns","rows"],"additionalProperties":false},{"type":"null"}]},"applied":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"stores":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"openDays":{"type":"integer","minimum":0},"lockedDays":{"type":"integer","minimum":0}},"required":["storeId","openDays","lockedDays"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"reason":{"type":"string","enum":["fully_locked","no_figures"]}},"required":["storeId","reason"],"additionalProperties":false}}},"required":["at","stores","skipped"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["planId","title","month","status","scope","version","mine","summary","run","stores","storesWithoutFigures","daily","applied","createdAt","updatedAt"],"additionalProperties":false},"CreateSalesPlanDraftData":{"type":"object","properties":{"planId":{"type":"string"},"title":{"type":"string"},"month":{"type":"string"},"status":{"type":"string","enum":["draft","ready","applied"]},"scope":{"description":"What the plan covers: the whole company, a structure node's stores, or one store.","anyOf":[{"type":"object","properties":{"kind":{"const":"network"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"node"},"nodeId":{"type":"string"}},"required":["kind","nodeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"store"},"storeId":{"type":"string"}},"required":["kind","storeId"],"additionalProperties":false}]},"version":{"type":"integer","minimum":0},"mine":{"type":"boolean"},"summary":{"type":"string"},"run":{"description":"The plan's model turn: `running` while one is in flight; else how the last one ended — `plan` (figures), `questions` (the model asks before it plans; `questions` lists them), `refusal` or `error`. Null when no model turn was ever made.","anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["running","plan","questions","refusal","error"]},"questions":{"type":"array","items":{"type":"string"}}},"required":["status","questions"],"additionalProperties":false},{"type":"null"}]},"stores":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"name":{"type":"string"},"monthSales":{"type":"number","minimum":0},"monthTransactions":{"type":"number","minimum":0},"confidence":{"type":"string","enum":["low","medium","high"]},"source":{"type":"string","enum":["model","manual","external"]},"rationale":{"type":"string"},"assumptions":{"type":"array","items":{"type":"string"}},"risks":{"type":"array","items":{"type":"string"}},"reference":{"type":"object","properties":{"lastMonth":{"anyOf":[{"type":"object","properties":{"sales":{"type":"number","minimum":0},"transactions":{"type":"number","minimum":0},"month":{"type":"string"}},"required":["sales","transactions","month"],"additionalProperties":false},{"type":"null"}]},"sameMonthLastYear":{"anyOf":[{"type":"object","properties":{"sales":{"type":"number","minimum":0},"transactions":{"type":"number","minimum":0}},"required":["sales","transactions"],"additionalProperties":false},{"type":"null"}]},"forecastWhenPlanned":{"anyOf":[{"type":"object","properties":{"sales":{"type":"number","minimum":0},"transactions":{"type":"number","minimum":0}},"required":["sales","transactions"],"additionalProperties":false},{"type":"null"}]}},"required":["lastMonth","sameMonthLastYear","forecastWhenPlanned"],"additionalProperties":false}},"required":["storeId","name","monthSales","monthTransactions","confidence","source","rationale","assumptions","risks","reference"],"additionalProperties":false}},"storesWithoutFigures":{"type":"array","items":{"type":"string"}},"daily":{"description":"Columns `storeId`, `date`, `sales`, `transactions`; null unless `include=daily`.","anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}}}},"required":["columns","rows"],"additionalProperties":false},{"type":"null"}]},"applied":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"stores":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"openDays":{"type":"integer","minimum":0},"lockedDays":{"type":"integer","minimum":0}},"required":["storeId","openDays","lockedDays"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"reason":{"type":"string","enum":["fully_locked","no_figures"]}},"required":["storeId","reason"],"additionalProperties":false}}},"required":["at","stores","skipped"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["planId","title","month","status","scope","version","mine","summary","run","stores","storesWithoutFigures","daily","applied","createdAt","updatedAt"],"additionalProperties":false},"CreateSalesPlanDraftInput":{"type":"object","properties":{"planId":{"description":"A plan to give new figures to (one the caller may edit). Absent: a new plan.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"version":{"description":"With `planId`: the plan's `version` the figures were made against.","type":"integer","minimum":0},"month":{"description":"A new plan's month, `YYYY-MM`: the current month or one of the next 12.","type":"string","format":"regex","pattern":"^(\\d{4})-(0[1-9]|1[0-2])$"},"scope":{"description":"What a new plan covers: `network` (every store of the reach, at most 60), a structure `node` (its stores), or one `store`.","anyOf":[{"type":"object","properties":{"kind":{"const":"network"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"node"},"nodeId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","nodeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"store"},"storeId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","storeId"],"additionalProperties":false}]},"title":{"description":"A new plan's title; a default names the store or node and the month.","type":"string","maxLength":120},"summary":{"description":"What the plan says as a whole, shown to the planner in the app.","type":"string","maxLength":2000},"stores":{"description":"The month's totals by store, each store of the plan at most once.","minItems":1,"maxItems":60,"type":"array","items":{"type":"object","properties":{"storeId":{"description":"A store of the plan.","type":"string","minLength":1,"maxLength":200},"monthSales":{"description":"The month's sales of the store, in whole currency units.","type":"number","minimum":0,"maximum":1000000000000000},"monthTransactions":{"description":"The month's number of receipts.","type":"number","minimum":0,"maximum":1000000000000000},"confidence":{"type":"string","description":"How sure the model is of the store's figures.","enum":["low","medium","high"]},"rationale":{"description":"Why these figures, in a few sentences.","type":"string","maxLength":1000},"assumptions":{"description":"What the figures take for granted, at most five short lines.","maxItems":5,"type":"array","items":{"type":"string","maxLength":200}},"risks":{"description":"What could make them wrong, at most five short lines.","maxItems":5,"type":"array","items":{"type":"string","maxLength":200}}},"required":["storeId","monthSales","monthTransactions","confidence"],"additionalProperties":false}}},"required":["stores"],"additionalProperties":false},"StartAiSalesPlanData":{"type":"object","properties":{"planId":{"type":"string"},"turn":{"type":"integer","minimum":1},"status":{"const":"running"},"estimatedCredits":{"description":"What the turn is expected to cost the company's AI credits; the charge settles when it ends.","type":"integer","minimum":0},"pollAfterSeconds":{"type":"integer","minimum":1}},"required":["planId","turn","status","estimatedCredits","pollAfterSeconds"],"additionalProperties":false},"StartAiSalesPlanInput":{"type":"object","properties":{"prompt":{"description":"What the planner's model is asked: goals, context, or a correction of the plan (`+10% in Tashkent`), or the answers to its questions.","type":"string","minLength":1,"maxLength":2000},"planId":{"description":"A plan to refine (one the caller may edit). Absent: a new plan.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"month":{"description":"A new plan's month, `YYYY-MM`: the current month or one of the next 12.","type":"string","format":"regex","pattern":"^(\\d{4})-(0[1-9]|1[0-2])$"},"scope":{"description":"What a new plan covers: `network` (every store of the reach, at most 60), a structure `node` (its stores), or one `store`.","anyOf":[{"type":"object","properties":{"kind":{"const":"network"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"node"},"nodeId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","nodeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"store"},"storeId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","storeId"],"additionalProperties":false}]},"title":{"description":"A new plan's title; a default names the store or node and the month.","type":"string","maxLength":120},"language":{"type":"string","description":"The language of the model's summary and reasons. Default: the company's.","enum":["ru","en","he","uz","es","pt","de","fr","ja","ar"]}},"required":["prompt"],"additionalProperties":false},"ApplySalesPlanData":{"type":"object","properties":{"planId":{"type":"string"},"title":{"type":"string"},"month":{"type":"string"},"status":{"type":"string","enum":["draft","ready","applied"]},"scope":{"description":"What the plan covers: the whole company, a structure node's stores, or one store.","anyOf":[{"type":"object","properties":{"kind":{"const":"network"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"node"},"nodeId":{"type":"string"}},"required":["kind","nodeId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"store"},"storeId":{"type":"string"}},"required":["kind","storeId"],"additionalProperties":false}]},"version":{"type":"integer","minimum":0},"mine":{"type":"boolean"},"summary":{"type":"string"},"run":{"description":"The plan's model turn: `running` while one is in flight; else how the last one ended — `plan` (figures), `questions` (the model asks before it plans; `questions` lists them), `refusal` or `error`. Null when no model turn was ever made.","anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["running","plan","questions","refusal","error"]},"questions":{"type":"array","items":{"type":"string"}}},"required":["status","questions"],"additionalProperties":false},{"type":"null"}]},"stores":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"name":{"type":"string"},"monthSales":{"type":"number","minimum":0},"monthTransactions":{"type":"number","minimum":0},"confidence":{"type":"string","enum":["low","medium","high"]},"source":{"type":"string","enum":["model","manual","external"]},"rationale":{"type":"string"},"assumptions":{"type":"array","items":{"type":"string"}},"risks":{"type":"array","items":{"type":"string"}},"reference":{"type":"object","properties":{"lastMonth":{"anyOf":[{"type":"object","properties":{"sales":{"type":"number","minimum":0},"transactions":{"type":"number","minimum":0},"month":{"type":"string"}},"required":["sales","transactions","month"],"additionalProperties":false},{"type":"null"}]},"sameMonthLastYear":{"anyOf":[{"type":"object","properties":{"sales":{"type":"number","minimum":0},"transactions":{"type":"number","minimum":0}},"required":["sales","transactions"],"additionalProperties":false},{"type":"null"}]},"forecastWhenPlanned":{"anyOf":[{"type":"object","properties":{"sales":{"type":"number","minimum":0},"transactions":{"type":"number","minimum":0}},"required":["sales","transactions"],"additionalProperties":false},{"type":"null"}]}},"required":["lastMonth","sameMonthLastYear","forecastWhenPlanned"],"additionalProperties":false}},"required":["storeId","name","monthSales","monthTransactions","confidence","source","rationale","assumptions","risks","reference"],"additionalProperties":false}},"storesWithoutFigures":{"type":"array","items":{"type":"string"}},"daily":{"description":"Columns `storeId`, `date`, `sales`, `transactions`; null unless `include=daily`.","anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}}}},"required":["columns","rows"],"additionalProperties":false},{"type":"null"}]},"applied":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"stores":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"openDays":{"type":"integer","minimum":0},"lockedDays":{"type":"integer","minimum":0}},"required":["storeId","openDays","lockedDays"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"storeId":{"type":"string"},"reason":{"type":"string","enum":["fully_locked","no_figures"]}},"required":["storeId","reason"],"additionalProperties":false}}},"required":["at","stores","skipped"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["planId","title","month","status","scope","version","mine","summary","run","stores","storesWithoutFigures","daily","applied","createdAt","updatedAt"],"additionalProperties":false},"ApplySalesPlanInput":{"type":"object","properties":{"version":{"description":"The plan's `version` the caller reviewed: a plan changed since is not written (409 VERSION_CONFLICT).","type":"integer","minimum":0},"storeIds":{"description":"Writes only these stores of the plan. Absent: every store with figures.","minItems":1,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"additionalProperties":false,"required":["version"]},"EstimateRequiredHoursData":{"type":"object","properties":{"storeId":{"type":"string"},"storeName":{"type":"string"},"positions":{"type":"array","items":{"type":"object","properties":{"positionId":{"type":"string"},"name":{"type":"string"},"measure":{"type":"string","enum":["sales","transactions","menu_items"]},"weekly":{"type":"boolean"}},"required":["positionId","name","measure","weekly"],"additionalProperties":false}},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"weekday":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},"open":{"anyOf":[{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"startsNextDay":{"type":"boolean"},"endsNextDay":{"type":"boolean"}},"required":["start","end","startsNextDay","endsNextDay"],"additionalProperties":false},{"type":"null"}]},"closed":{"anyOf":[{"type":"string","enum":["store","company"]},{"type":"null"}]},"profile":{"anyOf":[{"type":"string","enum":["sales_history","even"]},{"type":"null"}]},"estimate":{"type":"object","properties":{"sales":{"type":"number"},"transactions":{"type":"number"},"menuItems":{"anyOf":[{"type":"number"},{"type":"null"}]},"hours":{"type":"number"}},"required":["sales","transactions","menuItems","hours"],"additionalProperties":false},"saved":{"type":"object","properties":{"sales":{"type":"number"},"transactions":{"type":"number"},"menuItems":{"anyOf":[{"type":"number"},{"type":"null"}]},"hours":{"type":"number"}},"required":["sales","transactions","menuItems","hours"],"additionalProperties":false},"positions":{"type":"array","items":{"type":"object","properties":{"positionId":{"type":"string"},"hours":{"type":"number"},"savedHours":{"type":"number"}},"required":["positionId","hours","savedHours"],"additionalProperties":false}}},"required":["date","weekday","open","closed","profile","estimate","saved","positions"],"additionalProperties":false}},"totals":{"type":"object","properties":{"estimate":{"type":"object","properties":{"sales":{"type":"number"},"transactions":{"type":"number"},"hours":{"type":"number"}},"required":["sales","transactions","hours"],"additionalProperties":false},"saved":{"type":"object","properties":{"sales":{"type":"number"},"transactions":{"type":"number"},"hours":{"type":"number"}},"required":["sales","transactions","hours"],"additionalProperties":false}},"required":["estimate","saved"],"additionalProperties":false}},"required":["storeId","storeName","positions","days","totals"],"additionalProperties":false},"EstimateRequiredHoursInput":{"type":"object","properties":{"storeId":{"description":"The store (`search_directory` finds its id by name).","type":"string","minLength":1,"maxLength":200},"days":{"description":"1 to 31 days, each at most once, none more than 30 days from another.","minItems":1,"maxItems":31,"type":"array","items":{"type":"object","properties":{"date":{"description":"The day (YYYY-MM-DD).","type":"string","format":"date"},"sales":{"description":"The day's sales to staff for, in the company's currency.","type":"number","minimum":0,"maximum":1000000000000000},"transactions":{"description":"The day's number of receipts to staff for.","type":"number","minimum":0,"maximum":1000000000000000},"menuItems":{"description":"The day's menu items sold, for positions measured by them. Absent: such a position stays on its lowest step, as with a forecast without them.","type":"number","minimum":0,"maximum":1000000000000000}},"required":["date","sales","transactions"],"additionalProperties":false}}},"required":["storeId","days"],"additionalProperties":false},"ListWebhookEndpointsData":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"url":{"type":"string"},"description":{"type":"string"},"eventTypes":{"type":"array","items":{"type":"string","enum":["schedule.week.submitted","schedule.week.approved","schedule.week.returned","schedule.month.submitted","schedule.month.approved","schedule.month.returned","timesheet.month.approved","sales_plan.ready","sales_plan.applied","forecast.updated","ai_credits.low"]}},"enabled":{"description":"Off: the endpoint is sent nothing, and what waits for it waits. An endpoint whose receiver took no message for five days switches itself off (`disabledReason`).","type":"boolean"},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"administrators"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"service_key"},"keyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","keyId","keyName"],"additionalProperties":false}]},"secret":{"type":"object","properties":{"createdAt":{"description":"When the current signing secret was made.","type":"string","format":"date-time"},"previousExpiresAt":{"description":"Until when the secret before the last rotation still signs; null when there is none.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["createdAt","previousExpiresAt"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lastSucceededAt":{"description":"The last attempt the receiver answered with a 2xx.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastFailedAt":{"description":"The last attempt that failed.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failingSince":{"description":"The first failed attempt since the last success; null while the receiver takes messages. Five days of it switch the endpoint off.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"disabledReason":{"description":"Why the endpoint is off when it switched itself off: `failing` — five days without a single message taken; what still waited was marked failed. Null when it is on or was switched off by hand. Switching it on (`enabled: true`) clears it; `POST …/deliveries/retry` sends again what failed.","anyOf":[{"type":"string","enum":["failing"]},{"type":"null"}]},"disabledAt":{"description":"When it switched itself off; null otherwise.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","url","description","eventTypes","enabled","owner","secret","createdAt","updatedAt","lastSucceededAt","lastFailedAt","failingSince","disabledReason","disabledAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"GetWebhookEndpointData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"url":{"type":"string"},"description":{"type":"string"},"eventTypes":{"type":"array","items":{"type":"string","enum":["schedule.week.submitted","schedule.week.approved","schedule.week.returned","schedule.month.submitted","schedule.month.approved","schedule.month.returned","timesheet.month.approved","sales_plan.ready","sales_plan.applied","forecast.updated","ai_credits.low"]}},"enabled":{"description":"Off: the endpoint is sent nothing, and what waits for it waits. An endpoint whose receiver took no message for five days switches itself off (`disabledReason`).","type":"boolean"},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"administrators"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"service_key"},"keyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","keyId","keyName"],"additionalProperties":false}]},"secret":{"type":"object","properties":{"createdAt":{"description":"When the current signing secret was made.","type":"string","format":"date-time"},"previousExpiresAt":{"description":"Until when the secret before the last rotation still signs; null when there is none.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["createdAt","previousExpiresAt"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lastSucceededAt":{"description":"The last attempt the receiver answered with a 2xx.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastFailedAt":{"description":"The last attempt that failed.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failingSince":{"description":"The first failed attempt since the last success; null while the receiver takes messages. Five days of it switch the endpoint off.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"disabledReason":{"description":"Why the endpoint is off when it switched itself off: `failing` — five days without a single message taken; what still waited was marked failed. Null when it is on or was switched off by hand. Switching it on (`enabled: true`) clears it; `POST …/deliveries/retry` sends again what failed.","anyOf":[{"type":"string","enum":["failing"]},{"type":"null"}]},"disabledAt":{"description":"When it switched itself off; null otherwise.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","url","description","eventTypes","enabled","owner","secret","createdAt","updatedAt","lastSucceededAt","lastFailedAt","failingSince","disabledReason","disabledAt"],"additionalProperties":false},"CreateWebhookEndpointData":{"type":"object","properties":{"endpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"url":{"type":"string"},"description":{"type":"string"},"eventTypes":{"type":"array","items":{"type":"string","enum":["schedule.week.submitted","schedule.week.approved","schedule.week.returned","schedule.month.submitted","schedule.month.approved","schedule.month.returned","timesheet.month.approved","sales_plan.ready","sales_plan.applied","forecast.updated","ai_credits.low"]}},"enabled":{"description":"Off: the endpoint is sent nothing, and what waits for it waits. An endpoint whose receiver took no message for five days switches itself off (`disabledReason`).","type":"boolean"},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"administrators"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"service_key"},"keyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","keyId","keyName"],"additionalProperties":false}]},"secret":{"type":"object","properties":{"createdAt":{"description":"When the current signing secret was made.","type":"string","format":"date-time"},"previousExpiresAt":{"description":"Until when the secret before the last rotation still signs; null when there is none.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["createdAt","previousExpiresAt"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lastSucceededAt":{"description":"The last attempt the receiver answered with a 2xx.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastFailedAt":{"description":"The last attempt that failed.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failingSince":{"description":"The first failed attempt since the last success; null while the receiver takes messages. Five days of it switch the endpoint off.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"disabledReason":{"description":"Why the endpoint is off when it switched itself off: `failing` — five days without a single message taken; what still waited was marked failed. Null when it is on or was switched off by hand. Switching it on (`enabled: true`) clears it; `POST …/deliveries/retry` sends again what failed.","anyOf":[{"type":"string","enum":["failing"]},{"type":"null"}]},"disabledAt":{"description":"When it switched itself off; null otherwise.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","url","description","eventTypes","enabled","owner","secret","createdAt","updatedAt","lastSucceededAt","lastFailedAt","failingSince","disabledReason","disabledAt"],"additionalProperties":false},"secret":{"description":"The signing secret, `whsec_…` — shown here once and never again; null in an answer replayed under the same Idempotency-Key (rotate the secret if the first answer was lost).","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["endpoint","secret"],"additionalProperties":false},"CreateWebhookEndpointInput":{"type":"object","properties":{"url":{"description":"Where the events are POSTed: https, no user name or password, no #fragment, port 443 or 1024 and above, at most 2048 characters, and the name must resolve to public addresses only — a private network, loopback, link-local and other special addresses are refused (422 WEBHOOK_URL_NOT_ALLOWED). Redirects are never followed.","type":"string","minLength":1,"maxLength":2048},"description":{"description":"A note for people: what receives it.","type":"string","maxLength":200},"eventTypes":{"description":"What the endpoint is told about: the crew week (`schedule.week.submitted`, `.approved`, `.returned`) and the managers' month (`schedule.month.submitted`, `.approved`, `.returned`) — `schedules:read`; a time sheet signed at a level (`timesheet.month.approved`) — `timesheets:read`; a sales plan with figures (`sales_plan.ready`) or written into the forecast (`sales_plan.applied`) — `sales_plans:read` and the company's «Планирование продаж»; a store's revenue forecast changed (`forecast.updated`, once per store and month for five minutes of edits) — `analytics:read`; the AI credits running low (`ai_credits.low`) — `org:read`. A key's endpoint is told only what the key could read itself: the scope, and the reach — an event of a store only for a store of the key's reach, a sales plan only when all its stores are, the AI credits only to a key that reaches the whole company.","minItems":1,"maxItems":11,"type":"array","items":{"type":"string","enum":["schedule.week.submitted","schedule.week.approved","schedule.week.returned","schedule.month.submitted","schedule.month.approved","schedule.month.returned","timesheet.month.approved","sales_plan.ready","sales_plan.applied","forecast.updated","ai_credits.low"]}}},"required":["url","eventTypes"],"additionalProperties":false},"UpdateWebhookEndpointData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"url":{"type":"string"},"description":{"type":"string"},"eventTypes":{"type":"array","items":{"type":"string","enum":["schedule.week.submitted","schedule.week.approved","schedule.week.returned","schedule.month.submitted","schedule.month.approved","schedule.month.returned","timesheet.month.approved","sales_plan.ready","sales_plan.applied","forecast.updated","ai_credits.low"]}},"enabled":{"description":"Off: the endpoint is sent nothing, and what waits for it waits. An endpoint whose receiver took no message for five days switches itself off (`disabledReason`).","type":"boolean"},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"administrators"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"service_key"},"keyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","keyId","keyName"],"additionalProperties":false}]},"secret":{"type":"object","properties":{"createdAt":{"description":"When the current signing secret was made.","type":"string","format":"date-time"},"previousExpiresAt":{"description":"Until when the secret before the last rotation still signs; null when there is none.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["createdAt","previousExpiresAt"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lastSucceededAt":{"description":"The last attempt the receiver answered with a 2xx.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastFailedAt":{"description":"The last attempt that failed.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failingSince":{"description":"The first failed attempt since the last success; null while the receiver takes messages. Five days of it switch the endpoint off.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"disabledReason":{"description":"Why the endpoint is off when it switched itself off: `failing` — five days without a single message taken; what still waited was marked failed. Null when it is on or was switched off by hand. Switching it on (`enabled: true`) clears it; `POST …/deliveries/retry` sends again what failed.","anyOf":[{"type":"string","enum":["failing"]},{"type":"null"}]},"disabledAt":{"description":"When it switched itself off; null otherwise.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","url","description","eventTypes","enabled","owner","secret","createdAt","updatedAt","lastSucceededAt","lastFailedAt","failingSince","disabledReason","disabledAt"],"additionalProperties":false},"UpdateWebhookEndpointInput":{"type":"object","properties":{"url":{"description":"Where the events are POSTed: https, no user name or password, no #fragment, port 443 or 1024 and above, at most 2048 characters, and the name must resolve to public addresses only — a private network, loopback, link-local and other special addresses are refused (422 WEBHOOK_URL_NOT_ALLOWED). Redirects are never followed.","type":"string","minLength":1,"maxLength":2048},"description":{"description":"A note for people: what receives it.","type":"string","maxLength":200},"eventTypes":{"description":"What the endpoint is told about: the crew week (`schedule.week.submitted`, `.approved`, `.returned`) and the managers' month (`schedule.month.submitted`, `.approved`, `.returned`) — `schedules:read`; a time sheet signed at a level (`timesheet.month.approved`) — `timesheets:read`; a sales plan with figures (`sales_plan.ready`) or written into the forecast (`sales_plan.applied`) — `sales_plans:read` and the company's «Планирование продаж»; a store's revenue forecast changed (`forecast.updated`, once per store and month for five minutes of edits) — `analytics:read`; the AI credits running low (`ai_credits.low`) — `org:read`. A key's endpoint is told only what the key could read itself: the scope, and the reach — an event of a store only for a store of the key's reach, a sales plan only when all its stores are, the AI credits only to a key that reaches the whole company.","minItems":1,"maxItems":11,"type":"array","items":{"type":"string","enum":["schedule.week.submitted","schedule.week.approved","schedule.week.returned","schedule.month.submitted","schedule.month.approved","schedule.month.returned","timesheet.month.approved","sales_plan.ready","sales_plan.applied","forecast.updated","ai_credits.low"]}},"enabled":{"description":"Off: nothing is sent, and what waits for it waits; on again, it goes on.","type":"boolean"}},"additionalProperties":false},"DeleteWebhookEndpointData":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"deleted":{"const":true}},"required":["id","deleted"],"additionalProperties":false},"RotateWebhookSecretData":{"type":"object","properties":{"endpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"url":{"type":"string"},"description":{"type":"string"},"eventTypes":{"type":"array","items":{"type":"string","enum":["schedule.week.submitted","schedule.week.approved","schedule.week.returned","schedule.month.submitted","schedule.month.approved","schedule.month.returned","timesheet.month.approved","sales_plan.ready","sales_plan.applied","forecast.updated","ai_credits.low"]}},"enabled":{"description":"Off: the endpoint is sent nothing, and what waits for it waits. An endpoint whose receiver took no message for five days switches itself off (`disabledReason`).","type":"boolean"},"owner":{"anyOf":[{"type":"object","properties":{"kind":{"const":"administrators"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"service_key"},"keyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["kind","keyId","keyName"],"additionalProperties":false}]},"secret":{"type":"object","properties":{"createdAt":{"description":"When the current signing secret was made.","type":"string","format":"date-time"},"previousExpiresAt":{"description":"Until when the secret before the last rotation still signs; null when there is none.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["createdAt","previousExpiresAt"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lastSucceededAt":{"description":"The last attempt the receiver answered with a 2xx.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastFailedAt":{"description":"The last attempt that failed.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failingSince":{"description":"The first failed attempt since the last success; null while the receiver takes messages. Five days of it switch the endpoint off.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"disabledReason":{"description":"Why the endpoint is off when it switched itself off: `failing` — five days without a single message taken; what still waited was marked failed. Null when it is on or was switched off by hand. Switching it on (`enabled: true`) clears it; `POST …/deliveries/retry` sends again what failed.","anyOf":[{"type":"string","enum":["failing"]},{"type":"null"}]},"disabledAt":{"description":"When it switched itself off; null otherwise.","anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","url","description","eventTypes","enabled","owner","secret","createdAt","updatedAt","lastSucceededAt","lastFailedAt","failingSince","disabledReason","disabledAt"],"additionalProperties":false},"secret":{"description":"The signing secret, `whsec_…` — shown here once and never again; null in an answer replayed under the same Idempotency-Key (rotate the secret if the first answer was lost).","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["endpoint","secret"],"additionalProperties":false},"RotateWebhookSecretInput":{"type":"object","properties":{"overlapHours":{"description":"How long the secret it replaces still signs too, in hours. Default 24.","type":"integer","minimum":1,"maximum":168}},"additionalProperties":false},"SendWebhookTestData":{"type":"object","properties":{"queued":{"const":true}},"required":["queued"],"additionalProperties":false},"SendWebhookTestInput":{"type":"object","properties":{},"additionalProperties":false},"ListWebhookDeliveriesData":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"description":"The `webhook-id` every attempt of it carried: the receiver drops a repeat by it.","type":"string"},"eventType":{"type":"string","enum":["schedule.week.submitted","schedule.week.approved","schedule.week.returned","schedule.month.submitted","schedule.month.approved","schedule.month.returned","timesheet.month.approved","sales_plan.ready","sales_plan.applied","forecast.updated","ai_credits.low","webhook.test"]},"createdAt":{"type":"string","format":"date-time"},"status":{"type":"string","description":"`pending` (waits for its next attempt), `sending`, `succeeded` (answered 2xx), `failed` (out of attempts, or not allowed).","enum":["pending","sending","succeeded","failed"]},"attempts":{"type":"integer","minimum":0},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"finishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"recentAttempts":{"description":"The last ten attempts, newest first. The receiver's answer body is never kept.","type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"durationMs":{"type":"integer","minimum":0},"httpStatus":{"description":"The receiver's status code; null when no answer came.","anyOf":[{"type":"integer"},{"type":"null"}]},"error":{"description":"Null for a success. `timeout` (no connection in 3 s or no answer in 5 s), `dns`, `blocked_address` (the name resolved to an address that is not public), `tls`, `connection`, `redirect` (a 3xx is not followed), `http_4xx`, `http_5xx`, `not_allowed` (the endpoint may not be told any more: the company's access or the key's scope or reach is gone — no further attempts).","anyOf":[{"type":"string","enum":["timeout","dns","blocked_address","tls","connection","redirect","http_4xx","http_5xx","not_allowed"]},{"type":"null"}]}},"required":["at","durationMs","httpStatus","error"],"additionalProperties":false}}},"required":["id","eventType","createdAt","status","attempts","nextAttemptAt","finishedAt","recentAttempts"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"RetryWebhookDeliveryData":{"type":"object","properties":{"requeued":{"description":"False while an attempt of it is in flight this moment: it goes on by itself.","type":"boolean"}},"required":["requeued"],"additionalProperties":false},"RetryWebhookDeliveryInput":{"type":"object","properties":{},"additionalProperties":false},"RetryWebhookDeliveriesData":{"type":"object","properties":{"requeued":{"type":"integer","minimum":0}},"required":["requeued"],"additionalProperties":false},"RetryWebhookDeliveriesInput":{"type":"object","properties":{"since":{"description":"Every delivery of the endpoint that failed and was made at or after this moment is tried again.","type":"string","format":"date-time"}},"additionalProperties":false,"required":["since"]},"ScheduleWeekSubmittedEvent":{"type":"object","properties":{"type":{"const":"schedule.week.submitted"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"storeId":{"description":"The store, as the API's operations name it.","type":"string"},"weekStart":{"description":"The first day of the company's week, by its first weekday.","type":"string","format":"date"},"year":{"description":"How the schedule rows key the week; informational.","type":"integer"},"week":{"description":"How the schedule rows key the week; informational.","type":"integer"},"changeOrder":{"description":"The change's place in the schedule's status history: tells two changes of one week apart and orders them.","type":"integer","minimum":0}},"required":["storeId","weekStart","year","week","changeOrder"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"ScheduleWeekApprovedEvent":{"type":"object","properties":{"type":{"const":"schedule.week.approved"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"storeId":{"description":"The store, as the API's operations name it.","type":"string"},"weekStart":{"description":"The first day of the company's week, by its first weekday.","type":"string","format":"date"},"year":{"description":"How the schedule rows key the week; informational.","type":"integer"},"week":{"description":"How the schedule rows key the week; informational.","type":"integer"},"changeOrder":{"description":"The change's place in the schedule's status history: tells two changes of one week apart and orders them.","type":"integer","minimum":0}},"required":["storeId","weekStart","year","week","changeOrder"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"ScheduleWeekReturnedEvent":{"type":"object","properties":{"type":{"const":"schedule.week.returned"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"storeId":{"description":"The store, as the API's operations name it.","type":"string"},"weekStart":{"description":"The first day of the company's week, by its first weekday.","type":"string","format":"date"},"year":{"description":"How the schedule rows key the week; informational.","type":"integer"},"week":{"description":"How the schedule rows key the week; informational.","type":"integer"},"changeOrder":{"description":"The change's place in the schedule's status history: tells two changes of one week apart and orders them.","type":"integer","minimum":0}},"required":["storeId","weekStart","year","week","changeOrder"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"ScheduleMonthSubmittedEvent":{"type":"object","properties":{"type":{"const":"schedule.month.submitted"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"storeId":{"description":"The store, as the API's operations name it.","type":"string"},"month":{"description":"The month, YYYY-MM.","type":"string","format":"regex","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"changeOrder":{"description":"The change's place in the schedule's status history: tells two changes of one month apart and orders them.","type":"integer","minimum":0}},"required":["storeId","month","changeOrder"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"ScheduleMonthApprovedEvent":{"type":"object","properties":{"type":{"const":"schedule.month.approved"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"storeId":{"description":"The store, as the API's operations name it.","type":"string"},"month":{"description":"The month, YYYY-MM.","type":"string","format":"regex","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"changeOrder":{"description":"The change's place in the schedule's status history: tells two changes of one month apart and orders them.","type":"integer","minimum":0}},"required":["storeId","month","changeOrder"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"ScheduleMonthReturnedEvent":{"type":"object","properties":{"type":{"const":"schedule.month.returned"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"storeId":{"description":"The store, as the API's operations name it.","type":"string"},"month":{"description":"The month, YYYY-MM.","type":"string","format":"regex","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"changeOrder":{"description":"The change's place in the schedule's status history: tells two changes of one month apart and orders them.","type":"integer","minimum":0}},"required":["storeId","month","changeOrder"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"TimesheetMonthApprovedEvent":{"type":"object","properties":{"type":{"const":"timesheet.month.approved"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"storeId":{"description":"The store, as the API's operations name it.","type":"string"},"month":{"description":"The month, YYYY-MM.","type":"string","format":"regex","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"level":{"description":"The rung that signed.","anyOf":[{"const":1},{"const":2},{"const":3}]},"approvedThrough":{"description":"The last day of the month the signature covers.","type":"string","format":"date"},"final":{"description":"No role of the company approves time sheets above this rung.","type":"boolean"}},"required":["storeId","month","level","approvedThrough","final"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"SalesPlanReadyEvent":{"type":"object","properties":{"type":{"const":"sales_plan.ready"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"planId":{"description":"The plan, as get_sales_plan names it.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"month":{"description":"The month the plan is for, YYYY-MM.","type":"string","format":"regex","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"version":{"description":"The plan's version after the change — the token a write sends back.","type":"integer","minimum":0},"storeIds":{"description":"The stores the plan covers; an endpoint hears of a plan only when all of them are in its reach.","type":"array","items":{"type":"string"}},"source":{"type":"string","description":"Who made the figures: our planner, or a client's model through the API.","enum":["model","external"]}},"required":["planId","month","version","storeIds","source"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"SalesPlanAppliedEvent":{"type":"object","properties":{"type":{"const":"sales_plan.applied"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"planId":{"description":"The plan, as get_sales_plan names it.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"month":{"description":"The month the plan is for, YYYY-MM.","type":"string","format":"regex","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"version":{"description":"The plan's version after the change — the token a write sends back.","type":"integer","minimum":0},"storeIds":{"description":"The stores the plan covers; an endpoint hears of a plan only when all of them are in its reach.","type":"array","items":{"type":"string"}}},"required":["planId","month","version","storeIds"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"ForecastUpdatedEvent":{"type":"object","properties":{"type":{"const":"forecast.updated"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"storeId":{"description":"The store, as the API's operations name it.","type":"string"},"month":{"description":"The month, YYYY-MM.","type":"string","format":"regex","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},"required":["storeId","month"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"AiCreditsLowEvent":{"type":"object","properties":{"type":{"const":"ai_credits.low"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"reason":{"type":"string","enum":["low_balance","shortfall"]},"feature":{"description":"With `shortfall`: the AI feature that skipped its work; otherwise null.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["reason","feature"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false},"WebhookTestEvent":{"type":"object","properties":{"type":{"const":"webhook.test"},"timestamp":{"description":"When the change happened.","type":"string","format":"date-time"},"data":{"type":"object","properties":{"endpointId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"}},"required":["endpointId"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false}},"responses":{"Problem400":{"description":"`INVALID_REQUEST` — Invalid request; `MALFORMED_JSON` — Malformed JSON; `INVALID_CURSOR` — Invalid cursor; `CREDENTIAL_IN_QUERY` — Credential in the query string","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"INVALID_REQUEST":{"summary":"Invalid request","value":{"type":"https://proschedule.com/problems/invalid-request","title":"Invalid request","status":400,"detail":"The request has an unknown or malformed parameter or field.","code":"INVALID_REQUEST","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"MALFORMED_JSON":{"summary":"Malformed JSON","value":{"type":"https://proschedule.com/problems/malformed-json","title":"Malformed JSON","status":400,"detail":"The request body is not valid JSON.","code":"MALFORMED_JSON","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"INVALID_CURSOR":{"summary":"Invalid cursor","value":{"type":"https://proschedule.com/problems/invalid-cursor","title":"Invalid cursor","status":400,"detail":"The cursor is malformed or belongs to another query. Start again without a cursor.","code":"INVALID_CURSOR","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"CREDENTIAL_IN_QUERY":{"summary":"Credential in the query string","value":{"type":"https://proschedule.com/problems/credential-in-query","title":"Credential in the query string","status":400,"detail":"API keys are not accepted in the query string. Send the key in the Authorization header as a Bearer token, or in X-API-Key, and treat a key that was sent in a URL as exposed.","code":"CREDENTIAL_IN_QUERY","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem401":{"description":"`UNAUTHENTICATED` — Authentication required; `INVALID_CREDENTIAL` — Invalid credential; `CREDENTIAL_EXPIRED` — Credential expired; `CREDENTIAL_REVOKED` — Credential revoked","headers":{"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"UNAUTHENTICATED":{"summary":"Authentication required","value":{"type":"https://proschedule.com/problems/unauthenticated","title":"Authentication required","status":401,"detail":"Send an API key in the Authorization header as a Bearer token, or in X-API-Key.","code":"UNAUTHENTICATED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"INVALID_CREDENTIAL":{"summary":"Invalid credential","value":{"type":"https://proschedule.com/problems/invalid-credential","title":"Invalid credential","status":401,"detail":"The credential is not valid.","code":"INVALID_CREDENTIAL","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"CREDENTIAL_EXPIRED":{"summary":"Credential expired","value":{"type":"https://proschedule.com/problems/credential-expired","title":"Credential expired","status":401,"detail":"The API key has expired. Rotate it or issue a new one.","code":"CREDENTIAL_EXPIRED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"CREDENTIAL_REVOKED":{"summary":"Credential revoked","value":{"type":"https://proschedule.com/problems/credential-revoked","title":"Credential revoked","status":401,"detail":"The API key has been revoked.","code":"CREDENTIAL_REVOKED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem402":{"description":"`AI_TURN_NOT_COVERED` — AI credits do not cover the turn","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"AI_TURN_NOT_COVERED":{"summary":"AI credits do not cover the turn","value":{"type":"https://proschedule.com/problems/ai-turn-not-covered","title":"AI credits do not cover the turn","status":402,"detail":"The company's AI credits do not cover this model turn: the balance, the monthly limit of AI sales planning or the person's own limit. An administrator of the company manages them in ProSchedule.","code":"AI_TURN_NOT_COVERED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem403":{"description":"`API_ACCESS_DISABLED` — API access is switched off; `API_CONSENT_REQUIRED` — Data consent required; `PRINCIPAL_INACTIVE` — Key owner is not active; `ROLE_PERMISSION_REQUIRED` — Role permission required; `INSUFFICIENT_SCOPE` — Insufficient scope; `DATA_CATEGORY_DISABLED` — Data category is not open; `APP_NOT_ALLOWED` — Application not allowed; `AI_PLANNING_UNAVAILABLE` — AI sales planning unavailable; `IP_NOT_ALLOWED` — Address not allowed; `READ_ONLY_ACCOUNT` — Read-only account; `FORBIDDEN` — Forbidden","headers":{"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"API_ACCESS_DISABLED":{"summary":"API access is switched off","value":{"type":"https://proschedule.com/problems/api-access-disabled","title":"API access is switched off","status":403,"detail":"An administrator of the company has not switched external API access on.","code":"API_ACCESS_DISABLED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"API_CONSENT_REQUIRED":{"summary":"Data consent required","value":{"type":"https://proschedule.com/problems/api-consent-required","title":"Data consent required","status":403,"detail":"An administrator of the company has to accept the current data consent before the API can be used.","code":"API_CONSENT_REQUIRED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"PRINCIPAL_INACTIVE":{"summary":"Key owner is not active","value":{"type":"https://proschedule.com/problems/principal-inactive","title":"Key owner is not active","status":403,"detail":"The person this key acts as is no longer active in the company.","code":"PRINCIPAL_INACTIVE","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"ROLE_PERMISSION_REQUIRED":{"summary":"Role permission required","value":{"type":"https://proschedule.com/problems/role-permission-required","title":"Role permission required","status":403,"detail":"The role of the person this key acts as does not allow API access.","code":"ROLE_PERMISSION_REQUIRED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"INSUFFICIENT_SCOPE":{"summary":"Insufficient scope","value":{"type":"https://proschedule.com/problems/insufficient-scope","title":"Insufficient scope","status":403,"detail":"The credential lacks a scope this operation requires.","code":"INSUFFICIENT_SCOPE","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"DATA_CATEGORY_DISABLED":{"summary":"Data category is not open","value":{"type":"https://proschedule.com/problems/data-category-disabled","title":"Data category is not open","status":403,"detail":"The company has not opened this category of data to the API.","code":"DATA_CATEGORY_DISABLED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"APP_NOT_ALLOWED":{"summary":"Application not allowed","value":{"type":"https://proschedule.com/problems/app-not-allowed","title":"Application not allowed","status":403,"detail":"The company does not allow this application to connect. A company administrator can allow it in the API settings.","code":"APP_NOT_ALLOWED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"AI_PLANNING_UNAVAILABLE":{"summary":"AI sales planning unavailable","value":{"type":"https://proschedule.com/problems/ai-planning-unavailable","title":"AI sales planning unavailable","status":403,"detail":"AI sales planning is not available to this person: this server does not run it, the company has not switched it on with its consent, or the person's role does not have it.","code":"AI_PLANNING_UNAVAILABLE","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"IP_NOT_ALLOWED":{"summary":"Address not allowed","value":{"type":"https://proschedule.com/problems/ip-not-allowed","title":"Address not allowed","status":403,"detail":"This key cannot be used from the caller's address.","code":"IP_NOT_ALLOWED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"READ_ONLY_ACCOUNT":{"summary":"Read-only account","value":{"type":"https://proschedule.com/problems/read-only-account","title":"Read-only account","status":403,"detail":"The account this key acts as has read-only access and cannot make this change.","code":"READ_ONLY_ACCOUNT","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"FORBIDDEN":{"summary":"Forbidden","value":{"type":"https://proschedule.com/problems/forbidden","title":"Forbidden","status":403,"detail":"The credential is not allowed to do this.","code":"FORBIDDEN","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem404":{"description":"`NOT_FOUND` — Not found; `STORE_NOT_FOUND` — Store not found; `NODE_NOT_FOUND` — Structure node not found; `SALES_PLAN_NOT_FOUND` — Sales plan not found; `WEBHOOK_ENDPOINT_NOT_FOUND` — Webhook endpoint not found; `WEBHOOK_DELIVERY_NOT_FOUND` — Webhook delivery not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"NOT_FOUND":{"summary":"Not found","value":{"type":"https://proschedule.com/problems/not-found","title":"Not found","status":404,"detail":"The requested resource does not exist.","code":"NOT_FOUND","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"STORE_NOT_FOUND":{"summary":"Store not found","value":{"type":"https://proschedule.com/problems/store-not-found","title":"Store not found","status":404,"detail":"No such store within the reach of this credential.","code":"STORE_NOT_FOUND","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"NODE_NOT_FOUND":{"summary":"Structure node not found","value":{"type":"https://proschedule.com/problems/node-not-found","title":"Structure node not found","status":404,"detail":"No such structure node within the reach of this credential.","code":"NODE_NOT_FOUND","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"SALES_PLAN_NOT_FOUND":{"summary":"Sales plan not found","value":{"type":"https://proschedule.com/problems/sales-plan-not-found","title":"Sales plan not found","status":404,"detail":"No such sales plan that this credential may read.","code":"SALES_PLAN_NOT_FOUND","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"WEBHOOK_ENDPOINT_NOT_FOUND":{"summary":"Webhook endpoint not found","value":{"type":"https://proschedule.com/problems/webhook-endpoint-not-found","title":"Webhook endpoint not found","status":404,"detail":"No such webhook endpoint that this key manages.","code":"WEBHOOK_ENDPOINT_NOT_FOUND","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"WEBHOOK_DELIVERY_NOT_FOUND":{"summary":"Webhook delivery not found","value":{"type":"https://proschedule.com/problems/webhook-delivery-not-found","title":"Webhook delivery not found","status":404,"detail":"No such delivery of an endpoint that this key manages.","code":"WEBHOOK_DELIVERY_NOT_FOUND","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem409":{"description":"`VERSION_CONFLICT` — Version conflict; `PLAN_RUN_IN_PROGRESS` — A model turn is running; `PLAN_NOT_READY` — Plan has no figures; `WEBHOOK_ENDPOINT_LIMIT` — Too many webhook endpoints; `WEBHOOK_ENDPOINT_DISABLED` — Webhook endpoint switched off; `IDEMPOTENCY_IN_PROGRESS` — Request in progress; `CONFLICT` — Conflict","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"VERSION_CONFLICT":{"summary":"Version conflict","value":{"type":"https://proschedule.com/problems/version-conflict","title":"Version conflict","status":409,"detail":"The plan changed since the version the request names. Read it again and decide on what it holds now.","code":"VERSION_CONFLICT","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"PLAN_RUN_IN_PROGRESS":{"summary":"A model turn is running","value":{"type":"https://proschedule.com/problems/plan-run-in-progress","title":"A model turn is running","status":409,"detail":"The plan has a model turn in flight. Wait for it to end, then try again.","code":"PLAN_RUN_IN_PROGRESS","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"PLAN_NOT_READY":{"summary":"Plan has no figures","value":{"type":"https://proschedule.com/problems/plan-not-ready","title":"Plan has no figures","status":409,"detail":"The plan has no figures to write into the forecast yet.","code":"PLAN_NOT_READY","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"WEBHOOK_ENDPOINT_LIMIT":{"summary":"Too many webhook endpoints","value":{"type":"https://proschedule.com/problems/webhook-endpoint-limit","title":"Too many webhook endpoints","status":409,"detail":"The company has as many webhook endpoints as it may. Delete one first.","code":"WEBHOOK_ENDPOINT_LIMIT","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"WEBHOOK_ENDPOINT_DISABLED":{"summary":"Webhook endpoint switched off","value":{"type":"https://proschedule.com/problems/webhook-endpoint-disabled","title":"Webhook endpoint switched off","status":409,"detail":"The endpoint is switched off and is sent nothing. Switch it on first.","code":"WEBHOOK_ENDPOINT_DISABLED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"IDEMPOTENCY_IN_PROGRESS":{"summary":"Request in progress","value":{"type":"https://proschedule.com/problems/idempotency-in-progress","title":"Request in progress","status":409,"detail":"A request with this Idempotency-Key is still running. Retry shortly.","code":"IDEMPOTENCY_IN_PROGRESS","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"CONFLICT":{"summary":"Conflict","value":{"type":"https://proschedule.com/problems/conflict","title":"Conflict","status":409,"detail":"The request conflicts with the current state.","code":"CONFLICT","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem413":{"description":"`PAYLOAD_TOO_LARGE` — Payload too large","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"PAYLOAD_TOO_LARGE":{"summary":"Payload too large","value":{"type":"https://proschedule.com/problems/payload-too-large","title":"Payload too large","status":413,"detail":"The request body is larger than this API accepts.","code":"PAYLOAD_TOO_LARGE","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem415":{"description":"`UNSUPPORTED_MEDIA_TYPE` — Unsupported media type","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"UNSUPPORTED_MEDIA_TYPE":{"summary":"Unsupported media type","value":{"type":"https://proschedule.com/problems/unsupported-media-type","title":"Unsupported media type","status":415,"detail":"Send the request body as application/json in UTF-8.","code":"UNSUPPORTED_MEDIA_TYPE","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem422":{"description":"`INVALID_QUERY` — Invalid query; `INVALID_PERIOD` — Invalid period; `PERIOD_TOO_LONG` — Period too long; `WEBHOOK_URL_NOT_ALLOWED` — Webhook address not allowed; `TOO_MANY_STORES` — Too many stores; `DIMENSION_NOT_AVAILABLE` — Dimension not available; `IDEMPOTENCY_KEY_REUSED` — Idempotency key reused","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"INVALID_QUERY":{"summary":"Invalid query","value":{"type":"https://proschedule.com/problems/invalid-query","title":"Invalid query","status":422,"detail":"The query cannot be run as it is written.","code":"INVALID_QUERY","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"INVALID_PERIOD":{"summary":"Invalid period","value":{"type":"https://proschedule.com/problems/invalid-period","title":"Invalid period","status":422,"detail":"The period is not valid.","code":"INVALID_PERIOD","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"PERIOD_TOO_LONG":{"summary":"Period too long","value":{"type":"https://proschedule.com/problems/period-too-long","title":"Period too long","status":422,"detail":"The period is longer than this query allows.","code":"PERIOD_TOO_LONG","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"WEBHOOK_URL_NOT_ALLOWED":{"summary":"Webhook address not allowed","value":{"type":"https://proschedule.com/problems/webhook-url-not-allowed","title":"Webhook address not allowed","status":422,"detail":"The address must be https, without credentials or a fragment, on port 443 or 1024 and above, and resolve to public addresses only.","code":"WEBHOOK_URL_NOT_ALLOWED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"TOO_MANY_STORES":{"summary":"Too many stores","value":{"type":"https://proschedule.com/problems/too-many-stores","title":"Too many stores","status":422,"detail":"The call covers more stores than one call may read. Narrow it to a structure node.","code":"TOO_MANY_STORES","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"DIMENSION_NOT_AVAILABLE":{"summary":"Dimension not available","value":{"type":"https://proschedule.com/problems/dimension-not-available","title":"Dimension not available","status":422,"detail":"A requested dimension is not available for the requested measures.","code":"DIMENSION_NOT_AVAILABLE","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"IDEMPOTENCY_KEY_REUSED":{"summary":"Idempotency key reused","value":{"type":"https://proschedule.com/problems/idempotency-key-reused","title":"Idempotency key reused","status":422,"detail":"This Idempotency-Key was already used with a different request.","code":"IDEMPOTENCY_KEY_REUSED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem429":{"description":"`RATE_LIMITED` — Too many requests; `CONCURRENCY_LIMITED` — Too many requests at once; `CAPACITY_EXCEEDED` — Capacity exceeded; `COMPANY_WORK_LIMITED` — Company's share of the API spent; `HEAVY_DAILY_LIMIT_REACHED` — Daily limit of heavy reports reached","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"RATE_LIMITED":{"summary":"Too many requests","value":{"type":"https://proschedule.com/problems/rate-limited","title":"Too many requests","status":429,"detail":"The request limit is spent. Retry after the time in the Retry-After header.","code":"RATE_LIMITED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"CONCURRENCY_LIMITED":{"summary":"Too many requests at once","value":{"type":"https://proschedule.com/problems/concurrency-limited","title":"Too many requests at once","status":429,"detail":"This credential already runs as many requests at once as it may. Retry shortly.","code":"CONCURRENCY_LIMITED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"CAPACITY_EXCEEDED":{"summary":"Capacity exceeded","value":{"type":"https://proschedule.com/problems/capacity-exceeded","title":"Capacity exceeded","status":429,"detail":"The API is busy. Retry shortly.","code":"CAPACITY_EXCEEDED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"COMPANY_WORK_LIMITED":{"summary":"Company's share of the API spent","value":{"type":"https://proschedule.com/problems/company-work-limited","title":"Company's share of the API spent","status":429,"detail":"The company's keys and connections together have run as long this minute as the API allows one company. Retry after the time in the Retry-After header.","code":"COMPANY_WORK_LIMITED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}},"HEAVY_DAILY_LIMIT_REACHED":{"summary":"Daily limit of heavy reports reached","value":{"type":"https://proschedule.com/problems/heavy-daily-limit-reached","title":"Daily limit of heavy reports reached","status":429,"detail":"The company has had as many heavy reports computed today as this server allows. A report asked for in the last minute is still answered; new ones are computed again from 00:00 UTC.","code":"HEAVY_DAILY_LIMIT_REACHED","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem500":{"description":"`INTERNAL_ERROR` — Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"INTERNAL_ERROR":{"summary":"Internal error","value":{"type":"https://proschedule.com/problems/internal-error","title":"Internal error","status":500,"detail":"The request failed on our side. Quote the requestId when you report it.","code":"INTERNAL_ERROR","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem503":{"description":"`SERVICE_UNAVAILABLE` — Service unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"SERVICE_UNAVAILABLE":{"summary":"Service unavailable","value":{"type":"https://proschedule.com/problems/service-unavailable","title":"Service unavailable","status":503,"detail":"The API is temporarily unavailable. Retry shortly.","code":"SERVICE_UNAVAILABLE","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}},"Problem504":{"description":"`OPERATION_TIMEOUT` — Operation timed out","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"OPERATION_TIMEOUT":{"summary":"Operation timed out","value":{"type":"https://proschedule.com/problems/operation-timeout","title":"Operation timed out","status":504,"detail":"The operation did not finish in time. Narrow the request and retry.","code":"OPERATION_TIMEOUT","requestId":"5f0c2b9e-7c1d-4a57-9d43-2f6f5a1f0b3c"}}}}}}},"headers":{"RateLimit-Limit":{"description":"How many calls of this operation's weight the credential may make in a minute.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"How many of them are left in the current minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the current minute ends.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before sending the call again.","schema":{"type":"integer"}},"WWW-Authenticate":{"description":"The challenge of RFC 6750, for example `Bearer realm=\"proschedule\", error=\"invalid_token\"`. A 403 carries it with `INSUFFICIENT_SCOPE`, naming the scopes the operation requires.","schema":{"type":"string"}},"ETag":{"description":"A weak validator of this answer. Send it back in `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`private, max-age=<seconds>`: the caller's own cache may keep the answer.","schema":{"type":"string"}},"Link":{"description":"The address of the next page, `<…>; rel=\"next\"`, while the list has more.","schema":{"type":"string"}}}}}