{"openapi":"3.1.0","info":{"title":"Elavinya API","version":"1.0.0","description":"The Elavinya API, versioned in the path (/v1). Every /v1 route takes a signed-in session (the better-auth session cookie set by /api/auth); the routes marked with the apiKey scheme also take an organisation API key (Authorization: Bearer elv_live_...) with the scope named there. Webhook payloads are under webhooks. Errors share one envelope: a short message, a machine-readable code and, for invalid input, the fields at fault.\n\nSign-in and sign-up run on better-auth under /api/auth and are not listed here. Four of its routes need a Cloudflare Turnstile token in the x-turnstile-token header: POST /api/auth/sign-up/email, POST /api/auth/sign-in/magic-link, POST /api/auth/request-password-reset and POST /api/auth/send-verification-email. A missing or rejected token answers 403 with code TURNSTILE_FAILED; when the check cannot be made, 503 with code TURNSTILE_UNAVAILABLE. The site key for the widget comes from GET /api/public-config."},"jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","tags":[{"name":"Account"},{"name":"Announcements"},{"name":"Bookings"},{"name":"Cases"},{"name":"Files"},{"name":"Integrations"},{"name":"Medication"},{"name":"Messages"},{"name":"Notifications"},{"name":"Organisations"},{"name":"Records"},{"name":"Reports"},{"name":"Roster"},{"name":"Safeguarding"},{"name":"Secure document links"},{"name":"Service"},{"name":"Visits"},{"name":"Webhooks","description":"Signed POSTs Elavinya makes to the receivers an agency sets up."}],"security":[{"session":[]}],"paths":{"/health":{"get":{"operationId":"getHealth","tags":["Service"],"summary":"Check the service is up","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"region":{"type":"string"}},"required":["ok","region"],"additionalProperties":false}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[]}},"/api/openapi.json":{"get":{"operationId":"getApiOpenapiJson","tags":["Service"],"summary":"Get this OpenAPI document","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","description":"The OpenAPI 3.1 document."}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[]}},"/api/public-config":{"get":{"operationId":"getApiPublicConfig","tags":["Service"],"summary":"Get the public web app settings","description":"The Cloudflare Turnstile site key the web app draws the widget with; null where the check is skipped or not configured.","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"turnstileSiteKey":{"type":["string","null"]}},"required":["turnstileSiteKey"],"additionalProperties":false}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[]}},"/api/region":{"get":{"operationId":"getApiRegion","tags":["Service"],"summary":"Suggest a country for this visitor","description":"The country Cloudflare places the request in, with its known emergency number (null when Elavinya has none for it). A suggestion only: the person's own choice always wins, and nothing is stored.","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegionSuggestion"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[]}},"/api/invites/sign-in":{"post":{"operationId":"postApiInvitesSignIn","tags":["Service"],"summary":"Sign in from an invite link and accept it","description":"The invite link's one press, with no session: the emailed token proves the inbox, so the invited address is signed in (the account is created when there is none; `name` is kept only then) and the invite accepted in the same request. 410 for a token that is unknown, used or expired; 403 with fields.signIn \"authenticator\" for an address protected by an authenticator app (sign in with password and code, then accept). Limited to 30 presses per 300 seconds per client address: 429 RATE_LIMITED with Retry-After.","responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteSignedIn"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteSignInBody"}}}},"security":[]}},"/v1/admin/orgs":{"post":{"operationId":"postV1AdminOrgs","tags":["Organisations"],"summary":"Create an organisation","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRow"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCreateBody"}}}}}},"/v1/admin/orgs/{id}":{"get":{"operationId":"getV1AdminOrgsById","tags":["Organisations"],"summary":"Get an organisation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRow"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/admin/orgs/{id}/country":{"put":{"operationId":"putV1AdminOrgsByIdCountry","tags":["Organisations"],"summary":"Set or change an organisation's country","description":"Any admin sets it the first time; once set, only the owner changes it. A country with no known emergency number needs the organisation's own.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRow"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetOrgCountryBody"}}}}}},"/v1/admin/orgs/{id}/members":{"get":{"operationId":"getV1AdminOrgsByIdMembers","tags":["Organisations"],"summary":"List an organisation's members","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"role":{"type":"string"},"fromAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"toAt":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"owner":{"default":false,"type":"boolean"}},"required":["id","userId","orgId","name","role","fromAt","toAt","owner"],"additionalProperties":false}}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/admin/orgs/{id}/owner":{"post":{"operationId":"postV1AdminOrgsByIdOwner","tags":["Organisations"],"summary":"Transfer ownership","description":"The owner only, to another admin of the organisation. The previous owner stays an admin. The x-step-up header takes an authenticator step-up token or an emailed-code proof (spent once).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRow"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferOwnerBody"}}}}}},"/v1/admin/orgs/{id}/owner/confirm":{"post":{"operationId":"postV1AdminOrgsByIdOwnerConfirm","tags":["Organisations"],"summary":"Confirm an ownership set by the platform","description":"The owner only, where ownerReviewNeeded is true (the owner was picked when ownership was introduced, not chosen by a person). 409 when there is nothing to confirm. The x-step-up header takes an authenticator step-up token or an emailed-code proof.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRow"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/admin/memberships/{id}/role":{"put":{"operationId":"putV1AdminMembershipsByIdRole","tags":["Organisations"],"summary":"Change a member's role","description":"Agency staff roles only. Only the owner appoints or removes admins, and nobody changes the owner's role. The x-step-up header takes an authenticator step-up token or an emailed-code proof (spent once).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeRoleBody"}}}}}},"/v1/admin/orgs/{id}/escalation":{"get":{"operationId":"getV1AdminOrgsByIdEscalation","tags":["Organisations"],"summary":"Get the organisation's escalation settings","description":"The owner and admins only.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationSettingsView"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"operationId":"putV1AdminOrgsByIdEscalation","tags":["Organisations"],"summary":"Save the organisation's escalation settings","description":"The owner and admins only. Times may be faster than the defaults, never slower; named people must be members who can triage.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationSettingsView"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationSettings"}}}}}},"/v1/admin/orgs/{id}/sms":{"get":{"operationId":"getV1AdminOrgsByIdSms","tags":["Organisations"],"summary":"Get whether the organisation's people may get text messages","description":"The owner and admins only. Also the number of texts sent since the 1st of this month.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSmsSettings"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"operationId":"putV1AdminOrgsByIdSms","tags":["Organisations"],"summary":"Turn the organisation's text messages on or off","description":"The owner and admins only. Audited.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSmsSettings"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetOrgSmsBody"}}}}}},"/v1/admin/orgs/{id}/invite":{"post":{"operationId":"postV1AdminOrgsByIdInvite","tags":["Organisations"],"summary":"Invite a person to an organisation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteRow"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgInviteBody"}}}}}},"/v1/admin/orgs/{id}/invites":{"get":{"operationId":"getV1AdminOrgsByIdInvites","tags":["Organisations"],"summary":"List an organisation's pending invites","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingInviteList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/admin/invites/{id}/resend":{"post":{"operationId":"postV1AdminInvitesByIdResend","tags":["Organisations"],"summary":"Resend a pending invite","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingInvite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/admin/invites/{id}":{"delete":{"operationId":"deleteV1AdminInvitesById","tags":["Organisations"],"summary":"Cancel a pending invite","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"204":{"description":"Done. No body."},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/admin/invites/details":{"post":{"operationId":"postV1AdminInvitesDetails","tags":["Organisations"],"summary":"Look up an organisation invite by token","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteDetails"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteDetailsBody"}}}}}},"/v1/admin/invites/accept":{"post":{"operationId":"postV1AdminInvitesAccept","tags":["Organisations"],"summary":"Accept an organisation invite","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedMembership"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteBody"}}}}}},"/v1/admin/memberships/{id}":{"delete":{"operationId":"deleteV1AdminMembershipsById","tags":["Organisations"],"summary":"End a membership","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/admin/delegations":{"post":{"operationId":"postV1AdminDelegations","tags":["Organisations"],"summary":"Delegate functions to another person","parameters":[{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","description":"The delegation that was created."}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DelegationBody"}}}}},"get":{"operationId":"getV1AdminDelegations","tags":["Organisations"],"summary":"List delegations involving the caller","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","description":"The caller's active delegations."}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/admin/delegations/{id}":{"delete":{"operationId":"deleteV1AdminDelegationsById","tags":["Organisations"],"summary":"Revoke a delegation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/admin/orgs/{id}/break-glass-holders":{"get":{"operationId":"getV1AdminOrgsByIdBreakGlassHolders","tags":["Organisations"],"summary":"List break-glass holders","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"membershipId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","membershipId","userId","until"],"additionalProperties":false}}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"postV1AdminOrgsByIdBreakGlassHolders","tags":["Organisations"],"summary":"Grant break-glass to a member","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BreakGlassHolderGrant"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantBreakGlassBody"}}}}}},"/v1/admin/break-glass":{"post":{"operationId":"postV1AdminBreakGlass","tags":["Organisations"],"summary":"Use break-glass access","parameters":[{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","description":"The break-glass grant that was opened, with whether the alert was delivered."}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BreakGlassBody"}}}}}},"/v1/admin/step-up":{"post":{"operationId":"postV1AdminStepUp","tags":["Organisations"],"summary":"Step up with an authenticator code","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StepUpToken"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StepUpCodeBody"}}}}}},"/v1/bookings/cases/{caseId}/availability":{"get":{"operationId":"getV1BookingsCasesByCaseIdAvailability","tags":["Bookings"],"summary":"List open booking slots for a case","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"days","in":"query","required":false,"schema":{"default":7,"type":"integer","minimum":1,"maximum":14}},{"name":"tz","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Availability"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/bookings/cases/{caseId}/holds":{"post":{"operationId":"postV1BookingsCasesByCaseIdHolds","tags":["Bookings"],"summary":"Hold a booking slot","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hold"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HoldBody"}}}}}},"/v1/bookings/holds/{id}":{"delete":{"operationId":"deleteV1BookingsHoldsById","tags":["Bookings"],"summary":"Release a booking slot hold","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HoldReleased"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/bookings/cases/{caseId}/requests":{"post":{"operationId":"postV1BookingsCasesByCaseIdRequests","tags":["Bookings"],"summary":"Request a visit","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"Already done: the earlier result is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitRequestResult"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitRequestResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVisitRequestBody"}}}}},"get":{"operationId":"getV1BookingsCasesByCaseIdRequests","tags":["Bookings"],"summary":"List a case's visit requests","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitRequestList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/bookings/requests/{id}/move":{"post":{"operationId":"postV1BookingsRequestsByIdMove","tags":["Bookings"],"summary":"Move a visit request","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"Already done: the earlier result is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitRequestResult"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitRequestResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveVisitRequestBody"}}}}}},"/v1/bookings/requests/{id}/cancel":{"post":{"operationId":"postV1BookingsRequestsByIdCancel","tags":["Bookings"],"summary":"Cancel a visit request","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitRequestResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBody"}}}}}},"/v1/bookings/requests/{id}/decision":{"post":{"operationId":"postV1BookingsRequestsByIdDecision","tags":["Bookings"],"summary":"Decide a visit request","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitRequestResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitDecisionBody"}}}}}},"/v1/bookings/orgs/{orgId}/requests":{"get":{"operationId":"getV1BookingsOrgsByOrgIdRequests","tags":["Bookings"],"summary":"List an organisation's booking queue","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"default":"open","type":"string","enum":["open","closed"]}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingQueue"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:bookings"]}],"description":"Also callable with an organisation API key holding the read:bookings scope."}},"/v1/bookings/cases/{caseId}/gp-requests":{"post":{"operationId":"postV1BookingsCasesByCaseIdGpRequests","tags":["Bookings"],"summary":"Request a GP appointment","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpRequestResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGpRequestBody"}}}}},"get":{"operationId":"getV1BookingsCasesByCaseIdGpRequests","tags":["Bookings"],"summary":"List a case's GP appointment requests","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpRequestList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/bookings/gp-requests/{id}":{"get":{"operationId":"getV1BookingsGpRequestsById","tags":["Bookings"],"summary":"Get a GP appointment request","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpRequest"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/bookings/gp-requests/{id}/cancel":{"post":{"operationId":"postV1BookingsGpRequestsByIdCancel","tags":["Bookings"],"summary":"Cancel a GP appointment request","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpRequestResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBody"}}}}}},"/v1/bookings/gp-requests/{id}/status":{"post":{"operationId":"postV1BookingsGpRequestsByIdStatus","tags":["Bookings"],"summary":"Update a GP appointment request's status","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpRequestResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpStatusBody"}}}}}},"/v1/cases/mine":{"get":{"operationId":"getV1CasesMine","tags":["Cases"],"summary":"List the caller's cases","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyCases"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/cases/invites/accept":{"post":{"operationId":"postV1CasesInvitesAccept","tags":["Cases"],"summary":"Accept a case invite","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseInviteAccepted"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseInviteAcceptBody"}}}}}},"/v1/cases/invites/details":{"post":{"operationId":"postV1CasesInvitesDetails","tags":["Cases"],"summary":"Look up a case invite by token","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseInviteDetails"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseInviteAcceptBody"}}}}}},"/v1/cases/nhs-simulation":{"get":{"operationId":"getV1CasesNhsSimulation","tags":["Cases"],"summary":"Get the NHS simulation status","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NhsSimulationStatus"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/cases/agencies/{agencyId}":{"get":{"operationId":"getV1CasesAgenciesByAgencyId","tags":["Cases"],"summary":"Get an agency's public referral details","parameters":[{"name":"agencyId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencySummary"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/cases/referrals":{"post":{"operationId":"postV1CasesReferrals","tags":["Cases"],"summary":"Refer a person to an agency","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralCreated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralBody"}}}}}},"/v1/cases/orgs/{orgId}":{"get":{"operationId":"getV1CasesOrgsByOrgId","tags":["Cases"],"summary":"List an organisation's cases","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:cases"]}],"description":"Also callable with an organisation API key holding the read:cases scope."}},"/v1/cases/orgs/{orgId}/intake":{"post":{"operationId":"postV1CasesOrgsByOrgIdIntake","tags":["Cases"],"summary":"Record an intake for a new case","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeCreated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeBody"}}}}}},"/v1/cases/{caseId}":{"get":{"operationId":"getV1CasesByCaseId","tags":["Cases"],"summary":"Get a case","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDetail"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:cases"]}],"description":"Also callable with an organisation API key holding the read:cases scope."}},"/v1/cases/{caseId}/decision":{"post":{"operationId":"postV1CasesByCaseIdDecision","tags":["Cases"],"summary":"Decide a case intake","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionRecorded"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeDecision"}}}}}},"/v1/cases/{caseId}/nhs-number":{"put":{"operationId":"putV1CasesByCaseIdNhsNumber","tags":["Cases"],"summary":"Set a case's NHS number","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NhsNumberResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NhsNumberBody"}}}}}},"/v1/cases/{caseId}/nhs-number/trace":{"post":{"operationId":"postV1CasesByCaseIdNhsNumberTrace","tags":["Cases"],"summary":"Trace a case's NHS number","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NhsNumberResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/cases/{caseId}/timeline":{"get":{"operationId":"getV1CasesByCaseIdTimeline","tags":["Cases"],"summary":"Get a case's timeline","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"urgent","in":"query","required":false,"schema":{"type":"string","const":"1"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseTimeline"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/cases/{caseId}/invites":{"post":{"operationId":"postV1CasesByCaseIdInvites","tags":["Cases"],"summary":"Invite a person to a case","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseInviteCreated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseInviteBody"}}}}}},"/v1/cases/{caseId}/team":{"post":{"operationId":"postV1CasesByCaseIdTeam","tags":["Cases"],"summary":"Add a staff member to a case team","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartyChanged"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberBody"}}}}}},"/v1/cases/{caseId}/parties/{partyId}":{"delete":{"operationId":"deleteV1CasesByCaseIdPartiesByPartyId","tags":["Cases"],"summary":"Remove a party from a case","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"partyId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartyEnded"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/cases/{caseId}/consents":{"post":{"operationId":"postV1CasesByCaseIdConsents","tags":["Cases"],"summary":"Record a consent","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentChanged"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentBody"}}}}}},"/v1/cases/{caseId}/appeals":{"post":{"operationId":"postV1CasesByCaseIdAppeals","tags":["Cases"],"summary":"Raise an appeal","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppealChanged"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppealBody"}}}}}},"/v1/cases/{caseId}/appeals/{appealId}/decision":{"post":{"operationId":"postV1CasesByCaseIdAppealsByAppealIdDecision","tags":["Cases"],"summary":"Decide an appeal","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"appealId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppealChanged"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppealDecisionBody"}}}}}},"/v1/cases/{caseId}/plan":{"get":{"operationId":"getV1CasesByCaseIdPlan","tags":["Cases"],"summary":"Get a case's care plan","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarePlan"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:cases"]}],"description":"Also callable with an organisation API key holding the read:cases scope."}},"/v1/cases/{caseId}/plan/draft":{"post":{"operationId":"postV1CasesByCaseIdPlanDraft","tags":["Cases"],"summary":"Save a care plan draft","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanChanged"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanDraftBody"}}}}}},"/v1/cases/{caseId}/plan/approve":{"post":{"operationId":"postV1CasesByCaseIdPlanApprove","tags":["Cases"],"summary":"Approve a care plan","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanChanged"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanApproveBody"}}}}}},"/v1/integrations/orgs/{orgId}/keys":{"get":{"operationId":"getV1IntegrationsOrgsByOrgIdKeys","tags":["Integrations"],"summary":"List the agency's API keys","description":"Prefix, scopes, expiry and last use; never the secret. Signed-in people only.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"postV1IntegrationsOrgsByOrgIdKeys","tags":["Integrations"],"summary":"Create an API key","description":"Each scope needs the creator's own function in the agency (a key never exceeds its creator's role). The secret is in this answer only.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeySecret"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyBody"}}}}}},"/v1/integrations/orgs/{orgId}/keys/{keyId}/rotate":{"post":{"operationId":"postV1IntegrationsOrgsByOrgIdKeysByKeyIdRotate","tags":["Integrations"],"summary":"Rotate an API key","description":"A new secret at once; the old one stops working. From then on the key acts for the person who rotated it, so each of its scopes needs that person's own function (403 FORBIDDEN naming the scope otherwise). The new secret is in this answer only.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"keyId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeySecret"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/integrations/orgs/{orgId}/keys/{keyId}":{"delete":{"operationId":"deleteV1IntegrationsOrgsByOrgIdKeysByKeyId","tags":["Integrations"],"summary":"Revoke an API key","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"keyId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/integrations/orgs/{orgId}/webhooks":{"get":{"operationId":"getV1IntegrationsOrgsByOrgIdWebhooks","tags":["Integrations"],"summary":"List the agency's webhook endpoints","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["webhooks:manage"]}],"description":"Also callable with an organisation API key holding the webhooks:manage scope."},"post":{"operationId":"postV1IntegrationsOrgsByOrgIdWebhooks","tags":["Integrations"],"summary":"Create a webhook endpoint","description":"A public https receiver and the events it wants. The signing secret (whsec_...) is in this answer only. Signed-in people with step-up only. The concern.filed and concern.decided events need safeguarding.triage in the agency (403 FORBIDDEN with events: needsTriage otherwise).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecret"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookBody"}}}}}},"/v1/integrations/orgs/{orgId}/webhooks/{endpointId}":{"patch":{"operationId":"patchV1IntegrationsOrgsByOrgIdWebhooksByEndpointId","tags":["Integrations"],"summary":"Change a webhook endpoint","description":"Signed-in people with step-up only. Choosing concern.filed or concern.decided needs safeguarding.triage in the agency.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookBody"}}}}},"delete":{"operationId":"deleteV1IntegrationsOrgsByOrgIdWebhooksByEndpointId","tags":["Integrations"],"summary":"Delete a webhook endpoint","description":"Signed-in people with step-up only.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/integrations/orgs/{orgId}/webhooks/{endpointId}/rotate-secret":{"post":{"operationId":"postV1IntegrationsOrgsByOrgIdWebhooksByEndpointIdRotateSecret","tags":["Integrations"],"summary":"Rotate a webhook signing secret","description":"The old secret keeps signing (a second v1=) for the overlap period, so receivers can switch over. Signed-in people with step-up only.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecret"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/integrations/orgs/{orgId}/webhooks/{endpointId}/test":{"post":{"operationId":"postV1IntegrationsOrgsByOrgIdWebhooksByEndpointIdTest","tags":["Integrations"],"summary":"Send a test event","description":"A signed ping, delivered at once and logged. Limited to 20 per 3600 seconds per agency. Over it: 429 RATE_LIMITED with Retry-After.\n\nAlso callable with an organisation API key holding the webhooks:manage scope.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["webhooks:manage"]}]}},"/v1/integrations/orgs/{orgId}/webhooks/{endpointId}/deliveries":{"get":{"operationId":"getV1IntegrationsOrgsByOrgIdWebhooksByEndpointIdDeliveries","tags":["Integrations"],"summary":"List an endpoint's deliveries","description":"Newest first, the last 50.\n\nAlso callable with an organisation API key holding the webhooks:manage scope.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"endpointId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["webhooks:manage"]}]}},"/v1/me":{"get":{"operationId":"getV1Me","tags":["Account"],"summary":"Get the signed-in user","description":"user.emailVerified is false until the one emailed link confirms the address. Until then only this route, PATCH /v1/me, GET /v1/me/password, POST /v1/admin/orgs and the organisation's own settings routes answer; every other route answers 403 EMAIL_NOT_VERIFIED.","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"operationId":"patchV1Me","tags":["Account"],"summary":"Set the user's own name","description":"Asked where it is first needed: organisation setup or an invite. An account made by a sign-in link starts without one.","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatedMe"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMeBody"}}}}}},"/v1/me/password":{"get":{"operationId":"getV1MePassword","tags":["Account"],"summary":"Check whether the user has a password","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordState"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"postV1MePassword","tags":["Account"],"summary":"Set the user's password","parameters":[{"name":"x-step-up","in":"header","required":false,"description":"Step-up token. Some requests to this route need one (for example replacing an existing secret); those answer 403 STEP_UP_REQUIRED without it.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPasswordResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPasswordBody"}}}}}},"/v1/me/step-up/email":{"post":{"operationId":"postV1MeStepUpEmail","tags":["Account"],"summary":"Send an email step-up code","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStepUpSent"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/me/step-up/email/verify":{"post":{"operationId":"postV1MeStepUpEmailVerify","tags":["Account"],"summary":"Verify an email step-up code","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StepUpToken"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStepUpCodeBody"}}}}}},"/v1/medication/pin":{"get":{"operationId":"getV1MedicationPin","tags":["Medication"],"summary":"Get the signing PIN status","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningPinStatus"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"operationId":"putV1MedicationPin","tags":["Medication"],"summary":"Set the signing PIN","parameters":[{"name":"x-step-up","in":"header","required":false,"description":"Step-up token. Some requests to this route need one (for example replacing an existing secret); those answer 403 STEP_UP_REQUIRED without it.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSigningPinResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSigningPinBody"}}}}}},"/v1/medication/cases":{"get":{"operationId":"getV1MedicationCases","tags":["Medication"],"summary":"List cases with medication","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationCaseList"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/medication/cases/{caseId}/chart":{"get":{"operationId":"getV1MedicationCasesByCaseIdChart","tags":["Medication"],"summary":"Get a case's medication chart","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationChart"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:medication"]}],"description":"Also callable with an organisation API key holding the read:medication scope."}},"/v1/medication/cases/{caseId}/holds":{"get":{"operationId":"getV1MedicationCasesByCaseIdHolds","tags":["Medication"],"summary":"List a case's medication holds","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationHoldList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/medication/cases/{caseId}/witnesses":{"get":{"operationId":"getV1MedicationCasesByCaseIdWitnesses","tags":["Medication"],"summary":"List doses waiting for a witness","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoseWitnessList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/medication/cases/{caseId}/orders":{"post":{"operationId":"postV1MedicationCasesByCaseIdOrders","tags":["Medication"],"summary":"Add a medication order","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationOrderResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMedicationOrderBody"}}}}}},"/v1/medication/cases/{caseId}/orders/{orderId}/stop":{"post":{"operationId":"postV1MedicationCasesByCaseIdOrdersByOrderIdStop","tags":["Medication"],"summary":"Stop a medication order","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"orderId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationOrderResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopMedicationOrderBody"}}}}}},"/v1/medication/cases/{caseId}/gp-record":{"get":{"operationId":"getV1MedicationCasesByCaseIdGpRecord","tags":["Medication"],"summary":"Get a case's GP record import","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpRecordView"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/medication/cases/{caseId}/gp-record/import":{"post":{"operationId":"postV1MedicationCasesByCaseIdGpRecordImport","tags":["Medication"],"summary":"Import a case's GP record","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpRecordImportResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/medication/cases/{caseId}/gp-record/medicines/{draftId}/accept":{"post":{"operationId":"postV1MedicationCasesByCaseIdGpRecordMedicinesByDraftIdAccept","tags":["Medication"],"summary":"Accept an imported GP medicine","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"draftId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptGpMedicineResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptGpMedicineBody"}}}}}},"/v1/medication/cases/{caseId}/gp-record/medicines/{draftId}/reject":{"post":{"operationId":"postV1MedicationCasesByCaseIdGpRecordMedicinesByDraftIdReject","tags":["Medication"],"summary":"Reject an imported GP medicine","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"draftId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpMedicineReviewResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectGpItemBody"}}}}}},"/v1/medication/cases/{caseId}/gp-record/allergies/{allergyId}/accept":{"post":{"operationId":"postV1MedicationCasesByCaseIdGpRecordAllergiesByAllergyIdAccept","tags":["Medication"],"summary":"Accept an imported GP allergy","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"allergyId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpAllergyReviewResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptGpAllergyBody"}}}}}},"/v1/medication/cases/{caseId}/gp-record/allergies/{allergyId}/reject":{"post":{"operationId":"postV1MedicationCasesByCaseIdGpRecordAllergiesByAllergyIdReject","tags":["Medication"],"summary":"Reject an imported GP allergy","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"allergyId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpAllergyReviewResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectGpItemBody"}}}}}},"/v1/medication/cases/{caseId}/orders/{orderId}/holds":{"post":{"operationId":"postV1MedicationCasesByCaseIdOrdersByOrderIdHolds","tags":["Medication"],"summary":"Hold a medication order","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"orderId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationHoldResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceMedicationHoldBody"}}}}}},"/v1/medication/cases/{caseId}/holds/{holdId}/lift":{"post":{"operationId":"postV1MedicationCasesByCaseIdHoldsByHoldIdLift","tags":["Medication"],"summary":"Lift a medication hold","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"holdId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationHoldResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiftMedicationHoldBody"}}}}}},"/v1/medication/cases/{caseId}/holds/{holdId}/read":{"post":{"operationId":"postV1MedicationCasesByCaseIdHoldsByHoldIdRead","tags":["Medication"],"summary":"Mark a medication hold as read","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"holdId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationHoldReadResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationHoldReadBody"}}}}}},"/v1/medication/cases/{caseId}/orders/{orderId}/overrides":{"post":{"operationId":"postV1MedicationCasesByCaseIdOrdersByOrderIdOverrides","tags":["Medication"],"summary":"Grant a dose override","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"orderId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":true,"description":"Step-up token from POST /v1/admin/step-up or POST /v1/me/step-up/email/verify. Without a valid one the answer is 403 STEP_UP_REQUIRED.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoseOverrideResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantDoseOverrideBody"}}}}}},"/v1/medication/cases/{caseId}/orders/{orderId}/administrations":{"post":{"operationId":"postV1MedicationCasesByCaseIdOrdersByOrderIdAdministrations","tags":["Medication"],"summary":"Record a dose","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"orderId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-step-up","in":"header","required":false,"description":"Step-up token. Some requests to this route need one (for example replacing an existing secret); those answer 403 STEP_UP_REQUIRED without it.","schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordDoseResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordDoseBody"}}}}}},"/v1/medication/cases/{caseId}/summary":{"get":{"operationId":"getV1MedicationCasesByCaseIdSummary","tags":["Medication"],"summary":"Get a family medication summary","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FamilyMedicationSummary"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:medication"]}],"description":"Also callable with an organisation API key holding the read:medication scope."}},"/v1/records/orgs/{orgId}/recipients":{"get":{"operationId":"getV1RecordsOrgsByOrgIdRecipients","tags":["Records"],"summary":"List record recipients","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipientList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"postV1RecordsOrgsByOrgIdRecipients","tags":["Records"],"summary":"Add a record recipient","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipientCreated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecipientBody"}}}}}},"/v1/records/orgs/{orgId}/mesh":{"get":{"operationId":"getV1RecordsOrgsByOrgIdMesh","tags":["Records"],"summary":"Get the MESH connection status","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeshChannel"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/records/concerns/{concernId}/documents":{"post":{"operationId":"postV1RecordsConcernsByConcernIdDocuments","tags":["Records"],"summary":"Generate a safeguarding document","parameters":[{"name":"concernId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateDocumentBody"}}}}},"get":{"operationId":"getV1RecordsConcernsByConcernIdDocuments","tags":["Records"],"summary":"List a concern's documents","parameters":[{"name":"concernId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/records/documents/{id}":{"get":{"operationId":"getV1RecordsDocumentsById","tags":["Records"],"summary":"Get a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordDocument"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/records/documents/{id}/countersign":{"post":{"operationId":"postV1RecordsDocumentsByIdCountersign","tags":["Records"],"summary":"Countersign a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/records/documents/{id}/transmissions":{"post":{"operationId":"postV1RecordsDocumentsByIdTransmissions","tags":["Records"],"summary":"Send a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransmissionResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendDocumentBody"}}}}}},"/v1/records/transmissions/{id}/events":{"post":{"operationId":"postV1RecordsTransmissionsByIdEvents","tags":["Records"],"summary":"Record a transmission event","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransmissionResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordTransmissionEventBody"}}}}}},"/v1/records/transmissions/{id}/sync":{"post":{"operationId":"postV1RecordsTransmissionsByIdSync","tags":["Records"],"summary":"Sync a transmission's status","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransmissionSynced"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/records/transmissions/{id}/revoke":{"post":{"operationId":"postV1RecordsTransmissionsByIdRevoke","tags":["Records"],"summary":"Revoke a transmission","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransmissionResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/records/receipts/{token}":{"get":{"operationId":"getApiRecordsReceiptsByToken","tags":["Secure document links"],"summary":"Open a secure document link","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"An HTML page.","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"The link is unknown, expired or revoked (an HTML page).","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/api/records/receipts/{token}/code":{"post":{"operationId":"postApiRecordsReceiptsByTokenCode","tags":["Secure document links"],"summary":"Request a code for a secure document link","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"An HTML page.","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"The link is unknown, expired or revoked (an HTML page).","content":{"text/html":{"schema":{"type":"string"}}}},"429":{"description":"Too many tries for this link (an HTML page).","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/api/records/receipts/{token}/open":{"post":{"operationId":"postApiRecordsReceiptsByTokenOpen","tags":["Secure document links"],"summary":"Open a secure document with a code","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"An HTML page.","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"The link is unknown, expired or revoked (an HTML page).","content":{"text/html":{"schema":{"type":"string"}}}},"429":{"description":"Too many tries for this link (an HTML page).","content":{"text/html":{"schema":{"type":"string"}}}}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/ReceiptForm"}}}},"security":[]}},"/api/records/receipts/{token}/acknowledge":{"post":{"operationId":"postApiRecordsReceiptsByTokenAcknowledge","tags":["Secure document links"],"summary":"Acknowledge a secure document","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"An HTML page.","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"The link is unknown, expired or revoked (an HTML page).","content":{"text/html":{"schema":{"type":"string"}}}},"429":{"description":"Too many tries for this link (an HTML page).","content":{"text/html":{"schema":{"type":"string"}}}}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/ReceiptForm"}}}},"security":[]}},"/v1/roster/orgs/{orgId}/staff":{"get":{"operationId":"getV1RosterOrgsByOrgIdStaff","tags":["Roster"],"summary":"List an organisation's staff","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:staff"]}],"description":"Also callable with an organisation API key holding the read:staff scope."}},"/v1/roster/orgs/{orgId}/staff/{userId}":{"put":{"operationId":"putV1RosterOrgsByOrgIdStaffByUserId","tags":["Roster"],"summary":"Update a staff profile","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffProfileBody"}}}}}},"/v1/roster/orgs/{orgId}/staff/{userId}/certificates":{"post":{"operationId":"postV1RosterOrgsByOrgIdStaffByUserIdCertificates","tags":["Roster"],"summary":"Add a staff certificate","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateBody"}}}}}},"/v1/roster/orgs/{orgId}/staff/{userId}/availability":{"put":{"operationId":"putV1RosterOrgsByOrgIdStaffByUserIdAvailability","tags":["Roster"],"summary":"Set a staff member's availability","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityBody"}}}}}},"/v1/roster/orgs/{orgId}/visits":{"post":{"operationId":"postV1RosterOrgsByOrgIdVisits","tags":["Roster"],"summary":"Create a visit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitCreated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVisitBody"}}}},"security":[{"session":[]},{"apiKey":["write:visits"]}],"description":"Also callable with an organisation API key holding the write:visits scope."}},"/v1/roster/orgs/{orgId}/visits/generate":{"post":{"operationId":"postV1RosterOrgsByOrgIdVisitsGenerate","tags":["Roster"],"summary":"Generate visits from care plans","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitsGenerated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateVisitsBody"}}}}}},"/v1/roster/orgs/{orgId}/visits/publish":{"post":{"operationId":"postV1RosterOrgsByOrgIdVisitsPublish","tags":["Roster"],"summary":"Publish visits","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishBody"}}}},"security":[{"session":[]},{"apiKey":["write:visits"]}],"description":"Also callable with an organisation API key holding the write:visits scope."}},"/v1/roster/orgs/{orgId}/visits/{visitId}/candidates":{"get":{"operationId":"getV1RosterOrgsByOrgIdVisitsByVisitIdCandidates","tags":["Roster"],"summary":"List candidate carers for a visit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"name":"slot","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":2}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CandidateList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/roster/orgs/{orgId}/visits/{visitId}/assign":{"post":{"operationId":"postV1RosterOrgsByOrgIdVisitsByVisitIdAssign","tags":["Roster"],"summary":"Assign a carer to a visit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignBody"}}}},"security":[{"session":[]},{"apiKey":["write:visits"]}],"description":"Also callable with an organisation API key holding the write:visits scope."}},"/v1/roster/orgs/{orgId}/visits/{visitId}/broadcast":{"post":{"operationId":"postV1RosterOrgsByOrgIdVisitsByVisitIdBroadcast","tags":["Roster"],"summary":"Offer a visit to carers","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastBody"}}}}}},"/v1/roster/orgs/{orgId}/visits/{visitId}/unassign":{"post":{"operationId":"postV1RosterOrgsByOrgIdVisitsByVisitIdUnassign","tags":["Roster"],"summary":"Unassign a carer from a visit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnassignBody"}}}},"security":[{"session":[]},{"apiKey":["write:visits"]}],"description":"Also callable with an organisation API key holding the write:visits scope."}},"/v1/roster/orgs/{orgId}/visits/{visitId}/cancel":{"post":{"operationId":"postV1RosterOrgsByOrgIdVisitsByVisitIdCancel","tags":["Roster"],"summary":"Cancel a visit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelVisitBody"}}}},"security":[{"session":[]},{"apiKey":["write:visits"]}],"description":"Also callable with an organisation API key holding the write:visits scope."}},"/v1/roster/orgs/{orgId}/board":{"get":{"operationId":"getV1RosterOrgsByOrgIdBoard","tags":["Roster"],"summary":"Get the operations board for a day","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"tz","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpsBoard"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:visits"]}],"description":"Also callable with an organisation API key holding the read:visits scope."}},"/v1/roster/orgs/{orgId}/week":{"get":{"operationId":"getV1RosterOrgsByOrgIdWeek","tags":["Roster"],"summary":"Get the roster week","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"tz","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterWeek"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:visits"]}],"description":"Also callable with an organisation API key holding the read:visits scope."}},"/v1/roster/orgs/{orgId}/offers/mine":{"get":{"operationId":"getV1RosterOrgsByOrgIdOffersMine","tags":["Roster"],"summary":"List the caller's shift offers","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyOffers"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/roster/orgs/{orgId}/visits/{visitId}/move":{"post":{"operationId":"postV1RosterOrgsByOrgIdVisitsByVisitIdMove","tags":["Roster"],"summary":"Move a visit to another time or carer","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveVisitBody"}}}}}},"/v1/roster/orgs/{orgId}/publish-batches/{batchId}/undo":{"post":{"operationId":"postV1RosterOrgsByOrgIdPublishBatchesByBatchIdUndo","tags":["Roster"],"summary":"Undo a publish before its emails go","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"batchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishUndone"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/roster/orgs/{orgId}/publish-batches/{batchId}/send":{"post":{"operationId":"postV1RosterOrgsByOrgIdPublishBatchesByBatchIdSend","tags":["Roster"],"summary":"Send a publish's emails once","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"batchId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishSent"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/roster/orgs/{orgId}/route-times":{"put":{"operationId":"putV1RosterOrgsByOrgIdRouteTimes","tags":["Roster"],"summary":"Record the travel time between two postcodes","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteTimeWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteTime"}}}}}},"/v1/roster/orgs/{orgId}/shift-requests":{"get":{"operationId":"getV1RosterOrgsByOrgIdShiftRequests","tags":["Roster"],"summary":"List carers' requests to give up or swap visits","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":true,"schema":{"type":"string","enum":["open","closed"]}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftRequestQueue"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/roster/orgs/{orgId}/shift-requests/{requestId}/decide":{"post":{"operationId":"postV1RosterOrgsByOrgIdShiftRequestsByRequestIdDecide","tags":["Roster"],"summary":"Accept or decline a carer's request","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"requestId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftRequestDecided"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideShiftRequestBody"}}}}}},"/v1/roster/orgs/{orgId}/me/availability":{"get":{"operationId":"getV1RosterOrgsByOrgIdMeAvailability","tags":["Roster"],"summary":"Get the caller's weekly availability and time off","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyAvailability"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"operationId":"putV1RosterOrgsByOrgIdMeAvailability","tags":["Roster"],"summary":"Set the caller's weekly availability","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityBody"}}}}}},"/v1/roster/orgs/{orgId}/me/time-off":{"post":{"operationId":"postV1RosterOrgsByOrgIdMeTimeOff","tags":["Roster"],"summary":"Book time off","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeOffWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeOffBody"}}}}}},"/v1/roster/orgs/{orgId}/me/time-off/{id}":{"delete":{"operationId":"deleteV1RosterOrgsByOrgIdMeTimeOffById","tags":["Roster"],"summary":"Remove booked time off","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeOffWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/roster/orgs/{orgId}/me/visits/{visitId}/swap-options":{"get":{"operationId":"getV1RosterOrgsByOrgIdMeVisitsByVisitIdSwapOptions","tags":["Roster"],"summary":"List colleagues' visits the caller could swap into","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapOptions"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/roster/orgs/{orgId}/me/visits/{visitId}/requests":{"post":{"operationId":"postV1RosterOrgsByOrgIdMeVisitsByVisitIdRequests","tags":["Roster"],"summary":"Ask to give up or swap a visit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftRequestWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftRequestBody"}}}}}},"/v1/roster/orgs/{orgId}/me/requests":{"get":{"operationId":"getV1RosterOrgsByOrgIdMeRequests","tags":["Roster"],"summary":"List the caller's requests about visits","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyShiftRequests"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/roster/orgs/{orgId}/me/requests/{requestId}/withdraw":{"post":{"operationId":"postV1RosterOrgsByOrgIdMeRequestsByRequestIdWithdraw","tags":["Roster"],"summary":"Withdraw a request about a visit","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"requestId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftRequestWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/safeguarding/subjects":{"get":{"operationId":"getV1SafeguardingSubjects","tags":["Safeguarding"],"summary":"List people the caller can raise a concern about","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubjectList"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/safeguarding/concerns":{"post":{"operationId":"postV1SafeguardingConcerns","tags":["Safeguarding"],"summary":"Raise a safeguarding concern","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"Already done: the earlier result is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FiledConcern"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FiledConcern"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileConcernBody"}}}}}},"/v1/safeguarding/orgs/{orgId}/concerns":{"get":{"operationId":"getV1SafeguardingOrgsByOrgIdConcerns","tags":["Safeguarding"],"summary":"List an organisation's concerns","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"default":"active","type":"string","enum":["active","all"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConcernPage"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/safeguarding/concerns/{id}":{"get":{"operationId":"getV1SafeguardingConcernsById","tags":["Safeguarding"],"summary":"Get a concern","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConcernDetail"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/safeguarding/concerns/{id}/notes":{"post":{"operationId":"postV1SafeguardingConcernsByIdNotes","tags":["Safeguarding"],"summary":"Save triage notes on a concern","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConcernUpdated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveTriageBody"}}}}}},"/v1/safeguarding/concerns/{id}/steps":{"post":{"operationId":"postV1SafeguardingConcernsByIdSteps","tags":["Safeguarding"],"summary":"Save the steps taken on a concern","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConcernUpdated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveStepsBody"}}}}}},"/v1/safeguarding/concerns/{id}/decision":{"post":{"operationId":"postV1SafeguardingConcernsByIdDecision","tags":["Safeguarding"],"summary":"Decide a concern","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConcernUpdated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideBody"}}}}}},"/v1/safeguarding/concerns/{id}/close":{"post":{"operationId":"postV1SafeguardingConcernsByIdClose","tags":["Safeguarding"],"summary":"Close a concern","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConcernUpdated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseBody"}}}}}},"/v1/visits/orgs/{orgId}/mine":{"get":{"operationId":"getV1VisitsOrgsByOrgIdMine","tags":["Visits"],"summary":"Get the carer's visits for a day","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"tz","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarerDay"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/visits/orgs/{orgId}/mine/upcoming":{"get":{"operationId":"getV1VisitsOrgsByOrgIdMineUpcoming","tags":["Visits"],"summary":"Get the carer's upcoming visits","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"tz","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarerUpcoming"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/visits/cases/{caseId}/family":{"get":{"operationId":"getV1VisitsCasesByCaseIdFamily","tags":["Visits"],"summary":"Get a case's visits for the family","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FamilyVisits"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/visits/orgs/{orgId}/sync":{"post":{"operationId":"postV1VisitsOrgsByOrgIdSync","tags":["Visits"],"summary":"Sync offline visit changes","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncBody"}}}}}},"/v1/visits/orgs/{orgId}/conflicts/{conflictId}/resolve":{"post":{"operationId":"postV1VisitsOrgsByOrgIdConflictsByConflictIdResolve","tags":["Visits"],"summary":"Resolve a sync conflict","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"conflictId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConflictResolved"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveConflictBody"}}}}}},"/v1/visits/orgs/{orgId}/visits/{visitId}/note":{"put":{"operationId":"putV1VisitsOrgsByOrgIdVisitsByVisitIdNote","tags":["Visits"],"summary":"Edit a visit note","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"visitId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteEditBody"}}}}}},"/v1/visits/orgs/{orgId}/observations/{observationId}/acknowledge":{"post":{"operationId":"postV1VisitsOrgsByOrgIdObservationsByObservationIdAcknowledge","tags":["Visits"],"summary":"Acknowledge an observation","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"observationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObservationWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/visits/orgs/{orgId}/observations/{observationId}/resolve":{"post":{"operationId":"postV1VisitsOrgsByOrgIdObservationsByObservationIdResolve","tags":["Visits"],"summary":"Resolve an observation","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"observationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObservationWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/visits/orgs/{orgId}/observations/{observationId}/escalate":{"post":{"operationId":"postV1VisitsOrgsByOrgIdObservationsByObservationIdEscalate","tags":["Visits"],"summary":"Escalate an observation","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"observationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObservationWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalateBody"}}}}}},"/v1/roster/orgs/{orgId}/offers/{offerId}/accept":{"post":{"operationId":"postV1RosterOrgsByOrgIdOffersByOfferIdAccept","tags":["Roster"],"summary":"Accept a shift offer","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"offerId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/roster/orgs/{orgId}/offers/{offerId}/decline":{"post":{"operationId":"postV1RosterOrgsByOrgIdOffersByOfferIdDecline","tags":["Roster"],"summary":"Decline a shift offer","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"offerId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/reports/orgs/{orgId}/options":{"get":{"operationId":"getV1ReportsOrgsByOrgIdOptions","tags":["Reports"],"summary":"List the reports, filters and schedule recipients the caller may use","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportOptions"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/reports/orgs/{orgId}/reports/{kind}":{"get":{"operationId":"getV1ReportsOrgsByOrgIdReportsByKind","tags":["Reports"],"summary":"Get a fixed report","description":"Counted from stored records only; needs reports.org (concerns also safeguarding.triage).\n\nAlso callable with an organisation API key holding the read:reports scope.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"carer","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},{"name":"client","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},{"name":"group","in":"query","required":false,"schema":{"type":"string","enum":["carer","client","level","outcome"]}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResult"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:reports"]}]}},"/v1/reports/orgs/{orgId}/reports/{kind}/records":{"get":{"operationId":"getV1ReportsOrgsByOrgIdReportsByKindRecords","tags":["Reports"],"summary":"List the records behind one number of a report","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},{"name":"carer","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},{"name":"client","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},{"name":"group","in":"query","required":false,"schema":{"type":"string","enum":["carer","client","level","outcome"]}},{"name":"figure","in":"query","required":true,"schema":{"type":"string","pattern":"^[a-z-]{2,20}$"}},{"name":"row","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRecordList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"session":[]},{"apiKey":["read:reports"]}],"description":"Also callable with an organisation API key holding the read:reports scope."}},"/v1/reports/orgs/{orgId}/exports":{"get":{"operationId":"getV1ReportsOrgsByOrgIdExports","tags":["Reports"],"summary":"List the caller's recent exports","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"postV1ReportsOrgsByOrgIdExports","tags":["Reports"],"summary":"Export a report as CSV or PDF, or make a client's compliance pack","description":"200 when the file is ready within 3 seconds; 202 while it is made in the background (ranges over 92 days always). Audited.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportCreated"}}}},"202":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportCreated"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExportBody"}}}}}},"/v1/reports/orgs/{orgId}/exports/{exportId}":{"get":{"operationId":"getV1ReportsOrgsByOrgIdExportsByExportId","tags":["Reports"],"summary":"Get an export's state","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"exportId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportExport"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/reports/orgs/{orgId}/schedules":{"get":{"operationId":"getV1ReportsOrgsByOrgIdSchedules","tags":["Reports"],"summary":"List an organisation's report schedules","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"postV1ReportsOrgsByOrgIdSchedules","tags":["Reports"],"summary":"Schedule a weekly or monthly report email (a link only)","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScheduleBody"}}}}}},"/v1/reports/orgs/{orgId}/schedules/{scheduleId}":{"put":{"operationId":"putV1ReportsOrgsByOrgIdSchedulesByScheduleId","tags":["Reports"],"summary":"Turn a report schedule on or off","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"scheduleId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleWrite"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleStateBody"}}}}}},"/v1/messages/threads":{"get":{"operationId":"getV1MessagesThreads","tags":["Messages"],"summary":"List the caller's conversations","description":"Care-circle and office threads the caller is a member of now, newest activity first.","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadList"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"postV1MessagesThreads","tags":["Messages"],"summary":"Start a conversation, or get the open one","description":"201 when a thread is opened, 200 with the open one. Family cannot start a direct or office thread (403).","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"Already done: the earlier result is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartedThread"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartedThread"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartThreadBody"}}}}}},"/v1/messages/threads/{id}":{"get":{"operationId":"getV1MessagesThreadsById","tags":["Messages"],"summary":"Get a conversation with its newest messages and members","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadDetail"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/messages/threads/{id}/messages":{"post":{"operationId":"postV1MessagesThreadsByIdMessages","tags":["Messages"],"summary":"Send a message","description":"Idempotent on clientId: a resend answers 200 with the stored message. 409 on a closed thread. Audited without the text.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"Already done: the earlier result is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageBody"}}}}}},"/v1/messages/threads/{id}/attachments/{clientId}":{"put":{"operationId":"putV1MessagesThreadsByIdAttachmentsByClientId","tags":["Messages"],"summary":"Upload a file for a message","description":"Raw file body. Content-Type must be one of image/jpeg, image/png, image/webp, application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/plain and match the file's first bytes; at most 10 MB. X-File-Name carries the URI-encoded name. Refusals answer 400 with fields.file too-big, wrong-type or empty. Each person may upload 200 MB and each organisation 2048 MB in a rolling 24 hours; over that, 429 RATE_LIMITED with fields.file quota and Retry-After. An upload never put on a message is deleted after 24 hours. The same clientId again answers 200. Read it through POST /v1/files/attachment/:id/link.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"clientId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"Already done: the earlier result is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageAttachment"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageAttachment"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/messages/threads/{id}/read":{"post":{"operationId":"postV1MessagesThreadsByIdRead","tags":["Messages"],"summary":"Mark a conversation read up to a message","description":"Limited to 60 read marks per 60 seconds per person, shared by the four read routes. Over it: 429 RATE_LIMITED with Retry-After.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"204":{"description":"Done. No body."},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadThreadBody"}}}}}},"/v1/messages/threads/{id}/close":{"post":{"operationId":"postV1MessagesThreadsByIdClose","tags":["Messages"],"summary":"Close a conversation","description":"The agency office only. A new conversation can then be started.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"204":{"description":"Done. No body."},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/messages/circles":{"get":{"operationId":"getV1MessagesCircles","tags":["Messages"],"summary":"List the care circles and offices the caller can message","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CircleList"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/messages/cases/{caseId}/unread":{"get":{"operationId":"getV1MessagesCasesByCaseIdUnread","tags":["Messages"],"summary":"Get the newest unread message from the agency about a client","parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnreadFromAgency"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/messages/orgs/{orgId}/carers":{"get":{"operationId":"getV1MessagesOrgsByOrgIdCarers","tags":["Messages"],"summary":"List the carers the office can message","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarerChoiceList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/files/{kind}/{id}/link":{"post":{"operationId":"postV1FilesByKindByIdLink","tags":["Files"],"summary":"Get a short-lived link to read or download a stored file","description":"kind is attachment (a message attachment) or export (a report export or compliance pack). Runs the record's own access check: unknown ids and files the caller may not open answer the same 403. The url works for 5 minutes, for the caller only. 409 while an export is being made; 400 for inline on a file the reader cannot show (fields.disposition not-viewable). Limited to 120 links per 60 seconds per person. Over it: 429 RATE_LIMITED with Retry-After.","parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileLink"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileLinkBody"}}}}}},"/v1/files/open/{token}":{"get":{"operationId":"getV1FilesOpenByToken","tags":["Files"],"summary":"Read or download a stored file through its link","description":"The url from a file link, with the same session. Checks the link and the access again; each view (inline) and download (attachment) is audited. Served with nosniff, private no-store and a policy that never lets the file run. Limited to 240 opens per 60 seconds per person. Over it: 429 RATE_LIMITED with Retry-After.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","description":"The file, with its exact Content-Type and Content-Disposition."}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/messages/orgs/{orgId}/announcements/preview":{"post":{"operationId":"postV1MessagesOrgsByOrgIdAnnouncementsPreview","tags":["Announcements"],"summary":"Count who an announcement would go to","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementPreview"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementPreviewBody"}}}}}},"/v1/messages/orgs/{orgId}/announcements":{"post":{"operationId":"postV1MessagesOrgsByOrgIdAnnouncements","tags":["Announcements"],"summary":"Send an announcement","description":"Idempotent on clientId. 400 when nobody would get it.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"Already done: the earlier result is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Announcement"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Announcement"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendAnnouncementBody"}}}}},"get":{"operationId":"getV1MessagesOrgsByOrgIdAnnouncements","tags":["Announcements"],"summary":"List an organisation's sent announcements with who has seen them","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/messages/announcements":{"get":{"operationId":"getV1MessagesAnnouncements","tags":["Announcements"],"summary":"List the announcements the caller received","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementList"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/messages/announcements/{id}":{"get":{"operationId":"getV1MessagesAnnouncementsById","tags":["Announcements"],"summary":"Get an announcement","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementDetail"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/messages/announcements/{id}/read":{"post":{"operationId":"postV1MessagesAnnouncementsByIdRead","tags":["Announcements"],"summary":"Mark an announcement seen","description":"Limited to 60 read marks per 60 seconds per person, shared by the four read routes. Over it: 429 RATE_LIMITED with Retry-After.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"204":{"description":"Done. No body."},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/notifications":{"get":{"operationId":"getV1Notifications","tags":["Notifications"],"summary":"List the caller's notifications","parameters":[{"name":"tab","in":"query","required":false,"schema":{"default":"unread","type":"string","enum":["unread","all"]}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationList"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/notifications/count":{"get":{"operationId":"getV1NotificationsCount","tags":["Notifications"],"summary":"Count the caller's unread notifications","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationCount"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/notifications/{id}/read":{"post":{"operationId":"postV1NotificationsByIdRead","tags":["Notifications"],"summary":"Mark one notification read","description":"Limited to 60 read marks per 60 seconds per person, shared by the four read routes. Over it: 429 RATE_LIMITED with Retry-After.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"204":{"description":"Done. No body."},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error. The body is the error envelope; code is one of NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/notifications/read-all":{"post":{"operationId":"postV1NotificationsReadAll","tags":["Notifications"],"summary":"Mark every notification read","description":"Limited to 60 read marks per 60 seconds per person, shared by the four read routes. Over it: 429 RATE_LIMITED with Retry-After.","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"204":{"description":"Done. No body."},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/notifications/settings":{"get":{"operationId":"getV1NotificationsSettings","tags":["Notifications"],"summary":"Get the caller's notification settings","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettings"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/notifications/settings/prefs":{"put":{"operationId":"putV1NotificationsSettingsPrefs","tags":["Notifications"],"summary":"Turn one notification on or off","description":"Concerns are always on in the app and by email: 400 with fields.event locked. Texts (channel sms) only for visits and concerns, and only with a verified number: 409 with fields.phone notVerified.","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettings"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPrefBody"}}}}}},"/v1/notifications/settings/quiet-hours":{"put":{"operationId":"putV1NotificationsSettingsQuietHours","tags":["Notifications"],"summary":"Set quiet hours","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettings"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuietHours"}}}}}},"/v1/notifications/settings/language":{"put":{"operationId":"putV1NotificationsSettingsLanguage","tags":["Notifications"],"summary":"Set the language for the caller's emails","description":"The app sends the language it is shown in, so times in emails read as the app shows them.","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"204":{"description":"Done. No body."},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailLanguageBody"}}}}}},"/v1/notifications/sms":{"get":{"operationId":"getV1NotificationsSms","tags":["Notifications"],"summary":"Get the caller's mobile number and text reminder choice","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSettings"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/notifications/sms/phone":{"post":{"operationId":"postV1NotificationsSmsPhone","tags":["Notifications"],"summary":"Text a code to a mobile number","description":"Twilio Verify texts a code; the verified number stays in use until this one is verified. Rate limited per person and per number.","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSettings"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartPhoneBody"}}}}},"delete":{"operationId":"deleteV1NotificationsSmsPhone","tags":["Notifications"],"summary":"Remove the caller's mobile number","description":"Also turns every text off.","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSettings"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/notifications/sms/phone/check":{"post":{"operationId":"postV1NotificationsSmsPhoneCheck","tags":["Notifications"],"summary":"Check the texted code","description":"The right code makes the waiting number the verified one. Rate limited per person.","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSettings"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckPhoneBody"}}}}}},"/v1/notifications/sms/reminder":{"put":{"operationId":"putV1NotificationsSmsReminder","tags":["Notifications"],"summary":"Choose visit reminders by text","description":"Off, the evening before, or 1 hour before. Needs a verified number.","parameters":[{"name":"x-region","in":"header","required":false,"description":"The data region the client expects. When it differs from the region serving the request, the answer is 403 WRONG_REGION.","schema":{"type":"string","enum":["eu","uk","us","ca"]}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsSettings"}}}},"400":{"description":"Error. The body is the error envelope; code is one of INVALID. fields maps each invalid input to a field code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error. The body is the error envelope; code is one of UNAUTHENTICATED. No valid session cookie.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error. The body is the error envelope; code is one of EMAIL_NOT_VERIFIED, STEP_UP_REQUIRED, FORBIDDEN, WRONG_REGION. The caller lacks the function this route needs, has not verified their email, or sent the wrong x-region.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Error. The body is the error envelope; code is one of CONFLICT. The request conflicts with the current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error. The body is the error envelope; code is one of INTERNAL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSmsReminderBody"}}}}}}},"webhooks":{"visit.published":{"post":{"operationId":"postWebhooksVisitPublished","tags":["Webhooks"],"summary":"Event visit.published","description":"Sent to every enabled endpoint that chose visit.published. Identifiers, times and states only; no names or free text. Retried with exponential backoff until a 2xx; the event id stays the same on retries.","parameters":[{"name":"Elavinya-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" under the endpoint's signing secret>. Refuse it when t is more than 300 seconds from your clock. After a rotation a second v1= signs with the old secret for a while.","schema":{"type":"string"}},{"name":"Elavinya-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"Elavinya-Event-Type","in":"header","required":true,"schema":{"type":"string","const":"visit.published"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"visit.published"},"api_version":{"type":"string","const":"v1"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"org_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"data":{"type":"object","properties":{"visit_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"case_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"starts_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"ends_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["visit_id","case_id","starts_at","ends_at"],"additionalProperties":false}},"required":["id","type","api_version","created_at","org_id","data"],"additionalProperties":false}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in time, is retried."}}}},"visit.changed":{"post":{"operationId":"postWebhooksVisitChanged","tags":["Webhooks"],"summary":"Event visit.changed","description":"Sent to every enabled endpoint that chose visit.changed. Identifiers, times and states only; no names or free text. Retried with exponential backoff until a 2xx; the event id stays the same on retries.","parameters":[{"name":"Elavinya-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" under the endpoint's signing secret>. Refuse it when t is more than 300 seconds from your clock. After a rotation a second v1= signs with the old secret for a while.","schema":{"type":"string"}},{"name":"Elavinya-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"Elavinya-Event-Type","in":"header","required":true,"schema":{"type":"string","const":"visit.changed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"visit.changed"},"api_version":{"type":"string","const":"v1"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"org_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"data":{"type":"object","properties":{"visit_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"case_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"starts_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"ends_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"change":{"type":"string","enum":["assigned","unassigned","moved","cancelled"]}},"required":["visit_id","case_id","starts_at","ends_at","change"],"additionalProperties":false}},"required":["id","type","api_version","created_at","org_id","data"],"additionalProperties":false}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in time, is retried."}}}},"visit.finished":{"post":{"operationId":"postWebhooksVisitFinished","tags":["Webhooks"],"summary":"Event visit.finished","description":"Sent to every enabled endpoint that chose visit.finished. Identifiers, times and states only; no names or free text. Retried with exponential backoff until a 2xx; the event id stays the same on retries.","parameters":[{"name":"Elavinya-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" under the endpoint's signing secret>. Refuse it when t is more than 300 seconds from your clock. After a rotation a second v1= signs with the old secret for a while.","schema":{"type":"string"}},{"name":"Elavinya-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"Elavinya-Event-Type","in":"header","required":true,"schema":{"type":"string","const":"visit.finished"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"visit.finished"},"api_version":{"type":"string","const":"v1"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"org_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"data":{"type":"object","properties":{"visit_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"case_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"starts_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"ends_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"checked_in_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"checked_out_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["visit_id","case_id","starts_at","ends_at","checked_in_at","checked_out_at"],"additionalProperties":false}},"required":["id","type","api_version","created_at","org_id","data"],"additionalProperties":false}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in time, is retried."}}}},"medication.given":{"post":{"operationId":"postWebhooksMedicationGiven","tags":["Webhooks"],"summary":"Event medication.given","description":"Sent to every enabled endpoint that chose medication.given. Identifiers, times and states only; no names or free text. Retried with exponential backoff until a 2xx; the event id stays the same on retries.","parameters":[{"name":"Elavinya-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" under the endpoint's signing secret>. Refuse it when t is more than 300 seconds from your clock. After a rotation a second v1= signs with the old secret for a while.","schema":{"type":"string"}},{"name":"Elavinya-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"Elavinya-Event-Type","in":"header","required":true,"schema":{"type":"string","const":"medication.given"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"medication.given"},"api_version":{"type":"string","const":"v1"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"org_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"data":{"type":"object","properties":{"administration_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"case_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"order_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"due_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recorded_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["administration_id","case_id","order_id","due_at","recorded_at"],"additionalProperties":false}},"required":["id","type","api_version","created_at","org_id","data"],"additionalProperties":false}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in time, is retried."}}}},"concern.filed":{"post":{"operationId":"postWebhooksConcernFiled","tags":["Webhooks"],"summary":"Event concern.filed","description":"Sent to every enabled endpoint that chose concern.filed. Identifiers, times and states only; no names or free text. Retried with exponential backoff until a 2xx; the event id stays the same on retries.","parameters":[{"name":"Elavinya-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" under the endpoint's signing secret>. Refuse it when t is more than 300 seconds from your clock. After a rotation a second v1= signs with the old secret for a while.","schema":{"type":"string"}},{"name":"Elavinya-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"Elavinya-Event-Type","in":"header","required":true,"schema":{"type":"string","const":"concern.filed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"concern.filed"},"api_version":{"type":"string","const":"v1"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"org_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"data":{"type":"object","properties":{"concern_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"reference":{"type":"string"},"urgency":{"type":"string"}},"required":["concern_id","reference","urgency"],"additionalProperties":false}},"required":["id","type","api_version","created_at","org_id","data"],"additionalProperties":false}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in time, is retried."}}}},"concern.decided":{"post":{"operationId":"postWebhooksConcernDecided","tags":["Webhooks"],"summary":"Event concern.decided","description":"Sent to every enabled endpoint that chose concern.decided. Identifiers, times and states only; no names or free text. Retried with exponential backoff until a 2xx; the event id stays the same on retries.","parameters":[{"name":"Elavinya-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" under the endpoint's signing secret>. Refuse it when t is more than 300 seconds from your clock. After a rotation a second v1= signs with the old secret for a while.","schema":{"type":"string"}},{"name":"Elavinya-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"Elavinya-Event-Type","in":"header","required":true,"schema":{"type":"string","const":"concern.decided"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"concern.decided"},"api_version":{"type":"string","const":"v1"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"org_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"data":{"type":"object","properties":{"concern_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"reference":{"type":"string"},"stage":{"type":"string"}},"required":["concern_id","reference","stage"],"additionalProperties":false}},"required":["id","type","api_version","created_at","org_id","data"],"additionalProperties":false}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in time, is retried."}}}},"booking.requested":{"post":{"operationId":"postWebhooksBookingRequested","tags":["Webhooks"],"summary":"Event booking.requested","description":"Sent to every enabled endpoint that chose booking.requested. Identifiers, times and states only; no names or free text. Retried with exponential backoff until a 2xx; the event id stays the same on retries.","parameters":[{"name":"Elavinya-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" under the endpoint's signing secret>. Refuse it when t is more than 300 seconds from your clock. After a rotation a second v1= signs with the old secret for a while.","schema":{"type":"string"}},{"name":"Elavinya-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"Elavinya-Event-Type","in":"header","required":true,"schema":{"type":"string","const":"booking.requested"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"booking.requested"},"api_version":{"type":"string","const":"v1"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"org_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"data":{"type":"object","properties":{"request_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"case_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"starts_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["request_id","case_id","starts_at"],"additionalProperties":false}},"required":["id","type","api_version","created_at","org_id","data"],"additionalProperties":false}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in time, is retried."}}}},"ping":{"post":{"operationId":"postWebhooksPing","tags":["Webhooks"],"summary":"Test event (Send test event)","description":"Sent to every enabled endpoint that chose ping. Identifiers, times and states only; no names or free text. Retried with exponential backoff until a 2xx; the event id stays the same on retries.","parameters":[{"name":"Elavinya-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" under the endpoint's signing secret>. Refuse it when t is more than 300 seconds from your clock. After a rotation a second v1= signs with the old secret for a while.","schema":{"type":"string"}},{"name":"Elavinya-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"Elavinya-Event-Type","in":"header","required":true,"schema":{"type":"string","const":"ping"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"ping"},"api_version":{"type":"string","const":"v1"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"org_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"data":{"type":"object","properties":{"message":{"type":"string","const":"Test event from Elavinya"}},"required":["message"],"additionalProperties":false}},"required":["id","type","api_version","created_at","org_id","data"],"additionalProperties":false}}}},"responses":{"2XX":{"description":"Received. Anything else, or no answer in time, is retried."}}}}},"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"__Secure-better-auth.session_token","description":"better-auth session cookie. On http://localhost the name has no __Secure- prefix (better-auth.session_token)."},"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"elv_live_<id>_<secret> (production) or elv_test_<id>_<secret> (preview)","description":"An organisation API key: Authorization: Bearer <key>. It acts for the person who made it, in that agency only, on the routes that list the apiKey scheme, with the scope named there. Revoked, expired or unknown keys answer 401; a missing scope or another agency's data 403; over the per-key limit 429."}},"schemas":{"ErrorEnvelope":{"type":"object","properties":{"error":{"type":"string","maxLength":500},"code":{"type":"string","enum":["INVALID","UNAUTHENTICATED","EMAIL_NOT_VERIFIED","STEP_UP_REQUIRED","FORBIDDEN","WRONG_REGION","NOT_FOUND","CONFLICT","GONE","RATE_LIMITED","UNAVAILABLE","INTERNAL"]},"fields":{"type":"object","propertyNames":{"type":"string","maxLength":120},"additionalProperties":{"type":"string","maxLength":64}}},"required":["error"],"additionalProperties":false},"RegionSuggestion":{"type":"object","properties":{"country":{"anyOf":[{"type":"string","enum":["AD","AE","AF","AG","AI","AL","AM","AO","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GT","GU","GW","GY","HK","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]},{"type":"null"}]},"emergencyNumber":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}]}},"required":["country","emergencyNumber"],"additionalProperties":false},"InviteSignedIn":{"type":"object","properties":{"kind":{"type":"string","enum":["org","case"]},"home":{"type":"string","format":"starts_with","pattern":"^\\/app.*"}},"required":["kind","home"],"additionalProperties":false},"InviteSignInBody":{"type":"object","properties":{"kind":{"type":"string","enum":["org","case"]},"token":{"type":"string","pattern":"^[0-9a-f]{64}$"},"name":{"type":"string","maxLength":200}},"required":["kind","token"]},"OrgRow":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"type":{"type":"string","enum":["agency","branch","b2b-client","site","family","household"]},"parentId":{"type":["string","null"]},"region":{"type":"string","enum":["eu","uk","us","ca"]},"country":{"anyOf":[{"type":"string","enum":["AD","AE","AF","AG","AI","AL","AM","AO","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GT","GU","GW","GY","HK","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]},{"type":"null"}]},"emergencyNumber":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}]},"ownerUserId":{"type":["string","null"]},"ownerReviewNeeded":{"default":false,"type":"boolean"},"createdAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","type","parentId","region","country","emergencyNumber","ownerUserId","ownerReviewNeeded","createdAt"],"additionalProperties":false},"OrgCreateBody":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"type":{"type":"string","enum":["agency","branch","b2b-client","site","family","household"]},"parentId":{"type":"string"},"region":{"type":"string","enum":["eu","uk","us","ca"]},"country":{"type":"string","enum":["AD","AE","AF","AG","AI","AL","AM","AO","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GT","GU","GW","GY","HK","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]},"emergencyNumber":{"type":"string","pattern":"^\\d{2,6}$"}},"required":["name","type","region"]},"SetOrgCountryBody":{"type":"object","properties":{"country":{"type":"string","enum":["AD","AE","AF","AG","AI","AL","AM","AO","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GT","GU","GW","GY","HK","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]},"emergencyNumber":{"type":"string","pattern":"^\\d{2,6}$"}},"required":["country"]},"TransferOwnerBody":{"type":"object","properties":{"membershipId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["membershipId"]},"OkResult":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false},"ChangeRoleBody":{"type":"object","properties":{"role":{"type":"string","enum":["caregiver","senior","coordinator","agency-admin"]}},"required":["role"]},"EscalationSettingsView":{"type":"object","properties":{"settings":{"type":"object","properties":{"carerAlerts":{"type":"object","properties":{"urgent":{"type":"object","properties":{"responseMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"realertMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"nextAfterRealerts":{"type":"integer","minimum":1,"maximum":10},"next":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"],"additionalProperties":false},"alert":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"],"additionalProperties":false},"acknowledge":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"],"additionalProperties":false}},"required":["responseMinutes","realertMinutes","nextAfterRealerts","next","alert","acknowledge"],"additionalProperties":false},"emergency":{"type":"object","properties":{"responseMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"realertMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"nextAfterRealerts":{"type":"integer","minimum":1,"maximum":10},"next":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"],"additionalProperties":false},"alert":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"],"additionalProperties":false},"acknowledge":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"],"additionalProperties":false}},"required":["responseMinutes","realertMinutes","nextAfterRealerts","next","alert","acknowledge"],"additionalProperties":false}},"required":["urgent","emergency"],"additionalProperties":false},"concerns":{"type":"object","properties":{"urgent":{"type":"object","properties":{"responseMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"realertMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"nextAfterRealerts":{"type":"integer","minimum":1,"maximum":10},"next":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"],"additionalProperties":false},"alert":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"],"additionalProperties":false}},"required":["responseMinutes","realertMinutes","nextAfterRealerts","next","alert"],"additionalProperties":false},"emergency":{"type":"object","properties":{"responseMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"realertMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"nextAfterRealerts":{"type":"integer","minimum":1,"maximum":10},"next":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"],"additionalProperties":false},"alert":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"],"additionalProperties":false}},"required":["responseMinutes","realertMinutes","nextAfterRealerts","next","alert"],"additionalProperties":false}},"required":["urgent","emergency"],"additionalProperties":false}},"required":["carerAlerts","concerns"],"additionalProperties":false},"isDefault":{"type":"boolean"},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"people":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"role":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"required":["userId","name","role"],"additionalProperties":false}}},"required":["settings","isDefault","updatedAt","people"],"additionalProperties":false},"EscalationSettings":{"type":"object","properties":{"carerAlerts":{"type":"object","properties":{"urgent":{"type":"object","properties":{"responseMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"realertMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"nextAfterRealerts":{"type":"integer","minimum":1,"maximum":10},"next":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"]},"alert":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"]},"acknowledge":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"]}},"required":["responseMinutes","realertMinutes","nextAfterRealerts","next","alert","acknowledge"]},"emergency":{"type":"object","properties":{"responseMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"realertMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"nextAfterRealerts":{"type":"integer","minimum":1,"maximum":10},"next":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"]},"alert":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"]},"acknowledge":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"]}},"required":["responseMinutes","realertMinutes","nextAfterRealerts","next","alert","acknowledge"]}},"required":["urgent","emergency"]},"concerns":{"type":"object","properties":{"urgent":{"type":"object","properties":{"responseMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"realertMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"nextAfterRealerts":{"type":"integer","minimum":1,"maximum":10},"next":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"]},"alert":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"]}},"required":["responseMinutes","realertMinutes","nextAfterRealerts","next","alert"]},"emergency":{"type":"object","properties":{"responseMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"realertMinutes":{"type":"integer","minimum":5,"maximum":9007199254740991},"nextAfterRealerts":{"type":"integer","minimum":1,"maximum":10},"next":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"]},"alert":{"type":"object","properties":{"roles":{"maxItems":3,"type":"array","items":{"type":"string","enum":["agency-admin","coordinator","senior"]}},"userIds":{"maxItems":25,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["roles","userIds"]}},"required":["responseMinutes","realertMinutes","nextAfterRealerts","next","alert"]}},"required":["urgent","emergency"]}},"required":["carerAlerts","concerns"]},"OrgSmsSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"sentThisMonth":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["enabled","sentThisMonth"],"additionalProperties":false},"SetOrgSmsBody":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"InviteRow":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"expiresAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","expiresAt"],"additionalProperties":false},"OrgInviteBody":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","minLength":2,"maxLength":64}},"required":["email","role"]},"PendingInviteList":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","minLength":2,"maxLength":64},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","email","role","sentAt","expiresAt"],"additionalProperties":false}},"PendingInvite":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","minLength":2,"maxLength":64},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","email","role","sentAt","expiresAt"],"additionalProperties":false},"InviteDetails":{"type":"object","properties":{"org":{"type":"object","properties":{"name":{"type":"string","maxLength":120}},"required":["name"],"additionalProperties":false},"inviterFirstName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"role":{"type":"string","minLength":2,"maxLength":64}},"required":["org","inviterFirstName","role"],"additionalProperties":false},"InviteDetailsBody":{"type":"object","properties":{"token":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["token"]},"AcceptedMembership":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"role":{"type":"string"}},"required":["id","orgId","role"],"additionalProperties":false},"AcceptInviteBody":{"type":"object","properties":{"token":{"type":"string","minLength":16}},"required":["token"]},"DelegationBody":{"type":"object","properties":{"toEmail":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"orgId":{"type":"string","minLength":1},"scope":{"type":"string","minLength":1,"maxLength":120},"fnSubset":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"days":{"type":"integer","minimum":1,"maximum":30}},"required":["toEmail","orgId","scope","fnSubset","days"]},"BreakGlassHolderGrant":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"membershipId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"reviewDueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"alerted":{"type":"boolean"}},"required":["id","membershipId","userId","until","reviewDueAt","alerted"],"additionalProperties":false},"GrantBreakGlassBody":{"type":"object","properties":{"membershipId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["membershipId","reason"]},"BreakGlassBody":{"type":"object","properties":{"orgId":{"type":"string","minLength":1},"scope":{"type":"string","minLength":1,"maxLength":120},"reason":{"type":"string","minLength":10,"maxLength":500}},"required":["orgId","scope","reason"]},"StepUpToken":{"type":"object","properties":{"stepUpToken":{"type":"string","minLength":1}},"required":["stepUpToken"],"additionalProperties":false},"StepUpCodeBody":{"type":"object","properties":{"code":{"type":"string","minLength":4,"maxLength":32}},"required":["code"]},"Availability":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"tz":{"type":"string"},"slots":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"end":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"state":{"type":"string","enum":["free","yours","taken"]},"holdId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]}},"required":["start","end","state","holdId"],"additionalProperties":false}}},"required":["caseId","tz","slots"],"additionalProperties":false},"Hold":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"slotStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"slotEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","caseId","slotStart","slotEnd","expiresAt","audit"],"additionalProperties":false},"HoldBody":{"type":"object","properties":{"slotStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["slotStart"]},"HoldReleased":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","audit"],"additionalProperties":false},"VisitRequestResult":{"type":"object","properties":{"request":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"type":["string","null"]},"kind":{"type":"string","enum":["extra","move"]},"status":{"type":"string","enum":["requested","confirmed","declined","cancelled","moved"]},"slotStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"slotEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visitRef":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"visitStartsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"note":{"type":["string","null"]},"shortNotice":{"type":"boolean"},"requestedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"declineReason":{"type":["string","null"]},"emailSent":{"type":["boolean","null"]},"rosterChange":{"anyOf":[{"type":"string","const":"applied"},{"type":"null"}]},"rosterVisitId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"replacesRequestId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"tz":{"type":"string"}},"required":["id","caseId","clientName","kind","status","slotStart","slotEnd","visitRef","visitStartsAt","note","shortNotice","requestedBy","createdAt","decidedBy","decidedAt","declineReason","emailSent","rosterChange","rosterVisitId","replacesRequestId","tz"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["request","audit"],"additionalProperties":false},"CreateVisitRequestBody":{"type":"object","properties":{"holdId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["extra","move"]},"visitRef":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"note":{"type":"string","maxLength":500}},"required":["holdId","kind"]},"VisitRequestList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"type":["string","null"]},"kind":{"type":"string","enum":["extra","move"]},"status":{"type":"string","enum":["requested","confirmed","declined","cancelled","moved"]},"slotStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"slotEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visitRef":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"visitStartsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"note":{"type":["string","null"]},"shortNotice":{"type":"boolean"},"requestedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"declineReason":{"type":["string","null"]},"emailSent":{"type":["boolean","null"]},"rosterChange":{"anyOf":[{"type":"string","const":"applied"},{"type":"null"}]},"rosterVisitId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"replacesRequestId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"tz":{"type":"string"}},"required":["id","caseId","clientName","kind","status","slotStart","slotEnd","visitRef","visitStartsAt","note","shortNotice","requestedBy","createdAt","decidedBy","decidedAt","declineReason","emailSent","rosterChange","rosterVisitId","replacesRequestId","tz"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"MoveVisitRequestBody":{"type":"object","properties":{"holdId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["holdId"]},"CancelBody":{"type":"object","properties":{"reason":{"type":"string","maxLength":300}}},"VisitDecisionBody":{"oneOf":[{"type":"object","properties":{"decision":{"type":"string","const":"confirm"}},"required":["decision"]},{"type":"object","properties":{"decision":{"type":"string","const":"decline"},"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["decision","reason"]}]},"BookingQueue":{"type":"object","properties":{"visits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"type":["string","null"]},"kind":{"type":"string","enum":["extra","move"]},"status":{"type":"string","enum":["requested","confirmed","declined","cancelled","moved"]},"slotStart":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"slotEnd":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visitRef":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"visitStartsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"note":{"type":["string","null"]},"shortNotice":{"type":"boolean"},"requestedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"declineReason":{"type":["string","null"]},"emailSent":{"type":["boolean","null"]},"rosterChange":{"anyOf":[{"type":"string","const":"applied"},{"type":"null"}]},"rosterVisitId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"replacesRequestId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"tz":{"type":"string"}},"required":["id","caseId","clientName","kind","status","slotStart","slotEnd","visitRef","visitStartsAt","note","shortNotice","requestedBy","createdAt","decidedBy","decidedAt","declineReason","emailSent","rosterChange","rosterVisitId","replacesRequestId","tz"],"additionalProperties":false}},"gp":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"type":["string","null"]},"status":{"type":"string","enum":["requested","confirmed","declined","cancelled"]},"needs":{"type":"object","properties":{"reason":{"type":"string","enum":["fallFollowUp","longTermReview","medicines","mobility"]},"pain":{"type":"integer","minimum":0,"maximum":10},"redFlags":{"maxItems":8,"type":"array","items":{"type":"string","enum":["chestPain","breathing","stroke","confusion","bleeding","fallInjury","seizure","swelling"]}},"company":{"maxItems":2,"type":"array","items":{"type":"string","enum":["me","carer"]}},"gp":{"type":"string","enum":["usual","any"]},"signs":{"maxItems":7,"type":"array","items":{"type":"string","enum":["pain","fall","dizzy","eating","skin","memory","medicines"]}}},"required":["reason","pain","redFlags","company","gp","signs"],"additionalProperties":false},"mode":{"type":"string","enum":["home","surgery","call"]},"windows":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"part":{"type":"string","enum":["morning","afternoon"]}},"required":["date","part"],"additionalProperties":false}},"tz":{"type":"string"},"note":{"type":["string","null"]},"requestedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"practiceTime":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"practiceNote":{"type":["string","null"]},"updatedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"emailSent":{"type":["boolean","null"]}},"required":["id","caseId","clientName","status","needs","mode","windows","tz","note","requestedBy","createdAt","practiceTime","practiceNote","updatedBy","updatedAt","emailSent"],"additionalProperties":false}}},"required":["visits","gp"],"additionalProperties":false},"GpRequestResult":{"type":"object","properties":{"request":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"type":["string","null"]},"status":{"type":"string","enum":["requested","confirmed","declined","cancelled"]},"needs":{"type":"object","properties":{"reason":{"type":"string","enum":["fallFollowUp","longTermReview","medicines","mobility"]},"pain":{"type":"integer","minimum":0,"maximum":10},"redFlags":{"maxItems":8,"type":"array","items":{"type":"string","enum":["chestPain","breathing","stroke","confusion","bleeding","fallInjury","seizure","swelling"]}},"company":{"maxItems":2,"type":"array","items":{"type":"string","enum":["me","carer"]}},"gp":{"type":"string","enum":["usual","any"]},"signs":{"maxItems":7,"type":"array","items":{"type":"string","enum":["pain","fall","dizzy","eating","skin","memory","medicines"]}}},"required":["reason","pain","redFlags","company","gp","signs"],"additionalProperties":false},"mode":{"type":"string","enum":["home","surgery","call"]},"windows":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"part":{"type":"string","enum":["morning","afternoon"]}},"required":["date","part"],"additionalProperties":false}},"tz":{"type":"string"},"note":{"type":["string","null"]},"requestedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"practiceTime":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"practiceNote":{"type":["string","null"]},"updatedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"emailSent":{"type":["boolean","null"]}},"required":["id","caseId","clientName","status","needs","mode","windows","tz","note","requestedBy","createdAt","practiceTime","practiceNote","updatedBy","updatedAt","emailSent"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["request","audit"],"additionalProperties":false},"CreateGpRequestBody":{"type":"object","properties":{"needs":{"type":"object","properties":{"reason":{"type":"string","enum":["fallFollowUp","longTermReview","medicines","mobility"]},"pain":{"type":"integer","minimum":0,"maximum":10},"redFlags":{"maxItems":8,"type":"array","items":{"type":"string","enum":["chestPain","breathing","stroke","confusion","bleeding","fallInjury","seizure","swelling"]}},"company":{"maxItems":2,"type":"array","items":{"type":"string","enum":["me","carer"]}},"gp":{"type":"string","enum":["usual","any"]},"signs":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["pain","fall","dizzy","eating","skin","memory","medicines"]}}},"required":["reason","pain","redFlags","company","gp","signs"]},"mode":{"type":"string","enum":["home","surgery","call"]},"windows":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"part":{"type":"string","enum":["morning","afternoon"]}},"required":["date","part"]}},"tz":{"type":"string","minLength":1,"maxLength":64},"note":{"type":"string","maxLength":500}},"required":["needs","mode","windows","tz"]},"GpRequestList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"type":["string","null"]},"status":{"type":"string","enum":["requested","confirmed","declined","cancelled"]},"needs":{"type":"object","properties":{"reason":{"type":"string","enum":["fallFollowUp","longTermReview","medicines","mobility"]},"pain":{"type":"integer","minimum":0,"maximum":10},"redFlags":{"maxItems":8,"type":"array","items":{"type":"string","enum":["chestPain","breathing","stroke","confusion","bleeding","fallInjury","seizure","swelling"]}},"company":{"maxItems":2,"type":"array","items":{"type":"string","enum":["me","carer"]}},"gp":{"type":"string","enum":["usual","any"]},"signs":{"maxItems":7,"type":"array","items":{"type":"string","enum":["pain","fall","dizzy","eating","skin","memory","medicines"]}}},"required":["reason","pain","redFlags","company","gp","signs"],"additionalProperties":false},"mode":{"type":"string","enum":["home","surgery","call"]},"windows":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"part":{"type":"string","enum":["morning","afternoon"]}},"required":["date","part"],"additionalProperties":false}},"tz":{"type":"string"},"note":{"type":["string","null"]},"requestedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"practiceTime":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"practiceNote":{"type":["string","null"]},"updatedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"emailSent":{"type":["boolean","null"]}},"required":["id","caseId","clientName","status","needs","mode","windows","tz","note","requestedBy","createdAt","practiceTime","practiceNote","updatedBy","updatedAt","emailSent"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"GpRequest":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"type":["string","null"]},"status":{"type":"string","enum":["requested","confirmed","declined","cancelled"]},"needs":{"type":"object","properties":{"reason":{"type":"string","enum":["fallFollowUp","longTermReview","medicines","mobility"]},"pain":{"type":"integer","minimum":0,"maximum":10},"redFlags":{"maxItems":8,"type":"array","items":{"type":"string","enum":["chestPain","breathing","stroke","confusion","bleeding","fallInjury","seizure","swelling"]}},"company":{"maxItems":2,"type":"array","items":{"type":"string","enum":["me","carer"]}},"gp":{"type":"string","enum":["usual","any"]},"signs":{"maxItems":7,"type":"array","items":{"type":"string","enum":["pain","fall","dizzy","eating","skin","memory","medicines"]}}},"required":["reason","pain","redFlags","company","gp","signs"],"additionalProperties":false},"mode":{"type":"string","enum":["home","surgery","call"]},"windows":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"part":{"type":"string","enum":["morning","afternoon"]}},"required":["date","part"],"additionalProperties":false}},"tz":{"type":"string"},"note":{"type":["string","null"]},"requestedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"practiceTime":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"practiceNote":{"type":["string","null"]},"updatedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"emailSent":{"type":["boolean","null"]}},"required":["id","caseId","clientName","status","needs","mode","windows","tz","note","requestedBy","createdAt","practiceTime","practiceNote","updatedBy","updatedAt","emailSent"],"additionalProperties":false},"GpStatusBody":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"confirmed"},"practiceTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"practiceNote":{"type":"string","maxLength":300}},"required":["status","practiceTime"]},{"type":"object","properties":{"status":{"type":"string","const":"declined"},"practiceNote":{"type":"string","minLength":1,"maxLength":300}},"required":["status","practiceNote"]}]},"MyCases":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"status":{"type":"string","enum":["intake","eligible","ineligible","active","closed"]},"clientName":{"type":"string"},"preferredName":{"type":["string","null"]},"kind":{"type":"string","enum":["client","family","team"]},"partyId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"agencyName":{"type":"string"},"sharing":{"anyOf":[{"type":"string","enum":["on","off"]},{"type":"null"}]}},"required":["id","status","clientName","preferredName","kind","partyId","agencyName","sharing"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"CaseInviteAccepted":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"partyId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"membershipId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["caseId","partyId","membershipId","audit"],"additionalProperties":false},"CaseInviteAcceptBody":{"type":"object","properties":{"token":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["token"]},"CaseInviteDetails":{"type":"object","properties":{"org":{"type":"object","properties":{"name":{"type":"string","maxLength":120}},"required":["name"],"additionalProperties":false},"inviterFirstName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"client":{"type":"object","properties":{"name":{"type":"string","maxLength":240}},"required":["name"],"additionalProperties":false},"role":{"type":"string","enum":["client","lead-family","family"]}},"required":["org","inviterFirstName","client","role"],"additionalProperties":false},"NhsSimulationStatus":{"type":"object","properties":{"on":{"type":"boolean"},"records":{"type":"array","items":{"type":"object","properties":{"nhsNumber":{"type":"string","pattern":"^\\d{10}$"},"givenName":{"type":"string"},"familyName":{"type":"string"},"dateOfBirth":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"addressLine1":{"type":"string"},"town":{"type":"string"},"postcode":{"type":"string"},"holds":{"type":"string","enum":["medicines-and-allergies","medicines-only"]}},"required":["nhsNumber","givenName","familyName","dateOfBirth","addressLine1","town","postcode","holds"],"additionalProperties":false}}},"required":["on","records"],"additionalProperties":false},"AgencySummary":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"region":{"type":"string","enum":["eu","uk","us","ca"]},"country":{"anyOf":[{"type":"string","enum":["AD","AE","AF","AG","AI","AL","AM","AO","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GT","GU","GW","GY","HK","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]},{"type":"null"}]}},"required":["id","name","region","country"],"additionalProperties":false},"ReferralCreated":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["caseId","audit"],"additionalProperties":false},"ReferralBody":{"type":"object","properties":{"agencyId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"relationship":{"type":"string","enum":["self","child","spouse-partner","parent","sibling","grandchild","friend","other"]},"answers":{"type":"object","properties":{"givenName":{"type":"string","minLength":1,"maxLength":80},"familyName":{"type":"string","minLength":1,"maxLength":80},"preferredName":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"dateOfBirth":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"addressLine1":{"type":"string","minLength":1,"maxLength":120},"addressLine2":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"town":{"type":"string","minLength":1,"maxLength":120},"postcode":{"type":"string","minLength":2,"maxLength":12,"pattern":"^[A-Za-z0-9][A-Za-z0-9 -]*$"},"inArea":{"type":"string","enum":["yes","no"]},"needs":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["personal-care","medication","meals","mobility","companionship","household"]}},"hoursPerWeek":{"type":"integer","minimum":1,"maximum":168},"nursing":{"type":"string","enum":["none","some","continuous"]},"consent":{"type":"string","enum":["agrees","lpa","best-interests","declines"]},"funding":{"type":"string","enum":["self","council","nhs","employer","not-sure"]},"gpPractice":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"nhsNumber":{"anyOf":[{"type":"string","pattern":"^\\d{10}$"},{"type":"null"}]},"timeZone":{"type":"string","minLength":1,"maxLength":64}},"required":["givenName","familyName","preferredName","dateOfBirth","addressLine1","addressLine2","town","postcode","inArea","needs","hoursPerWeek","nursing","consent","funding","gpPractice","timeZone"]}},"required":["agencyId","relationship","answers"]},"CaseList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"status":{"type":"string","enum":["intake","eligible","ineligible","active","closed"]},"useCase":{"type":"string","enum":["HOMECARE","CHILDCARE","CLINIC","SUPPORT"]},"clientName":{"type":"string"},"preferredName":{"type":["string","null"]},"dateOfBirth":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"teamCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"familyCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"appealOpen":{"type":"boolean"}},"required":["id","status","useCase","clientName","preferredName","dateOfBirth","createdAt","updatedAt","teamCount","familyCount","appealOpen"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false},"IntakeCreated":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"status":{"type":"string","enum":["intake","eligible","ineligible","active","closed"]},"suggestion":{"type":"object","properties":{"outcome":{"type":"string","enum":["eligible","ineligible"]},"reasons":{"type":"array","items":{"type":"string","enum":["adult","under-18","in-area","outside-area","nursing-manageable","continuous-nursing","consent-given","consent-declined"]}}},"required":["outcome","reasons"],"additionalProperties":false},"nhsTrace":{"anyOf":[{"type":"object","properties":{"outcome":{"type":"string","enum":["matched","mismatch","not-found","unavailable"]},"source":{"anyOf":[{"type":"string","enum":["pds-sandbox","gpc-demonstrator"]},{"type":"null"}]},"mismatches":{"type":"array","items":{"type":"string","enum":["name","date-of-birth","postcode"]}},"tracedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"simulated":{"type":"boolean","const":true}},"required":["outcome","source","mismatches","tracedAt","simulated"],"additionalProperties":false},{"type":"null"}]},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["caseId","status","suggestion","nhsTrace","audit"],"additionalProperties":false},"IntakeBody":{"type":"object","properties":{"answers":{"type":"object","properties":{"givenName":{"type":"string","minLength":1,"maxLength":80},"familyName":{"type":"string","minLength":1,"maxLength":80},"preferredName":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"dateOfBirth":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"addressLine1":{"type":"string","minLength":1,"maxLength":120},"addressLine2":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"town":{"type":"string","minLength":1,"maxLength":120},"postcode":{"type":"string","minLength":2,"maxLength":12,"pattern":"^[A-Za-z0-9][A-Za-z0-9 -]*$"},"inArea":{"type":"string","enum":["yes","no"]},"needs":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["personal-care","medication","meals","mobility","companionship","household"]}},"hoursPerWeek":{"type":"integer","minimum":1,"maximum":168},"nursing":{"type":"string","enum":["none","some","continuous"]},"consent":{"type":"string","enum":["agrees","lpa","best-interests","declines"]},"funding":{"type":"string","enum":["self","council","nhs","employer","not-sure"]},"gpPractice":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"nhsNumber":{"anyOf":[{"type":"string","pattern":"^\\d{10}$"},{"type":"null"}]},"timeZone":{"type":"string","minLength":1,"maxLength":64}},"required":["givenName","familyName","preferredName","dateOfBirth","addressLine1","addressLine2","town","postcode","inArea","needs","hoursPerWeek","nursing","consent","funding","gpPractice","timeZone"]},"decision":{"type":"object","properties":{"outcome":{"type":"string","enum":["eligible","ineligible"]},"overrideReason":{"anyOf":[{"type":"string","minLength":10,"maxLength":1000},{"type":"null"}]}},"required":["outcome","overrideReason"]}},"required":["answers","decision"]},"CaseDetail":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"status":{"type":"string","enum":["intake","eligible","ineligible","active","closed"]},"useCase":{"type":"string","enum":["HOMECARE","CHILDCARE","CLINIC","SUPPORT"]},"agencyName":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"client":{"type":"object","properties":{"givenName":{"type":"string"},"familyName":{"type":"string"},"preferredName":{"type":["string","null"]},"dateOfBirth":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"addressLine1":{"type":"string"},"addressLine2":{"type":["string","null"]},"town":{"type":"string"},"postcode":{"type":"string"},"gpPractice":{"type":["string","null"]},"timeZone":{"type":"string"},"nhsNumber":{"type":["string","null"]},"nhsTrace":{"anyOf":[{"type":"object","properties":{"outcome":{"type":"string","enum":["matched","mismatch","not-found","unavailable"]},"source":{"anyOf":[{"type":"string","enum":["pds-sandbox","gpc-demonstrator"]},{"type":"null"}]},"mismatches":{"type":"array","items":{"type":"string","enum":["name","date-of-birth","postcode"]}},"tracedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"simulated":{"type":"boolean","const":true}},"required":["outcome","source","mismatches","tracedAt","simulated"],"additionalProperties":false},{"type":"null"}]}},"required":["givenName","familyName","preferredName","dateOfBirth","addressLine1","addressLine2","town","postcode","gpPractice","timeZone","nhsNumber","nhsTrace"],"additionalProperties":false},"viewer":{"type":"object","properties":{"scope":{"type":"string","enum":["org","team","family"]},"partyId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"manages":{"type":"boolean"},"decidesConsent":{"type":"boolean"}},"required":["scope","partyId","manages","decidesConsent"],"additionalProperties":false},"parties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["client","family","team"]},"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"relationship":{"anyOf":[{"type":"string","enum":["self","child","spouse-partner","parent","sibling","grandchild","friend","other"]},{"type":"null"}]},"lpa":{"type":"boolean"},"lead":{"type":"boolean"},"teamRole":{"anyOf":[{"type":"string","enum":["carer","coordinator","care-manager"]},{"type":"null"}]},"since":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sharing":{"anyOf":[{"type":"string","enum":["on","off"]},{"type":"null"}]}},"required":["id","kind","userId","name","relationship","lpa","lead","teamRole","since","sharing"],"additionalProperties":false}},"invites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"relationship":{"type":"string","enum":["self","child","spouse-partner","parent","sibling","grandchild","friend","other"]},"lpa":{"type":"boolean"},"lead":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","relationship","lpa","lead","expiresAt"],"additionalProperties":false}},"consents":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string","enum":["care-delivery","family-sharing","gp-sharing","nursing-sharing","payer-reporting"]},"subjectPartyId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"state":{"type":"string","enum":["granted","withdrawn"]},"basis":{"type":"string","enum":["client","lpa","best-interests","recorded","invited","referred"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["purpose","subjectPartyId","state","basis","decidedBy","decidedAt"],"additionalProperties":false}},"intake":{"anyOf":[{"type":"object","properties":{"rulesVersion":{"type":"string"},"suggested":{"type":"string","enum":["eligible","ineligible"]},"reasons":{"type":"array","items":{"type":"string","enum":["adult","under-18","in-area","outside-area","nursing-manageable","continuous-nursing","consent-given","consent-declined"]}},"decided":{"anyOf":[{"type":"string","enum":["eligible","ineligible"]},{"type":"null"}]},"overrideReason":{"type":["string","null"]},"decidedBy":{"type":["string","null"]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"answers":{"anyOf":[{"type":"object","properties":{"givenName":{"type":"string","minLength":1,"maxLength":80},"familyName":{"type":"string","minLength":1,"maxLength":80},"preferredName":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"dateOfBirth":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"addressLine1":{"type":"string","minLength":1,"maxLength":120},"addressLine2":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"town":{"type":"string","minLength":1,"maxLength":120},"postcode":{"type":"string","minLength":2,"maxLength":12,"pattern":"^[A-Za-z0-9][A-Za-z0-9 -]*$"},"inArea":{"type":"string","enum":["yes","no"]},"needs":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["personal-care","medication","meals","mobility","companionship","household"]}},"hoursPerWeek":{"type":"integer","minimum":1,"maximum":168},"nursing":{"type":"string","enum":["none","some","continuous"]},"consent":{"type":"string","enum":["agrees","lpa","best-interests","declines"]},"funding":{"type":"string","enum":["self","council","nhs","employer","not-sure"]},"gpPractice":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"nhsNumber":{"anyOf":[{"type":"string","pattern":"^\\d{10}$"},{"type":"null"}]},"timeZone":{"type":"string","minLength":1,"maxLength":64}},"required":["givenName","familyName","preferredName","dateOfBirth","addressLine1","addressLine2","town","postcode","inArea","needs","hoursPerWeek","nursing","consent","funding","gpPractice","timeZone"],"additionalProperties":false},{"type":"null"}]}},"required":["rulesVersion","suggested","reasons","decided","overrideReason","decidedBy","decidedAt","answers"],"additionalProperties":false},{"type":"null"}]},"appeals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"status":{"type":"string","enum":["open","upheld","declined"]},"reason":{"type":"string"},"requestedBy":{"type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"type":["string","null"]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]}},"required":["id","status","reason","requestedBy","requestedAt","decidedBy","decidedAt","decisionNote"],"additionalProperties":false}}},"required":["id","status","useCase","agencyName","createdAt","updatedAt","client","viewer","parties","invites","consents","intake","appeals"],"additionalProperties":false},"DecisionRecorded":{"type":"object","properties":{"status":{"type":"string","enum":["intake","eligible","ineligible","active","closed"]},"suggestion":{"type":"object","properties":{"outcome":{"type":"string","enum":["eligible","ineligible"]},"reasons":{"type":"array","items":{"type":"string","enum":["adult","under-18","in-area","outside-area","nursing-manageable","continuous-nursing","consent-given","consent-declined"]}}},"required":["outcome","reasons"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["status","suggestion","audit"],"additionalProperties":false},"IntakeDecision":{"type":"object","properties":{"outcome":{"type":"string","enum":["eligible","ineligible"]},"overrideReason":{"anyOf":[{"type":"string","minLength":10,"maxLength":1000},{"type":"null"}]}},"required":["outcome","overrideReason"]},"NhsNumberResult":{"type":"object","properties":{"nhsNumber":{"anyOf":[{"type":"string","pattern":"^\\d{10}$"},{"type":"null"}]},"nhsTrace":{"anyOf":[{"type":"object","properties":{"outcome":{"type":"string","enum":["matched","mismatch","not-found","unavailable"]},"source":{"anyOf":[{"type":"string","enum":["pds-sandbox","gpc-demonstrator"]},{"type":"null"}]},"mismatches":{"type":"array","items":{"type":"string","enum":["name","date-of-birth","postcode"]}},"tracedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"simulated":{"type":"boolean","const":true}},"required":["outcome","source","mismatches","tracedAt","simulated"],"additionalProperties":false},{"type":"null"}]},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["nhsNumber","nhsTrace","audit"],"additionalProperties":false},"NhsNumberBody":{"type":"object","properties":{"nhsNumber":{"anyOf":[{"type":"string","pattern":"^\\d{10}$"},{"type":"null"}]}},"required":["nhsNumber"]},"CaseTimeline":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"kind":{"type":"string","enum":["case.referred","case.created","case.decided","case.appealed","case.review-decided","case.activated","party.invited","party.joined","party.ended","consent.changed","plan.drafted","plan.approved","visit.scheduled","visit.started","visit.completed","visit.missed","visit.cancelled","observation.recorded","observation.acknowledged","observation.escalated","observation.resolved","medication.ordered","medication.stopped","medication.given","medication.not-given","medication.held","medication.lifted","medication.hold-read","medication.overridden","nhs.traced","gp-record.imported","gp-record.accepted","gp-record.rejected","safeguarding.raised","safeguarding.triaged","booking.requested","booking.confirmed","booking.declined","booking.cancelled","gp.requested","gp.confirmed","gp.declined","gp.cancelled"]},"audience":{"type":"string","enum":["team","circle"]},"urgency":{"anyOf":[{"type":"string","enum":["routine","urgent","emergency"]},{"type":"null"}]},"actorName":{"type":["string","null"]},"ref":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","pattern":"^[a-z][a-z-]{0,31}$"},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["type","id"],"additionalProperties":false},{"type":"null"}]},"params":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-zA-Z]{1,32}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"}]}},"note":{"type":["string","null"]}},"required":["id","at","kind","audience","urgency","actorName","ref","params","note"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false},"CaseInviteCreated":{"type":"object","properties":{"invite":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"relationship":{"type":"string","enum":["self","child","spouse-partner","parent","sibling","grandchild","friend","other"]},"lpa":{"type":"boolean"},"lead":{"type":"boolean"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","relationship","lpa","lead","expiresAt"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["invite","audit"],"additionalProperties":false},"CaseInviteBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"relationship":{"type":"string","enum":["self","child","spouse-partner","parent","sibling","grandchild","friend","other"]},"lpa":{"type":"boolean"},"lead":{"type":"boolean"}},"required":["name","email","relationship","lpa","lead"]},"PartyChanged":{"type":"object","properties":{"party":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["client","family","team"]},"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"relationship":{"anyOf":[{"type":"string","enum":["self","child","spouse-partner","parent","sibling","grandchild","friend","other"]},{"type":"null"}]},"lpa":{"type":"boolean"},"lead":{"type":"boolean"},"teamRole":{"anyOf":[{"type":"string","enum":["carer","coordinator","care-manager"]},{"type":"null"}]},"since":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"sharing":{"anyOf":[{"type":"string","enum":["on","off"]},{"type":"null"}]}},"required":["id","kind","userId","name","relationship","lpa","lead","teamRole","since","sharing"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["party","audit"],"additionalProperties":false},"TeamMemberBody":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"teamRole":{"type":"string","enum":["carer","coordinator","care-manager"]}},"required":["userId","teamRole"]},"PartyEnded":{"type":"object","properties":{"partyId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["partyId","audit"],"additionalProperties":false},"ConsentChanged":{"type":"object","properties":{"consent":{"type":"object","properties":{"purpose":{"type":"string","enum":["care-delivery","family-sharing","gp-sharing","nursing-sharing","payer-reporting"]},"subjectPartyId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"state":{"type":"string","enum":["granted","withdrawn"]},"basis":{"type":"string","enum":["client","lpa","best-interests","recorded","invited","referred"]},"decidedBy":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["purpose","subjectPartyId","state","basis","decidedBy","decidedAt"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["consent","audit"],"additionalProperties":false},"ConsentBody":{"type":"object","properties":{"purpose":{"type":"string","enum":["care-delivery","family-sharing","gp-sharing","nursing-sharing","payer-reporting"]},"subjectPartyId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"state":{"type":"string","enum":["granted","withdrawn"]}},"required":["purpose","subjectPartyId","state"]},"AppealChanged":{"type":"object","properties":{"appeal":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"status":{"type":"string","enum":["open","upheld","declined"]},"reason":{"type":"string"},"requestedBy":{"type":"string"},"requestedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedBy":{"type":["string","null"]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"decisionNote":{"type":["string","null"]}},"required":["id","status","reason","requestedBy","requestedAt","decidedBy","decidedAt","decisionNote"],"additionalProperties":false},"status":{"type":"string","enum":["intake","eligible","ineligible","active","closed"]},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["appeal","status","audit"],"additionalProperties":false},"AppealBody":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":2000}},"required":["reason"]},"AppealDecisionBody":{"type":"object","properties":{"outcome":{"type":"string","enum":["upheld","declined"]},"note":{"type":"string","minLength":10,"maxLength":2000}},"required":["outcome","note"]},"CarePlan":{"type":"object","properties":{"current":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","approved","superseded"]},"timeZone":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"string","enum":["morning","lunch","tea","bed","night"]},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"durationMinutes":{"type":"integer","minimum":15,"maximum":720},"carersNeeded":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2}]},"purpose":{"type":"string","minLength":1,"maxLength":120},"skills":{"maxItems":4,"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"tasks":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"detail":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]}},"required":["title","detail"],"additionalProperties":false}},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["slot","weekdays","startMinute","durationMinutes","carersNeeded","purpose","skills","tasks","id"],"additionalProperties":false}},"draftedBy":{"type":"string"},"draftedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approvedBy":{"type":["string","null"]},"approvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","version","status","timeZone","items","draftedBy","draftedAt","approvedBy","approvedAt"],"additionalProperties":false},{"type":"null"}]},"proposed":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","approved","superseded"]},"timeZone":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"string","enum":["morning","lunch","tea","bed","night"]},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"durationMinutes":{"type":"integer","minimum":15,"maximum":720},"carersNeeded":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2}]},"purpose":{"type":"string","minLength":1,"maxLength":120},"skills":{"maxItems":4,"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"tasks":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"detail":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]}},"required":["title","detail"],"additionalProperties":false}},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["slot","weekdays","startMinute","durationMinutes","carersNeeded","purpose","skills","tasks","id"],"additionalProperties":false}},"draftedBy":{"type":"string"},"draftedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approvedBy":{"type":["string","null"]},"approvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","version","status","timeZone","items","draftedBy","draftedAt","approvedBy","approvedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["current","proposed"],"additionalProperties":false},"PlanChanged":{"type":"object","properties":{"plan":{"type":"object","properties":{"current":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","approved","superseded"]},"timeZone":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"string","enum":["morning","lunch","tea","bed","night"]},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"durationMinutes":{"type":"integer","minimum":15,"maximum":720},"carersNeeded":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2}]},"purpose":{"type":"string","minLength":1,"maxLength":120},"skills":{"maxItems":4,"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"tasks":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"detail":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]}},"required":["title","detail"],"additionalProperties":false}},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["slot","weekdays","startMinute","durationMinutes","carersNeeded","purpose","skills","tasks","id"],"additionalProperties":false}},"draftedBy":{"type":"string"},"draftedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approvedBy":{"type":["string","null"]},"approvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","version","status","timeZone","items","draftedBy","draftedAt","approvedBy","approvedAt"],"additionalProperties":false},{"type":"null"}]},"proposed":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","approved","superseded"]},"timeZone":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"string","enum":["morning","lunch","tea","bed","night"]},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"durationMinutes":{"type":"integer","minimum":15,"maximum":720},"carersNeeded":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2}]},"purpose":{"type":"string","minLength":1,"maxLength":120},"skills":{"maxItems":4,"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"tasks":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"detail":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]}},"required":["title","detail"],"additionalProperties":false}},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["slot","weekdays","startMinute","durationMinutes","carersNeeded","purpose","skills","tasks","id"],"additionalProperties":false}},"draftedBy":{"type":"string"},"draftedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"approvedBy":{"type":["string","null"]},"approvedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","version","status","timeZone","items","draftedBy","draftedAt","approvedBy","approvedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["current","proposed"],"additionalProperties":false},"status":{"type":"string","enum":["intake","eligible","ineligible","active","closed"]},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["plan","status","audit"],"additionalProperties":false},"PlanDraftBody":{"type":"object","properties":{"items":{"minItems":1,"maxItems":30,"type":"array","items":{"type":"object","properties":{"slot":{"type":"string","enum":["morning","lunch","tea","bed","night"]},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"durationMinutes":{"type":"integer","minimum":15,"maximum":720},"carersNeeded":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2}]},"purpose":{"type":"string","minLength":1,"maxLength":120},"skills":{"maxItems":4,"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"tasks":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"detail":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]}},"required":["title","detail"]}}},"required":["slot","weekdays","startMinute","durationMinutes","carersNeeded","purpose","skills","tasks"]}}},"required":["items"]},"PlanApproveBody":{"type":"object","properties":{"packageId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["packageId"]},"ApiKeyList":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["read:visits","write:visits","read:staff","read:cases","read:medication","read:bookings","read:reports","webhooks:manage"]}},"status":{"type":"string","enum":["active","expired","revoked"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"rotatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","name","prefix","scopes","status","createdAt","createdBy","expiresAt","lastUsedAt","rotatedAt","revokedAt"],"additionalProperties":false}}},"required":["keys"],"additionalProperties":false},"ApiKeySecret":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["read:visits","write:visits","read:staff","read:cases","read:medication","read:bookings","read:reports","webhooks:manage"]}},"status":{"type":"string","enum":["active","expired","revoked"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"rotatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","name","prefix","scopes","status","createdAt","createdBy","expiresAt","lastUsedAt","rotatedAt","revokedAt"],"additionalProperties":false},"secret":{"type":"string"}},"required":["key","secret"],"additionalProperties":false},"CreateApiKeyBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"minItems":1,"maxItems":8,"type":"array","items":{"type":"string","enum":["read:visits","write:visits","read:staff","read:cases","read:medication","read:bookings","read:reports","webhooks:manage"]}},"expiresInDays":{"type":"integer","minimum":1,"maximum":365}},"required":["name","scopes","expiresInDays"]},"WebhookEndpointList":{"type":"object","properties":{"endpoints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"url":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["visit.published","visit.changed","visit.finished","medication.given","concern.filed","concern.decided","booking.requested"]}},"enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"secretRotatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lastDelivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["pending","succeeded","failed","dead"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["status","at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","url","description","events","enabled","createdAt","secretRotatedAt","lastDelivery"],"additionalProperties":false}}},"required":["endpoints"],"additionalProperties":false},"WebhookSecret":{"type":"object","properties":{"endpoint":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"url":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["visit.published","visit.changed","visit.finished","medication.given","concern.filed","concern.decided","booking.requested"]}},"enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"secretRotatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lastDelivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["pending","succeeded","failed","dead"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["status","at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","url","description","events","enabled","createdAt","secretRotatedAt","lastDelivery"],"additionalProperties":false},"secret":{"type":"string"}},"required":["endpoint","secret"],"additionalProperties":false},"CreateWebhookBody":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"description":{"default":"","type":"string","maxLength":200},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["visit.published","visit.changed","visit.finished","medication.given","concern.filed","concern.decided","booking.requested"]}}},"required":["url","events"]},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"url":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["visit.published","visit.changed","visit.finished","medication.given","concern.filed","concern.decided","booking.requested"]}},"enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"secretRotatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"lastDelivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["pending","succeeded","failed","dead"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["status","at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","url","description","events","enabled","createdAt","secretRotatedAt","lastDelivery"],"additionalProperties":false},"UpdateWebhookBody":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"description":{"type":"string","maxLength":200},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["visit.published","visit.changed","visit.finished","medication.given","concern.filed","concern.decided","booking.requested"]}},"enabled":{"type":"boolean"}}},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"eventId":{"type":"string"},"eventType":{"type":"string","enum":["visit.published","visit.changed","visit.finished","medication.given","concern.filed","concern.decided","booking.requested","ping"]},"status":{"type":"string","enum":["pending","succeeded","failed","dead"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","eventId","eventType","status","attempts","responseStatus","error","createdAt","lastAttemptAt","nextAttemptAt"],"additionalProperties":false},"WebhookDeliveryList":{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"eventId":{"type":"string"},"eventType":{"type":"string","enum":["visit.published","visit.changed","visit.finished","medication.given","concern.filed","concern.decided","booking.requested","ping"]},"status":{"type":"string","enum":["pending","succeeded","failed","dead"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"responseStatus":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","eventId","eventType","status","attempts","responseStatus","error","createdAt","lastAttemptAt","nextAttemptAt"],"additionalProperties":false}}},"required":["deliveries"],"additionalProperties":false},"Me":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"emailVerified":{"type":"boolean"},"authenticator":{"type":"boolean"}},"required":["id","name","email","emailVerified"],"additionalProperties":false},"memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"role":{"type":"string","minLength":2,"maxLength":64},"area":{"anyOf":[{"type":"string","enum":["family","carer","ops"]},{"type":"null"}]},"ops":{"anyOf":[{"type":"string","enum":["full","limited"]},{"type":"null"}]},"since":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"org":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":120},"type":{"type":"string","enum":["agency","branch","b2b-client","site","family","household"]},"region":{"type":"string","enum":["eu","uk","us","ca"]},"country":{"anyOf":[{"type":"string","enum":["AD","AE","AF","AG","AI","AL","AM","AO","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GT","GU","GW","GY","HK","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]},{"type":"null"}]},"emergencyNumber":{"type":"string","maxLength":8}},"required":["id","name","type","region","country","emergencyNumber"],"additionalProperties":false},"owner":{"default":false,"type":"boolean"},"functions":{"type":"array","items":{"type":"string","maxLength":64}}},"required":["id","role","area","ops","since","org","owner","functions"],"additionalProperties":false}},"areas":{"type":"array","items":{"type":"string","enum":["family","carer","ops"]}},"orgRegion":{"anyOf":[{"type":"string","enum":["eu","uk","us","ca"]},{"type":"null"}]}},"required":["user","memberships","areas","orgRegion"],"additionalProperties":false},"UpdatedMe":{"type":"object","properties":{"name":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false},"UpdateMeBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"]},"PasswordState":{"type":"object","properties":{"set":{"type":"boolean"}},"required":["set"],"additionalProperties":false},"SetPasswordResult":{"type":"object","properties":{"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["audit"],"additionalProperties":false},"SetPasswordBody":{"type":"object","properties":{"newPassword":{"type":"string","minLength":12,"maxLength":128}},"required":["newPassword"]},"EmailStepUpSent":{"type":"object","properties":{"sent":{"type":"boolean","const":true},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["sent","expiresAt"],"additionalProperties":false},"EmailStepUpCodeBody":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["code"]},"SigningPinStatus":{"type":"object","properties":{"set":{"type":"boolean"},"lockedUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["set","lockedUntil"],"additionalProperties":false},"SetSigningPinResult":{"type":"object","properties":{"set":{"type":"boolean","const":true},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["set","audit"],"additionalProperties":false},"SetSigningPinBody":{"type":"object","properties":{"pin":{"type":"string","pattern":"^\\d{4,6}$"}},"required":["pin"]},"MedicationCaseList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"held":{"type":"integer","minimum":0,"maximum":9007199254740991},"due":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["caseId","clientName","held","due"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"MedicationChart":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"tz":{"type":"string","maxLength":64},"now":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"client":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["name"],"additionalProperties":false},"access":{"type":"object","properties":{"administer":{"type":"boolean"},"manage":{"type":"boolean"},"override":{"type":"boolean"}},"required":["administer","manage","override"],"additionalProperties":false},"pinSet":{"type":"boolean"},"orders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"medicine":{"type":"string","maxLength":120},"brand":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"strength":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000},"unit":{"type":"string","enum":["mg","mcg","g","ml","unit"]}},"required":["amount","unit"],"additionalProperties":false},"dose":{"type":"string","maxLength":120},"instructions":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"source":{"type":"string","enum":["gp-list","pharmacy-list","discharge-letter","gp-connect-sim"]},"sourceRef":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"gpRetrievedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"checks":{"type":"array","items":{"type":"string","enum":["bruise","bleeding","water","barcode","swallow"]}},"witnessRequired":{"type":"boolean"},"tz":{"type":"string","maxLength":64},"status":{"type":"string","enum":["active","stopped"]},"enteredBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"windowBeforeMin":{"type":"integer","minimum":0,"maximum":240},"windowAfterMin":{"type":"integer","minimum":0,"maximum":240}},"required":["id","time","windowBeforeMin","windowAfterMin"],"additionalProperties":false}},"holds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orderId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"medicine":{"type":"string","maxLength":120},"reason":{"type":"string","maxLength":1000},"directedBy":{"type":"string","maxLength":120},"directedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"channel":{"type":"string","enum":["phone","in-person","written","gp-system"]},"placedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"placedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lift":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"reason":{"type":"string","maxLength":1000},"directedBy":{"type":"string","maxLength":120},"directedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["at","by","reason","directedBy","directedAt"],"additionalProperties":false},{"type":"null"}]},"readByMeAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","orderId","caseId","medicine","reason","directedBy","directedAt","channel","placedBy","placedAt","lift","readByMeAt"],"additionalProperties":false}},"doses":{"type":"array","items":{"type":"object","properties":{"orderId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"scheduleId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"opensAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"closesAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"state":{"type":"string","enum":["upcoming","due","late","missed","held","given","not-given"]},"record":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"outcome":{"type":"string","enum":["given","not-given"]},"reason":{"anyOf":[{"type":"string","enum":["refused","asleep","sick","other"]},{"type":"null"}]},"checks":{"type":"array","items":{"type":"string","enum":["bruise","bleeding","water","barcode","swallow"]}},"recordedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"recordedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"witness":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"overridden":{"type":"boolean"}},"required":["id","outcome","reason","checks","recordedBy","recordedAt","witness","overridden"],"additionalProperties":false},{"type":"null"}]}},"required":["orderId","scheduleId","dueAt","opensAt","closesAt","state","record"],"additionalProperties":false}}},"required":["id","caseId","medicine","brand","strength","dose","instructions","source","sourceRef","gpRetrievedAt","checks","witnessRequired","tz","status","enteredBy","createdAt","schedules","holds","doses"],"additionalProperties":false}},"allergies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"substance":{"type":"string","maxLength":120},"reaction":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"source":{"type":"string","enum":["gpc-demonstrator"]},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"importedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"status":{"type":"string","enum":["pending","accepted","rejected"]},"review":{"anyOf":[{"type":"object","properties":{"by":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["by","at","note"],"additionalProperties":false},{"type":"null"}]}},"required":["id","caseId","substance","reaction","severity","source","retrievedAt","importedBy","status","review"],"additionalProperties":false}}},"required":["caseId","date","tz","now","client","access","pinSet","orders","allergies"],"additionalProperties":false},"MedicationHoldList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orderId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"medicine":{"type":"string","maxLength":120},"reason":{"type":"string","maxLength":1000},"directedBy":{"type":"string","maxLength":120},"directedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"channel":{"type":"string","enum":["phone","in-person","written","gp-system"]},"placedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"placedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lift":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"reason":{"type":"string","maxLength":1000},"directedBy":{"type":"string","maxLength":120},"directedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["at","by","reason","directedBy","directedAt"],"additionalProperties":false},{"type":"null"}]},"readByMeAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","orderId","caseId","medicine","reason","directedBy","directedAt","channel","placedBy","placedAt","lift","readByMeAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"DoseWitnessList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"blockers":{"maxItems":2,"type":"array","items":{"type":"string","enum":["off-duty","no-pin"]}}},"required":["id","name","blockers"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"MedicationOrderResult":{"type":"object","properties":{"order":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"medicine":{"type":"string","maxLength":120},"brand":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"strength":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000},"unit":{"type":"string","enum":["mg","mcg","g","ml","unit"]}},"required":["amount","unit"],"additionalProperties":false},"dose":{"type":"string","maxLength":120},"instructions":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"source":{"type":"string","enum":["gp-list","pharmacy-list","discharge-letter","gp-connect-sim"]},"sourceRef":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"gpRetrievedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"checks":{"type":"array","items":{"type":"string","enum":["bruise","bleeding","water","barcode","swallow"]}},"witnessRequired":{"type":"boolean"},"tz":{"type":"string","maxLength":64},"status":{"type":"string","enum":["active","stopped"]},"enteredBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"windowBeforeMin":{"type":"integer","minimum":0,"maximum":240},"windowAfterMin":{"type":"integer","minimum":0,"maximum":240}},"required":["id","time","windowBeforeMin","windowAfterMin"],"additionalProperties":false}}},"required":["id","caseId","medicine","brand","strength","dose","instructions","source","sourceRef","gpRetrievedAt","checks","witnessRequired","tz","status","enteredBy","createdAt","schedules"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["order","audit"],"additionalProperties":false},"CreateMedicationOrderBody":{"type":"object","properties":{"medicine":{"type":"string","minLength":1,"maxLength":120},"brand":{"type":"string","minLength":1,"maxLength":120},"strength":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000},"unit":{"type":"string","enum":["mg","mcg","g","ml","unit"]}},"required":["amount","unit"]},"dose":{"type":"string","minLength":1,"maxLength":120},"instructions":{"type":"string","minLength":1,"maxLength":1000},"source":{"type":"string","enum":["gp-list","pharmacy-list","discharge-letter","gp-connect-sim"]},"sourceRef":{"type":"string","minLength":1,"maxLength":200},"checks":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","enum":["bruise","bleeding","water","barcode","swallow"]}},"witnessRequired":{"default":false,"type":"boolean"},"tz":{"type":"string","minLength":1,"maxLength":64},"schedules":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"windowBeforeMin":{"default":15,"type":"integer","minimum":0,"maximum":240},"windowAfterMin":{"default":15,"type":"integer","minimum":0,"maximum":240}},"required":["time"]}}},"required":["medicine","strength","dose","source","schedules"]},"StopMedicationOrderBody":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["reason"]},"GpRecordView":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["name"],"additionalProperties":false},"blocked":{"anyOf":[{"type":"string","enum":["simulation-off","no-nhs-number","not-traced"]},{"type":"null"}]},"imports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"source":{"type":"string","enum":["gpc-demonstrator"]},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"importedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"medicines":{"type":"integer","minimum":0,"maximum":9007199254740991},"allergies":{"type":"integer","minimum":0,"maximum":9007199254740991},"noKnownAllergies":{"type":"boolean"},"allergiesUnavailable":{"type":"boolean"}},"required":["id","source","retrievedAt","importedBy","medicines","allergies","noKnownAllergies","allergiesUnavailable"],"additionalProperties":false}},"medicines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"importId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"medicine":{"type":"string","maxLength":120},"dosageText":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"instructions":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"suggestedStrength":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000},"unit":{"type":"string","enum":["mg","mcg","g","ml","unit"]}},"required":["amount","unit"],"additionalProperties":false},{"type":"null"}]},"source":{"type":"string","enum":["gpc-demonstrator"]},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"importedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"status":{"type":"string","enum":["pending","accepted","rejected"]},"review":{"anyOf":[{"type":"object","properties":{"by":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["by","at","note"],"additionalProperties":false},{"type":"null"}]},"orderId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]}},"required":["id","caseId","importId","medicine","dosageText","instructions","suggestedStrength","source","retrievedAt","importedBy","status","review","orderId"],"additionalProperties":false}},"allergies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"substance":{"type":"string","maxLength":120},"reaction":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"source":{"type":"string","enum":["gpc-demonstrator"]},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"importedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"status":{"type":"string","enum":["pending","accepted","rejected"]},"review":{"anyOf":[{"type":"object","properties":{"by":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["by","at","note"],"additionalProperties":false},{"type":"null"}]}},"required":["id","caseId","substance","reaction","severity","source","retrievedAt","importedBy","status","review"],"additionalProperties":false}},"viewerId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["caseId","client","blocked","imports","medicines","allergies","viewerId"],"additionalProperties":false},"GpRecordImportResult":{"type":"object","properties":{"import":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"source":{"type":"string","enum":["gpc-demonstrator"]},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"importedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"medicines":{"type":"integer","minimum":0,"maximum":9007199254740991},"allergies":{"type":"integer","minimum":0,"maximum":9007199254740991},"noKnownAllergies":{"type":"boolean"},"allergiesUnavailable":{"type":"boolean"}},"required":["id","source","retrievedAt","importedBy","medicines","allergies","noKnownAllergies","allergiesUnavailable"],"additionalProperties":false},"added":{"type":"object","properties":{"medicines":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allergies":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["medicines","allergies"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["import","added","audit"],"additionalProperties":false},"AcceptGpMedicineResult":{"type":"object","properties":{"draft":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"importId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"medicine":{"type":"string","maxLength":120},"dosageText":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"instructions":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"suggestedStrength":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000},"unit":{"type":"string","enum":["mg","mcg","g","ml","unit"]}},"required":["amount","unit"],"additionalProperties":false},{"type":"null"}]},"source":{"type":"string","enum":["gpc-demonstrator"]},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"importedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"status":{"type":"string","enum":["pending","accepted","rejected"]},"review":{"anyOf":[{"type":"object","properties":{"by":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["by","at","note"],"additionalProperties":false},{"type":"null"}]},"orderId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]}},"required":["id","caseId","importId","medicine","dosageText","instructions","suggestedStrength","source","retrievedAt","importedBy","status","review","orderId"],"additionalProperties":false},"order":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"medicine":{"type":"string","maxLength":120},"brand":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"strength":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000},"unit":{"type":"string","enum":["mg","mcg","g","ml","unit"]}},"required":["amount","unit"],"additionalProperties":false},"dose":{"type":"string","maxLength":120},"instructions":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"source":{"type":"string","enum":["gp-list","pharmacy-list","discharge-letter","gp-connect-sim"]},"sourceRef":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"gpRetrievedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"checks":{"type":"array","items":{"type":"string","enum":["bruise","bleeding","water","barcode","swallow"]}},"witnessRequired":{"type":"boolean"},"tz":{"type":"string","maxLength":64},"status":{"type":"string","enum":["active","stopped"]},"enteredBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"windowBeforeMin":{"type":"integer","minimum":0,"maximum":240},"windowAfterMin":{"type":"integer","minimum":0,"maximum":240}},"required":["id","time","windowBeforeMin","windowAfterMin"],"additionalProperties":false}}},"required":["id","caseId","medicine","brand","strength","dose","instructions","source","sourceRef","gpRetrievedAt","checks","witnessRequired","tz","status","enteredBy","createdAt","schedules"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["draft","order","audit"],"additionalProperties":false},"AcceptGpMedicineBody":{"type":"object","properties":{"medicine":{"type":"string","minLength":1,"maxLength":120},"brand":{"type":"string","minLength":1,"maxLength":120},"strength":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000},"unit":{"type":"string","enum":["mg","mcg","g","ml","unit"]}},"required":["amount","unit"]},"dose":{"type":"string","minLength":1,"maxLength":120},"instructions":{"type":"string","minLength":1,"maxLength":1000},"checks":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","enum":["bruise","bleeding","water","barcode","swallow"]}},"witnessRequired":{"default":false,"type":"boolean"},"tz":{"type":"string","minLength":1,"maxLength":64},"schedules":{"minItems":1,"maxItems":12,"type":"array","items":{"type":"object","properties":{"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"windowBeforeMin":{"default":15,"type":"integer","minimum":0,"maximum":240},"windowAfterMin":{"default":15,"type":"integer","minimum":0,"maximum":240}},"required":["time"]}}},"required":["medicine","strength","dose","schedules"]},"GpMedicineReviewResult":{"type":"object","properties":{"draft":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"importId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"medicine":{"type":"string","maxLength":120},"dosageText":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"instructions":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"suggestedStrength":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000},"unit":{"type":"string","enum":["mg","mcg","g","ml","unit"]}},"required":["amount","unit"],"additionalProperties":false},{"type":"null"}]},"source":{"type":"string","enum":["gpc-demonstrator"]},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"importedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"status":{"type":"string","enum":["pending","accepted","rejected"]},"review":{"anyOf":[{"type":"object","properties":{"by":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["by","at","note"],"additionalProperties":false},{"type":"null"}]},"orderId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]}},"required":["id","caseId","importId","medicine","dosageText","instructions","suggestedStrength","source","retrievedAt","importedBy","status","review","orderId"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["draft","audit"],"additionalProperties":false},"RejectGpItemBody":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["reason"]},"GpAllergyReviewResult":{"type":"object","properties":{"allergy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"substance":{"type":"string","maxLength":120},"reaction":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"severity":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"source":{"type":"string","enum":["gpc-demonstrator"]},"retrievedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"importedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"status":{"type":"string","enum":["pending","accepted","rejected"]},"review":{"anyOf":[{"type":"object","properties":{"by":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["by","at","note"],"additionalProperties":false},{"type":"null"}]}},"required":["id","caseId","substance","reaction","severity","source","retrievedAt","importedBy","status","review"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["allergy","audit"],"additionalProperties":false},"AcceptGpAllergyBody":{"type":"object","properties":{"substance":{"type":"string","minLength":1,"maxLength":120},"reaction":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["substance","reaction"]},"MedicationHoldResult":{"type":"object","properties":{"hold":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orderId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"medicine":{"type":"string","maxLength":120},"reason":{"type":"string","maxLength":1000},"directedBy":{"type":"string","maxLength":120},"directedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"channel":{"type":"string","enum":["phone","in-person","written","gp-system"]},"placedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"placedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lift":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"reason":{"type":"string","maxLength":1000},"directedBy":{"type":"string","maxLength":120},"directedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["at","by","reason","directedBy","directedAt"],"additionalProperties":false},{"type":"null"}]},"readByMeAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","orderId","caseId","medicine","reason","directedBy","directedAt","channel","placedBy","placedAt","lift","readByMeAt"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["hold","audit"],"additionalProperties":false},"PlaceMedicationHoldBody":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":1000},"directedBy":{"type":"string","minLength":1,"maxLength":120},"directedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"channel":{"type":"string","enum":["phone","in-person","written","gp-system"]}},"required":["reason","directedBy","directedAt","channel"]},"LiftMedicationHoldBody":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":1000},"directedBy":{"type":"string","minLength":1,"maxLength":120},"directedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["reason","directedBy","directedAt"]},"MedicationHoldReadResult":{"type":"object","properties":{"holdId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"readAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["holdId","readAt","audit"],"additionalProperties":false},"MedicationHoldReadBody":{"type":"object","properties":{"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"DoseOverrideResult":{"type":"object","properties":{"override":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orderId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","orderId","dueAt","expiresAt"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["override","audit"],"additionalProperties":false},"GrantDoseOverrideBody":{"type":"object","properties":{"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["dueAt","reason"]},"RecordDoseResult":{"type":"object","properties":{"dose":{"type":"object","properties":{"orderId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"scheduleId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"opensAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"closesAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"state":{"type":"string","enum":["upcoming","due","late","missed","held","given","not-given"]},"record":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"outcome":{"type":"string","enum":["given","not-given"]},"reason":{"anyOf":[{"type":"string","enum":["refused","asleep","sick","other"]},{"type":"null"}]},"checks":{"type":"array","items":{"type":"string","enum":["bruise","bleeding","water","barcode","swallow"]}},"recordedBy":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},"recordedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"witness":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"overridden":{"type":"boolean"}},"required":["id","outcome","reason","checks","recordedBy","recordedAt","witness","overridden"],"additionalProperties":false},{"type":"null"}]}},"required":["orderId","scheduleId","dueAt","opensAt","closesAt","state","record"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["dose","audit"],"additionalProperties":false},"RecordDoseBody":{"type":"object","properties":{"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"outcome":{"type":"string","enum":["given","not-given"]},"reason":{"type":"string","enum":["refused","asleep","sick","other"]},"note":{"type":"string","minLength":1,"maxLength":1000},"checks":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","enum":["bruise","bleeding","water","barcode","swallow"]}},"signature":{"oneOf":[{"type":"object","properties":{"method":{"type":"string","const":"pin"},"pin":{"type":"string","pattern":"^\\d{4,6}$"}},"required":["method","pin"]},{"type":"object","properties":{"method":{"type":"string","const":"step-up"}},"required":["method"]}]},"witness":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"pin":{"type":"string","pattern":"^\\d{4,6}$"}},"required":["userId","pin"]}},"required":["dueAt","outcome","signature"]},"FamilyMedicationSummary":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"tz":{"type":"string","maxLength":64},"items":{"type":"array","items":{"type":"object","properties":{"orderId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"medicine":{"type":"string","maxLength":120},"strength":{"type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000},"unit":{"type":"string","enum":["mg","mcg","g","ml","unit"]}},"required":["amount","unit"],"additionalProperties":false},"status":{"type":"string","enum":["on-hold","given","not-given","due","upcoming","missed","none-today"]},"at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["orderId","medicine","strength","status","at"],"additionalProperties":false}}},"required":["caseId","date","tz","items"],"additionalProperties":false},"RecipientList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["gp-practice","mash"]},"name":{"type":"string"},"odsCode":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","kind","name","odsCode","email"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"MeshChannel":{"oneOf":[{"type":"object","properties":{"available":{"type":"boolean","const":false}},"required":["available"],"additionalProperties":false},{"type":"object","properties":{"available":{"type":"boolean","const":true},"simulated":{"type":"boolean"},"recipients":{"type":"object","properties":{"sbar":{"type":"object","properties":{"name":{"type":"string"},"mailbox":{"type":"string","pattern":"^[A-Z0-9]{3,20}$"}},"required":["name","mailbox"],"additionalProperties":false},"s42":{"type":"object","properties":{"name":{"type":"string"},"mailbox":{"type":"string","pattern":"^[A-Z0-9]{3,20}$"}},"required":["name","mailbox"],"additionalProperties":false}},"required":["sbar","s42"],"additionalProperties":false}},"required":["available","simulated","recipients"],"additionalProperties":false}]},"RecipientCreated":{"type":"object","properties":{"recipient":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["gp-practice","mash"]},"name":{"type":"string"},"odsCode":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","kind","name","odsCode","email"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["recipient","audit"],"additionalProperties":false},"CreateRecipientBody":{"type":"object","properties":{"kind":{"type":"string","enum":["gp-practice","mash"]},"name":{"type":"string","minLength":1,"maxLength":200},"odsCode":{"type":"string","pattern":"^[A-Z0-9]{3,10}$"},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["kind","name","email"]},"DocumentResult":{"type":"object","properties":{"document":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["sbar","s42"]},"reference":{"type":"string"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"latestVersion":{"type":"integer","minimum":1,"maximum":9007199254740991},"concernId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"contentHash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"content":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"sbar"},"organisation":{"type":"string"},"subject":{"type":"object","properties":{"name":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"nhsNumber":{"type":["string","null"]}},"required":["name","dateOfBirth","nhsNumber"],"additionalProperties":false},"concern":{"type":"object","properties":{"reference":{"type":"string"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"urgency":{"type":"string","enum":["routine","urgent","emergency"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"details":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string","enum":["unexplained","distress","unsafe","family"]}}},"required":["reference","category","urgency","filedAt","details","tags"],"additionalProperties":false},"triage":{"type":"object","properties":{"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"checks":{"type":"array","items":{"type":"string","enum":["bodyMap","carerSafe","gpReview","localAuthority"]}},"decision":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"string"},"rationale":{"type":"string"}},"required":["at","by","rationale"],"additionalProperties":false},{"type":"null"}]}},"required":["stage","checks","decision"],"additionalProperties":false},"observations":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string"},"note":{"type":["string","null"]},"recordedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recordedBy":{"type":["string","null"]}},"required":["level","note","recordedAt","recordedBy"],"additionalProperties":false}},"medications":{"type":"array","items":{"type":"object","properties":{"medicine":{"type":"string"},"dose":{"type":"string"},"held":{"type":"boolean"},"holdReason":{"type":["string","null"]},"lastGivenAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["medicine","dose","held","holdReason","lastGivenAt"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["reference","category","filedAt"],"additionalProperties":false}},"recommendation":{"type":"string"}},"required":["kind","organisation","subject","concern","triage","observations","medications","history","recommendation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"s42"},"organisation":{"type":"string"},"subject":{"type":"object","properties":{"name":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"nhsNumber":{"type":["string","null"]}},"required":["name","dateOfBirth","nhsNumber"],"additionalProperties":false},"concern":{"type":"object","properties":{"reference":{"type":"string"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"urgency":{"type":"string","enum":["routine","urgent","emergency"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"details":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string","enum":["unexplained","distress","unsafe","family"]}}},"required":["reference","category","urgency","filedAt","details","tags"],"additionalProperties":false},"triage":{"type":"object","properties":{"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"checks":{"type":"array","items":{"type":"string","enum":["bodyMap","carerSafe","gpReview","localAuthority"]}},"decision":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"string"},"rationale":{"type":"string"}},"required":["at","by","rationale"],"additionalProperties":false},{"type":"null"}]}},"required":["stage","checks","decision"],"additionalProperties":false},"observations":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string"},"note":{"type":["string","null"]},"recordedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recordedBy":{"type":["string","null"]}},"required":["level","note","recordedAt","recordedBy"],"additionalProperties":false}},"medications":{"type":"array","items":{"type":"object","properties":{"medicine":{"type":"string"},"dose":{"type":"string"},"held":{"type":"boolean"},"holdReason":{"type":["string","null"]},"lastGivenAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["medicine","dose","held","holdReason","lastGivenAt"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["reference","category","filedAt"],"additionalProperties":false}},"reporter":{"type":"object","properties":{"name":{"type":["string","null"]},"role":{"type":"string"}},"required":["name","role"],"additionalProperties":false},"familyTold":{"type":["boolean","null"]},"immediateActions":{"type":"string"},"personsViews":{"type":["string","null"]}},"required":["kind","organisation","subject","concern","triage","observations","medications","history","reporter","familyTold","immediateActions","personsViews"],"additionalProperties":false}]},"signatures":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["author","countersign"]},"by":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["role","by","at"],"additionalProperties":false}},"transmissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"documentId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"channel":{"type":"string","enum":["secure-link","by-hand","mesh"]},"recipientLabel":{"type":"string"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["sent","delivered","acknowledged","failed"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"linkExpiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"linkRevokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mesh":{"anyOf":[{"type":"object","properties":{"messageId":{"type":["string","null"]},"mailbox":{"type":"string"},"workflowId":{"type":"string"},"simulated":{"type":"boolean"}},"required":["messageId","mailbox","workflowId","simulated"],"additionalProperties":false},{"type":"null"}]},"events":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["sent","delivered","acknowledged","failed"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"byName":{"type":["string","null"]},"reason":{"type":["string","null"]},"source":{"anyOf":[{"type":"string","enum":["mesh"]},{"type":"null"}]},"actorLabel":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["kind","at","byName","reason","source","actorLabel","note"],"additionalProperties":false}}},"required":["id","documentId","channel","recipientLabel","attempt","status","createdAt","createdBy","linkExpiresAt","linkRevokedAt","mesh","events"],"additionalProperties":false}}},"required":["id","kind","reference","version","latestVersion","concernId","caseId","orgId","createdAt","contentHash","content","signatures","transmissions"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["document","audit"],"additionalProperties":false},"GenerateDocumentBody":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"sbar"},"recommendation":{"type":"string","minLength":1,"maxLength":2000}},"required":["kind","recommendation"]},{"type":"object","properties":{"kind":{"type":"string","const":"s42"},"immediateActions":{"type":"string","minLength":1,"maxLength":2000},"personsViews":{"type":"string","maxLength":2000}},"required":["kind","immediateActions"]}]},"DocumentList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["sbar","s42"]},"reference":{"type":"string"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"countersigned":{"type":"boolean"},"transmissionStatus":{"anyOf":[{"type":"string","enum":["sent","delivered","acknowledged","failed"]},{"type":"null"}]}},"required":["id","kind","reference","version","createdAt","countersigned","transmissionStatus"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"RecordDocument":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["sbar","s42"]},"reference":{"type":"string"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991},"latestVersion":{"type":"integer","minimum":1,"maximum":9007199254740991},"concernId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"contentHash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"content":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"sbar"},"organisation":{"type":"string"},"subject":{"type":"object","properties":{"name":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"nhsNumber":{"type":["string","null"]}},"required":["name","dateOfBirth","nhsNumber"],"additionalProperties":false},"concern":{"type":"object","properties":{"reference":{"type":"string"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"urgency":{"type":"string","enum":["routine","urgent","emergency"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"details":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string","enum":["unexplained","distress","unsafe","family"]}}},"required":["reference","category","urgency","filedAt","details","tags"],"additionalProperties":false},"triage":{"type":"object","properties":{"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"checks":{"type":"array","items":{"type":"string","enum":["bodyMap","carerSafe","gpReview","localAuthority"]}},"decision":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"string"},"rationale":{"type":"string"}},"required":["at","by","rationale"],"additionalProperties":false},{"type":"null"}]}},"required":["stage","checks","decision"],"additionalProperties":false},"observations":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string"},"note":{"type":["string","null"]},"recordedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recordedBy":{"type":["string","null"]}},"required":["level","note","recordedAt","recordedBy"],"additionalProperties":false}},"medications":{"type":"array","items":{"type":"object","properties":{"medicine":{"type":"string"},"dose":{"type":"string"},"held":{"type":"boolean"},"holdReason":{"type":["string","null"]},"lastGivenAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["medicine","dose","held","holdReason","lastGivenAt"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["reference","category","filedAt"],"additionalProperties":false}},"recommendation":{"type":"string"}},"required":["kind","organisation","subject","concern","triage","observations","medications","history","recommendation"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"s42"},"organisation":{"type":"string"},"subject":{"type":"object","properties":{"name":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"nhsNumber":{"type":["string","null"]}},"required":["name","dateOfBirth","nhsNumber"],"additionalProperties":false},"concern":{"type":"object","properties":{"reference":{"type":"string"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"urgency":{"type":"string","enum":["routine","urgent","emergency"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"details":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string","enum":["unexplained","distress","unsafe","family"]}}},"required":["reference","category","urgency","filedAt","details","tags"],"additionalProperties":false},"triage":{"type":"object","properties":{"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"checks":{"type":"array","items":{"type":"string","enum":["bodyMap","carerSafe","gpReview","localAuthority"]}},"decision":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"string"},"rationale":{"type":"string"}},"required":["at","by","rationale"],"additionalProperties":false},{"type":"null"}]}},"required":["stage","checks","decision"],"additionalProperties":false},"observations":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string"},"note":{"type":["string","null"]},"recordedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"recordedBy":{"type":["string","null"]}},"required":["level","note","recordedAt","recordedBy"],"additionalProperties":false}},"medications":{"type":"array","items":{"type":"object","properties":{"medicine":{"type":"string"},"dose":{"type":"string"},"held":{"type":"boolean"},"holdReason":{"type":["string","null"]},"lastGivenAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["medicine","dose","held","holdReason","lastGivenAt"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["reference","category","filedAt"],"additionalProperties":false}},"reporter":{"type":"object","properties":{"name":{"type":["string","null"]},"role":{"type":"string"}},"required":["name","role"],"additionalProperties":false},"familyTold":{"type":["boolean","null"]},"immediateActions":{"type":"string"},"personsViews":{"type":["string","null"]}},"required":["kind","organisation","subject","concern","triage","observations","medications","history","reporter","familyTold","immediateActions","personsViews"],"additionalProperties":false}]},"signatures":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["author","countersign"]},"by":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["role","by","at"],"additionalProperties":false}},"transmissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"documentId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"channel":{"type":"string","enum":["secure-link","by-hand","mesh"]},"recipientLabel":{"type":"string"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["sent","delivered","acknowledged","failed"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"linkExpiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"linkRevokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mesh":{"anyOf":[{"type":"object","properties":{"messageId":{"type":["string","null"]},"mailbox":{"type":"string"},"workflowId":{"type":"string"},"simulated":{"type":"boolean"}},"required":["messageId","mailbox","workflowId","simulated"],"additionalProperties":false},{"type":"null"}]},"events":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["sent","delivered","acknowledged","failed"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"byName":{"type":["string","null"]},"reason":{"type":["string","null"]},"source":{"anyOf":[{"type":"string","enum":["mesh"]},{"type":"null"}]},"actorLabel":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["kind","at","byName","reason","source","actorLabel","note"],"additionalProperties":false}}},"required":["id","documentId","channel","recipientLabel","attempt","status","createdAt","createdBy","linkExpiresAt","linkRevokedAt","mesh","events"],"additionalProperties":false}}},"required":["id","kind","reference","version","latestVersion","concernId","caseId","orgId","createdAt","contentHash","content","signatures","transmissions"],"additionalProperties":false},"TransmissionResult":{"type":"object","properties":{"transmission":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"documentId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"channel":{"type":"string","enum":["secure-link","by-hand","mesh"]},"recipientLabel":{"type":"string"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["sent","delivered","acknowledged","failed"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"linkExpiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"linkRevokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mesh":{"anyOf":[{"type":"object","properties":{"messageId":{"type":["string","null"]},"mailbox":{"type":"string"},"workflowId":{"type":"string"},"simulated":{"type":"boolean"}},"required":["messageId","mailbox","workflowId","simulated"],"additionalProperties":false},{"type":"null"}]},"events":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["sent","delivered","acknowledged","failed"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"byName":{"type":["string","null"]},"reason":{"type":["string","null"]},"source":{"anyOf":[{"type":"string","enum":["mesh"]},{"type":"null"}]},"actorLabel":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["kind","at","byName","reason","source","actorLabel","note"],"additionalProperties":false}}},"required":["id","documentId","channel","recipientLabel","attempt","status","createdAt","createdBy","linkExpiresAt","linkRevokedAt","mesh","events"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["transmission","audit"],"additionalProperties":false},"SendDocumentBody":{"oneOf":[{"type":"object","properties":{"channel":{"type":"string","const":"secure-link"},"recipientId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"secondCopy":{"type":"boolean","const":true}},"required":["channel","recipientId"]},{"type":"object","properties":{"channel":{"type":"string","const":"by-hand"},"recipientLabel":{"type":"string","minLength":1,"maxLength":200},"secondCopy":{"type":"boolean","const":true}},"required":["channel","recipientLabel"]},{"type":"object","properties":{"channel":{"type":"string","const":"mesh"},"secondCopy":{"type":"boolean","const":true}},"required":["channel"]}]},"RecordTransmissionEventBody":{"type":"object","properties":{"kind":{"type":"string","enum":["delivered","acknowledged","failed"]},"reason":{"type":"string","maxLength":500}},"required":["kind"]},"TransmissionSynced":{"type":"object","properties":{"transmission":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"documentId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"channel":{"type":"string","enum":["secure-link","by-hand","mesh"]},"recipientLabel":{"type":"string"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"status":{"type":"string","enum":["sent","delivered","acknowledged","failed"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"createdBy":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"linkExpiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"linkRevokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"mesh":{"anyOf":[{"type":"object","properties":{"messageId":{"type":["string","null"]},"mailbox":{"type":"string"},"workflowId":{"type":"string"},"simulated":{"type":"boolean"}},"required":["messageId","mailbox","workflowId","simulated"],"additionalProperties":false},{"type":"null"}]},"events":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["sent","delivered","acknowledged","failed"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"byName":{"type":["string","null"]},"reason":{"type":["string","null"]},"source":{"anyOf":[{"type":"string","enum":["mesh"]},{"type":"null"}]},"actorLabel":{"type":["string","null"]},"note":{"type":["string","null"]}},"required":["kind","at","byName","reason","source","actorLabel","note"],"additionalProperties":false}}},"required":["id","documentId","channel","recipientLabel","attempt","status","createdAt","createdBy","linkExpiresAt","linkRevokedAt","mesh","events"],"additionalProperties":false}},"required":["transmission"],"additionalProperties":false},"ReceiptForm":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"},"grant":{"type":"string","maxLength":200}}},"StaffList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"role":{"type":"string","maxLength":64},"onRoster":{"type":"boolean"},"skills":{"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"timeZone":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"maxWeekMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"certificates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["dbs","certificate-of-conduct","background-check","vulnerable-sector-check","manual-handling","first-aid","medication"]},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","kind","expiresAt"],"additionalProperties":false}},"availability":{"type":"array","items":{"type":"object","properties":{"weekday":{"type":"integer","minimum":1,"maximum":7},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"endMinute":{"type":"integer","minimum":1,"maximum":1440}},"required":["weekday","startMinute","endMinute"],"additionalProperties":false}},"blocked":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["dbs","certificate-of-conduct","background-check","vulnerable-sector-check","manual-handling","first-aid","medication"]},"problem":{"type":"string","enum":["missing","expired","expiring"]},"at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["kind","problem","at"],"additionalProperties":false}}},"required":["userId","name","role","onRoster","skills","timeZone","maxWeekMinutes","certificates","availability","blocked","issues"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"StaffWrite":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["userId","audit"],"additionalProperties":false},"StaffProfileBody":{"type":"object","properties":{"skills":{"maxItems":4,"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"timeZone":{"type":"string","minLength":1,"maxLength":64},"maxWeekMinutes":{"anyOf":[{"type":"integer","minimum":60,"maximum":10080},{"type":"null"}]}},"required":["skills","timeZone","maxWeekMinutes"]},"CertificateBody":{"type":"object","properties":{"kind":{"type":"string","enum":["dbs","certificate-of-conduct","background-check","vulnerable-sector-check","manual-handling","first-aid","medication"]},"expiresOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["kind","expiresOn"]},"AvailabilityBody":{"type":"object","properties":{"slots":{"maxItems":42,"type":"array","items":{"type":"object","properties":{"weekday":{"type":"integer","minimum":1,"maximum":7},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"endMinute":{"type":"integer","minimum":1,"maximum":1440}},"required":["weekday","startMinute","endMinute"]}}},"required":["slots"]},"VisitCreated":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"ids":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"created":{"type":"integer","minimum":1,"maximum":9007199254740991},"assigned":{"type":"integer","minimum":0,"maximum":9007199254740991},"refused":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"failures":{"type":"array","items":{"type":"string","enum":["not-staff","certificate-missing","certificate-expired","skill-missing","unavailable","time-off","overlap","max-hours","rest"]}}},"required":["id","failures"],"additionalProperties":false}},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","ids","created","assigned","refused","audit"],"additionalProperties":false},"CreateVisitBody":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"timeZone":{"type":"string","minLength":1,"maxLength":64},"carersNeeded":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2}]},"purpose":{"type":"string","minLength":1,"maxLength":120},"skills":{"maxItems":4,"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"tasks":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"detail":{"type":"string","maxLength":300}},"required":["title"]}},"carerUserId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"repeat":{"type":"object","properties":{"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"until":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"count":{"type":"integer","minimum":1,"maximum":84}},"required":["weekdays"]}},"required":["caseId","startsAt","endsAt","timeZone","carersNeeded","purpose","skills","tasks"]},"VisitsGenerated":{"type":"object","properties":{"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"audit":{"anyOf":[{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false},{"type":"null"}]}},"required":["created","audit"],"additionalProperties":false},"GenerateVisitsBody":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"days":{"type":"integer","minimum":1,"maximum":14}},"required":["from","days"]},"PublishResult":{"type":"object","properties":{"published":{"type":"integer","minimum":0,"maximum":9007199254740991},"audit":{"anyOf":[{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false},{"type":"null"}]},"batchId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"carers":{"type":"integer","minimum":0,"maximum":9007199254740991},"undoUntil":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["published","audit","batchId","carers","undoUntil"],"additionalProperties":false},"PublishBody":{"type":"object","properties":{"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"visitIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"notify":{"default":true,"type":"boolean"}},"required":["from","to"]},"CandidateList":{"type":"object","properties":{"visit":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["caseId","name","address","postcode"],"additionalProperties":false},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"timeZone":{"type":"string","maxLength":64},"purpose":{"type":"string","maxLength":120},"skills":{"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"carersNeeded":{"type":"integer","minimum":1,"maximum":2},"status":{"type":"string","enum":["draft","published","cancelled"]},"carers":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"assignedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["slot","userId","name","assignedAt"],"additionalProperties":false}},"openSlots":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","client","startsAt","endsAt","timeZone","purpose","skills","carersNeeded","status","carers","openSlots","version"],"additionalProperties":false},"slot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"skills":{"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"gate":{"type":"object","properties":{"ok":{"type":"boolean"},"failures":{"type":"array","items":{"type":"string","enum":["not-staff","certificate-missing","certificate-expired","skill-missing","unavailable","time-off","overlap","max-hours","rest"]}}},"required":["ok","failures"],"additionalProperties":false},"continuity":{"type":"integer","minimum":0,"maximum":9007199254740991},"minutesThisWeek":{"type":"integer","minimum":0,"maximum":9007199254740991},"offer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"status":{"type":"string","enum":["offered","accepted","declined","assigned","waitlisted","withdrawn"]},"offeredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"respondedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","status","offeredAt","respondedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["userId","name","skills","gate","continuity","minutesThisWeek","offer"],"additionalProperties":false}}},"required":["visit","slot","items"],"additionalProperties":false},"RosterWrite":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","audit"],"additionalProperties":false},"AssignBody":{"type":"object","properties":{"slot":{"type":"integer","minimum":1,"maximum":2},"carerUserId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["slot","carerUserId"]},"BroadcastResult":{"type":"object","properties":{"offered":{"type":"integer","minimum":0,"maximum":9007199254740991},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["offered","audit"],"additionalProperties":false},"BroadcastBody":{"type":"object","properties":{"slot":{"type":"integer","minimum":1,"maximum":2},"carerUserIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["slot"]},"UnassignBody":{"type":"object","properties":{"slot":{"type":"integer","minimum":1,"maximum":2}},"required":["slot"]},"CancelVisitBody":{"type":"object","properties":{"reason":{"type":"string","enum":["family-request","client-in-hospital","agency","other"]}},"required":["reason"]},"OpsBoard":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"visits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["caseId","name","address","postcode"],"additionalProperties":false},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"purpose":{"type":"string","maxLength":120},"skills":{"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"rosterStatus":{"type":"string","enum":["draft","published","cancelled"]},"state":{"type":"string","enum":["missed","late","open","in-progress","scheduled","completed","cancelled"]},"carers":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"assignedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"checkedInAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"checkedOutAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["slot","userId","name","assignedAt","checkedInAt","checkedOutAt"],"additionalProperties":false}},"openSlots":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"offers":{"type":"object","properties":{"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"accepted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sent","accepted"],"additionalProperties":false},"tasks":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","client","startsAt","endsAt","purpose","skills","rosterStatus","state","carers","openSlots","offers","tasks","version"],"additionalProperties":false}},"observations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["caseId","name","address","postcode"],"additionalProperties":false},"carer":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["userId","name"],"additionalProperties":false},"level":{"type":"string","enum":["routine","supervisor","urgent","critical"]},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"note":{"type":"string","maxLength":2000},"shareWithFamily":{"type":"boolean"},"raisedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"acknowledgedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"nextTimerAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"nextAction":{"type":"string","enum":["acknowledge","resolve"]}},"required":["id","visitId","client","carer","level","status","note","shareWithFamily","raisedAt","acknowledgedAt","nextTimerAt","nextAction"],"additionalProperties":false}},"compliance":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"blocked":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["dbs","certificate-of-conduct","background-check","vulnerable-sector-check","manual-handling","first-aid","medication"]},"problem":{"type":"string","enum":["missing","expired","expiring"]},"at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["kind","problem","at"],"additionalProperties":false}},"blockedVisits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["userId","name","blocked","issues","blockedVisits"],"additionalProperties":false}},"serverTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["date","visits","observations","compliance","serverTime"],"additionalProperties":false},"RosterWeek":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"days":{"minItems":7,"maxItems":7,"type":"array","items":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"timeZone":{"type":"string","minLength":1,"maxLength":64},"visits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["caseId","name","address","postcode"],"additionalProperties":false},"day":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"purpose":{"type":"string","maxLength":120},"skills":{"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"carersNeeded":{"type":"integer","minimum":1,"maximum":2},"status":{"type":"string","enum":["draft","published"]},"carers":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"gate":{"type":"object","properties":{"ok":{"type":"boolean"},"failures":{"type":"array","items":{"type":"string","enum":["not-staff","certificate-missing","certificate-expired","skill-missing","unavailable","time-off","overlap","max-hours","rest"]}}},"required":["ok","failures"],"additionalProperties":false},"checkedInAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"checkedOutAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"request":{"anyOf":[{"type":"string","enum":["offer","swap"]},{"type":"null"}]}},"required":["slot","userId","name","gate","checkedInAt","checkedOutAt","request"],"additionalProperties":false}},"openSlots":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","client","day","startsAt","endsAt","purpose","skills","carersNeeded","status","carers","openSlots","version"],"additionalProperties":false}},"carers":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"onRoster":{"type":"boolean"},"minutes":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxWeekMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"timeZone":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string","enum":["personal-care","medication","dementia","hoist"]}},"availability":{"type":"array","items":{"type":"object","properties":{"weekday":{"type":"integer","minimum":1,"maximum":7},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"endMinute":{"type":"integer","minimum":1,"maximum":1440}},"required":["weekday","startMinute","endMinute"],"additionalProperties":false}},"timeOff":{"type":"array","items":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["startsAt","endsAt"],"additionalProperties":false}}},"required":["userId","name","onRoster","minutes","maxWeekMinutes","timeZone","skills","availability","timeOff"],"additionalProperties":false}},"routes":{"type":"array","items":{"type":"object","properties":{"fromPostcode":{"type":"string","minLength":1,"maxLength":16},"toPostcode":{"type":"string","minLength":1,"maxLength":16},"minutes":{"type":"integer","minimum":1,"maximum":600}},"required":["fromPostcode","toPostcode","minutes"],"additionalProperties":false}},"approvedPackages":{"type":"integer","minimum":0,"maximum":9007199254740991},"familyFirst":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"everPublished":{"type":"boolean"},"serverTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["from","days","timeZone","visits","carers","routes","approvedPackages","familyFirst","everPublished","serverTime"],"additionalProperties":false},"MyOffers":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"slot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["offered","accepted","declined","assigned","waitlisted","withdrawn"]},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"purpose":{"type":"string","maxLength":120},"client":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["caseId","name","address","postcode"],"additionalProperties":false},"offeredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"respondedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","visitId","slot","status","startsAt","endsAt","purpose","client","offeredAt","respondedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"MoveResult":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false},"told":{"type":"object","properties":{"removed":{"type":"integer","minimum":0,"maximum":9007199254740991},"added":{"type":"integer","minimum":0,"maximum":9007199254740991},"moved":{"type":"integer","minimum":0,"maximum":9007199254740991},"family":{"type":"boolean"}},"required":["removed","added","moved","family"],"additionalProperties":false}},"required":["id","audit","told"],"additionalProperties":false},"MoveVisitBody":{"type":"object","properties":{"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"slot":{"type":"integer","minimum":1,"maximum":2},"carerUserId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]}},"required":["version","startsAt","endsAt"]},"PublishUndone":{"type":"object","properties":{"reverted":{"type":"integer","minimum":0,"maximum":9007199254740991},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["reverted","audit"],"additionalProperties":false},"PublishSent":{"type":"object","properties":{"sent":{"type":"boolean"}},"required":["sent"],"additionalProperties":false},"RouteTimeWrite":{"type":"object","properties":{"route":{"type":"object","properties":{"fromPostcode":{"type":"string","minLength":1,"maxLength":16},"toPostcode":{"type":"string","minLength":1,"maxLength":16},"minutes":{"type":"integer","minimum":1,"maximum":600}},"required":["fromPostcode","toPostcode","minutes"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["route","audit"],"additionalProperties":false},"RouteTime":{"type":"object","properties":{"fromPostcode":{"type":"string","minLength":1,"maxLength":16},"toPostcode":{"type":"string","minLength":1,"maxLength":16},"minutes":{"type":"integer","minimum":1,"maximum":600}},"required":["fromPostcode","toPostcode","minutes"]},"ShiftRequestQueue":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["offer","swap"]},"status":{"type":"string","enum":["open","accepted","declined","withdrawn"]},"visit":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["caseId","name","address","postcode"],"additionalProperties":false},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"slot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","client","startsAt","endsAt","slot"],"additionalProperties":false},"carer":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["userId","name"],"additionalProperties":false},"swap":{"anyOf":[{"type":"object","properties":{"visit":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["caseId","name","address","postcode"],"additionalProperties":false},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"slot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","client","startsAt","endsAt","slot"],"additionalProperties":false},"carer":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["userId","name"],"additionalProperties":false}},"required":["visit","carer"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","kind","status","visit","carer","swap","createdAt","decidedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"ShiftRequestDecided":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"status":{"type":"string","enum":["open","accepted","declined","withdrawn"]},"offered":{"type":"integer","minimum":0,"maximum":9007199254740991},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","status","offered","audit"],"additionalProperties":false},"DecideShiftRequestBody":{"oneOf":[{"type":"object","properties":{"accept":{"type":"boolean","const":true},"carerUserId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["accept"]},{"type":"object","properties":{"accept":{"type":"boolean","const":false}},"required":["accept"]}]},"MyAvailability":{"type":"object","properties":{"timeZone":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"slots":{"type":"array","items":{"type":"object","properties":{"weekday":{"type":"integer","minimum":1,"maximum":7},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"endMinute":{"type":"integer","minimum":1,"maximum":1440}},"required":["weekday","startMinute","endMinute"],"additionalProperties":false}},"timeOff":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","startsOn","endsOn","startsAt","endsAt"],"additionalProperties":false}}},"required":["timeZone","slots","timeOff"],"additionalProperties":false},"TimeOffWrite":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","audit"],"additionalProperties":false},"TimeOffBody":{"type":"object","properties":{"startsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"endsOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["startsOn","endsOn"]},"SwapOptions":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"carerName":{"type":"string","maxLength":200}},"required":["visitId","startsAt","endsAt","carerName"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"ShiftRequestWrite":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"status":{"type":"string","enum":["open","accepted","declined","withdrawn"]},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","status","audit"],"additionalProperties":false},"ShiftRequestBody":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"offer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"swap"},"swapVisitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind","swapVisitId"]}]},"MyShiftRequests":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["offer","swap"]},"status":{"type":"string","enum":["open","accepted","declined","withdrawn"]},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"swap":{"anyOf":[{"type":"object","properties":{"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"carerName":{"type":"string","maxLength":200}},"required":["visitId","startsAt","endsAt","carerName"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","kind","status","visitId","startsAt","endsAt","swap","createdAt","decidedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"SubjectList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["caseId","clientName"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"FiledConcern":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"reference":{"type":"string","maxLength":40},"urgency":{"type":"string","enum":["routine","urgent","emergency"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"alerted":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","reference","urgency","filedAt","dueAt","alerted","audit"],"additionalProperties":false},"FileConcernBody":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"urgency":{"type":"string","enum":["routine","urgent","emergency"]},"details":{"type":"string","maxLength":4000},"tags":{"default":[],"maxItems":4,"type":"array","items":{"type":"string","enum":["unexplained","distress","unsafe","family"]}},"keepPrivate":{"default":true,"type":"boolean"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientRequestId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["caseId","category","urgency","clientRequestId"]},"ConcernPage":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"reference":{"type":"string"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"type":["string","null"]},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"urgency":{"type":"string","enum":["routine","urgent","emergency"]},"status":{"type":"string","enum":["open","escalated","decided","closed"]},"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"escalationLevel":{"type":"integer","minimum":0,"maximum":9007199254740991},"timer":{"type":"object","properties":{"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"breached":{"type":"boolean"},"stoppedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["dueAt","breached","stoppedAt"],"additionalProperties":false}},"required":["id","reference","caseId","clientName","category","urgency","status","stage","filedAt","escalationLevel","timer"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["items","nextCursor"],"additionalProperties":false},"ConcernDetail":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"reference":{"type":"string"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"type":["string","null"]},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"urgency":{"type":"string","enum":["routine","urgent","emergency"]},"status":{"type":"string","enum":["open","escalated","decided","closed"]},"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"escalationLevel":{"type":"integer","minimum":0,"maximum":9007199254740991},"timer":{"type":"object","properties":{"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"breached":{"type":"boolean"},"stoppedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["dueAt","breached","stoppedAt"],"additionalProperties":false},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgName":{"type":"string"},"details":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string","enum":["unexplained","distress","unsafe","family"]}},"keepPrivate":{"type":"boolean"},"visitId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"reporter":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"role":{"type":"string"}},"required":["userId","name","role"],"additionalProperties":false},"proposedStage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"checks":{"type":"array","items":{"type":"string","enum":["bodyMap","carerSafe","gpReview","localAuthority"]}},"notes":{"type":["string","null"]},"decision":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"rationale":{"type":"string"},"familyTold":{"type":"boolean"}},"required":["at","by","stage","rationale","familyTold"],"additionalProperties":false},{"type":"null"}]},"decisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"rationale":{"type":"string"},"familyTold":{"type":"boolean"}},"required":["id","at","by","stage","rationale","familyTold"],"additionalProperties":false}},"closure":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"outcome":{"anyOf":[{"type":"string","enum":["substantiated","notSubstantiated","inconclusive","referredToLocalAuthority","noFurtherAction"]},{"type":"null"}]},"reason":{"type":"string"}},"required":["at","by","outcome","reason"],"additionalProperties":false},{"type":"null"}]},"history":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["reference","category","filedAt"],"additionalProperties":false}},"triageTeam":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"kind":{"type":"string","enum":["filed","alerted","escalated","notes-saved","steps-saved","decided","closed","document-created","document-countersigned","transmission-sent","transmission-status"]},"actorName":{"type":["string","null"]},"ref":{"type":["string","null"]}},"required":["id","at","kind","actorName","ref"],"additionalProperties":false}}},"required":["id","reference","caseId","clientName","category","urgency","status","stage","filedAt","escalationLevel","timer","orgId","orgName","details","tags","keepPrivate","visitId","reporter","proposedStage","checks","notes","decision","decisions","closure","history","triageTeam","events"],"additionalProperties":false},"ConcernUpdated":{"type":"object","properties":{"concern":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"reference":{"type":"string"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"type":["string","null"]},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"urgency":{"type":"string","enum":["routine","urgent","emergency"]},"status":{"type":"string","enum":["open","escalated","decided","closed"]},"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"escalationLevel":{"type":"integer","minimum":0,"maximum":9007199254740991},"timer":{"type":"object","properties":{"dueAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"breached":{"type":"boolean"},"stoppedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["dueAt","breached","stoppedAt"],"additionalProperties":false},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgName":{"type":"string"},"details":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string","enum":["unexplained","distress","unsafe","family"]}},"keepPrivate":{"type":"boolean"},"visitId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"reporter":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"},"role":{"type":"string"}},"required":["userId","name","role"],"additionalProperties":false},"proposedStage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"checks":{"type":"array","items":{"type":"string","enum":["bodyMap","carerSafe","gpReview","localAuthority"]}},"notes":{"type":["string","null"]},"decision":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"rationale":{"type":"string"},"familyTold":{"type":"boolean"}},"required":["at","by","stage","rationale","familyTold"],"additionalProperties":false},{"type":"null"}]},"decisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"rationale":{"type":"string"},"familyTold":{"type":"boolean"}},"required":["id","at","by","stage","rationale","familyTold"],"additionalProperties":false}},"closure":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"by":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},"outcome":{"anyOf":[{"type":"string","enum":["substantiated","notSubstantiated","inconclusive","referredToLocalAuthority","noFurtherAction"]},{"type":"null"}]},"reason":{"type":"string"}},"required":["at","by","outcome","reason"],"additionalProperties":false},{"type":"null"}]},"history":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"category":{"type":"string","enum":["harm","neglect","money","medication","emotional","staff"]},"filedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["reference","category","filedAt"],"additionalProperties":false}},"triageTeam":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"kind":{"type":"string","enum":["filed","alerted","escalated","notes-saved","steps-saved","decided","closed","document-created","document-countersigned","transmission-sent","transmission-status"]},"actorName":{"type":["string","null"]},"ref":{"type":["string","null"]}},"required":["id","at","kind","actorName","ref"],"additionalProperties":false}}},"required":["id","reference","caseId","clientName","category","urgency","status","stage","filedAt","escalationLevel","timer","orgId","orgName","details","tags","keepPrivate","visitId","reporter","proposedStage","checks","notes","decision","decisions","closure","history","triageTeam","events"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["concern","audit"],"additionalProperties":false},"SaveTriageBody":{"type":"object","properties":{"proposedStage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"checks":{"maxItems":4,"type":"array","items":{"type":"string","enum":["bodyMap","carerSafe","gpReview","localAuthority"]}},"notes":{"type":"string","maxLength":4000}},"required":["proposedStage","checks"]},"SaveStepsBody":{"type":"object","properties":{"checks":{"maxItems":4,"type":"array","items":{"type":"string","enum":["bodyMap","carerSafe","gpReview","localAuthority"]}}},"required":["checks"]},"DecideBody":{"type":"object","properties":{"stage":{"type":"string","enum":["stage1","stage2","stage3","stage4"]},"rationale":{"type":"string","minLength":1,"maxLength":4000},"familyTold":{"type":"boolean"}},"required":["stage","rationale","familyTold"]},"CloseBody":{"type":"object","properties":{"outcome":{"type":"string","enum":["substantiated","notSubstantiated","inconclusive","referredToLocalAuthority","noFurtherAction"]},"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["outcome","reason"]},"CarerDay":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"visits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["caseId","name","address","postcode"],"additionalProperties":false},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"purpose":{"type":"string","maxLength":120},"state":{"type":"string","enum":["scheduled","checked-in","completed","cancelled","missed"]},"late":{"type":"boolean"},"checkedInAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"checkedOutAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"coCarers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":200}},"required":["name"],"additionalProperties":false}},"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"title":{"type":"string","maxLength":120},"detail":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"doneAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","title","detail","doneAt","version"],"additionalProperties":false}},"note":{"anyOf":[{"type":"object","properties":{"body":{"type":"string","maxLength":4000},"shareWithFamily":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"byMe":{"type":"boolean"}},"required":["body","shareWithFamily","version","updatedAt","byMe"],"additionalProperties":false},{"type":"null"}]},"observations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"level":{"type":"string","enum":["routine","supervisor","urgent","critical"]},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"raisedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"acknowledgedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","level","status","raisedAt","acknowledgedAt"],"additionalProperties":false}}},"required":["id","orgId","client","startsAt","endsAt","purpose","state","late","checkedInAt","checkedOutAt","coCarers","tasks","note","observations"],"additionalProperties":false}},"offers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"slot":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["offered","accepted","declined","assigned","waitlisted","withdrawn"]},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"purpose":{"type":"string","maxLength":120},"client":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["caseId","name","address","postcode"],"additionalProperties":false},"offeredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"respondedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","visitId","slot","status","startsAt","endsAt","purpose","client","offeredAt","respondedAt"],"additionalProperties":false}},"conflicts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"entity":{"type":"string","enum":["task","note"]},"entityId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"mine":{"type":"string","maxLength":4000},"theirs":{"type":"string","maxLength":4000},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visitId","entity","entityId","mine","theirs","createdAt"],"additionalProperties":false}},"serverTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["date","visits","offers","conflicts","serverTime"],"additionalProperties":false},"CarerUpcoming":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"visits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"postcode":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}]}},"required":["caseId","name","address","postcode"],"additionalProperties":false},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"purpose":{"type":"string","maxLength":120}},"required":["id","client","startsAt","endsAt","purpose"],"additionalProperties":false}}},"required":["date","visits"],"additionalProperties":false}},"serverTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["from","to","days","serverTime"],"additionalProperties":false},"FamilyVisits":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"timeZone":{"type":"string","minLength":1,"maxLength":64},"today":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"state":{"type":"string","enum":["booked","in-progress","finished","missed","cancelled"]},"carers":{"type":"array","items":{"type":"string","maxLength":200}},"arrivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"tasks":{"type":"object","properties":{"done":{"type":"integer","minimum":0,"maximum":9007199254740991},"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"sharedNote":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":["id","startsAt","endsAt","state","carers","arrivedAt","finishedAt","tasks","sharedNote"],"additionalProperties":false}},"next":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"state":{"type":"string","enum":["booked","in-progress","finished","missed","cancelled"]},"carers":{"type":"array","items":{"type":"string","maxLength":200}},"arrivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"tasks":{"type":"object","properties":{"done":{"type":"integer","minimum":0,"maximum":9007199254740991},"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"sharedNote":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":["id","startsAt","endsAt","state","carers","arrivedAt","finishedAt","tasks","sharedNote"],"additionalProperties":false},{"type":"null"}]},"arranging":{"type":"boolean"},"serverTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["date","timeZone","today","next","arranging","serverTime"],"additionalProperties":false},"SyncResult":{"type":"object","properties":{"results":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"opId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","const":"applied"},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["opId","status","version"],"additionalProperties":false},{"type":"object","properties":{"opId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","const":"duplicate"},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["opId","status","version"],"additionalProperties":false},{"type":"object","properties":{"opId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","const":"conflict"},"conflict":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"entity":{"type":"string","enum":["task","note"]},"entityId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"mine":{"type":"string","maxLength":4000},"theirs":{"type":"string","maxLength":4000},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","visitId","entity","entityId","mine","theirs","createdAt"],"additionalProperties":false}},"required":["opId","status","conflict"],"additionalProperties":false},{"type":"object","properties":{"opId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","const":"rejected"},"reason":{"type":"string","enum":["not-found","not-yours","not-checked-in","already-done","cancelled","hold-unread","invalid","outside-window","closed"]}},"required":["opId","status","reason"],"additionalProperties":false}]}},"serverTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["results","serverTime"],"additionalProperties":false},"SyncBody":{"type":"object","properties":{"ops":{"minItems":1,"maxItems":50,"type":"array","items":{"oneOf":[{"type":"object","properties":{"opId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"kind":{"type":"string","const":"checkIn"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"locationShared":{"type":"boolean"}},"required":["opId","at","kind","visitId","locationShared"]},{"type":"object","properties":{"opId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"kind":{"type":"string","const":"checkOut"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["opId","at","kind","visitId"]},{"type":"object","properties":{"opId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"baseVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"afterOpId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","const":"taskSet"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"taskId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"done":{"type":"boolean"}},"required":["opId","at","baseVersion","kind","visitId","taskId","done"]},{"type":"object","properties":{"opId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"baseVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"afterOpId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","const":"noteSave"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"body":{"type":"string","maxLength":4000},"shareWithFamily":{"type":"boolean"}},"required":["opId","at","baseVersion","kind","visitId","body","shareWithFamily"]},{"type":"object","properties":{"opId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"kind":{"type":"string","const":"observationRaise"},"visitId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"observationId":{"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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"level":{"type":"string","enum":["routine","supervisor","urgent","critical"]},"note":{"type":"string","minLength":1,"maxLength":2000},"shareWithFamily":{"type":"boolean"}},"required":["opId","at","kind","visitId","observationId","level","note","shareWithFamily"]}]}}},"required":["ops"]},"ConflictResolved":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","audit"],"additionalProperties":false},"ResolveConflictBody":{"type":"object","properties":{"choice":{"type":"string","enum":["mine","theirs"]}},"required":["choice"]},"NoteWrite":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["version","audit"],"additionalProperties":false},"NoteEditBody":{"type":"object","properties":{"body":{"type":"string","maxLength":4000},"shareWithFamily":{"type":"boolean"},"baseVersion":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["body","shareWithFamily","baseVersion"]},"ObservationWrite":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"level":{"type":"string","enum":["routine","supervisor","urgent","critical"]},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","level","status","audit"],"additionalProperties":false},"EscalateBody":{"type":"object","properties":{"toLevel":{"type":"string","enum":["routine","supervisor","urgent","critical"]}},"required":["toLevel"]},"OfferWrite":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"status":{"type":"string","enum":["offered","accepted","declined","assigned","waitlisted","withdrawn"]},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["id","status","audit"],"additionalProperties":false},"ReportOptions":{"type":"object","properties":{"org":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":120}},"required":["id","name"],"additionalProperties":false},"kinds":{"type":"array","items":{"type":"string","enum":["visits","hours","medicines","concerns","staff-checks","requests"]}},"pack":{"type":"boolean"},"carers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"recipients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["org","kinds","pack","carers","clients","recipients"],"additionalProperties":false},"ReportResult":{"type":"object","properties":{"kind":{"type":"string","enum":["visits","hours","medicines","concerns","staff-checks","requests"]},"org":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":120}},"required":["id","name"],"additionalProperties":false},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"group":{"type":"string","enum":["carer","client","level","outcome"]},"filters":{"type":"object","properties":{"carer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["carer","client"],"additionalProperties":false},"rows":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","maxLength":64},"label":{"type":"string","maxLength":200},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"medianMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["key","label","values","medianMinutes"],"additionalProperties":false}},"totals":{"type":"object","properties":{"key":{"type":"string","maxLength":64},"label":{"type":"string","maxLength":200},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"medianMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["key","label","values","medianMinutes"],"additionalProperties":false},"records":{"type":"integer","minimum":0,"maximum":9007199254740991},"countedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["kind","org","from","to","group","filters","rows","totals","records","countedAt"],"additionalProperties":false},"ReportRecordList":{"type":"object","properties":{"figure":{"type":"string"},"row":{"type":["string","null"]},"rowLabel":{"type":["string","null"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"timeZone":{"type":"string","maxLength":64},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"carer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"label":{"type":"string","maxLength":200},"state":{"type":"string","maxLength":40},"minutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"href":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["id","at","timeZone","client","carer","label","state","minutes","href"],"additionalProperties":false}}},"required":["figure","row","rowLabel","items"],"additionalProperties":false},"ExportList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["visits","hours","medicines","concerns","staff-checks","requests","compliance-pack"]},"format":{"type":"string","enum":["csv","pdf"]},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"filters":{"type":"object","properties":{"carer":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"client":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"group":{"anyOf":[{"type":"string","enum":["carer","client","level","outcome"]},{"type":"null"}]}},"required":["carer","client","group"],"additionalProperties":false},"status":{"type":"string","enum":["making","ready","failed"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"readyAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"fileName":{"type":"string","maxLength":200}},"required":["id","kind","format","from","to","filters","status","createdAt","readyAt","expiresAt","fileName"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"ExportCreated":{"type":"object","properties":{"export":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["visits","hours","medicines","concerns","staff-checks","requests","compliance-pack"]},"format":{"type":"string","enum":["csv","pdf"]},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"filters":{"type":"object","properties":{"carer":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"client":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"group":{"anyOf":[{"type":"string","enum":["carer","client","level","outcome"]},{"type":"null"}]}},"required":["carer","client","group"],"additionalProperties":false},"status":{"type":"string","enum":["making","ready","failed"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"readyAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"fileName":{"type":"string","maxLength":200}},"required":["id","kind","format","from","to","filters","status","createdAt","readyAt","expiresAt","fileName"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["export","audit"],"additionalProperties":false},"CreateExportBody":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"carer":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"group":{"type":"string","enum":["carer","client","level","outcome"]},"kind":{"type":"string","enum":["visits","hours","medicines","concerns","staff-checks","requests","compliance-pack"]},"format":{"type":"string","enum":["csv","pdf"]}},"required":["from","to","kind","format"]},"ReportExport":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["visits","hours","medicines","concerns","staff-checks","requests","compliance-pack"]},"format":{"type":"string","enum":["csv","pdf"]},"from":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"to":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"filters":{"type":"object","properties":{"carer":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"client":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"group":{"anyOf":[{"type":"string","enum":["carer","client","level","outcome"]},{"type":"null"}]}},"required":["carer","client","group"],"additionalProperties":false},"status":{"type":"string","enum":["making","ready","failed"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"readyAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"fileName":{"type":"string","maxLength":200}},"required":["id","kind","format","from","to","filters","status","createdAt","readyAt","expiresAt","fileName"],"additionalProperties":false},"ScheduleList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["visits","hours","medicines","concerns","staff-checks","requests"]},"frequency":{"type":"string","enum":["weekly","monthly"]},"recipients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"filters":{"type":"object","properties":{"carer":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"client":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]}},"required":["carer","client"],"additionalProperties":false},"active":{"type":"boolean"},"nextSendAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastSentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","kind","frequency","recipients","filters","active","nextSendAt","lastSentAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"ScheduleWrite":{"type":"object","properties":{"schedule":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["visits","hours","medicines","concerns","staff-checks","requests"]},"frequency":{"type":"string","enum":["weekly","monthly"]},"recipients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"filters":{"type":"object","properties":{"carer":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"client":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]}},"required":["carer","client"],"additionalProperties":false},"active":{"type":"boolean"},"nextSendAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lastSentAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","kind","frequency","recipients","filters","active","nextSendAt","lastSentAt"],"additionalProperties":false},"audit":{"type":"object","properties":{"action":{"type":"string","pattern":"^[a-z]+(\\.[a-z-]+){1,3}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["action","at"],"additionalProperties":false}},"required":["schedule","audit"],"additionalProperties":false},"CreateScheduleBody":{"type":"object","properties":{"kind":{"type":"string","enum":["visits","hours","medicines","concerns","staff-checks","requests"]},"frequency":{"type":"string","enum":["weekly","monthly"]},"recipients":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"carer":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"client":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind","frequency","recipients"]},"ScheduleStateBody":{"type":"object","properties":{"active":{"type":"boolean"}},"required":["active"]},"ThreadList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["circle","direct","announcement"]},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"clientName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"carerName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"closed":{"type":"boolean"},"lastMessage":{"anyOf":[{"type":"object","properties":{"authorName":{"type":"string","maxLength":200},"side":{"type":"string","enum":["agency","family"]},"preview":{"type":"string","maxLength":160},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"mine":{"type":"boolean"}},"required":["authorName","side","preview","sentAt","mine"],"additionalProperties":false},{"type":"null"}]},"unread":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","kind","orgId","caseId","clientName","carerName","title","closed","lastMessage","unread"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"StartedThread":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"created":{"type":"boolean"}},"required":["id","created"],"additionalProperties":false},"StartThreadBody":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"circle"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind","caseId"]},{"type":"object","properties":{"kind":{"type":"string","const":"direct"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"carerUserId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind","orgId","carerUserId"]},{"type":"object","properties":{"kind":{"type":"string","const":"office"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind","orgId"]}]},"ThreadDetail":{"type":"object","properties":{"thread":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["circle","direct","announcement"]},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"caseId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]},"clientName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"carerName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"closed":{"type":"boolean"},"lastMessage":{"anyOf":[{"type":"object","properties":{"authorName":{"type":"string","maxLength":200},"side":{"type":"string","enum":["agency","family"]},"preview":{"type":"string","maxLength":160},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"mine":{"type":"boolean"}},"required":["authorName","side","preview","sentAt","mine"],"additionalProperties":false},{"type":"null"}]},"unread":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","kind","orgId","caseId","clientName","carerName","title","closed","lastMessage","unread"],"additionalProperties":false},"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"side":{"type":"string","enum":["agency","family"]},"role":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"required":["userId","name","side","role"],"additionalProperties":false}},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"threadId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientId":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"},"author":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"side":{"type":"string","enum":["agency","family"]}},"required":["userId","name","side"],"additionalProperties":false},"body":{"type":"string","maxLength":4000},"mentions":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["userId","name"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"contentType":{"type":"string","enum":["image/jpeg","image/png","image/webp","application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/plain"]},"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","name","contentType","bytes"],"additionalProperties":false}},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"mine":{"type":"boolean"},"seen":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"byName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"others":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["at","byName","others"],"additionalProperties":false},{"type":"null"}]}},"required":["id","threadId","clientId","author","body","mentions","attachments","sentAt","mine","seen"],"additionalProperties":false}},"canReply":{"type":"boolean"},"canClose":{"type":"boolean"}},"required":["thread","members","messages","canReply","canClose"],"additionalProperties":false},"Message":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"threadId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientId":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"},"author":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"side":{"type":"string","enum":["agency","family"]}},"required":["userId","name","side"],"additionalProperties":false},"body":{"type":"string","maxLength":4000},"mentions":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["userId","name"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"contentType":{"type":"string","enum":["image/jpeg","image/png","image/webp","application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/plain"]},"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","name","contentType","bytes"],"additionalProperties":false}},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"mine":{"type":"boolean"},"seen":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"byName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"others":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["at","byName","others"],"additionalProperties":false},{"type":"null"}]}},"required":["id","threadId","clientId","author","body","mentions","attachments","sentAt","mine","seen"],"additionalProperties":false},"SendMessageBody":{"type":"object","properties":{"clientId":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"},"body":{"type":"string","maxLength":4000},"mentions":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"attachmentIds":{"default":[],"maxItems":4,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"required":["clientId","body"]},"MessageAttachment":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"contentType":{"type":"string","enum":["image/jpeg","image/png","image/webp","application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/plain"]},"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","name","contentType","bytes"],"additionalProperties":false},"ReadThreadBody":{"type":"object","properties":{"upTo":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["upTo"]},"CircleList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"clientName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"threadId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]}},"required":["caseId","orgId","clientName","threadId"],"additionalProperties":false}},"offices":{"type":"array","items":{"type":"object","properties":{"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":120},"threadId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]}},"required":["orgId","name","threadId"],"additionalProperties":false}}},"required":["items","offices"],"additionalProperties":false},"UnreadFromAgency":{"type":"object","properties":{"item":{"anyOf":[{"type":"object","properties":{"threadId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"authorName":{"type":"string","maxLength":200},"preview":{"type":"string","maxLength":160},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["threadId","authorName","preview","sentAt"],"additionalProperties":false},{"type":"null"}]}},"required":["item"],"additionalProperties":false},"CarerChoiceList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"threadId":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}]}},"required":["userId","name","threadId"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"FileLink":{"type":"object","properties":{"file":{"type":"object","properties":{"kind":{"type":"string","enum":["attachment","export"]},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200},"contentType":{"type":"string","maxLength":100},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"view":{"type":"string","enum":["pdf","image","text","none"]},"uploadedBy":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"uploadedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["kind","id","name","contentType","bytes","view","uploadedBy","uploadedAt"],"additionalProperties":false},"url":{"type":"string","maxLength":1000},"disposition":{"type":"string","enum":["inline","attachment"]},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["file","url","disposition","expiresAt"],"additionalProperties":false},"FileLinkBody":{"type":"object","properties":{"disposition":{"type":"string","enum":["inline","attachment"]}},"required":["disposition"]},"AnnouncementPreview":{"type":"object","properties":{"recipients":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["recipients"],"additionalProperties":false},"AnnouncementPreviewBody":{"type":"object","properties":{"audience":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"all-carers"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"role"},"role":{"type":"string","enum":["caregiver","senior","coordinator","agency-admin"]}},"required":["kind","role"]},{"type":"object","properties":{"kind":{"type":"string","const":"client-carers"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind","caseId"]}]}},"required":["audience"]},"Announcement":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":4000},"audience":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"all-carers"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"role"},"role":{"type":"string","enum":["caregiver","senior","coordinator","agency-admin"]}},"required":["kind","role"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"client-carers"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind","caseId"],"additionalProperties":false}]},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"senderName":{"type":"string","maxLength":200},"seenAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"seenCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"recipientCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","orgId","title","body","audience","sentAt","senderName","seenAt","seenCount","recipientCount"],"additionalProperties":false},"SendAnnouncementBody":{"type":"object","properties":{"clientId":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"},"audience":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"all-carers"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"role"},"role":{"type":"string","enum":["caregiver","senior","coordinator","agency-admin"]}},"required":["kind","role"]},{"type":"object","properties":{"kind":{"type":"string","const":"client-carers"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind","caseId"]}]},"title":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["clientId","audience","title","body"]},"AnnouncementList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":4000},"audience":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"all-carers"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"role"},"role":{"type":"string","enum":["caregiver","senior","coordinator","agency-admin"]}},"required":["kind","role"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"client-carers"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind","caseId"],"additionalProperties":false}]},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"senderName":{"type":"string","maxLength":200},"seenAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"seenCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"recipientCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","orgId","title","body","audience","sentAt","senderName","seenAt","seenCount","recipientCount"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false},"AnnouncementDetail":{"type":"object","properties":{"announcement":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"orgId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":4000},"audience":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"all-carers"}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"role"},"role":{"type":"string","enum":["caregiver","senior","coordinator","agency-admin"]}},"required":["kind","role"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"client-carers"},"caseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"}},"required":["kind","caseId"],"additionalProperties":false}]},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"senderName":{"type":"string","maxLength":200},"seenAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"seenCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"recipientCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","orgId","title","body","audience","sentAt","senderName","seenAt","seenCount","recipientCount"],"additionalProperties":false},"notSeen":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"name":{"type":"string","maxLength":200}},"required":["userId","name"],"additionalProperties":false}},{"type":"null"}]}},"required":["announcement","notSeen"],"additionalProperties":false},"NotificationList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"kind":{"type":"string","enum":["message","mention","announcement","visit-change","request","concern","emergency","report-ready"]},"href":{"type":"string","maxLength":300,"pattern":"^\\/app\\/(family|carer|ops|records)(\\/[A-Za-z0-9/_-]*)?(\\?[A-Za-z0-9=&_-]*)?$"},"count":{"type":"integer","minimum":1,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","kind","href","count","createdAt","readAt"],"additionalProperties":false}},"unread":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["items","unread"],"additionalProperties":false},"NotificationCount":{"type":"object","properties":{"unread":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["unread"],"additionalProperties":false},"NotificationSettings":{"type":"object","properties":{"prefs":{"type":"object","propertyNames":{"type":"string","enum":["visits","messages","announcements","requests","concerns","reports"]},"additionalProperties":{"type":"object","properties":{"inApp":{"type":"boolean"},"email":{"type":"boolean"},"sms":{"type":"boolean"}},"required":["inApp","email","sms"],"additionalProperties":false},"required":["visits","messages","announcements","requests","concerns","reports"]},"quietHours":{"anyOf":[{"type":"object","properties":{"enabled":{"type":"boolean"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"timeZone":{"type":"string","minLength":1,"maxLength":64}},"required":["enabled","from","to","days","timeZone"],"additionalProperties":false},{"type":"null"}]}},"required":["prefs","quietHours"],"additionalProperties":false},"SetPrefBody":{"type":"object","properties":{"event":{"type":"string","enum":["visits","messages","announcements","requests","concerns","reports"]},"channel":{"type":"string","enum":["inApp","email","sms"]},"enabled":{"type":"boolean"}},"required":["event","channel","enabled"]},"QuietHours":{"type":"object","properties":{"enabled":{"type":"boolean"},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"timeZone":{"type":"string","minLength":1,"maxLength":64}},"required":["enabled","from","to","days","timeZone"]},"EmailLanguageBody":{"type":"object","properties":{"locale":{"type":"string","enum":["en-GB","en-US","fr-CA","de"]}},"required":["locale"]},"SmsSettings":{"type":"object","properties":{"available":{"type":"boolean"},"turnedOffByOrg":{"type":"boolean"},"phone":{"anyOf":[{"type":"object","properties":{"number":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},"verifiedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["number","verifiedAt"],"additionalProperties":false},{"type":"null"}]},"pending":{"anyOf":[{"type":"object","properties":{"number":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"}},"required":["number"],"additionalProperties":false},{"type":"null"}]},"reminder":{"type":"string","enum":["off","evening","hour"]}},"required":["available","turnedOffByOrg","phone","pending","reminder"],"additionalProperties":false},"StartPhoneBody":{"type":"object","properties":{"phone":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"}},"required":["phone"]},"CheckPhoneBody":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{4,10}$"}},"required":["code"]},"SetSmsReminderBody":{"type":"object","properties":{"reminder":{"type":"string","enum":["off","evening","hour"]}},"required":["reminder"]}}},"servers":[{"url":"https://elavinya.com"}]}