{"openapi":"3.0.0","info":{"title":"Sixminute API","version":"1.0.0","description":"The cloud API of Sixminute, under `/v1`. Every route takes a WorkOS access token as a bearer except `/healthz`, `/v1/health`, `/v1/ready`, the two `/v1/auth/email/*` routes and `/v1/auth/organization-selection`, `/v1/auth/authorize` and `/v1/auth/token`, which a person who is signing in reaches before they have one (D-69), and the three `/v1/newsletter/*` routes, which nobody signing up to a mailing list could carry one for: the two the website calls are guarded by a shared header only it holds, and the webhook by Resend's signature over the raw body, and the two `/v1/update/*` routes, which the application's own host asks and which disclose a version number and a file name; the tenant is the token's organisation and appears in no url, header or body. Every error is an RFC 9457 problem (`application/problem+json`). The device-bound routes also carry the registered device id in `X-Six-Minute-Device`. Every call from the application names its version in `X-Six-Minute-Version`; a version below the floor answers 400 `urn:six-minute:problem:client-outdated` with `minimum`, on every route but `/healthz`, `/v1/health`, `/v1/ready`, `/v1/update/*`, `/v1/auth/*` and `/v1/me/provision`, with `reason` `update`. The served page names its build in `X-Six-Minute-Build` (`YYYYMMDDHHMMSS-<commit>`); a build older than the page floor answers the same problem with `reason` `reload` and the page floor as `minimum`, on the same routes."},"tags":[{"name":"ops","description":"Health and the document itself."},{"name":"clients","description":"The tenant's clients: read by every role, written by billing and admin."},{"name":"matters","description":"The tenant's matters and the seed import."},{"name":"vocabulary","description":"The attributes the firm's entries carry, with the option sets a matter names. The activity types are gone and answer only for desktops from before the stream-only release (COMPAT(#180))."},{"name":"entries","description":"The time entries: the Time screen, the device's batch, edits, release, the day read and the intervals."},{"name":"llm","description":"The completions proxy and its meter. Forwards cards, retains counts."},{"name":"telemetry","description":"Counts only. Never content."},{"name":"me","description":"Who am I, and the sign-in that accepts a pending invitation (D-73)."},{"name":"auth","description":"Email one-time-code sign-in, unauthenticated: the two calls that need a WorkOS secret and therefore cannot happen on the device (D-69)."},{"name":"newsletter","description":"The sixminute.ai mailing list, unauthenticated: the website's subscribe and confirm calls, and Resend's unsubscribe webhook. The one table outside tenancy."},{"name":"devices","description":"The daemons that capture for a person."},{"name":"coverage","description":"When a source was watching: one row per stretch, the author's alone, so the space between two entries reads as absent or as not captured."},{"name":"tenant","description":"The firm and its capture policy (admin)."},{"name":"members","description":"Memberships, roles and pending invitations (admin)."},{"name":"config","description":"The configuration that is ours: the model ids, the prompts and the judgment's tunables, as one versioned bundle every device fetches."},{"name":"icons","description":"Site icons by domain, fetched once by us and cached, so no client ever fetches an icon from a host other than this API."},{"name":"update","description":"The application update: the manifest a host asks every four and a half hours, and the build it downloads. Both unauthenticated, like the health check."},{"name":"connectors","description":"The firm's link to its practice management system: the two-step connect, the employee table, Sync now, Disconnect, and the scheduled sync every five minutes. No route here answers with a credential."},{"name":"calendar","description":"The person's one calendar account, Outlook or Google: the connect, its finish, the wait for a firm's administrator, and the disconnect. No route answers a token."},{"name":"phone","description":"The phone's calls: the sync a signed-in phone sends at every wake, the forget of calls it sent, and the person's phones as the desktop shows them. No route answers a number, a contact's name or a push token."},{"name":"admin","description":"The operator routes: a member of the Sixminute operators organisation, signed in as themselves, acting on any firm. Every write leaves an audit row before it runs."},{"name":"pipeline","description":"The cloud pipeline: the daemon's interval contexts and clock, the status a client polls, and the hourly purge of expired screen material. No route answers a context's text."},{"name":"research","description":"The daily purge of the research cards already stored. No route reads, opens or exports a card, and none is written."}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"The WorkOS access token. The tenant is its `org_id`."}},"schemas":{"UpdateManifest":{"type":"object","properties":{"version":{"type":"string","example":"0.1.1"},"url":{"type":"string","example":"https://api.example.test/v1/update/download/0.1.1/Sixminute.app.tar.gz"},"signature":{"type":"string","description":"The minisign signature of the artefact, inline."},"notes":{"type":"string"},"pub_date":{"type":"string","example":"2026-09-25T09:00:00Z"}},"required":["version","url","signature","notes","pub_date"]}},"parameters":{}},"paths":{"/healthz":{"get":{"tags":["ops"],"summary":"Liveness, unauthenticated","responses":{"200":{"description":"The service is up; `version` is the build, `admin_surface` the operator routes' fingerprint.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"version":{"type":"string"},"admin_surface":{"type":"string"},"pipeline_internal_only":{"type":"boolean"}},"required":["ok","version","admin_surface","pipeline_internal_only"]}}}}}}},"/v1/health":{"get":{"tags":["ops"],"summary":"Liveness, unauthenticated, reachable from outside Cloud Run","responses":{"200":{"description":"The service is up; `version` is the build, `admin_surface` the operator routes' fingerprint.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"version":{"type":"string"},"admin_surface":{"type":"string"},"pipeline_internal_only":{"type":"boolean"}},"required":["ok","version","admin_surface","pipeline_internal_only"]}}}}}}},"/v1/ready":{"get":{"tags":["ops"],"summary":"Readiness, unauthenticated: the database answers through the service's own pool","responses":{"200":{"description":"The database answered a `select 1` through the service's pool; `version` is the build.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"version":{"type":"string"}},"required":["ok","version"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/provision":{"post":{"tags":["me"],"summary":"Create the tenant, user and membership rows for a verified token, idempotently","description":"Safe to call on every sign-in. A token that names an organisation is provisioned straight away and the answer's `action` is `ready`. A token that names none has its PENDING INVITATIONS looked up by the address WorkOS holds for it: the oldest is accepted, which creates the WorkOS membership with the invited role, the rows follow, and `action` is `refresh` because the caller's token predates that membership and must be refreshed with `tenant.workos_org_id`. Nobody invited: 403 `no-firm`, and nothing is written (D-73).","security":[{"bearer":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant_name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","format":"email"},"name":{"type":"string","maxLength":200}},"default":{}}}}},"responses":{"200":{"description":"The rows, and what the caller must do next.","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"workos_user_id":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"name":{"type":"string","default":""},"avatar":{"type":"object","nullable":true,"properties":{"updated_at":{"type":"string","format":"date-time"}},"default":null,"required":["updated_at"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","workos_user_id","email","created_at"]},"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"workos_org_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"policy":{"type":"object","properties":{"excluded_bundles":{"type":"array","items":{"type":"string","minLength":1},"default":[]},"security_tier":{"type":"string","enum":["standard","confidential"],"default":"standard"},"raw_archive":{"type":"boolean","default":false},"research_export":{"type":"boolean","default":false},"context_retention_days":{"type":"integer","minimum":0,"maximum":365,"default":30},"demo":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"default":{}},"settings":{"type":"object","properties":{"unit_minutes":{"type":"integer","minimum":3,"maximum":15,"default":6},"narrative":{"type":"object","properties":{"max_chars":{"type":"integer","nullable":true,"minimum":40,"maximum":1023,"default":null},"language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"],"default":"en"},"guidance":{"type":"string","maxLength":1500,"default":""},"lowered_to_system":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"at":{"type":"string","format":"date-time"}},"default":null,"required":["kind","at"]}},"default":{}},"capture":{"type":"object","properties":{"always_on":{"type":"string","enum":["member_choice","enforced"],"default":"member_choice"}},"default":{}},"timesheet_pet":{"type":"object","properties":{"on":{"type":"boolean","default":false},"on_since":{"type":"string","nullable":true,"format":"date-time","default":null}},"default":{}}},"default":{}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"connector":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"supplies_languages":{"type":"boolean"},"identity":{"type":"string","enum":["mapping","sign_in"]}},"required":["kind","narrative_max_chars"]},"administrators":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","workos_org_id","name","created_at","updated_at","connector"]},"member":{"type":"object","properties":{"id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"active":{"type":"boolean","default":true},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"entry_size":{"type":"string","nullable":true,"enum":["fewer","balanced","more"],"default":null},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"system_link":{"type":"object","nullable":true,"properties":{"system":{"type":"string","enum":["urios","legalsense","fake"]},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1},"status":{"type":"string","enum":["connected","needs_reconnect"]},"synced":{"type":"boolean"},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"approval":{"type":"string","enum":["review","auto"]}},"default":null,"required":["system","name","code"]},"time_zone":{"type":"string","nullable":true},"time_zone_next":{"type":"string","nullable":true},"time_zone_next_from":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["id","user_id","role","created_at","updated_at"]},"permissions":{"type":"array","items":{"type":"string"},"default":[]},"judgment_pipeline":{"type":"string","enum":["standard","jev"],"default":"standard"},"legalsense_connector":{"type":"boolean","default":false},"timesheet_pet":{"type":"boolean","default":false},"calendar_offered":{"type":"boolean"},"swallow_short_pauses":{"type":"boolean"},"pipeline_shadow":{"type":"boolean"},"narrative_limit":{"type":"object","properties":{"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true},"by":{"type":"string","enum":["firm","house","system","max"]}},"required":["limit","by"]},"practice":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"narrative_style":{"type":"boolean"},"action":{"type":"string","enum":["ready","refresh"],"default":"ready"}},"required":["user","tenant","member"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me":{"get":{"tags":["me"],"summary":"Who am I, in which tenant, as what","description":"`tenant.connector` is the firm's practice system as every role may read it: its `kind` and its `narrative_max_chars` (and `note_max_chars`, the internal note's ceiling, null where it declares none, and `supplies_languages`, whether the system supplies each matter's narrative language), or null where the firm has none, whatever the connector's status. It is what a client words the connector's release blockers and refusals with (`connector.*`, among them `connector.not_connected` for a connector in any status but `connected`); the connector itself is billing's and admin's (`GET /v1/connector`). `tenant.settings` is the firm's own settings, which every role reads and an admin writes (`PATCH /v1/tenant/settings`). `tenant.administrators` is the display names of the firm's active administrators, in name order, so a page can say who sets the firm's settings. `member.system_link` is who the caller is in the practice system, or null. `judgment_pipeline` is `jev` where the service holds a Jev key and `standard` where it does not: it is kept for installed desktops that still read it (COMPAT(#180)). `legalsense_connector` and `calendar_offered` are always true: LegalSense and the calendar are offered to everyone, and the fields stay for installed desktops that read them. `swallow_short_pauses` is whether a short pause in the capture is part of the activity block before it (true) or away (false): the `swallow-short-pauses` flag, true where the flag is on and where this service holds no PostHog key, and LEFT OUT where the flag store gave no answer (it could not be reached, or it does not know the flag), so a device keeps what it had; a device that was never answered swallows. `timesheet_pet` is whether the firm is offered the timesheet pet: the `timesheet-pet` flag, false wherever it is off or cannot be read. `pipeline_shadow` is always false: the cloud pipeline's shadow is deleted (the generate-reliability plan, W6), and the field stays until the follow-up removes it, because a response field is never removed.","security":[{"bearer":[]}],"responses":{"200":{"description":"The acting user, tenant and membership.","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"workos_user_id":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"name":{"type":"string","default":""},"avatar":{"type":"object","nullable":true,"properties":{"updated_at":{"type":"string","format":"date-time"}},"default":null,"required":["updated_at"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","workos_user_id","email","created_at"]},"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"workos_org_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"policy":{"type":"object","properties":{"excluded_bundles":{"type":"array","items":{"type":"string","minLength":1},"default":[]},"security_tier":{"type":"string","enum":["standard","confidential"],"default":"standard"},"raw_archive":{"type":"boolean","default":false},"research_export":{"type":"boolean","default":false},"context_retention_days":{"type":"integer","minimum":0,"maximum":365,"default":30},"demo":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"default":{}},"settings":{"type":"object","properties":{"unit_minutes":{"type":"integer","minimum":3,"maximum":15,"default":6},"narrative":{"type":"object","properties":{"max_chars":{"type":"integer","nullable":true,"minimum":40,"maximum":1023,"default":null},"language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"],"default":"en"},"guidance":{"type":"string","maxLength":1500,"default":""},"lowered_to_system":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"at":{"type":"string","format":"date-time"}},"default":null,"required":["kind","at"]}},"default":{}},"capture":{"type":"object","properties":{"always_on":{"type":"string","enum":["member_choice","enforced"],"default":"member_choice"}},"default":{}},"timesheet_pet":{"type":"object","properties":{"on":{"type":"boolean","default":false},"on_since":{"type":"string","nullable":true,"format":"date-time","default":null}},"default":{}}},"default":{}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"connector":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"supplies_languages":{"type":"boolean"},"identity":{"type":"string","enum":["mapping","sign_in"]}},"required":["kind","narrative_max_chars"]},"administrators":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","workos_org_id","name","created_at","updated_at","connector"]},"member":{"type":"object","properties":{"id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"active":{"type":"boolean","default":true},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"entry_size":{"type":"string","nullable":true,"enum":["fewer","balanced","more"],"default":null},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"system_link":{"type":"object","nullable":true,"properties":{"system":{"type":"string","enum":["urios","legalsense","fake"]},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1},"status":{"type":"string","enum":["connected","needs_reconnect"]},"synced":{"type":"boolean"},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"approval":{"type":"string","enum":["review","auto"]}},"default":null,"required":["system","name","code"]},"time_zone":{"type":"string","nullable":true},"time_zone_next":{"type":"string","nullable":true},"time_zone_next_from":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["id","user_id","role","created_at","updated_at"]},"permissions":{"type":"array","items":{"type":"string"},"default":[]},"judgment_pipeline":{"type":"string","enum":["standard","jev"],"default":"standard"},"legalsense_connector":{"type":"boolean","default":false},"timesheet_pet":{"type":"boolean","default":false},"calendar_offered":{"type":"boolean"},"swallow_short_pauses":{"type":"boolean"},"pipeline_shadow":{"type":"boolean"},"narrative_limit":{"type":"object","properties":{"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true},"by":{"type":"string","enum":["firm","house","system","max"]}},"required":["limit","by"]},"practice":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"narrative_style":{"type":"boolean"}},"required":["user","tenant","member"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"patch":{"tags":["me"],"summary":"Change the caller's own name, narrative language, entry size or day zone","description":"The caller's own name, narrative language and entry size, and nobody else's: no route takes another person's id for any of them. At least one of the three is sent. The name is written to WorkOS first, the text up to the first space as the first name and the rest as the last name, and to our row only when WorkOS took it, so later sign-ins carry the same name. WorkOS refusing is a 502 (a 429 while it rate limits), and a deploy with no WorkOS key a 503; in both cases nothing is written. `narrative_language` is the language the caller's own narratives are written in where the matter names none, ahead of the firm's default; `null` returns them to the firm's default. Every role sets their own; it is served as `member.narrative_language`, and WorkOS is not involved. `entry_size` is how much related work the caller's Generate groups into one entry (`more` for small entries, `balanced`, `fewer` for large ones), read when each Generate and regeneration starts; `null` returns them to the served default. It is served as `member.entry_size`. `time_zone` is the zone the caller's days are cut in, a named IANA id (`Europe/Amsterdam`; no `Etc/` id and no offset, 400 otherwise): it applies from the caller's next local date, served as `member.time_zone_next` and `member.time_zone_next_from` until that day opens; days already opened keep their zone (ruling 6.2).","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"entry_size":{"type":"string","nullable":true,"enum":["fewer","balanced","more"]},"time_zone":{"type":"string","minLength":1,"maxLength":64}}}}}},"responses":{"200":{"description":"The caller after the change: the same answer as `GET /v1/me`.","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"workos_user_id":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"name":{"type":"string","default":""},"avatar":{"type":"object","nullable":true,"properties":{"updated_at":{"type":"string","format":"date-time"}},"default":null,"required":["updated_at"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","workos_user_id","email","created_at"]},"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"workos_org_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"policy":{"type":"object","properties":{"excluded_bundles":{"type":"array","items":{"type":"string","minLength":1},"default":[]},"security_tier":{"type":"string","enum":["standard","confidential"],"default":"standard"},"raw_archive":{"type":"boolean","default":false},"research_export":{"type":"boolean","default":false},"context_retention_days":{"type":"integer","minimum":0,"maximum":365,"default":30},"demo":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"default":{}},"settings":{"type":"object","properties":{"unit_minutes":{"type":"integer","minimum":3,"maximum":15,"default":6},"narrative":{"type":"object","properties":{"max_chars":{"type":"integer","nullable":true,"minimum":40,"maximum":1023,"default":null},"language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"],"default":"en"},"guidance":{"type":"string","maxLength":1500,"default":""},"lowered_to_system":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"at":{"type":"string","format":"date-time"}},"default":null,"required":["kind","at"]}},"default":{}},"capture":{"type":"object","properties":{"always_on":{"type":"string","enum":["member_choice","enforced"],"default":"member_choice"}},"default":{}},"timesheet_pet":{"type":"object","properties":{"on":{"type":"boolean","default":false},"on_since":{"type":"string","nullable":true,"format":"date-time","default":null}},"default":{}}},"default":{}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"connector":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"supplies_languages":{"type":"boolean"},"identity":{"type":"string","enum":["mapping","sign_in"]}},"required":["kind","narrative_max_chars"]},"administrators":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","workos_org_id","name","created_at","updated_at","connector"]},"member":{"type":"object","properties":{"id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"active":{"type":"boolean","default":true},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"entry_size":{"type":"string","nullable":true,"enum":["fewer","balanced","more"],"default":null},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"system_link":{"type":"object","nullable":true,"properties":{"system":{"type":"string","enum":["urios","legalsense","fake"]},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1},"status":{"type":"string","enum":["connected","needs_reconnect"]},"synced":{"type":"boolean"},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"approval":{"type":"string","enum":["review","auto"]}},"default":null,"required":["system","name","code"]},"time_zone":{"type":"string","nullable":true},"time_zone_next":{"type":"string","nullable":true},"time_zone_next_from":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["id","user_id","role","created_at","updated_at"]},"permissions":{"type":"array","items":{"type":"string"},"default":[]},"judgment_pipeline":{"type":"string","enum":["standard","jev"],"default":"standard"},"legalsense_connector":{"type":"boolean","default":false},"timesheet_pet":{"type":"boolean","default":false},"calendar_offered":{"type":"boolean"},"swallow_short_pauses":{"type":"boolean"},"pipeline_shadow":{"type":"boolean"},"narrative_limit":{"type":"object","properties":{"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true},"by":{"type":"string","enum":["firm","house","system","max"]}},"required":["limit","by"]},"practice":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"narrative_style":{"type":"boolean"}},"required":["user","tenant","member"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/avatar":{"put":{"tags":["me"],"summary":"Set the caller's own picture","description":"The body is the image itself, at most 262144 bytes, under its own `Content-Type`: png, jpeg or webp. The client scales it to 256 by 256 first. Too large is a 413; any other type (SVG and GIF among them) is a 415; an empty body, or bytes that are not the type they are declared as, is a 422. Nothing is stored on a refusal. The answer is the picture's `updated_at`, which the rows that name the person carry as `avatar.updated_at`.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"When the picture changed.","content":{"application/json":{"schema":{"type":"object","properties":{"updated_at":{"type":"string","format":"date-time"}},"required":["updated_at"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"413":{"description":"The body is larger than this route takes.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"415":{"description":"The body's content type is not one this route takes.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["me"],"summary":"Remove the caller's own picture","description":"204 whether or not there was one; the letter is drawn instead.","security":[{"bearer":[]}],"responses":{"204":{"description":"Removed."},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/avatars/{user_id}":{"get":{"tags":["me"],"summary":"One person's picture, to someone who shares a firm with them","description":"The bytes under the type they were stored as. A person with no picture, and a person who is not a member of the caller's firm, are both a 404. `v` is the picture's `avatar.updated_at` as the rows that name the person carry it: with it the answer may be kept for a year, without it it is revalidated.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"user_id","in":"path"},{"schema":{"type":"string","maxLength":64},"required":false,"name":"v","in":"query"}],"responses":{"200":{"description":"The picture.","content":{"image/png":{"schema":{"type":"string"}},"image/jpeg":{"schema":{"type":"string"}},"image/webp":{"schema":{"type":"string"}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/devices":{"post":{"tags":["devices"],"summary":"Register this daemon, or refresh the registration","description":"Idempotent on the device id. The owner never changes; a revoked device cannot re-register.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]}},"required":["id","name","platform"]}}}},"responses":{"200":{"description":"Already registered by this user; name and platform refreshed.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]},"created_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","nullable":true,"format":"date-time","default":null},"revoked_at":{"type":"string","nullable":true,"format":"date-time","default":null}},"required":["id","user_id","name","platform","created_at"]}}}},"201":{"description":"Registered for the first time.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]},"created_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","nullable":true,"format":"date-time","default":null},"revoked_at":{"type":"string","nullable":true,"format":"date-time","default":null}},"required":["id","user_id","name","platform","created_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"get":{"tags":["devices"],"summary":"The caller's devices; every device in the tenant for an admin; or one person's with `user_id`","description":"With `user_id`, that person's devices only: an admin may name anyone in the firm, anyone else only themselves (403 otherwise). A person with no devices in this firm is an empty list.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"required":false,"name":"user_id","in":"query"}],"responses":{"200":{"description":"Newest first.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]},"created_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","nullable":true,"format":"date-time","default":null},"revoked_at":{"type":"string","nullable":true,"format":"date-time","default":null},"signed_in":{"type":"boolean","default":true}},"required":["id","user_id","name","platform","created_at"]}}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/devices/credential":{"delete":{"tags":["devices"],"summary":"The daemon signs out: its credential stops working","description":"A device route. Clears the credential of the device that calls and ends the WorkOS sessions recorded against it, so their access tokens are refused on their next request; the device stays registered.","security":[{"bearer":[]}],"responses":{"204":{"description":"Signed out."},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/devices/{id}":{"delete":{"tags":["devices"],"summary":"Revoke a device: the owner's own, or any in the tenant for an admin","description":"Sets `revoked_at` once; the row stays so the audit trail does. The device-bound routes then refuse the id, and the WorkOS sessions recorded against the device are ended, so their access tokens are refused on their next request.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The device, revoked.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]},"created_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","nullable":true,"format":"date-time","default":null},"revoked_at":{"type":"string","nullable":true,"format":"date-time","default":null}},"required":["id","user_id","name","platform","created_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/devices/enrollment":{"post":{"tags":["devices"],"summary":"A one-time code the signed-in page hands to this machine's daemon","description":"The person's session. Answers a code that works once, for five minutes, at `POST /v1/devices/enroll`, where it issues a device credential for one of this person's devices.","security":[{"bearer":[]}],"responses":{"201":{"description":"The code and when it stops working.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}},"required":["code","expires_at"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/devices/enroll":{"post":{"tags":["devices"],"summary":"The daemon exchanges a one-time code for its own credential","description":"A device route; the code is the only authentication, and any request carrying `Origin` is refused. A used, expired or unknown code is 401. A `device_id` registered to another person is 409 and that device's credential is left as it was; a revoked device, or a membership deactivated since the code was issued, is 403. The credential is answered once and stored as its hash; it is accepted by the device routes alone.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","maxLength":200},"device_id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]}},"required":["code","device_id","name","platform"]}}}},"responses":{"201":{"description":"The credential, shown once, the device, and the firm's policy with its version.","content":{"application/json":{"schema":{"type":"object","properties":{"credential":{"type":"string"},"device":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]},"created_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","nullable":true,"format":"date-time","default":null},"revoked_at":{"type":"string","nullable":true,"format":"date-time","default":null}},"required":["id","user_id","name","platform","created_at"]},"account":{"type":"string","minLength":1},"tenant_id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"policy":{"type":"object","properties":{"excluded_bundles":{"type":"array","items":{"type":"string"}},"raw_archive":{"type":"boolean"},"swallow_short_pauses":{"type":"boolean","nullable":true},"unit_minutes":{"type":"integer","minimum":3,"maximum":15},"time_zone":{"type":"string","nullable":true,"minLength":1,"default":null},"context_retention_days":{"type":"integer","minimum":0},"minimum_version":{"type":"string","nullable":true},"always_on":{"type":"string","enum":["member_choice","enforced"],"default":"member_choice"},"policy_version":{"type":"string","minLength":1}},"required":["excluded_bundles","raw_archive","swallow_short_pauses","unit_minutes","context_retention_days","minimum_version","policy_version"]}},"required":["credential","device"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/devices/exchange":{"post":{"tags":["devices"],"summary":"R1's handover: the daemon exchanges the session an older desktop stored for its own credential, once","description":"The stored session of a desktop older than R1, as the bearer; no page sign-in and no code. Any request carrying `Origin` is refused (403), and a device credential is not a session (401). The device must be one the person registered from a desktop older than R1 and last called from at such a version, and that never held a credential of its own: an unknown id, or one last seen at R1 or later, is 403; one that ever enrolled is 409 `session-exchanged`. Once per device and once per session: a second exchange is 409 `session-exchanged`, except the same session for the same device again (an answer that was lost), which answers 200 with a fresh credential and stops the first. A `device_id` registered to another person is 409 `conflict` and that device is left as it was; a revoked device is 403. The credential is answered once and stored as its hash. Deleted at phase 7.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device_id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]}},"required":["device_id","name","platform"]}}}},"responses":{"200":{"description":"The same session for the same device again (its first answer was lost): a fresh credential, the first one stopped.","content":{"application/json":{"schema":{"type":"object","properties":{"credential":{"type":"string"},"device":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]},"created_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","nullable":true,"format":"date-time","default":null},"revoked_at":{"type":"string","nullable":true,"format":"date-time","default":null}},"required":["id","user_id","name","platform","created_at"]},"account":{"type":"string","minLength":1},"tenant_id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"}},"required":["credential","device"]}}}},"201":{"description":"The credential, shown once, and the device.","content":{"application/json":{"schema":{"type":"object","properties":{"credential":{"type":"string"},"device":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]},"created_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","nullable":true,"format":"date-time","default":null},"revoked_at":{"type":"string","nullable":true,"format":"date-time","default":null}},"required":["id","user_id","name","platform","created_at"]},"account":{"type":"string","minLength":1},"tenant_id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"}},"required":["credential","device"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/devices/session-handoff":{"post":{"tags":["devices"],"summary":"R1's session hand-off: the daemon's stored pre-R1 session, for a one-time code the page redeems","description":"A device route, and only under the credential the handover's exchange issued (any other is 409 `session-handoff-refused`, as is a device whose code was redeemed already). The refresh token is refreshed with WorkOS with the client secret: a refused token is 401, another person's 403, another firm's 403. Answers a code that works once, for a minute, at `POST /v1/auth/page/session-handoff`; a new code may be asked until one is redeemed. Nothing of the token is stored. Deleted at phase 7.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"refresh_token":{"type":"string","minLength":1,"maxLength":4096},"organization_id":{"type":"string","nullable":true,"minLength":1,"maxLength":200}},"required":["refresh_token","organization_id"]}}}},"responses":{"201":{"description":"The code and when it stops working.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","maxLength":4096,"pattern":"^smh_[A-Za-z0-9_-]+$"},"expires_at":{"type":"string","format":"date-time"}},"required":["code","expires_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/devices/{id}/credential":{"delete":{"tags":["devices"],"summary":"Sign a device out from the person's session: their own device, or any for an admin","description":"Clears the device's credential, so a daemon or phone that is offline at sign-out is signed out too, and ends the WorkOS sessions recorded against it, so their access tokens are refused on their next request. The device stays and can sign in again. 404 for a device the caller may not reach.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Cleared."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/devices/sign-out-elsewhere":{"post":{"tags":["devices"],"summary":"Sign out everywhere else: every other WorkOS session of the person, and their other devices' credentials","description":"The person's session. Ends every WorkOS session of the person but the caller's own (WorkOS lists them, so a session no device row records, one made before devices recorded sessions, is ended too), records each as ended, so its access tokens are refused on their next request, and clears the credential of every other device of the person. The caller's device is the one its session is recorded against, else the one `X-Six-Minute-Device` names. Answers how many sessions and device credentials it ended.","security":[{"bearer":[]}],"responses":{"200":{"description":"What was ended.","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"integer","minimum":0},"devices":{"type":"integer","minimum":0}},"required":["sessions","devices"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/device/policy":{"get":{"tags":["devices"],"summary":"The capture policy, for the daemon","description":"A device route. The firm's exclusions, whether the raw archive is allowed, whether short pauses are swallowed (null when the flag store did not answer), the firm's interval, its `context_retention_days` (the outbox's age bound) and the version floor. Nothing of anybody's day.","security":[{"bearer":[]}],"responses":{"200":{"description":"The capture policy.","content":{"application/json":{"schema":{"type":"object","properties":{"excluded_bundles":{"type":"array","items":{"type":"string"}},"raw_archive":{"type":"boolean"},"swallow_short_pauses":{"type":"boolean","nullable":true},"unit_minutes":{"type":"integer","minimum":3,"maximum":15},"time_zone":{"type":"string","nullable":true,"minLength":1,"default":null},"context_retention_days":{"type":"integer","minimum":0},"minimum_version":{"type":"string","nullable":true},"always_on":{"type":"string","enum":["member_choice","enforced"],"default":"member_choice"}},"required":["excluded_bundles","raw_archive","swallow_short_pauses","unit_minutes","context_retention_days","minimum_version"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/device/check-in":{"post":{"tags":["devices"],"summary":"The device's check-in: alive, capturing, and the policy when it moved","description":"A device route, as the context upload; `Origin` is refused. Sent every 60 seconds while the app runs and once at quit. The credential's call stamps the device's last call and version. Answers the firm's policy with its `policy_version` when the device's differs, else `policy: null`. A check-in with `open_days: true` is answered `open_days`, the person's open days on this device for the timesheet pet: empty where none is open or the pet is off for them. A check-in that does not ask is answered without it.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"seq":{"type":"integer","minimum":0,"exclusiveMinimum":true},"now":{"type":"string","format":"date-time"},"zone":{"type":"string","minLength":1},"capturing":{"type":"boolean"},"counters":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"samples_received":{"type":"integer","minimum":0},"observations_written":{"type":"integer","minimum":0},"snapshots_written":{"type":"integer","minimum":0},"samples_idle":{"type":"integer","minimum":0},"samples_excluded":{"type":"integer","minimum":0},"samples_empty":{"type":"integer","minimum":0},"samples_out_of_order":{"type":"integer","minimum":0},"samples_late":{"type":"integer","minimum":0},"marks_late":{"type":"integer","minimum":0},"samples_dropped":{"type":"integer","minimum":0},"browser_breaker_trips":{"type":"integer","minimum":0},"clock_steps":{"type":"integer","minimum":0},"active_ms":{"type":"integer","minimum":0},"idle_ms":{"type":"integer","minimum":0},"excluded_ms":{"type":"integer","minimum":0},"locked_ms":{"type":"integer","minimum":0},"outbox_dropped":{"type":"integer","minimum":0},"outbox_aged_out":{"type":"integer","minimum":0},"outbox_signed_out":{"type":"integer","minimum":0},"sampler_dropped":{"type":"object","properties":{"channel_full":{"type":"integer","minimum":0},"too_long":{"type":"integer","minimum":0},"unreadable":{"type":"integer","minimum":0}},"required":["channel_full","too_long","unreadable"]},"sampler_restarts":{"type":"integer","minimum":0},"ended":{"type":"boolean"},"app_ms":{"type":"integer","minimum":0},"app_sessions":{"type":"integer","minimum":0}},"required":["day","samples_received","observations_written","snapshots_written","samples_idle","samples_excluded","samples_empty","samples_out_of_order","samples_late","marks_late","samples_dropped","browser_breaker_trips","clock_steps","active_ms","idle_ms","excluded_ms","locked_ms","outbox_dropped","outbox_aged_out","outbox_signed_out","sampler_dropped","sampler_restarts"]},"maxItems":8},"version":{"type":"string","minLength":1},"platform":{"type":"string","enum":["windows","macos"]},"permissions":{"type":"object","nullable":true,"properties":{"accessibility":{"type":"string","enum":["granted","denied","unknown"]},"automation":{"type":"string","enum":["granted","denied","unknown"]},"screen":{"type":"string","enum":["granted","denied","unknown"]}},"required":["accessibility","automation","screen"]},"sampler":{"type":"string","enum":["starting","ok","failing","refused"]},"update":{"type":"string","enum":["current","available","required"]},"policy_version":{"type":"string","nullable":true,"minLength":1},"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"at":{"type":"string","format":"date-time"},"name":{"type":"string","enum":["capture.started"]},"trigger":{"type":"string","enum":["button","tray","always_on","launch","sign_in"]}},"required":["id","at","name","trigger"]},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"at":{"type":"string","format":"date-time"},"name":{"type":"string","enum":["capture.stopped"]},"trigger":{"type":"string","enum":["button","tray","sign_out"]}},"required":["id","at","name","trigger"]},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"at":{"type":"string","format":"date-time"},"name":{"type":"string","enum":["user.signed_out"]},"trigger":{"type":"string","enum":["menu","tray","revoked"]}},"required":["id","at","name","trigger"]},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"at":{"type":"string","format":"date-time"},"name":{"type":"string","enum":["permission.changed"]},"permission":{"type":"string","enum":["accessibility","automation","screen"]},"granted":{"type":"boolean"}},"required":["id","at","name","permission","granted"]},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"at":{"type":"string","format":"date-time"},"name":{"type":"string","enum":["update.failed"]},"stage":{"type":"string","enum":["check","download","verify","install"]},"reason":{"type":"string","enum":["offline","timeout","http_4xx","http_5xx","manifest","signature","download","install","other"]}},"required":["id","at","name","stage"]},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"at":{"type":"string","format":"date-time"},"name":{"type":"string","enum":["setting.changed"]},"setting":{"type":"string","enum":["always_on","launch_at_login","theme","exclusions"]}},"required":["id","at","name","setting"]},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"at":{"type":"string","format":"date-time"},"name":{"type":"string","enum":["raw_archive.switched"]},"on":{"type":"boolean"},"reason":{"type":"string","enum":["person","expired","signed_out","tenant_changed","not_allowed","refused","disk_low"]}},"required":["id","at","name","on","reason"]}]},"maxItems":500},"open_days":{"type":"boolean","enum":[true]}},"required":["seq","now","zone","capturing","counters","version","platform","permissions","sampler","update","policy_version","events"]}}}},"responses":{"200":{"description":"The policy, when the device's is not current.","content":{"application/json":{"schema":{"type":"object","properties":{"policy":{"type":"object","nullable":true,"properties":{"excluded_bundles":{"type":"array","items":{"type":"string"}},"raw_archive":{"type":"boolean"},"swallow_short_pauses":{"type":"boolean","nullable":true},"unit_minutes":{"type":"integer","minimum":3,"maximum":15},"time_zone":{"type":"string","nullable":true,"minLength":1,"default":null},"context_retention_days":{"type":"integer","minimum":0},"minimum_version":{"type":"string","nullable":true},"always_on":{"type":"string","enum":["member_choice","enforced"],"default":"member_choice"},"policy_version":{"type":"string","minLength":1}},"required":["excluded_bundles","raw_archive","swallow_short_pauses","unit_minutes","context_retention_days","minimum_version","policy_version"]},"open_days":{"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"maxItems":31}},"required":["policy"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/coverage":{"post":{"tags":["coverage"],"summary":"A device posts when its sources were watching, idempotent on the coverage id","description":"Carries the device header (X-Six-Minute-Device) with a person's session, or the daemon's own device credential (a device route); the body's `device_id` must be that device, and a row's own `device_id` is that device or null. Each row is answered with one outcome: `applied` (written), `unchanged` (the row did not move, so a replay is not an error) or `refused` with a sentence saying what to fix. The write is monotone and the first value wins: `to_at` and `settled_at` are taken when the row has none yet and kept once stored, whatever a later body carries, and `from_at`, `source` and `device_id` never change after the first post. A row another member posted is refused and left untouched. The author is the caller, from the token; the body cannot name one.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device_id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"coverage":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^cov_[a-z0-9][a-z0-9_.:-]*$"},"source":{"type":"string","pattern":"^[a-z_]{1,40}$"},"device_id":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$","default":null},"from_at":{"type":"string","format":"date-time"},"to_at":{"type":"string","nullable":true,"format":"date-time","default":null},"settled_at":{"type":"string","nullable":true,"format":"date-time","default":null}},"required":["id","source","from_at"]},"minItems":1,"maxItems":500}},"required":["device_id","coverage"]}}}},"responses":{"200":{"description":"One outcome per row of the batch, in the order posted.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^cov_[a-z0-9][a-z0-9_.:-]*$"},"outcome":{"type":"string","enum":["applied","unchanged","refused"]},"reason":{"type":"string","minLength":1}},"required":["id","outcome"]}}},"required":["results"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"get":{"tags":["coverage"],"summary":"The caller's own coverage overlapping a window, an open row included","description":"Rows with `from_at < to` and either no `to_at` yet or `to_at > from`, ordered by `(from_at, id)`; `since` continues from a `next_cursor`. Both instants are required, `to` after `from`, at most 31 days apart. Only the caller's own rows, whatever their role.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"since","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":2000,"default":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of coverage rows, and where to continue.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^cov_[a-z0-9][a-z0-9_.:-]*$"},"source":{"type":"string","pattern":"^[a-z_]{1,40}$"},"device_id":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$","default":null},"from_at":{"type":"string","format":"date-time"},"to_at":{"type":"string","nullable":true,"format":"date-time","default":null},"settled_at":{"type":"string","nullable":true,"format":"date-time","default":null},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","source","from_at","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"minLength":1}},"required":["rows","next_cursor"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/tenant":{"get":{"tags":["tenant"],"summary":"The tenant row with its policy (admin)","security":[{"bearer":[]}],"responses":{"200":{"description":"The tenant.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"workos_org_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"policy":{"type":"object","properties":{"excluded_bundles":{"type":"array","items":{"type":"string","minLength":1},"default":[]},"security_tier":{"type":"string","enum":["standard","confidential"],"default":"standard"},"raw_archive":{"type":"boolean","default":false},"research_export":{"type":"boolean","default":false},"context_retention_days":{"type":"integer","minimum":0,"maximum":365,"default":30},"demo":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"default":{}},"settings":{"type":"object","properties":{"unit_minutes":{"type":"integer","minimum":3,"maximum":15,"default":6},"narrative":{"type":"object","properties":{"max_chars":{"type":"integer","nullable":true,"minimum":40,"maximum":1023,"default":null},"language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"],"default":"en"},"guidance":{"type":"string","maxLength":1500,"default":""},"lowered_to_system":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"at":{"type":"string","format":"date-time"}},"default":null,"required":["kind","at"]}},"default":{}},"capture":{"type":"object","properties":{"always_on":{"type":"string","enum":["member_choice","enforced"],"default":"member_choice"}},"default":{}},"timesheet_pet":{"type":"object","properties":{"on":{"type":"boolean","default":false},"on_since":{"type":"string","nullable":true,"format":"date-time","default":null}},"default":{}}},"default":{}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","workos_org_id","name","created_at","updated_at"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/tenant/settings":{"patch":{"tags":["tenant"],"summary":"Change the firm's own settings: its interval, its narratives, Always on and the timesheet pet (admin)","description":"A merge, per key at both levels: a patch naming only `narrative.language` keeps the stored length and guidance, and `narrative.max_chars: null` returns the firm to the house length. Every role reads the result on `GET /v1/me` as `tenant.settings`. `narrative.max_chars` may not exceed the connected practice system's ceiling, or 1023 without one: 422 on that path. A new `unit_minutes` applies to every recording started after the change. `capture.always_on: \"enforced\"` keeps capture running on every member's device whenever Sixminute is open; each device saves it off `GET /v1/me`, at its hourly refresh. Older Sixminute versions do not enforce it until they update. `timesheet_pet.on` turns the timesheet pet on or off for everyone in the firm; on needs a connected practice system (422 `timesheet_pet.no_practice_system` on that path). Each change from off to on sets `timesheet_pet.on_since` to the moment of the change, so no day before it is listed; it is the API's alone to write.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"unit_minutes":{"type":"integer","minimum":3,"maximum":15},"narrative":{"type":"object","properties":{"max_chars":{"type":"integer","nullable":true,"minimum":40,"maximum":1023},"language":{"type":"string","enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"guidance":{"type":"string","maxLength":1500}}},"capture":{"type":"object","properties":{"always_on":{"type":"string","enum":["member_choice","enforced"]}}},"timesheet_pet":{"type":"object","properties":{"on":{"type":"boolean"}},"required":["on"]}}}}}},"responses":{"200":{"description":"The firm's settings after the patch.","content":{"application/json":{"schema":{"type":"object","properties":{"unit_minutes":{"type":"integer","minimum":3,"maximum":15,"default":6},"narrative":{"type":"object","properties":{"max_chars":{"type":"integer","nullable":true,"minimum":40,"maximum":1023,"default":null},"language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"],"default":"en"},"guidance":{"type":"string","maxLength":1500,"default":""},"lowered_to_system":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"at":{"type":"string","format":"date-time"}},"default":null,"required":["kind","at"]}},"default":{}},"capture":{"type":"object","properties":{"always_on":{"type":"string","enum":["member_choice","enforced"],"default":"member_choice"}},"default":{}},"timesheet_pet":{"type":"object","properties":{"on":{"type":"boolean","default":false},"on_since":{"type":"string","nullable":true,"format":"date-time","default":null}},"default":{}}},"default":{}}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/members":{"get":{"tags":["members"],"summary":"The firm's memberships and its pending invitations (admin)","description":"Memberships oldest first; invitations are WorkOS's pending ones for this firm's organisation, oldest first, with the expiry the list shows as \"invited, expires in 6 days\".","security":[{"bearer":[]}],"responses":{"200":{"description":"Both lists.","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"active":{"type":"boolean","default":true},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"entry_size":{"type":"string","nullable":true,"enum":["fewer","balanced","more"],"default":null},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"email":{"type":"string","format":"email"},"name":{"type":"string","default":""},"avatar":{"type":"object","nullable":true,"properties":{"updated_at":{"type":"string","format":"date-time"}},"default":null,"required":["updated_at"]}},"required":["id","user_id","role","created_at","updated_at","email"]}},"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"expires_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","email","role","expires_at","created_at"]},"default":[]}},"required":["members"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/members/invite":{"post":{"tags":["members"],"summary":"Invite a colleague to this firm by email (admin)","description":"WorkOS creates the invitation, good for seven days, and THIS SERVICE emails it (D-76): the message names the firm, the role and the download page, and carries no accept link and no token, because the person's first sign-in accepts it and creates their rows with this role (D-73). An address that already has a membership in this firm is a 409 naming the patch that changes it. Without a mail key the route answers 503 before creating anything; a send that fails revokes the invitation and answers 502.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["timekeeper","billing","admin"]}},"required":["email","role"]}}}},"responses":{"201":{"description":"The invitation, created and emailed.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"expires_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","email","role","expires_at","created_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/members/invitations/{id}":{"delete":{"tags":["members"],"summary":"Revoke a pending invitation to this firm (admin)","description":"An id this firm has no pending invitation for is a 404: an admin revokes only what they can see.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The invitation, now revoked.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"expires_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","email","role","expires_at","created_at"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/members/{id}":{"patch":{"tags":["members"],"summary":"Change a membership's role or active flag (admin)","description":"The last active admin cannot be demoted or deactivated: 409 `urn:six-minute:problem:last-admin`. Deactivating a member of a firm whose practice system each person signs in to deletes that member's own session there and their binding; nothing is sent to the practice system. Deactivating a member also deletes their calendar account with its stored events and marks, and asks the provider to revoke where it allows. This is also how a former member comes back. The interval is the firm's (`PATCH /v1/tenant/settings`).","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["timekeeper","billing","admin"]},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The membership after the patch.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"active":{"type":"boolean","default":true},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"entry_size":{"type":"string","nullable":true,"enum":["fewer","balanced","more"],"default":null},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","user_id","role","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/config/bundle":{"get":{"tags":["config"],"summary":"The model ids, the three prompts, the judgment's tunables and the published code vocabularies","description":"One document for every device of every firm, named by a 12-character fingerprint over its own contents. The daemon fetches it at start and hourly and caches it beside its data; an unchanged `version` means an unchanged configuration, all four parts of it. Nothing here is tenant-specific: which code sets a firm uses, and any code it added, are the firm's lists and arrive on `/v1/code-sets`. COMPAT(#180): a call whose `X-Six-Minute-Version` is below the first stream-only release is served the narrative prompt that version shipped with, under that document's own `version`.","security":[{"bearer":[]}],"responses":{"200":{"description":"The bundle. `version` changes exactly when the configuration does.","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","pattern":"^[0-9a-f]{12}$"},"generated_at":{"type":"string","format":"date-time"},"models":{"type":"object","properties":{"label":{"type":"string","minLength":1},"write":{"type":"string","minLength":1},"decisions":{"type":"string","minLength":1},"reask":{"type":"string","minLength":1}},"required":["label","write"]},"judge":{"type":"object","properties":{"shortlistSize":{"type":"number"},"cardOpeningChars":{"type":"number"},"cardChangedChars":{"type":"number"},"chromeMinSnapshots":{"type":"number"},"cardMaxAnchors":{"type":"number"},"cardTypedChars":{"type":"number"},"cardClickedChars":{"type":"number"},"glanceSeconds":{"type":"number"},"sampleIntervalSeconds":{"type":"number"},"absentAfterMinutes":{"type":"number"},"maxNarrativeChars":{"type":"number"},"judgeSamples":{"type":"number"},"matterReaskBelow":{"type":"number","minimum":0,"maximum":1},"joinMore":{"type":"number","minimum":0,"maximum":1},"joinBalanced":{"type":"number","minimum":0,"maximum":1},"joinFewer":{"type":"number","minimum":0,"maximum":1},"joinDefault":{"type":"string","enum":["more","balanced","fewer"]},"summaryMaxChars":{"type":"integer","minimum":0,"exclusiveMinimum":true},"summaryStatedChars":{"type":"integer","minimum":0,"exclusiveMinimum":true},"shortlistDepth":{"type":"integer","minimum":0,"exclusiveMinimum":true},"windowMinutes":{"type":"number"},"edgeSearchMinutes":{"type":"number"},"renderBudgetChars":{"type":"number"},"activitySamples":{"type":"number"}},"required":["shortlistSize","cardOpeningChars","cardChangedChars","chromeMinSnapshots","cardMaxAnchors","cardTypedChars","cardClickedChars","glanceSeconds","sampleIntervalSeconds","absentAfterMinutes","maxNarrativeChars","judgeSamples","windowMinutes","edgeSearchMinutes","renderBudgetChars","activitySamples"]},"prompts":{"type":"object","properties":{"label":{"type":"string","minLength":1},"activity":{"type":"string","minLength":1},"narrative":{"type":"string","minLength":1},"summary":{"type":"object","properties":{"guide":{"type":"string","minLength":1},"work":{"type":"string","minLength":1},"verb_work":{"type":"string","minLength":1},"thing_free":{"type":"string","minLength":1},"tool_object":{"type":"string","minLength":1},"speech":{"type":"string","minLength":1},"work_read":{"type":"string","minLength":1},"work_plan":{"type":"string","minLength":1}},"required":["guide","work","verb_work","thing_free","tool_object","speech","work_read","work_plan"]},"matter":{"type":"string","minLength":1},"matter_prior":{"type":"string","minLength":1},"matter_own":{"type":"string","minLength":1},"shortlist_judge":{"type":"string","minLength":1},"block_boundary":{"type":"string","minLength":1},"block_label":{"type":"string","minLength":1},"join":{"type":"string","minLength":1},"narrative_blocks":{"type":"string","minLength":1}},"required":["label","activity","narrative"]},"vocabularies":{"type":"object","properties":{"activity_types":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"},"title":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0},"source":{"type":"string","enum":["published","firm"],"default":"firm"}},"required":["key","title","description"]},"minItems":1}},"required":["activity_types"]}},"required":["version","generated_at","models","judge","prompts","vocabularies"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/icons/{domain}":{"get":{"tags":["icons"],"summary":"The site's icon for one domain, from our cache, fetched once per domain","description":"The domain is a bare host: lower-case, no scheme, no port and no path, and never an address. On a miss, or past the cache's TTL, the API asks Google's favicon service about that domain once, under a three second deadline, with the domain as a query parameter of one fixed upstream url and never as a host the caller chose. A redirect is not followed. A 64 KB cap and an image content-type allowlist finish it, and the upstream's own 404, which is what it answers for a domain it has no icon for, is stored as no icon. A domain with no icon we will serve answers 204, which is the client's signal to draw a monogram. No client ever fetches an icon itself.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":253,"description":"A url host: lower-case, no scheme, no port and no path.","example":"rechtspraak.nl"},"required":true,"name":"domain","in":"path"}],"responses":{"200":{"description":"The icon's bytes, with the content type it was served under.","content":{"image/x-icon":{"schema":{"type":"string"}},"image/vnd.microsoft.icon":{"schema":{"type":"string"}},"image/png":{"schema":{"type":"string"}},"image/svg+xml":{"schema":{"type":"string"}},"image/jpeg":{"schema":{"type":"string"}},"image/webp":{"schema":{"type":"string"}}}},"204":{"description":"This domain has no icon we will serve; draw a monogram."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/update/release":{"get":{"tags":["update"],"summary":"Which release this page or host should run, unauthenticated","description":"The release's one question (ruling 6.34): `key` is the host table the caller speaks (`unkeyed` for every page a three-process host loads), `version` its own release where it has one. `current` is the release that key runs now, or null when it has none; `state` is `current`, `available` (offer Restart) or `required` (superseded 7 days, withdrawn, or older than an urgent release); `expired` says the caller's release is past 14 days and its page is no longer served. Open and never refused by the version floor. 503 while the release index cannot be read.","parameters":[{"schema":{"anyOf":[{"type":"string","enum":["unkeyed"]},{"type":"string","pattern":"^h:[0-9a-f]{8}$"}]},"required":true,"name":"key","in":"query"},{"schema":{"type":"string","pattern":"^\\d+\\.\\d+\\.\\d+$"},"required":false,"name":"version","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"device","in":"query"}],"responses":{"200":{"description":"The release to run, and the caller's state.","content":{"application/json":{"schema":{"type":"object","properties":{"current":{"type":"object","nullable":true,"properties":{"version":{"type":"string","pattern":"^\\d+\\.\\d+\\.\\d+$"},"key":{"anyOf":[{"type":"string","enum":["unkeyed"]},{"type":"string","pattern":"^h:[0-9a-f]{8}$"}]},"promoted_at":{"type":"string","format":"date-time"},"desktop":{"type":"string","nullable":true,"pattern":"^\\d+\\.\\d+\\.\\d+$"}},"required":["version","key","promoted_at","desktop"]},"state":{"type":"string","enum":["current","available","required"]},"expired":{"type":"boolean"}},"required":["current","state","expired"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/update/manifest":{"get":{"tags":["update"],"summary":"The build this device should be running, unauthenticated","description":"What `tauri-plugin-updater` calls every four and a half hours. `204` means stay where you are: the device is already on the release it should be on, or the platform is one we do not publish. Otherwise the plugin's dynamic shape for the version `latest.json` names (or its stepping stone, for a device below it), whose `url` points back at the download route below and whose `signature` is the minisign signature the plugin verifies the bytes against. Open like the health check: the host holds no session, and a version number and a file name are what this discloses. Every device is offered the same build.","parameters":[{"schema":{"type":"string","example":"darwin"},"required":false,"name":"target","in":"query"},{"schema":{"type":"string","example":"aarch64"},"required":false,"name":"arch","in":"query"},{"schema":{"type":"string","example":"0.1.0"},"required":true,"name":"version","in":"query"}],"responses":{"200":{"description":"A newer build for this platform and this device.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateManifest"}}}},"204":{"description":"Nothing for this device: it stays on the build it has."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/update/download/latest/{platform}":{"get":{"tags":["update"],"summary":"The installer everyone is offered, as a redirect, unauthenticated","description":"What the download page's buttons point at. `platform` is `macos` or `windows`. Answers 302 to the download route above for the installer the manifest of the version `latest.json` names lists, which only Promote moves, so a candidate never reaches this route.","parameters":[{"schema":{"type":"string","example":"macos"},"required":true,"name":"platform","in":"path"}],"responses":{"302":{"description":"The installer, at its versioned address."},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/update/download/{version}/{file}":{"get":{"tags":["update"],"summary":"One artefact of one published version, streamed, unauthenticated","description":"The bytes the manifest's `url` points at, streamed from the private bucket as the runtime service account. The file must be one the version's own `manifest.json` lists, so this route serves nothing we did not publish; `Content-Length` is the size the publisher recorded. Streamed rather than buffered, because Cloud Run cuts a buffered response at 32 MiB. An installer (an `installers` entry) is served the same way; `via=latest` marks the redirect from the latest route, for the count alone.","parameters":[{"schema":{"type":"string","example":"0.1.1"},"required":true,"name":"version","in":"path"},{"schema":{"type":"string","example":"Sixminute.app.tar.gz"},"required":true,"name":"file","in":"path"},{"schema":{"type":"string","example":"latest"},"required":false,"name":"via","in":"query"}],"responses":{"200":{"description":"The artefact's bytes.","content":{"application/octet-stream":{"schema":{"type":"string"}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/clients":{"get":{"tags":["clients"],"summary":"A page of clients, whole or changed since a position (any role)","description":"With no `since` the pages are the whole list. The last page carries an `ETag`, the position the read ended at: send it as `since` to read only what changed since then, and also as `If-None-Match`, so that a read finding nothing changed is a 304 with no body. Send each `next_cursor` as `since` to continue; a null `next_cursor` means the last page. A `since` the API cannot continue (from another sign-in) is a 400: read from the start. Where a practice system shows each person their own matters (`capabilities.matter_visibility` is `member`), the page holds the clients the firm made itself and the clients of the matters THE CALLER is served by `GET /v1/matters`, and no others: a client that system named is served only while one of its matters is the caller's to see, with an `updated_at` that is the later of its own and the instant such a matter came into the caller's sight, so it arrives on an incremental pull. Every other firm's answer is unchanged.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"since","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":2000,"default":500},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"if-none-match","in":"header"}],"responses":{"200":{"description":"The page.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null},"kind":{"type":"string","enum":["primary","billing","other"],"default":"other"}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"minLength":1}},"required":["rows","next_cursor"]}}}},"304":{"description":"Nothing changed since `since`."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["clients"],"summary":"Create a client (billing, admin)","description":"The id may be given (a device minted it) or is minted here. A name already in use is 409.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null},"kind":{"type":"string","enum":["primary","billing","other"],"default":"other"}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]}},"required":["name"]}}}},"responses":{"201":{"description":"The client as stored.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null},"kind":{"type":"string","enum":["primary","billing","other"],"default":"other"}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/matters":{"get":{"tags":["matters"],"summary":"A page of matters, whole or changed since a position (any role)","description":"With no `since` the pages are the whole list. The last page carries an `ETag`, the position the read ended at: send it as `since` to read only what changed since then, and also as `If-None-Match`, so that a read finding nothing changed is a 304 with no body. Send each `next_cursor` as `since` to continue; a null `next_cursor` means the last page. A `since` the API cannot continue (from another sign-in) is a 400: read from the start. Where the firm's practice system shows each person their own matters (`capabilities.matter_visibility` is `member`), the page holds the matters THE CALLER is shown there and no others, besides the matters the firm made itself, and only while the caller's own sign-in there is live (`member.system_link.status` is `connected` on `GET /v1/me`): a caller who has not signed in, or whose sign-in is no longer accepted, is served none of that system's matters until they sign in again, and so is everybody at a firm that disconnected it. Each such row's `updated_at` is the later of the matter's own and the instant the caller's access to it last changed, so a matter that became visible arrives on an incremental pull. One the system withdrew from the caller arrives once, with `active` false, on a pull whose `since` is from before the withdrawal, and never again whatever changes on it; a pull with no `since` holds none. Every other firm's answer is unchanged.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"since","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":2000,"default":500},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"if-none-match","in":"header"}],"responses":{"200":{"description":"The page.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"firm_internal":{"type":"boolean","default":false},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"attribute_required":{"type":"object","additionalProperties":{"type":"boolean"},"default":{}},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","client_id","name","opened_at","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"minLength":1}},"required":["rows","next_cursor"]}}}},"304":{"description":"Nothing changed since `since`."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["matters"],"summary":"Create a matter under a client of this firm (billing, admin)","description":"The id may be given (a device minted it) or is minted here; `opened_at` defaults to now. An unknown client is 422; a matter number already used within the client is 409.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"}},"required":["client_id","name"]}}}},"responses":{"201":{"description":"The matter as stored.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"firm_internal":{"type":"boolean","default":false},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"attribute_required":{"type":"object","additionalProperties":{"type":"boolean"},"default":{}},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","client_id","name","opened_at","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/matters/{id}":{"patch":{"tags":["matters"],"summary":"Change a matter's fields (billing, admin)","description":"The client is never changed. A temporary matter with entries on it cannot be deactivated: move the entries to the real matter first (409). `narrative_language` is an admin's to change (403 for billing), and not on a matter held by a connected practice system that supplies each matter's language, whose language is the system's (409); sending the value the matter already has changes nothing and is allowed. A matter the caller is not served by `GET /v1/matters` (a practice system that shows each person their own matters does not show it to them) is a 404, whatever their role.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"}}}}}},"responses":{"200":{"description":"The matter after the patch.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"firm_internal":{"type":"boolean","default":false},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"attribute_required":{"type":"object","additionalProperties":{"type":"boolean"},"default":{}},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","client_id","name","opened_at","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/matters/{id}/firm-internal":{"put":{"tags":["matters"],"summary":"Mark a matter as one of the firm's own, or clear the mark (admin)","description":"The firm's internal matters are listed in a section of their own in every matter request, whatever the screen shows. This is the one write of `firm_internal`: no other body takes it and no sync of a practice system changes it. A change raises `updated_at`, so every device's next pull carries it; the value the matter already has changes nothing. A matter the caller is not served by `GET /v1/matters` is a 404, as the patch's. The firm marks at most 10 active matters: marking one more is 409 `urn:six-minute:problem:list-full` and writes nothing; clearing a mark is never refused.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firm_internal":{"type":"boolean"}},"required":["firm_internal"]}}}},"responses":{"200":{"description":"The matter as it now stands.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"firm_internal":{"type":"boolean","default":false},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"attribute_required":{"type":"object","additionalProperties":{"type":"boolean"},"default":{}},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","client_id","name","opened_at","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/matters/import":{"post":{"tags":["matters"],"summary":"The seed import: clients with their matters, matched by name, idempotent (billing, admin)","description":"The shape `six-minute matter import` reads. Clients are matched by exact name and matters by (client, name); missing rows are created, known rows are corrected in `code`, `description`, `external_ref`, `billing`, the record's own words, `temporary`, `billable` and `active` only where the seed differs, and an identical re-import changes nothing. One transaction: a refused row refuses the whole import.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clients":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"external_ref":{"type":"string","nullable":true,"default":null},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null},"kind":{"type":"string","enum":["primary","billing","other"],"default":"other"}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"matters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"},"opened_at":{"type":"string","format":"date-time"}},"required":["name"]}}},"required":["name","matters"]}}},"required":["clients"]}}}},"responses":{"200":{"description":"What was created, updated and left alone.","content":{"application/json":{"schema":{"type":"object","properties":{"clients":{"type":"object","properties":{"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"}},"required":["created","updated","unchanged"]},"matters":{"type":"object","properties":{"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"}},"required":["created","updated","unchanged"]}},"required":["clients","matters"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/internal-matters":{"get":{"tags":["matters"],"summary":"The caller's own internal matters in this firm (any role)","description":"The matter ids the caller marked as their own internal work, in the order they marked them. Every matter request lists the active ones the caller is shown, beside the firm's internal matters.","security":[{"bearer":[]}],"responses":{"200":{"description":"The caller's own list.","content":{"application/json":{"schema":{"type":"object","properties":{"matter_ids":{"type":"array","items":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"}}},"required":["matter_ids"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/me/internal-matters/{id}":{"put":{"tags":["matters"],"summary":"Put a matter on the caller's own internal matters, or take it off (any role)","description":"A list holds at most 10 active matters: one more is 409 `urn:six-minute:problem:list-full`, and nothing is written. Marking a matter already on the list changes nothing, and taking one off is never refused. A matter the caller is not served by `GET /v1/matters` is a 404, unless it is on the list already and is being taken off.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"internal":{"type":"boolean"}},"required":["internal"]}}}},"responses":{"200":{"description":"The caller's own list as it now stands.","content":{"application/json":{"schema":{"type":"object","properties":{"matter_ids":{"type":"array","items":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"}}},"required":["matter_ids"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/activity-types":{"get":{"tags":["vocabulary"],"summary":"COMPAT(#180): the published activity types, for desktops from before the stream-only release (any role)","description":"Activity types are gone. A desktop from before the stream-only release still reads this list, so it answers the published eleven to every firm, in their fixed order, whatever the firm once stored. Removed by #180 once no such desktop has been seen for 30 days.","deprecated":true,"security":[{"bearer":[]}],"responses":{"200":{"description":"The published eleven, in position order.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"},"title":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0},"source":{"type":"string","enum":["published","firm"],"default":"firm"}},"required":["key","title","description"]}}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/activity-types/{key}":{"put":{"tags":["vocabulary"],"summary":"COMPAT(#180): gone; activity types are no longer written","description":"Activity types are gone, so a write is a 410 of type `urn:six-minute:problem:activity-types-gone` and changes nothing. The body and the 200 stay documented only so a client built against the old route still matches; the 200 is never answered. Removed by #180.","deprecated":true,"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"},"required":true,"name":"key","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"},"title":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0},"source":{"type":"string","enum":["published","firm"],"default":"firm"}},"required":["key","title","description"]}}}},"responses":{"200":{"description":"Never answered: the route is gone.","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"},"title":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0},"source":{"type":"string","enum":["published","firm"],"default":"firm"}},"required":["key","title","description"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"410":{"description":"The route is gone and changes nothing; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/attributes":{"get":{"tags":["vocabulary"],"summary":"The firm's attributes: the fields its entries carry (any role)","description":"In `position` then `key` order. `required` blocks release where the matter's list is non-empty and the entry carries no value; `proposed` says the narrative call answers this attribute in the one call it already makes. On a row the connector owns or has bound (`source: connector`, or a `binding`), `label` and `proposed` are the firm's and the rest is the connector's, as are the row's sets. `position` is the server's on every row.","security":[{"bearer":[]}],"responses":{"200":{"description":"In position then key order.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"required":{"type":"boolean","default":false},"proposed":{"type":"boolean","default":true},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"binding":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","minLength":1},"field":{"type":"string","minLength":1}},"default":null,"required":["kind","field"]},"default_set_ids":{"type":"array","items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"default":[]},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0}},"required":["key","label"]}}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/attributes/{key}":{"put":{"tags":["vocabulary"],"summary":"Create or replace one attribute (admin)","description":"The body's `key` must be the path's. `default_set_ids` must name sets this firm already holds AND holds under this attribute (422 otherwise, naming the set and both attributes): a default set of another attribute renders nothing on every matter that inherits it. The `position` is the server's and a body's is accepted and ignored: a new key goes one past the firm's last, and a key the firm holds keeps its place. On a row the connector owns or has bound, `label` and `proposed` are the firm's and the rest, `position` aside, is the connector's: a body that differs from the stored row in any other field is a 409 naming the fields, because the connector declared them and its options and sets are written by the sync. On any other row a body that says `source: connector`, or carries a `binding` the row does not already have, is a 409: both are set by connecting a practice system, never by a write.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":true,"name":"key","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"required":{"type":"boolean","default":false},"proposed":{"type":"boolean","default":true},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"binding":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","minLength":1},"field":{"type":"string","minLength":1}},"default":null,"required":["kind","field"]},"default_set_ids":{"type":"array","items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"default":[]},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0}},"required":["key","label"]}}}},"responses":{"200":{"description":"The attribute as stored.","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"required":{"type":"boolean","default":false},"proposed":{"type":"boolean","default":true},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"binding":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","minLength":1},"field":{"type":"string","minLength":1}},"default":null,"required":["kind","field"]},"default_set_ids":{"type":"array","items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"default":[]},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0}},"required":["key","label"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["vocabulary"],"summary":"Delete an attribute no entry carries (admin)","description":"204 while no entry carries the key, with the attribute's sets. 409 for a row a connector owns or has bound, and 409 once an entry carries the key: an attribute an entry carries is DEACTIVATED and never deleted, so a released line keeps meaning what it said. A matter that still names one of the deleted sets keeps naming it, and an id that names nothing is ignored when the entry's options are worked out.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":true,"name":"key","in":"path"}],"responses":{"204":{"description":"Deleted, with its sets."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/attribute-sets":{"get":{"tags":["vocabulary"],"summary":"Every option set the firm holds, or one attribute's (any role)","description":"`?attribute=` narrows it to one attribute's sets. A matter names the sets that apply to it and never owns options of its own, which is what keeps one list in one place however many matters read it. Where the firm's practice system shows each person their own matters, a set of the system's that only matters the caller is not shown name is left out.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":false,"name":"attribute","in":"query"}],"responses":{"200":{"description":"In attribute then id order.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"attribute_key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"name":{"type":"string","minLength":1},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"external_ref":{"type":"string","nullable":true,"default":null},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string","minLength":1},"description":{"type":"string","default":""},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"min_narrative_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null}},"required":["value","label"]}},"active":{"type":"boolean","default":true},"updated_at":{"type":"string","format":"date-time"}},"required":["id","attribute_key","name","options","updated_at"]}}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/attributes/{key}/sets/{id}":{"put":{"tags":["vocabulary"],"summary":"Create or replace one option set, whole (admin)","description":"The body's `id` and `attribute_key` must be the path's. A set is a LIST, so the body carries every option and an unchanged body leaves `updated_at` where it was. An attribute this firm does not hold is a 404; a connector-owned set, or an attribute the connector owns or has bound, is a 409, and so is a body that says `source: connector`; two options with one value is a 400. Leaving out an option an entry carries is a 409 `urn:six-minute:problem:option-in-use` naming the values: send it with `active: false`, which retires it.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":true,"name":"key","in":"path"},{"schema":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"attribute_key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"name":{"type":"string","minLength":1},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"external_ref":{"type":"string","nullable":true,"default":null},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string","minLength":1},"description":{"type":"string","default":""},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"min_narrative_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null}},"required":["value","label"]}},"active":{"type":"boolean","default":true}},"required":["id","attribute_key","name","options"]}}}},"responses":{"200":{"description":"The set as stored.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"attribute_key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"name":{"type":"string","minLength":1},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"external_ref":{"type":"string","nullable":true,"default":null},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string","minLength":1},"description":{"type":"string","default":""},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"min_narrative_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null}},"required":["value","label"]}},"active":{"type":"boolean","default":true},"updated_at":{"type":"string","format":"date-time"}},"required":["id","attribute_key","name","options","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["vocabulary"],"summary":"Delete an option set none of whose values an entry carries (admin)","description":"204 while no entry carries one of its values, 409 once one does, naming the count. A set whose values are in use is DEACTIVATED and never deleted: it is the only record of what those values meant.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":true,"name":"key","in":"path"},{"schema":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/entries":{"get":{"tags":["entries"],"summary":"The caller's own entries by day, period or cursor, whatever their role","description":"The caller's entries, drafts included, whatever their role (D-68). No role reads another member's entries (O13): there is no firm view, and a `scope` or `timekeeper` an older caller still sends is not read, so the answer is the caller's own list. Ordered by `(updated_at, id)`; `since` continues from a `next_cursor`. Each row carries its `delivery` where the firm has a connector and the ledger holds one for that entry (D-163).","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"day","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"since","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":2000,"default":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A page of entries, and where to continue.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time_zone":{"type":"string","minLength":1},"timekeeper_id":{"type":"string","minLength":1},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"narrative":{"type":"string"},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"internal_note":{"type":"string","nullable":true,"default":null},"status":{"type":"string","enum":["draft","released"],"default":"draft"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"released_at":{"type":"string","nullable":true,"format":"date-time","default":null},"edited_at":{"type":"string","nullable":true,"format":"date-time","default":null},"override_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":86400},"device_id":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"}},"required":["id","day","time_zone","timekeeper_id","t_start","t_end","narrative","created_at","updated_at"]},"delivery":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"state":{"type":"string","enum":["released","accepted","rejected","edited"]},"reason":{"type":"string","nullable":true,"enum":["deleted_in_pms","written_off","draft_discarded","edited_in_pms"],"default":null},"pms_status":{"type":"string","nullable":true,"default":null},"external_id":{"type":"string","minLength":1},"state_changed_at":{"type":"string","format":"date-time"},"pms_copy":{"type":"object","nullable":true,"properties":{"external_id":{"type":"string","minLength":1},"present":{"type":"boolean"},"accepted":{"type":"boolean","default":false},"billed":{"type":"boolean","default":false},"written_off":{"type":"boolean","default":false},"discarded":{"type":"boolean","default":false},"minutes":{"type":"integer","nullable":true,"minimum":0,"default":null},"day":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null},"matter_external_ref":{"type":"string","nullable":true,"default":null},"narrative":{"type":"string","nullable":true,"default":null},"modified_at":{"type":"string","nullable":true,"format":"date-time","default":null},"raw_status":{"type":"string","nullable":true,"default":null}},"default":null,"required":["external_id","present"]}},"required":["kind","state","external_id","state_changed_at"],"additionalProperties":false}},"required":["entry"]}},"next_cursor":{"type":"string","nullable":true,"minLength":1}},"required":["rows","next_cursor"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["entries"],"summary":"A device posts its entries and the intervals they cover, idempotent on the entry id","description":"Carries the device header (X-Six-Minute-Device); the body's `device_id` must be that device. Each entry is answered with one outcome: `applied` (written), `unchanged` (the row was already exactly this, so a replayed batch is not an error) or `refused` with a sentence saying what to fix. The cloud refuses an entry whose `edited_at` is set, because it is the person's from their first edit and the engine may not replace it (Row E); an accounting field moved on a released row; a row under another member's name; a matter that is not this firm's; and a hand-made entry (no `as_judged`) whose narrative is longer than the firm's length, `narrative.max_chars` or else 240, which an engine-written draft is not held to here (D-230). A body carrying a local-only field of an entry (`summary`, `idle_ratio`, `observation_ids`, `assignment`, `assignment_ref`, `assigned_at`, `recording_id`) is a 422 for the whole batch: those never leave the device (D-85). Each item carries the intervals its entry covers (D-215): each lies inside the entry's block, with every observation made during it, tagged by source and with no cap (a `screen` item is `{source, t_start, t_end, app, bundle, title, host}`, `bundle` being the application's identity, a Mac bundle id or a Windows app id or executable name, `\"\"` when unknown), and the text the judgment read, both sealed under the tenant key; the text is not stored under the `confidential` tier. The intervals are written with an applied item only: a refused or unchanged item writes none, and the replacement of an engine-owned draft replaces the intervals inside its block. An item whose intervals would overlap a stored interval of the author is refused. A new row's edges are checked on the grid at that point (D-219): a stored interval's edge, the item's own included, or a line of the day's unit (the firm's when the day opened, or now for a day not opened yet), never inside a stored interval; the stored intervals of the posting device and the earlier ids X-Six-Minute-Device-Known names, as the page snaps a hand-made entry (O12). An entry carries no billing field, no price and no durations: its hours are its block (D-218).","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device_id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"entries":{"type":"array","items":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time_zone":{"type":"string","minLength":1},"timekeeper_id":{"type":"string","minLength":1},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"narrative":{"type":"string"},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"internal_note":{"type":"string","nullable":true,"default":null},"status":{"type":"string","enum":["draft","released"],"default":"draft"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"released_at":{"type":"string","nullable":true,"format":"date-time","default":null},"edited_at":{"type":"string","nullable":true,"format":"date-time","default":null},"override_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":86400},"as_judged":{"type":"object","nullable":true,"properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time_zone":{"type":"string","minLength":1},"timekeeper_id":{"type":"string","minLength":1},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"narrative":{"type":"string"},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"internal_note":{"type":"string","nullable":true,"default":null},"activity_type":{"type":"string","nullable":true,"pattern":"^[A-Za-z0-9_-]{1,40}$"},"judged_at":{"type":"string","format":"date-time"}},"default":null,"required":["day","time_zone","timekeeper_id","t_start","t_end","narrative","judged_at"]}},"required":["id","day","time_zone","timekeeper_id","t_start","t_end","narrative","created_at","updated_at"]},"intervals":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"evidence":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"app":{"type":"string","minLength":1,"maxLength":120},"bundle":{"type":"string","maxLength":255,"default":""},"title":{"type":"string","maxLength":300},"host":{"type":"string","nullable":true},"source":{"type":"string","enum":["screen"]},"microphone":{"type":"boolean"},"camera":{"type":"boolean"}},"required":["t_start","t_end","app","title","host","source"]}]}},"text":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true,"minLength":1,"maxLength":240,"default":null},"activity":{"type":"object","nullable":true,"properties":{"key":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","nullable":true,"minLength":1,"maxLength":60}},"default":null,"required":["key","label"]},"stripped":{"type":"boolean"}},"required":["t_start","t_end","evidence","text"]},"default":[]},"how":{"type":"string","enum":["drag","form"]}},"required":["entry"]},"minItems":1,"maxItems":500}},"required":["device_id","entries"]}}}},"responses":{"200":{"description":"One outcome per entry of the batch, in no promised order.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"outcome":{"type":"string","enum":["applied","unchanged","refused"]},"reason":{"type":"string","minLength":1}},"required":["id","outcome"]}}},"required":["results"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/entries/{id}":{"get":{"tags":["entries"],"summary":"One entry by id, with the same reach the list has","description":"The author's own row, draft or released, whatever their role; no role reads another member's entry (O13). Anything else is a blank 404, as on every other per-entry route: the difference between an entry this firm does not have and one this caller may not see is a difference these routes do not draw. It answers the row and the row only, `attributes` included: an entry owns no evidence, and the intervals it covers are read with its day (`GET /v1/days/{day}`). The daemon reads this before it proposes the words of a split or a merge, for the matter, the time zone and the block.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The entry as stored.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time_zone":{"type":"string","minLength":1},"timekeeper_id":{"type":"string","minLength":1},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"narrative":{"type":"string"},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"internal_note":{"type":"string","nullable":true,"default":null},"status":{"type":"string","enum":["draft","released"],"default":"draft"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"released_at":{"type":"string","nullable":true,"format":"date-time","default":null},"edited_at":{"type":"string","nullable":true,"format":"date-time","default":null},"override_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":86400},"device_id":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"}},"required":["id","day","time_zone","timekeeper_id","t_start","t_end","narrative","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"patch":{"tags":["entries"],"summary":"Edit fields of an own draft; a released entry refuses every field","description":"The first change by a person sets `edited_at`, and from that moment the engine may not replace the row. Every refusal carries a `code` and, per field, its `rule` and `params` (`entry.*`, `duration.*`, `narrative.*`, `matter.*`). **Nothing is edited after release** (D-164): every field a patch would move on a released entry is a 409 `entry.released`, each on its own path; a draft being released, or one the practice system may hold a line for, is a 409 `entry.releasing`; a deleted draft a 409 `entry.deleted`; an entry that is not the caller's a 404 `entry.not_found`. A local-only field is a 422 (D-85). A `narrative` over the limit (the firm's length, else 240, never above the practice system's ceiling or 1,023, measured trimmed) is a 422 `narrative.too_long` at `narrative`. `matter_id` may be null; a matter the caller may not name is a 422 `matter.missing`. `reason` is accepted and not stored. **The time** is `parts`, the whole new set of spans, or `t_start` and `t_end`, the one-span case, which on a draft of two spans or more is a 409 `entry.changed` on `t_start`. On a draft each span is a 422 `urn:six-minute:problem:block` whose `detail` is one sentence, on `parts.N.t_start` or `parts.N.t_end` (`t_start` or `t_end` for the one-span case): \"An entry starts and ends on the day's interval lines.\" (`entry.off_grid`: each edge the patch moves is a stored cell's edge or a line of the day's unit, never inside a stored cell; D-219; the stored intervals are those of the device the entry was generated on (its `device_id`), or, for a hand-made entry and one generated on the asking device, those of the device X-Six-Minute-Device names and the earlier ids X-Six-Minute-Device-Known names; with no device of the caller's named, every device's for a hand-made entry), \"An entry ends after it starts.\" (`entry.empty`) or \"An entry stays inside its day.\" (`entry.crosses_day`). A span over another live entry of the person is a 409 with the same urn and \"This time overlaps another entry.\" (`entry.overlap`). A time edit writes the row only (D-216). **A change to the spans clears `override_seconds`**; `override_seconds` alone sets the hours a person typed (whole units of the day's unit, at most a day, else a 422 `duration.*`) or clears them.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"narrative":{"type":"string"},"internal_note":{"type":"string","nullable":true},"attributes":{"type":"object","additionalProperties":{"type":"string","nullable":true,"minLength":1}},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"override_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":86400},"reason":{"type":"string","nullable":true,"minLength":1,"default":null}}}}}},"responses":{"200":{"description":"The entry after the patch.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time_zone":{"type":"string","minLength":1},"timekeeper_id":{"type":"string","minLength":1},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"narrative":{"type":"string"},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"internal_note":{"type":"string","nullable":true,"default":null},"status":{"type":"string","enum":["draft","released"],"default":"draft"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"released_at":{"type":"string","nullable":true,"format":"date-time","default":null},"edited_at":{"type":"string","nullable":true,"format":"date-time","default":null},"override_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":86400},"device_id":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"}},"required":["id","day","time_zone","timekeeper_id","t_start","t_end","narrative","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["entries"],"summary":"Delete an own DRAFT; a released entry is never deleted","description":"Only the entry's author may delete it, and only while it is a draft: a released entry belongs to the firm and is a 409 (D-56), and so is a draft whose release is with the practice system at that moment, or for which the practice system holds or may hold a line from a release that did not finish (409 on `connector.pending`: releasing the entry settles it). An entry this caller does not own, or cannot see, is a 404 whether or not it exists. Idempotent: a draft this caller already deleted answers 204 again, so a request retried after a lost answer is not an error. From the delete the entry is in no read: not the list, not `GET /v1/entries/{id}`, not its day, and PATCH, release, split and merge answer 404 for it. The delete writes the row only: the intervals under it stay, and a new entry over the same time shows them again (D-216). A device that posts the deleted id again, or a new id whose block lies wholly inside the deleted one, is answered `unchanged` and nothing is written.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"The draft is deleted, now or by an earlier request of the same author."},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/entries/{id}/release":{"post":{"tags":["entries"],"summary":"Hand an own entry to the firm: the blockers as a 422, else released and the judged text under it cleared","description":"Every blocker at once in `errors` (empty narrative, closed or missing matter, a required attribute missing or a value outside the matter's list). Already released is a no-op answering the same entry and the delivery it already has. There is no inverse (D-61). From release the entry is FROZEN: nothing is edited after release (D-164). In the same transaction the judged text of the intervals it covers is cleared (for an entry the pipeline drafted by a person matter learning is on for, held for its learning and deleted within the hour); their evidence stays, and no batch writes those intervals again, so the evidence behind a released line is the evidence that was behind it when the person released it. The practice system receives the entry's minutes, its `override_seconds` where one is set and else the sum of its parts, and applies any rounding of its own (D-218). The judged text cleared is under the entry's parts only: an interval in a gap between two of them keeps its text.\n\n**Where the firm has a practice system, the entry is released only once the system has taken it**. A connector in any status but `connected` is the blocker `connector.not_connected`; a connected one adds its own blockers, each under a path of its own: `connector.matter` (a matter the system does not hold), `connector.timekeeper` (no employee, or an inactive one, bound to the author), `connector.narrative` (longer than the system's declared ceiling, both numbers in the message) and `connector.matter_blocked`; a required field the system declares is the attribute's own blocker. Then the entry is pushed inside this request, a connection failure retried quietly (three attempts within twenty seconds), and the release and its `delivery` (`released`, with the system's id) are committed only when the system has answered with its own id. A refused login at that connect marks the connector `needs_reconnect` and answers the 422 `connector.not_connected`; the system's own refusal is a 422 on one of `connector.matter_not_found`, `connector.matter_closed`, `connector.person_not_found`, `connector.person_inactive`, `connector.not_accepted` and `connector.reviewer` (the reviewer the firm chose was refused: its setting needs changing); a system that could not be reached is a 503 `practice-system-unreachable`. Each leaves the entry a draft. Where the practice system is one each member signs in to with their own account, the push goes out on the AUTHOR's own session: a member who has not signed in, whose session the system stopped accepting, or whose session is refused during the push is answered the 422 `connector.sign_in` (sign in under Settings, Practice system, and release again), which marks that member's session alone and never the firm's connector, so colleagues keep releasing; a member whose account there books no time is answered `connector.timekeeper`; and a matter the system does not show the member is answered as a matter that is not there, on `matter_id`. An entry edited while it was being released is a 409 `entry.changed`, still a draft, and a second release of an entry whose first is still with the practice system a 409: one push is in flight per entry. The push is idempotent on the entry id, so a release retried after a lost answer books nothing twice. Every blocker carries its `rule` and `params` (`narrative.*`, `matter.*`, `attribute.*`, `release.*`); a deleted draft is a 409 `entry.deleted`, and an entry that is not the caller's a 404 `entry.not_found`.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The released entry, and its delivery where the firm has a connector.","content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time_zone":{"type":"string","minLength":1},"timekeeper_id":{"type":"string","minLength":1},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"narrative":{"type":"string"},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"internal_note":{"type":"string","nullable":true,"default":null},"status":{"type":"string","enum":["draft","released"],"default":"draft"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"released_at":{"type":"string","nullable":true,"format":"date-time","default":null},"edited_at":{"type":"string","nullable":true,"format":"date-time","default":null},"override_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":86400},"device_id":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"}},"required":["id","day","time_zone","timekeeper_id","t_start","t_end","narrative","created_at","updated_at"]},"delivery":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"state":{"type":"string","enum":["released","accepted","rejected","edited"]},"reason":{"type":"string","nullable":true,"enum":["deleted_in_pms","written_off","draft_discarded","edited_in_pms"],"default":null},"pms_status":{"type":"string","nullable":true,"default":null},"external_id":{"type":"string","minLength":1},"state_changed_at":{"type":"string","format":"date-time"},"pms_copy":{"type":"object","nullable":true,"properties":{"external_id":{"type":"string","minLength":1},"present":{"type":"boolean"},"accepted":{"type":"boolean","default":false},"billed":{"type":"boolean","default":false},"written_off":{"type":"boolean","default":false},"discarded":{"type":"boolean","default":false},"minutes":{"type":"integer","nullable":true,"minimum":0,"default":null},"day":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null},"matter_external_ref":{"type":"string","nullable":true,"default":null},"narrative":{"type":"string","nullable":true,"default":null},"modified_at":{"type":"string","nullable":true,"format":"date-time","default":null},"raw_status":{"type":"string","nullable":true,"default":null}},"default":null,"required":["external_id","present"]}},"required":["kind","state","external_id","state_changed_at"],"additionalProperties":false}},"required":["entry"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/entries/{id}/split":{"post":{"tags":["entries"],"summary":"End an own draft at a line of one of its parts, or move some of its parts, and start a second entry","description":"The body carries exactly one of `at` and `leaving`, else a 400. `at` lies strictly inside one of the entry's parts and on the grid at that point (D-219): a stored interval's edge of the author's day, or a line of the day's unit (the firm's when the day opened, or now for a day not opened yet) where none is stored, and never inside a stored interval (the stored intervals are those of the device the entry was generated on (its `device_id`), or, for a hand-made entry and one generated on the asking device, those of the device X-Six-Minute-Device names and the earlier ids X-Six-Minute-Device-Known names; with no device of the caller's named, every device's for a hand-made entry); anything else is a 422 on `at` naming the lines that exist. The first half KEEPS THE ID and holds the parts before `at` and the cut part up to it; the second is a new `entry_` id holding the rest from `at`. `leaving` names parts of the entry, each exactly as it holds them, that become the second entry (a split at a gap, or one part detached from anywhere in the set); it is a strict, non-empty subset of the parts, else a 422 on `leaving`, and the rest keep the id. The second half has the same matter, day, zone, author, narrative, attributes, note and judged copy. Each half's `t_start` and `t_end` are its first start and last end, its recorded time is the sum of its parts, and neither keeps an `override_seconds`. The split writes the rows only: the intervals stay where they are, and each half covers the ones whose start lies in one of its parts (D-216). `first` and `second` are the narratives and attribute maps the person approved on the review before this call: both or neither, and each map REPLACES the half's attributes rather than merging into them; a half's optional `matter_id` moves that half as a PATCH does, and `null` moves it to no matter. Without them the parent's narrative and attributes are copied onto both halves, which is what a firm on the `confidential` tier gets, because it stores no judged text to propose from. A half's narrative longer than the firm's length (`narrative.max_chars`, else 240) is a 422 at `first.narrative` or `second.narrative`, and nothing is written (D-230). Both halves are stamped `edited_at`: a split is a person's edit, so the engine never replaces either of them again (Row E). It is the complement of the cut and not a correction to it; D-85's Split, which moves hours to another matter, is a different gesture and stays. A draft whose release is with the practice system, or for which the practice system holds or may hold a line from a release that did not finish, is a 409 (the latter on `connector.pending`: releasing the entry settles it).","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"leaving":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"first":{"type":"object","properties":{"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"narrative":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1}}},"required":["narrative","attributes"]},"second":{"type":"object","properties":{"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"narrative":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1}}},"required":["narrative","attributes"]}}}}}},"responses":{"200":{"description":"The two halves.","content":{"application/json":{"schema":{"type":"object","properties":{"first":{"type":"object","properties":{"id":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time_zone":{"type":"string","minLength":1},"timekeeper_id":{"type":"string","minLength":1},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"narrative":{"type":"string"},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"internal_note":{"type":"string","nullable":true,"default":null},"status":{"type":"string","enum":["draft","released"],"default":"draft"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"released_at":{"type":"string","nullable":true,"format":"date-time","default":null},"edited_at":{"type":"string","nullable":true,"format":"date-time","default":null},"override_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":86400},"device_id":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"}},"required":["id","day","time_zone","timekeeper_id","t_start","t_end","narrative","created_at","updated_at"]},"second":{"type":"object","properties":{"id":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time_zone":{"type":"string","minLength":1},"timekeeper_id":{"type":"string","minLength":1},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"narrative":{"type":"string"},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"internal_note":{"type":"string","nullable":true,"default":null},"status":{"type":"string","enum":["draft","released"],"default":"draft"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"released_at":{"type":"string","nullable":true,"format":"date-time","default":null},"edited_at":{"type":"string","nullable":true,"format":"date-time","default":null},"override_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":86400},"device_id":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"}},"required":["id","day","time_zone","timekeeper_id","t_start","t_end","narrative","created_at","updated_at"]}},"required":["first","second"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/entries/{id}/merge":{"post":{"tags":["entries"],"summary":"Join an own draft with other own drafts of its day, into this one","description":"The inverse of the split. The other rows are named in exactly one of two fields: `with` is one row, and `with_all` is one or more rows, as many as the day holds (D-282 without its fifty-row cap). Both fields, neither, or an id twice in `with_all` is a 400, and this row's own id among them is a 422. Every row is the caller's own draft on this row's day, cut in its time zone, else a 422 (`day`); they need not touch and their order is not a rule. The joined row's `parts` are the union of the rows' parts, parts that touch joined, and its `t_start` and `t_end` their first start and last end: the time between two rows stays in no entry. Their matters are not a rule, and any drafts of one day merge (D-214), whatever grid each was cut on (D-219). The joined row starts on the first row's matter, a matter or none; an optional matter_id moves it, and null moves it to no matter, as a PATCH does. A `billable` in the body is dropped by the parse. A released row is a 409 and a row the caller cannot see is a 404. THIS ROW KEEPS ITS ID; its recorded time is the sum of its parts, and no `override_seconds` survives the merge. `narrative` and `attributes` are the words the person confirmed on the review before this call, and the attributes replace the map rather than merging into it; a narrative longer than the firm's length (`narrative.max_chars`, else 240) is a 422 at `narrative` (D-230). The merge writes the rows only: the intervals of every row stay where they are and the joined parts cover them (D-216). The other rows are DELETED in the same transaction, and the survivor is stamped `edited_at`, so the engine never replaces it again. A row whose release is with the practice system, or for which the practice system holds or may hold a line from a release that did not finish, is not merged: 409 (the latter on `connector.pending`). One row that may not be merged refuses the whole merge, and nothing is written. An error about a row that follows is on the path of the field that named it, `with` or `with_all`.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"with":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"with_all":{"type":"array","items":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"minItems":1},"narrative":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1}}},"required":["narrative","attributes"]}}}},"responses":{"200":{"description":"The joined row, which is this row.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time_zone":{"type":"string","minLength":1},"timekeeper_id":{"type":"string","minLength":1},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"narrative":{"type":"string"},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"internal_note":{"type":"string","nullable":true,"default":null},"status":{"type":"string","enum":["draft","released"],"default":"draft"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"released_at":{"type":"string","nullable":true,"format":"date-time","default":null},"edited_at":{"type":"string","nullable":true,"format":"date-time","default":null},"override_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":86400},"device_id":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"}},"required":["id","day","time_zone","timekeeper_id","t_start","t_end","narrative","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/days/{day}":{"get":{"tags":["entries"],"summary":"The caller's day on the asking device: the entries and the intervals they cover, in one read","description":"The caller's own day, whatever their role: nobody reads another person's day. Device-bound: without the device header, until the page floor moves, the caller's most recently active device, and no activity with none; 403 for a device not theirs. The day's entries in time order, from every device and source, each with its `delivery` where the firm has a connector, and the asking device's intervals of the local day in time order, with those of the earlier ids the same machine held that `X-Six-Minute-Device-Known` names (comma-separated; an id that is not one of the caller's devices is ignored), each on its device's local day, with its evidence, its summary and its `activity` block and never its judged text: the activity column, where another device's intervals never appear. An entry's evidence is the activity it was generated from: `entry_intervals` holds, for each live entry of the day generated on another of the caller's devices (the entry's `device_id`, not the asking device nor an earlier id it names), that device's intervals under the entry (an interval whose start lies in one of its parts), in time order and in the same shape, and nothing else; they are never activity. An entry generated on the asking device, and a hand-made entry (`device_id` null), read `intervals`. Never another person's. A slot of an entry with no interval reads \"Not captured\" (D-217). `unit_seconds` is the day's unit (the firm's when the day opened, or now for a day not opened yet), the grid of every stretch where no interval is stored (D-219). `zone`, `t_start` and `t_end` are the caller's day row, `provisional` where the day is not opened yet (the bounds opening it now would store). Each entry carries `editable` (false once released or while its release is in flight), `blockers` (what stands between it and a released entry, as rule codes) and `options` per attribute key. `calendar` is present only with a calendar connected: the events that overlap the day's bounds, with the caller's marks. Each interval carries `judge_order` where its matter call read a ranked list: the matter ids, best first. `recent_matters` is the matters of the caller's own released entries worked in the last 90 days, at most 20, the most recently released first.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"day","in":"path"}],"responses":{"200":{"description":"The day's entries and intervals.","content":{"application/json":{"schema":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"unit_seconds":{"type":"integer","minimum":0,"exclusiveMinimum":true},"zone":{"type":"string"},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"provisional":{"type":"boolean"},"entries":{"type":"array","items":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string","pattern":"^entry_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time_zone":{"type":"string","minLength":1},"timekeeper_id":{"type":"string","minLength":1},"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"parts":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"}},"required":["t_start","t_end"]},"minItems":1},"narrative":{"type":"string"},"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$","default":null},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"internal_note":{"type":"string","nullable":true,"default":null},"status":{"type":"string","enum":["draft","released"],"default":"draft"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"released_at":{"type":"string","nullable":true,"format":"date-time","default":null},"edited_at":{"type":"string","nullable":true,"format":"date-time","default":null},"override_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":86400},"device_id":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"}},"required":["id","day","time_zone","timekeeper_id","t_start","t_end","narrative","created_at","updated_at"]},"delivery":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"state":{"type":"string","enum":["released","accepted","rejected","edited"]},"reason":{"type":"string","nullable":true,"enum":["deleted_in_pms","written_off","draft_discarded","edited_in_pms"],"default":null},"pms_status":{"type":"string","nullable":true,"default":null},"external_id":{"type":"string","minLength":1},"state_changed_at":{"type":"string","format":"date-time"},"pms_copy":{"type":"object","nullable":true,"properties":{"external_id":{"type":"string","minLength":1},"present":{"type":"boolean"},"accepted":{"type":"boolean","default":false},"billed":{"type":"boolean","default":false},"written_off":{"type":"boolean","default":false},"discarded":{"type":"boolean","default":false},"minutes":{"type":"integer","nullable":true,"minimum":0,"default":null},"day":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null},"matter_external_ref":{"type":"string","nullable":true,"default":null},"narrative":{"type":"string","nullable":true,"default":null},"modified_at":{"type":"string","nullable":true,"format":"date-time","default":null},"raw_status":{"type":"string","nullable":true,"default":null}},"default":null,"required":["external_id","present"]}},"required":["kind","state","external_id","state_changed_at"],"additionalProperties":false},"editable":{"type":"boolean"},"blockers":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","rule"]}},"options":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string","minLength":1},"description":{"type":"string","default":""},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"min_narrative_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null}},"required":["value","label"]}}}},"required":["entry"]}},"intervals":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"evidence":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"app":{"type":"string","minLength":1,"maxLength":120},"bundle":{"type":"string","maxLength":255,"default":""},"title":{"type":"string","maxLength":300},"host":{"type":"string","nullable":true},"source":{"type":"string","enum":["screen"]},"microphone":{"type":"boolean"},"camera":{"type":"boolean"}},"required":["t_start","t_end","app","title","host","source"]}]}},"summary":{"type":"string","nullable":true},"activity":{"type":"object","nullable":true,"properties":{"key":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","nullable":true,"minLength":1,"maxLength":60}},"default":null,"required":["key","label"]},"judge_order":{"type":"array","items":{"type":"string"}}},"required":["t_start","t_end","evidence","summary"]}},"entry_intervals":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"evidence":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"app":{"type":"string","minLength":1,"maxLength":120},"bundle":{"type":"string","maxLength":255,"default":""},"title":{"type":"string","maxLength":300},"host":{"type":"string","nullable":true},"source":{"type":"string","enum":["screen"]},"microphone":{"type":"boolean"},"camera":{"type":"boolean"}},"required":["t_start","t_end","app","title","host","source"]}]}},"summary":{"type":"string","nullable":true},"activity":{"type":"object","nullable":true,"properties":{"key":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","nullable":true,"minLength":1,"maxLength":60}},"default":null,"required":["key","label"]},"judge_order":{"type":"array","items":{"type":"string"}}},"required":["t_start","t_end","evidence","summary"]},"default":[]},"calendar":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"type":"string"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"all_day":{"type":"boolean"},"status":{"type":"string","enum":["confirmed","cancelled"]},"my_response":{"type":"string","enum":["organiser","accepted","tentative","declined","none"]},"where":{"type":"object","properties":{"kind":{"type":"string","enum":["call","address","none"]},"text":{"type":"string","nullable":true}},"required":["kind","text"]},"guests":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true},"response":{"type":"string","enum":["organiser","accepted","tentative","declined","none"]},"organiser":{"type":"boolean"},"me":{"type":"boolean"}},"required":["name","email","response","organiser","me"]}},"provider":{"type":"string","enum":["microsoft","google"]},"web_link":{"type":"string","nullable":true},"not_attended":{"type":"boolean"},"can_mark":{"type":"boolean"}},"required":["id","title","from","to","all_day","status","my_response","where","guests","provider","web_link","not_attended","can_mark"]}}},"required":["events"]},"recent_matters":{"type":"array","items":{"type":"string"}}},"required":["day","unit_seconds","entries","intervals"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/intervals":{"put":{"tags":["entries"],"summary":"Gone: a device no longer writes its intervals; the cloud decides each from its context","description":"Answers 410 `gone`: since the generate-reliability plan an interval is decided once, in the cloud, from the context its device uploaded, and no device writes one. Kept so its removal is not an API break; the follow-up removes it.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device_id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"intervals":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"evidence":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"app":{"type":"string","minLength":1,"maxLength":120},"bundle":{"type":"string","maxLength":255,"default":""},"title":{"type":"string","maxLength":300},"host":{"type":"string","nullable":true},"source":{"type":"string","enum":["screen"]},"microphone":{"type":"boolean"},"camera":{"type":"boolean"}},"required":["t_start","t_end","app","title","host","source"]}]}},"text":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true,"minLength":1,"maxLength":240,"default":null},"activity":{"type":"object","nullable":true,"properties":{"key":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","nullable":true,"minLength":1,"maxLength":60}},"default":null,"required":["key","label"]},"stripped":{"type":"boolean"}},"required":["t_start","t_end","evidence","text"]},"minItems":1,"maxItems":500},"time_zone":{"type":"string","nullable":true,"minLength":1,"default":null}},"required":["device_id","intervals"]}}}},"responses":{"200":{"description":"Never answered since the writer is gone.","content":{"application/json":{"schema":{"type":"object","properties":{"stored":{"type":"integer","minimum":0}},"required":["stored"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"410":{"description":"The route is gone and changes nothing; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/intervals/text":{"get":{"tags":["entries"],"summary":"The judged text of the caller's own intervals in a range, for the words a split or a merge proposes","description":"Device-bound, and from R1 a desktop older than R1 only: a call naming R1 or later in `X-Six-Minute-Version`, or none, a call carrying `Origin`, or one from a device whose credential a daemon has used or that was exchanged is 403. Deleted at phase 7. The text the judgment read for each of the caller's intervals starting in `[from, to)` that a live draft of theirs covers, in time order; an interval with no text is left out. THE AUTHOR AND NOBODY ELSE: the range is always the caller's own. A released entry of the caller covering any of the range is a 409: its text was cleared at release, and nothing is split or merged after it. `activity_type` is always null: activity types are gone, and the field stays only for desktops from before the stream-only release, which require it (COMPAT(#180)). With `uncovered=true` the draft condition is dropped: the text of every one of the caller's own intervals starting in the range, covered or not, which is what the device reads back for intervals whose local text it no longer keeps (the 31-day rule) and to propose an entry over any range of intervals. Only then, each item also carries `summary` (the interval's stored plain summary, or null) and `windows` (the interval's screen evidence), and the answer carries `entries`: one item per part of each of the caller's own live entries, not deleted, that overlaps the range, the part's span and the entry's `matter_id` (null on no matter), in time order. A draft covers an interval, and a released entry makes the range a 409, only where one of its parts holds the time: the gap between two parts is no entry's.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"uncovered","in":"query"}],"responses":{"200":{"description":"The judged text, by interval start.","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"text":{"type":"string"},"summary":{"type":"string","nullable":true},"t_end":{"type":"string","format":"date-time"},"windows":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"app":{"type":"string","minLength":1,"maxLength":120},"bundle":{"type":"string","maxLength":255,"default":""},"title":{"type":"string","maxLength":300},"host":{"type":"string","nullable":true},"source":{"type":"string","enum":["screen"]},"microphone":{"type":"boolean"},"camera":{"type":"boolean"}},"required":["t_start","t_end","app","title","host","source"]}}},"required":["t_start","text"]}},"activity_type":{"type":"string","nullable":true,"pattern":"^[A-Za-z0-9_-]{1,40}$"},"entries":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"matter_id":{"type":"string","nullable":true}},"required":["t_start","t_end","matter_id"]}}},"required":["text","activity_type"]}}}},"204":{"description":"Never answered: the confidential tier is gone (D-249); the follow-up removes it with the route."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/intervals/{from}/context":{"post":{"tags":["pipeline"],"summary":"The daemon uploads one cell's context, gzip, in order","description":"A device route: the device credential; any request carrying `Origin` is refused. The body is the context JSON (`schema_version` 2, or 1 from a three-process desktop, and its `header`), gzip with `Content-Encoding: gzip` or plain, at most 2 MB compressed and 8 MB decompressed (413). `from` in the path must equal the header's (422). It is stored by the credential's device and its `from`: 202 stores it sealed under the tenant key and answers the run; 200 is a repeat of the same body; 409 `context-conflict` is another body for the same cell, or a cell cut on another unit than the device's day's first; 410 `context-expired` is past the firm's retention; an interval starting more than an hour after the service's clock is 425 `context-early`, which the daemon keeps and sends again later. A three-process desktop's `seq` and Stop are ignored: a gap in `seq` is no error. No route answers a context's text.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"from","in":"path"}],"responses":{"200":{"description":"A repeat of a stored context; nothing changed.","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"recording_id":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"}},"required":["accepted"]}}}},"202":{"description":"Stored; the run that decides it.","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"recording_id":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"}},"required":["accepted"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"410":{"description":"The route is gone and changes nothing; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"413":{"description":"The body is larger than this route takes.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"415":{"description":"The body's content type is not one this route takes.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"425":{"description":"Too early: send the same request again later.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/device/signals":{"post":{"tags":["pipeline"],"summary":"The daemon uploads one signals note, in order with the contexts","description":"A device route, as the context upload. The anchor signals Tier 0 changed for observations a context already carried (`ContextSignals`, version 2), placed among the device's contexts at `t_at`. Its identity is the device and `note_seq`: 202 stores it sealed under the tenant key; 200 is a repeat of the same body; 409 `context-conflict` is another body for the same `note_seq`; 410 `context-expired` is past the firm's retention; a note sent more than an hour after the service's clock is 425 `context-early`.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"number","enum":[2]},"note_seq":{"type":"integer","minimum":0,"exclusiveMinimum":true},"t_at":{"type":"string","nullable":true,"format":"date-time"},"sent_at":{"type":"string","format":"date-time"},"observations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^obs_[a-z0-9][a-z0-9_.:-]*$"},"signals":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"string"}},"urls":{"type":"array","items":{"type":"string"}},"paths":{"type":"array","items":{"type":"string"}}},"required":["emails","urls","paths"]}},"required":["id","signals"]},"minItems":1}},"required":["schema_version","note_seq","t_at","sent_at","observations"]}}}},"responses":{"200":{"description":"A repeat of a stored note; nothing changed.","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"recording_id":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"}},"required":["accepted"]}}}},"202":{"description":"Stored.","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"recording_id":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"}},"required":["accepted"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"410":{"description":"The route is gone and changes nothing; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"425":{"description":"Too early: send the same request again later.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/device/clock":{"post":{"tags":["pipeline"],"summary":"The daemon's heartbeat: the device is alive","description":"A device route, as the context upload. The device's clock and nothing else. The credential's call stamps the device's last call; the cloud replays no clock step and decides nothing from it.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device_clock":{"type":"string","format":"date-time"}},"required":["device_clock"]}}}},"responses":{"204":{"description":"Taken."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/recordings/{id}/signals":{"post":{"tags":["pipeline"],"summary":"A three-process desktop uploads one signals note","description":"A device route, as the context upload, for a three-process desktop until the follow-up removes it. The note (version 1) is stored by the credential's device, placed at the end of the context of its recording it follows. 202 stores it; 200 is a repeat; 409 `context-conflict` is another body for the same recording and `note_seq`; 410 `context-expired` is past the firm's retention; `recording_id` in the body must equal the path's (422).","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"recording_id":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"},"note_seq":{"type":"integer","minimum":0,"exclusiveMinimum":true},"after_seq":{"type":"integer","minimum":0},"sent_at":{"type":"string","format":"date-time"},"observations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^obs_[a-z0-9][a-z0-9_.:-]*$"},"signals":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"string"}},"urls":{"type":"array","items":{"type":"string"}},"paths":{"type":"array","items":{"type":"string"}}},"required":["emails","urls","paths"]}},"required":["id","signals"]},"minItems":1}},"required":["schema_version","recording_id","note_seq","after_seq","sent_at","observations"]}}}},"responses":{"200":{"description":"A repeat of a stored note; nothing changed.","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"recording_id":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"}},"required":["accepted"]}}}},"202":{"description":"Stored.","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"recording_id":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"}},"required":["accepted"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"410":{"description":"The route is gone and changes nothing; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"425":{"description":"Too early: send the same request again later.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/recordings/{id}/stop":{"post":{"tags":["pipeline"],"summary":"A three-process desktop's Stop that no context carried","description":"A three-process desktop's route, kept until the follow-up removes it: answered 204 and otherwise ignored. There is no recording in the cloud; capture is a state of the device, and the cloud replays no clock step.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"after_seq":{"type":"integer","minimum":0},"at":{"type":"string","format":"date-time"},"reason":{"type":"string","enum":["person","quit","update","sign-out","roll"]}},"required":["after_seq","at","reason"]}}}},"responses":{"204":{"description":"Taken; nothing changes."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/recordings/{id}/skip":{"post":{"tags":["pipeline"],"summary":"A three-process desktop passes over a seq or a note it dropped","description":"A three-process desktop's route, kept until the follow-up removes it: answered 204 and otherwise ignored. There is no recording in the cloud; capture is a state of the device, and the cloud replays no clock step.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"seq":{"type":"integer","minimum":0,"exclusiveMinimum":true},"note_seq":{"type":"integer","minimum":0,"exclusiveMinimum":true}}}}}},"responses":{"204":{"description":"Taken; nothing changes."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/recordings/{id}/clock":{"post":{"tags":["pipeline"],"summary":"A three-process desktop's clock heartbeat","description":"A three-process desktop's route, kept until the follow-up removes it: answered 204 and otherwise ignored. There is no recording in the cloud; capture is a state of the device, and the cloud replays no clock step.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device_clock":{"type":"string","format":"date-time"},"last_witness_at":{"type":"string","nullable":true,"format":"date-time"},"silence_end_after":{"type":"string","nullable":true,"format":"date-time"},"seq":{"type":"integer","minimum":0},"note_seq":{"type":"integer","minimum":0}},"required":["device_clock","last_witness_at","silence_end_after"]}}}},"responses":{"204":{"description":"Taken; nothing changes."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/pipeline/status":{"get":{"tags":["pipeline"],"summary":"Where the cloud pipeline stands for the caller on the asking device; 304 while `since` is still the version","description":"The caller's own, on the device the device header names (without it, until the page floor moves, the caller's most recently active device, and no device's time with none; 403 for a device not theirs). `version` moves at every decision and every Generate commit; with `since` equal to it the answer is 304 and no body. `recordings` and `deciding` describe the asking device's capture: how far it is decided and what is being decided, to the clock while the device captures (the version then moves at every cell, and when it stops). `generate.pending` is what the asking device's press would generate, with the day's meetings waiting, which belong to no device. `generate.running` is the person's running Generate on any device, with its `device` and `through` (the end of the last entry it wrote); `step` and `entries` are kept with a neutral value. Never text. `mode=shadow` answers 410: the shadow is deleted.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{1,18}$"},"required":false,"name":"since","in":"query"},{"schema":{"type":"string","enum":["live","shadow"]},"required":false,"name":"mode","in":"query"}],"responses":{"200":{"description":"The status.","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0},"recordings":{"type":"array","items":{"type":"object","properties":{"recording_id":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"},"device_id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"decided_through":{"type":"string","nullable":true,"format":"date-time"},"behind_seconds":{"type":"integer","minimum":0},"stopped_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["recording_id","device_id","decided_through","behind_seconds","stopped_at"]}},"deciding":{"type":"object","nullable":true,"properties":{"recording_id":{"type":"string","pattern":"^rec_[a-z0-9][a-z0-9_.:-]*$"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["recording_id","from","to"]},"generate":{"type":"object","properties":{"running":{"type":"object","nullable":true,"properties":{"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"kind":{"type":"string","enum":["generate","regenerate","propose"]},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"device":{"type":"string","nullable":true,"pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"through":{"type":"string","nullable":true,"format":"date-time"},"step":{"type":"object","properties":{"name":{"type":"string"},"at":{"type":"string","format":"date-time"},"entry_from":{"type":"string","format":"date-time"}},"required":["name","at"]},"entries":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"cut":{"type":"boolean"},"written":{"type":"boolean"}},"required":["from","to","cut","written"]}}},"required":["run_id","kind","day","device","through","step"]},"pending":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["day","from","to"]}},"failed":{"type":"object","nullable":true,"properties":{"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"error_class":{"type":"string"}},"required":["run_id","day","error_class"]},"last":{"type":"object","properties":{"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"entries":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"cut":{"type":"boolean"},"written":{"type":"boolean"}},"required":["from","to","cut","written"]}}},"required":["run_id","entries"]}},"required":["running","pending","failed"]}},"required":["version","recordings","deciding","generate"]}}}},"304":{"description":"Unchanged since `since`."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"410":{"description":"The route is gone and changes nothing; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/pipeline/shadow/days/{day}":{"get":{"tags":["pipeline"],"summary":"Gone: the cloud pipeline's shadow is deleted","description":"Answers 410 `gone`: the shadow is deleted (the generate-reliability plan, W6). Kept so its removal is not an API break; the follow-up removes it.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"day","in":"path"}],"responses":{"200":{"description":"Never answered since the shadow is deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"intervals":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"matter_id":{"type":"string","nullable":true},"away":{"type":"boolean"},"activity_key":{"type":"string","nullable":true},"activity_label":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true}},"required":["t_start","t_end","matter_id","away","activity_key","activity_label","summary"]}},"entries":{"type":"array","items":{"type":"object","properties":{"t_start":{"type":"string","format":"date-time"},"t_end":{"type":"string","format":"date-time"},"matter_id":{"type":"string","nullable":true},"narrative":{"type":"string"}},"required":["t_start","t_end","matter_id","narrative"]}}},"required":["day","intervals","entries"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"410":{"description":"The route is gone and changes nothing; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/days/{day}/generate":{"post":{"tags":["pipeline"],"summary":"Generate a day's entries on the device the request names","description":"Starts a Generate of that local day on the device `X-Six-Minute-Device` names (403 for a device that is not the caller's; without the header, until the follow-up, the caller's most recently active device, 400 with none), from that device's activity and the meetings, which belong to no device, over the day's start to the press (D-311; the generate-reliability plan, T2 and A2). It writes only over free time: what a live entry already holds is clipped, never refused. 202 names the run; 200 `started: false` when nothing waits (K8); 409 `generate-running` while a Generate of that day on that device runs. A press on another device while one runs is queued behind it. Two presses of one window are one run; a press after a delete is a run of its own.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"day","in":"path"},{"schema":{"type":"string","enum":["1"]},"required":false,"name":"shadow","in":"query"}],"responses":{"200":{"description":"Nothing pending: nothing started.","content":{"application/json":{"schema":{"type":"object","properties":{"started":{"type":"boolean","enum":[false]}},"required":["started"]}}}},"202":{"description":"Started: the run.","content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"}},"required":["run_id"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/days/{day}/regenerate":{"post":{"tags":["pipeline"],"summary":"Retired: regenerating is deleting the drafts and pressing Generate again","description":"Answers 410 `gone` since the generate-reliability plan (O4): delete the drafts of the window (`DELETE /v1/entries/{id}`) and press Generate (`POST /v1/days/{day}/generate`), which writes new drafts over the freed time. Removed by the follow-up.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"day","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["from","to"]}}}},"responses":{"202":{"description":"Never answered since O4.","content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"}},"required":["run_id"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"410":{"description":"The route is gone and changes nothing; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/entries/propose":{"post":{"tags":["pipeline"],"summary":"Propose what an entry over a range of intervals would say, in the cloud","description":"The hand-made entry's ranges, as the daemon's `POST /entries/propose` takes them. Decided in the request: 202 answers the proposal and names the run it was decided as, which `GET /v1/pipeline/runs/{id}` answers too. It first waits, at most 30 s, for the cloud's own interval runs of what the device already uploaded over the ranges, as a Generate does. Over the caller's daily cap, or on a failure, the answer is `offline` with no proposal. Writes nothing but the answer. The internal firm's alone until firms outside it join (403 otherwise). It reads the activity of the device `X-Six-Minute-Device` names (without it, until the follow-up, the caller's most recently active device), and the words where each interval is an entry's evidence: under an entry generated on any of the caller's devices, that device's; under a hand-made entry or free time, the asking device's and the earlier ids `X-Six-Minute-Device-Known` names. An entry's evidence is the activity it was generated from (O12).","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"matter_id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"parts":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["from","to"]},"minItems":1}},"required":["from","to"]},"minItems":1,"maxItems":2},"for":{"type":"string","enum":["compose","split","merge"]}},"required":["ranges"]}}}},"responses":{"202":{"description":"The proposal, and its run.","content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"result":{"type":"object","properties":{"proposals":{"type":"array","items":{"type":"object","nullable":true,"properties":{"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"how":{"type":"string","enum":["chosen","most","tie","none"]},"narrative":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1}}},"required":["matter_id","how","narrative","attributes"]},"maxItems":2},"kept":{"type":"string","nullable":true,"enum":["no_text","not_signed_in","refused","offline"]}},"required":["proposals","kept"]}},"required":["run_id","result"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/pipeline/runs/{id}":{"get":{"tags":["pipeline"],"summary":"Where one of the caller's runs stands, and a proposal's answer once done","description":"The author's own runs only (404 otherwise). `result` is a done proposal's answer; never context text.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^run_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The run.","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["pending","held","done","failed"]},"error_class":{"type":"string"},"result":{"type":"object","properties":{"proposals":{"type":"array","items":{"type":"object","nullable":true,"properties":{"matter_id":{"type":"string","nullable":true,"pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"how":{"type":"string","enum":["chosen","most","tie","none"]},"narrative":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string","minLength":1}}},"required":["matter_id","how","narrative","attributes"]},"maxItems":2},"kept":{"type":"string","nullable":true,"enum":["no_text","not_signed_in","refused","offline"]}},"required":["proposals","kept"]}},"required":["state"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/llm/completions":{"post":{"tags":["llm"],"summary":"Forward one completion to the model provider under the server-held key","description":"Carries the device header. The answer is priced and the call's counts are added to the member's meter for the UTC day; over the daily cap the answer is 429 with `Retry-After` in seconds until midnight UTC. Nothing of the call is kept but its counts. With `upstream: jev` the call goes to Jev: a request over Jev's context limit is a 400 of type `urn:six-minute:problem:jev-capacity`, and a Jev failure a 502 of type `urn:six-minute:problem:provider`. With `upstream: decisions` the call is one closed question to OpenAI's Decisions API: the request carries `decision` (the property the answer fills and the choices, each with its description) and names its `model`, and a request without either is a 400. The answer is `{ [property]: choice }` under `output`, with the probabilities and the confidence under `decision`. A request the Decisions API refuses for what it holds, and an answer outside the choices, is a 502 of type `urn:six-minute:problem:provider-answer`, which the caller answers by asking the same question on the `openai` upstream; with the upstream switched off by the operator the answer is the 503 of type `urn:six-minute:problem:provider-unconfigured`. `sampling: pinned` on an `openai` call asks for the least sampling randomness the model serves (reasoning effort `none` and temperature 0 on the fixed-temperature models). A provider that fails is a 502 of type `urn:six-minute:problem:provider`; one that answers with nothing the request can use (a refusal, an answer cut at the output cap, no content, not JSON) is a 502 of type `urn:six-minute:problem:provider-answer`, which asking again will not change. A purpose only the cloud pipeline asks under (the calendar's: `judge_calendar_event`, `judge_calendar_matter`, `judge_calendar_attendance`; matter learning's: `learn_terms`) is a 422 and meters nothing.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","enum":["judge_label","judge_activity","judge_attribute","judge_narrative","judge_write","judge_window","segment","merge","merge_prose","assign","judge","judge_shortlist","judge_calendar_event","judge_calendar_matter","judge_calendar_attendance","learn_terms"]},"upstream":{"type":"string","enum":["openai","jev","decisions"]},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user"]},"content":{"type":"string"}},"required":["role","content"]},"minItems":1},"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","schema"]},"model":{"type":"string","minLength":1},"max_output_tokens":{"type":"integer","minimum":0,"exclusiveMinimum":true},"decision":{"type":"object","properties":{"property":{"type":"string","minLength":1},"choices":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1},"description":{"type":"string"}},"required":["value","description"]},"maxItems":1000}},"required":["property","choices"]},"sampling":{"type":"string","enum":["pinned"]}},"required":["purpose","messages","schema"]}}}},"responses":{"200":{"description":"The model's answer, parsed, with the usage the meter recorded.","content":{"application/json":{"schema":{"type":"object","properties":{"output":{"nullable":true},"text":{"type":"string"},"model":{"type":"string","minLength":1},"jev":{"type":"object","properties":{"model":{"type":"string"},"answers":{"type":"object","additionalProperties":{"type":"object","properties":{"type":{"type":"string","enum":["choice"]},"choice":{"type":"string"},"confidence":{"type":"number","minimum":0,"maximum":1},"probabilities":{"type":"object","additionalProperties":{"type":"number","minimum":0,"maximum":1}}},"required":["type","choice","confidence","probabilities"]}},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0}},"required":["input_tokens","output_tokens"]}},"required":["model","answers","usage"]},"decision":{"type":"object","properties":{"probabilities":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["value","probability"]}},"confidence":{"type":"number","nullable":true,"minimum":0,"maximum":1}},"required":["probabilities","confidence"]},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer","minimum":0},"completion_tokens":{"type":"integer","minimum":0},"cached_prompt_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0},"cost_usd":{"type":"number","minimum":0},"priced":{"type":"boolean"}},"required":["prompt_tokens","completion_tokens","cached_prompt_tokens","total_tokens","cost_usd","priced"]}},"required":["text","model","usage"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/telemetry":{"post":{"tags":["telemetry"],"summary":"Add a batch of counts, and the device's relayed events, for the signing device","description":"Carries the device header with a person's session, or the daemon's own device credential (a device route); `device_id` in the body must be that device. Counts add to the day's row and are deltas since the last accepted post. `events` are what the daemon and the client say happened: each carries a name from a closed list and a time, optionally a `session_id` (a UUIDv7) and `properties`, a closed set of keys per name; the raw archive's two carry a closed `reason`. An event whose name this service does not know, a property its name does not have and a value outside its enum are dropped, never refused: the rest of the batch is accepted. A batch empty of both counts and events is a 400.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"device_id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"counts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_.]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"count":{"type":"integer","minimum":0}},"required":["name","day","count"]},"maxItems":1000,"default":[]},"events":{"type":"array","items":{"type":"object","properties":{"name":{"nullable":true},"at":{"nullable":true},"reason":{"nullable":true},"session_id":{"nullable":true},"properties":{"nullable":true}}},"maxItems":500,"default":[]}},"required":["device_id"]}}}},"responses":{"202":{"description":"Accepted; the counters and the events were emitted."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/connector":{"put":{"tags":["connectors"],"summary":"Connect the firm's practice system, step 1: the credentials (billing, admin)","description":"The credentials are VERIFIED before anything is stored: the adapter connects and probes, and a failure is a 422 whose one error's path names the step that failed (`step.tls`, `step.login`, `step.schema`, `step.rights`) so an administrator is sent to the one screen in their own system where the answer is. On success the row is sealed under the firm's key, a NEW connector is stored as `pending_mapping`, the system's employees are written to the team table, and the answer carries the team proposal, matched to the firm's members by exact email and by nothing else (D-166). The adapter's declared pick-list fields are bound in the same step: one attribute per field, `source: connector`, keyed `<kind>_<field>` or by the standard it names, created or rebound to the row a former connection of the same system left behind, and a firm-wide field's one set with it (D-174). A connector of ANOTHER kind is a 409 naming Disconnect; the same kind again re-verifies, re-seals, keeps the team and its bindings and keeps a firm that was `connected` or `needs_reconnect` connected, because a firm that has already confirmed its team is not sent through that step again by a reconnection. The deliveries a former connection left keep the kind they were sent to, as history. For a kind each member signs in to with their own account (`capabilities.identity` is `sign_in`) the caller must be an ADMINISTRATOR (403 for billing) and the credentials are their OWN account (a username and password, or an `api_token` they made in the system): the firm's row seals which installation it is and no session, the connector is `connected` at once, the administrator's own session is stored as `PUT /v1/connector/account` stores a member's, and `team` is null. It answers as soon as the system accepted the sign-in and runs NO sync: the summary's counts are what the firm held before, and the client sends `POST /v1/connector/sync` itself, straight after, reading `GET /v1/connector/sync/progress` while it runs. The same installation again is that administrator signing in again; another installation while connected is a 409 naming Disconnect. An account of the system that another member already signed in with is a 409. An operator is refused such a connect with a 422: it takes a person's own password. A credential whose host resolves to a loopback, private, link-local or unspecified address is a 422 on the path `host`, before anything is dialled. The system's narrative ceiling is not copied into the firm's settings: the limit in force is the firm's own length under the ceiling, computed on every read.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["urios"]},"host":{"type":"string","minLength":1},"port":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":3306},"database":{"type":"string","minLength":1},"user":{"type":"string","minLength":1},"password":{"type":"string","minLength":1}},"required":["kind","host","database","user","password"]},{"type":"object","properties":{"kind":{"type":"string","enum":["legalsense"]},"host":{"type":"string","minLength":1,"pattern":"^[a-z0-9]([a-z0-9-]*[a-z0-9])?\\.legalsense\\.nl$"},"username":{"type":"string","minLength":1},"password":{"type":"string","minLength":1},"totp":{"type":"string","pattern":"^[0-9]{6}$"},"api_token":{"type":"string","minLength":1}},"required":["kind","host"]},{"type":"object","properties":{"kind":{"type":"string","enum":["fake"]},"seed":{"type":"string"}},"required":["kind"]}]}}}},"responses":{"200":{"description":"The connector, and the team table to confirm.","content":{"application/json":{"schema":{"type":"object","properties":{"connector":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false},"team":{"type":"object","nullable":true,"properties":{"rows":{"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"email":{"type":"string","nullable":true,"default":null},"code":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"member_id":{"type":"string","nullable":true,"pattern":"^member_[a-z0-9][a-z0-9_.:-]*$","default":null},"bound_by":{"type":"string","nullable":true,"enum":["email","admin","sign_in"],"default":null},"bound_at":{"type":"string","nullable":true,"format":"date-time","default":null},"note":{"type":"string","nullable":true,"default":null},"member_name":{"type":"string","nullable":true,"default":null},"member_email":{"type":"string","nullable":true,"default":null}},"required":["external_ref","name"]}},"unmatched_members":{"type":"array","items":{"type":"object","properties":{"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","default":""},"email":{"type":"string"}},"required":["member_id","email"]}}},"required":["rows","unmatched_members"]}},"required":["connector","team"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"get":{"tags":["connectors"],"summary":"The firm's connector: its kind, status, settings and counts (billing, admin)","description":"404 while the firm has none, which is what a settings page draws as Not connected. The page says what the firm is connected to from it.","security":[{"bearer":[]}],"responses":{"200":{"description":"The connector. Never a credential.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["connectors"],"summary":"Disconnect the practice system (billing, admin)","description":"The row goes and the team goes with it. The DELIVERIES stay, because they are the history of what a practice system took and disconnecting does not undo that, and so do the matters and the clients the sync wrote. The attributes the connector made are unbound and made inactive with their sets untouched, and the ones no entry ever carried are deleted with their sets and taken off every matter that named them; a standard's row the firm made is unbound and left as it was; a reconnect of the same system rebinds the ones that stayed. Connecting another system starts at step 1 again. Where the system keeps a session for the stored credential, it is ended there first, best effort: a system that cannot be reached does not stop the disconnect. For a system each member signs in to, every member's sealed session and their set of visible matters go with the row and NOTHING is sent to the practice system: the sessions there are the members' own. A firm connected to a system this service carries no adapter for answers the not-available 422.","security":[{"bearer":[]}],"responses":{"204":{"description":"Disconnected. The team is gone with it; the deliveries and the carried attributes are not."},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/connector/account":{"put":{"tags":["connectors"],"summary":"Sign in to the firm's practice system with your own account (any role)","description":"For a firm whose practice system each member signs in to (`tenant.connector.identity` is `sign_in` on `GET /v1/me`): the caller's own username and password there, and the six-digit code on the second press of an account that has two-factor on; or, in their place, `api_token`, a token the caller made in the system, which is how a person who signs in there with Microsoft connects. A token the system refuses is `step.login` with `reason` `token`. Which system and which installation are the firm's, read from its own row: a posted `host` or `kind` is a 400. The sign-in is VERIFIED before anything is stored, and a failure is the connect route's 422, one error whose path names the step (`step.login`, `step.tls`, `step.rights`); `step.login` with `reason` `code` asks for the code where none was sent and refuses the one that was. On success the session the system handed back is sealed under the firm's key as the caller's own (never the password or the code), the caller is bound to that account of the system, and the answer is their link as `GET /v1/me` then carries it in `member.system_link`. It answers as soon as the system accepted the sign-in and runs NO sync: the link's `synced` is false until the caller's first read has finished, which the client starts itself, straight after, with `POST /v1/connector/account/sync`. An account another member of the firm already signed in with is a 409 and writes nothing: the first sign-in holds it. While the FIRM's own link is not `connected` the answer is a 409 of the type `urn:six-minute:problem:connector-not-connected`, before anything is dialled: nothing the caller typed is wrong, and an administrator connects the firm first. An account that books no time there is accepted; its releases are refused as `connector.timekeeper`. Signing in again replaces the session. 404 while the firm has no connector, or one the firm connected once. A firm that is connected is one every member can sign in at.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","minLength":1},"password":{"type":"string","minLength":1},"totp":{"type":"string","pattern":"^[0-9]{6}$"},"api_token":{"type":"string","minLength":1}},"additionalProperties":false}}}},"responses":{"200":{"description":"The caller's own link to the practice system.","content":{"application/json":{"schema":{"type":"object","properties":{"system":{"type":"string","enum":["urios","legalsense","fake"]},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1},"status":{"type":"string","enum":["connected","needs_reconnect"]},"synced":{"type":"boolean"},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"approval":{"type":"string","enum":["review","auto"]}},"required":["system","name","code"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["connectors"],"summary":"Sign out of the firm's practice system (any role)","description":"Deletes the caller's own sealed session and their binding to the account they signed in with. The firm stays connected and every colleague stays signed in. NOTHING is sent to the practice system: the session there is the person's own and is left as it is. Until they sign in again the caller's releases answer `connector.sign_in`, and they are served none of that system's matters, their clients or their per-matter sets: the set of matters they were shown is deleted with the session, and their next sign-in reads it again whole. Their drafts keep the matter they name. Answers 204 whether or not there was a session. 404 while the firm has no connector, or one the firm connected once.","security":[{"bearer":[]}],"responses":{"204":{"description":"Signed out here. The firm's connector and every other member's session are untouched."},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/connector/team":{"put":{"tags":["connectors"],"summary":"Connect step 2, and the settings table afterwards: bind the system's employees to members","description":"One line per employee, a member or nobody. A member bound to two employees is a 409: one employee of the practice system is one person here. A connector waiting on its team (`pending_mapping`) becomes `connected`; any other status, and its `last_error`, is left as it is. Where the firm's first read is done (the sync a client sends after the connect ran it while the connector waited on this step) the read made here is by change and quick; where it never ran it is made here, whole; and a read that is running already is not waited for, the summary being answered with what is in so far. The sync runs inline and the summary is the answer. The same route edits the table afterwards, where a new employee the sync found appears unbound. 404 for a kind whose identity is a per-user sign-in: nobody is shown a table there, and each person's own authorisation fills their row (D-166). A firm connected to a system this service carries no adapter for answers the not-available 422.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1},"member_id":{"type":"string","nullable":true,"pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}},"required":["external_ref","member_id"]}}}}},"responses":{"200":{"description":"The connector after the confirmation and the first sync.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"get":{"tags":["connectors"],"summary":"The employee table: the system's people beside the members they are bound to","description":"Unbound employees first, because they are the rows an administrator has something to do about. `unmatched_members` is the firm's own members nobody is bound to, so it is visible who is missing. For a system each member signs in to it is the same table, read-only: the people who have signed in, each bound to the member who did (`bound_by` is `sign_in`), and `unmatched_members` is the members who have not signed in yet. Its write stays a 404 there. A firm connected to a system this service carries no adapter for answers the not-available 422.","security":[{"bearer":[]}],"responses":{"200":{"description":"The table, and the members nobody matched.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"email":{"type":"string","nullable":true,"default":null},"code":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"member_id":{"type":"string","nullable":true,"pattern":"^member_[a-z0-9][a-z0-9_.:-]*$","default":null},"bound_by":{"type":"string","nullable":true,"enum":["email","admin","sign_in"],"default":null},"bound_at":{"type":"string","nullable":true,"format":"date-time","default":null},"note":{"type":"string","nullable":true,"default":null},"member_name":{"type":"string","nullable":true,"default":null},"member_email":{"type":"string","nullable":true,"default":null}},"required":["external_ref","name"]}},"unmatched_members":{"type":"array","items":{"type":"object","properties":{"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","default":""},"email":{"type":"string"}},"required":["member_id","email"]}}},"required":["rows","unmatched_members"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/connector/settings":{"put":{"tags":["connectors"],"summary":"Choose the connector's settings: who reviews a released entry (admin)","description":"Each key is the whole value. `reviewer` is who approves a released entry in a system that takes entries as drafts for approval: `null` or `{mode: \"timekeeper\"}` is each lawyer their own, and `{mode: \"person\", external_ref, name}` is one person of the firm's, who must be an ACTIVE employee on this connector's team (422 on `reviewer.external_ref` otherwise). The system may still refuse that person at the push, which answers `connector.reviewer`. A system that does not take entries as drafts for approval has no reviewer: any reviewer but `null` is a 422 on `reviewer` there, and so it is in a system where the person who released an entry is always its reviewer (`capabilities.reviewer` is `self`). A sync never changes the setting. 404 while the firm has no connector. A firm connected to a system this service carries no adapter for answers the not-available 422.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}]}},"required":["reviewer"]}}}},"responses":{"200":{"description":"The connector with the setting stored.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/connector/approval":{"put":{"tags":["connectors"],"summary":"Choose whether one member's released time waits for approval in the practice system or is written as approved time (admin)","description":"For a system that takes entries as drafts for approval (`capabilities.accepts_by` is `approval`). `mode: \"auto\"` is the default: the member's released time is written as approved time, on the member's own account, with no draft; where the system refuses that write the release fails and says why, as a refused draft does, and the entry stays a draft in Sixminute. `mode: \"review\"` leaves a draft there that waits until it is approved. One member per request, merged over the settings as they stand, so two administrators setting two people at once both land. The answer's `settings.auto_approve` lists the active members on Auto-approve. A sync never changes it. 422 on `mode` for `auto` in a system that does not accept by approval (`review` is always taken); 422 on `member_id` for somebody who is not an active member of this firm. 404 while the firm has no connector. A firm connected to a system this service carries no adapter for answers the not-available 422, as `PUT /v1/connector/settings` does.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"mode":{"type":"string","enum":["review","auto"]}},"required":["member_id","mode"]}}}},"responses":{"200":{"description":"The connector with the setting stored.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/connector/sync":{"post":{"tags":["connectors"],"summary":"Sync now: the presser's own matters and the firm's lists in, the deliveries' states back (billing, admin)","description":"Sync now, as the person who pressed it means it, run inside this request and answered when it ends. For a practice system each member signs in to (`tenant.connector.identity` is `sign_in` on `GET /v1/me`) it is the CALLER'S OWN sync: their complete list of matters compared with the system, what changed in them, and the firm's shared lists when those are due; it never reads as a colleague and never waits on one, and a caller who is not signed in to the system syncs nothing. For a system the firm connected once it is the firm's sync, compared whole. It is also the request a client sends straight after `PUT /v1/connector` answered, since a connect syncs nothing itself: a connector that still waits on its team step (`pending_mapping`) is read exactly as a connected one, so the firm's first read runs here, with progress, before anybody pressed Done, and its status stays `pending_mapping`. While it runs, `GET /v1/connector/sync/progress` says how far it is. Where a sync of the same subject is already running (the scheduled run has the firm, or the caller), this request WAITS for it, up to a minute, and then makes its own, so the answer is a sync that happened; one it cannot outwait is answered with an `error` saying a sync is still running and zero counts, never as a sync in which nothing changed, and the progress route goes on saying `running`. It pushes nothing: an entry is released only once the practice system has taken it, inside the release. A failure is reported in the answer's `error` and on the connector row rather than as a status code: the run happened, and what it could not do is what the report is for. `deliveries` is answered with zero counts: what the practice system did with released entries is measured, never shown to the firm (R-8). A firm connected to a system this service carries no adapter for answers the not-available 422. On the operator's mount it is the firm's whole run: every signed-in member, as the scheduler runs it.","security":[{"bearer":[]}],"responses":{"200":{"description":"What the sync did.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"started_at":{"type":"string","format":"date-time"},"finished_at":{"type":"string","format":"date-time"},"clients":{"type":"object","properties":{"created":{"type":"integer","minimum":0},"updated":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0}},"required":["created","updated","unchanged"]},"matters":{"type":"object","properties":{"created":{"type":"integer","minimum":0},"updated":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0}},"required":["created","updated","unchanged"]},"timekeepers":{"type":"object","properties":{"created":{"type":"integer","minimum":0},"updated":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0}},"required":["created","updated","unchanged"]},"options":{"type":"object","properties":{"created":{"type":"integer","minimum":0},"updated":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0},"refused":{"type":"integer","minimum":0,"default":0}},"required":["created","updated","unchanged"]},"deliveries":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0},"rejected":{"type":"integer","minimum":0},"edited":{"type":"integer","minimum":0}},"required":["accepted","rejected","edited"]},"cursors":{"type":"object","additionalProperties":{"type":"string"},"default":{}},"error":{"type":"string","nullable":true,"default":null}},"required":["kind","started_at","finished_at","clients","matters","timekeepers","options","deliveries"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/connector/account/sync":{"post":{"tags":["connectors"],"summary":"Sync your own matters from the firm's practice system (any role)","description":"For a firm whose practice system each member signs in to: the caller's own sync, run inside this request. Their complete list of matters is compared with the system (a matter that left their sight is withdrawn, a new one opened), what changed is brought up to date, and the firm's shared lists are read when they are due. A matter's details are read once per firm: where a colleague's sync already holds them, only the ids are read. It is the request a client sends straight after `PUT /v1/connector/account` answered, and need not wait for: `GET /v1/connector/sync/progress` says how far it is, and a client that goes away leaves the read to the next scheduled run, which takes a member no read was tried for first. The answer is the caller's progress as it stands when the request ends. Where a read as the caller is already running, nothing is started and the answer is that read's progress. 404 while the firm has no connector, one the firm connected once, or while the caller is not signed in to it.","security":[{"bearer":[]}],"responses":{"200":{"description":"The caller's own sync as it stands now.","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["idle","running"]},"first":{"type":"boolean"},"total":{"type":"integer","nullable":true,"minimum":0},"done":{"type":"integer","minimum":0},"started_at":{"type":"string","nullable":true,"format":"date-time"},"finished_at":{"type":"string","nullable":true,"format":"date-time"},"failed":{"type":"boolean"}},"required":["state","first","total","done","started_at","finished_at","failed"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/connector/sync/progress":{"get":{"tags":["connectors"],"summary":"Where the caller's sync stands (any role)","description":"The progress of the caller's own subject: for a practice system each member signs in to, the caller's own session (404 while they are not signed in); for a system the firm connected once, the firm's connector, whatever its status (a connector waiting on its team step is read and has progress as a connected one has). `state` is `running` while a sync of it is going on. `first` is true until the subject's matters are in for the first time (its first whole read has committed them; the read-back that follows has no say in it), which is what `member.system_link.synced` on `GET /v1/me` says too and what Release waits for. `total` is how many matters the read answers in all and is null until the system's first page has said so; `done` is how many of them are in. `failed` says the last run ended in an error and carries no text. Read from a route of its own because `GET /v1/connector` gains no key. 404 while the firm has no connector.","security":[{"bearer":[]}],"responses":{"200":{"description":"The sync's state and count.","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["idle","running"]},"first":{"type":"boolean"},"total":{"type":"integer","nullable":true,"minimum":0},"done":{"type":"integer","minimum":0},"started_at":{"type":"string","nullable":true,"format":"date-time"},"finished_at":{"type":"string","nullable":true,"format":"date-time"},"failed":{"type":"boolean"}},"required":["state","first","total","done","started_at","finished_at","failed"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/calendar":{"get":{"tags":["calendar"],"summary":"The caller's calendar account, or 204 with none","description":"One account per person (A4), the caller's own whatever their role. `admin_consent_url` is set only while `awaiting_admin`.","security":[{"bearer":[]}],"responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["microsoft","google"]},"account_kind":{"type":"string","enum":["work","personal"]},"account_email":{"type":"string"},"status":{"type":"string","enum":["connected","awaiting_admin","needs_reconnect"]},"admin_consent_url":{"type":"string","nullable":true},"last_synced_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["provider","account_kind","account_email","status","admin_consent_url","last_synced_at"]}}}},"204":{"description":"No calendar is connected."},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["calendar"],"summary":"Disconnect: the account goes, and the provider is asked to revoke where it allows","description":"Every stored event of the caller and their marks go with the account; entries already written stay (R12). Answers 204 whether or not a calendar was connected.","security":[{"bearer":[]}],"responses":{"204":{"description":"Disconnected."},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/calendar/connect":{"post":{"tags":["calendar"],"summary":"Start a connect: store the window's state, answer the provider's consent page","description":"The window made the state and the PKCE verifier and keeps them; this seals the state, the caller and the S256 challenge into `state_token`, good for ten minutes, which the window keeps and hands back with the finish, and answers the consent page with the hosted redirect page of this deploy's page as `redirect_uri`. The state is also stored for ten minutes, for a page that finishes without the token. 409 while the caller has a connected account.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["microsoft","google"]},"state":{"type":"string","minLength":16},"code_challenge":{"type":"string","minLength":16}},"required":["provider","state","code_challenge"]}}}},"responses":{"200":{"description":"The consent page.","content":{"application/json":{"schema":{"type":"object","properties":{"authorize_url":{"type":"string","format":"uri"},"state_token":{"type":"string","minLength":1}},"required":["authorize_url"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/calendar/connect/finish":{"post":{"tags":["calendar"],"summary":"Finish a connect with the provider's code and the window's verifier, or its error","description":"`state_token` must be the one the connect answered, unaltered, the caller's, for this state and unexpired; a finish without one is a connect an older release started, whose stored state must be the caller's, unexpired and unused, and is used by this call whatever follows. The code is exchanged with this service's client secret, the verifier and the same redirect uri. An `error` that says an administrator must approve the app first writes `awaiting_admin` with the approval link; any other `error` ends the connect (422). 409 when the caller's calendar is connected meanwhile (one account per person).","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","minLength":16},"state_token":{"type":"string","minLength":1,"maxLength":4096},"code":{"type":"string","minLength":1},"code_verifier":{"type":"string","minLength":43,"maxLength":128}},"required":["state","code","code_verifier"],"additionalProperties":false},{"type":"object","properties":{"state":{"type":"string","minLength":16},"state_token":{"type":"string","minLength":1,"maxLength":4096},"error":{"type":"string","minLength":1,"maxLength":200},"error_description":{"type":"string","maxLength":2000},"error_subcode":{"type":"string","maxLength":200}},"required":["state","error"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"The account.","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["microsoft","google"]},"account_kind":{"type":"string","enum":["work","personal"]},"account_email":{"type":"string"},"status":{"type":"string","enum":["connected","awaiting_admin","needs_reconnect"]},"admin_consent_url":{"type":"string","nullable":true},"last_synced_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["provider","account_kind","account_email","status","admin_consent_url","last_synced_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/calendar/events/{id}/not-attended":{"put":{"tags":["calendar"],"summary":"Mark one of the caller's events as not attended","description":"The caller's own events only, whatever their role (404 otherwise). Offered on an event judged an engagement, timed and not cancelled, while no entry covers its time; 409 otherwise, a clear as much as a set: after Generate the person edits the entry. Setting a set mark, or clearing none, changes nothing. A 204.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Done."},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["calendar"],"summary":"Clear the caller's \"Did not attend\" on one event","description":"The caller's own events only, whatever their role (404 otherwise). Offered on an event judged an engagement, timed and not cancelled, while no entry covers its time; 409 otherwise, a clear as much as a set: after Generate the person edits the entry. Setting a set mark, or clearing none, changes nothing. A 204.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Done."},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/phone/sync":{"post":{"tags":["phone"],"summary":"The phone sends the calls not yet taken, and its state","description":"A phone's device route. Every wake sends one, with or without calls. Each call is parsed by itself: one that does not parse is refused by its index with a closed reason, and the rest are taken. A call is stored once per person and record id; one sent again, or past the firm's retention, is answered as taken and not stored. The number is kept as given and sealed with the contact's name.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"calls":{"type":"array","items":{"nullable":true},"maxItems":500},"capture":{"type":"string","enum":["ok","not_default"]},"excluded_count":{"type":"integer","minimum":0},"push_token":{"type":"string","nullable":true,"minLength":1,"maxLength":400},"push_env":{"type":"string","enum":["production","sandbox"]},"background_refresh":{"type":"string","enum":["available","denied","restricted"]},"notifications":{"type":"string","enum":["allowed","denied","not_asked"]},"time_zone":{"type":"string","minLength":1,"maxLength":64},"region":{"type":"string","nullable":true,"pattern":"^[A-Z]{2}$"},"app_version":{"type":"string","minLength":1,"maxLength":64},"os_version":{"type":"string","minLength":1,"maxLength":64}},"required":["calls","capture","excluded_count","push_token","push_env","background_refresh","notifications","time_zone","region","app_version","os_version"]}}}},"responses":{"200":{"description":"What was taken and what was refused.","content":{"application/json":{"schema":{"type":"object","properties":{"taken":{"type":"array","items":{"type":"string"}},"refused":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"record_id":{"type":"string","nullable":true,"minLength":1,"maxLength":200},"reason":{"type":"string","enum":["malformed","too_long","bad_time"]}},"required":["index","record_id","reason"]}},"person":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"firm":{"type":"string"}},"required":["name","email","firm"]}},"required":["taken","refused","person"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/phone/calls/forget":{"post":{"tags":["phone"],"summary":"The phone removes calls it sent earlier","description":"A phone's device route. Deletes the person's calls with these record ids, whichever of their phones sent them, so a reinstalled phone can remove what its earlier install sent. Never another person's.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"record_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":500}},"required":["record_ids"]}}}},"responses":{"204":{"description":"Forgotten."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/phone":{"get":{"tags":["phone"],"summary":"The caller's phones, and whether the firm's desktops show them","description":"The person's own phones that hold a live credential (not revoked, not cleared, not idle past the credential's limit), each with its calls synced, last sync and state. `enabled` is the firm's `phone-calls` flag, false when the flag read fails: the desktop shows nothing about a phone while it is false.","security":[{"bearer":[]}],"responses":{"200":{"description":"The phones, oldest connection first.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"device_id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"},"connected_at":{"type":"string","format":"date-time"},"last_sync_at":{"type":"string","nullable":true,"format":"date-time"},"calls_synced":{"type":"integer","minimum":0},"state":{"type":"string","enum":["ok","not_default","no_wake","quiet"]},"excluded_count":{"type":"integer","minimum":0}},"required":["device_id","name","connected_at","last_sync_at","calls_synced","state","excluded_count"]}}},"required":["enabled","phones"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/audit":{"get":{"tags":["admin"],"summary":"The operator audit log, newest first (operators only)","description":"Every operator write leaves a row here before it runs: `started`, then `ok` or `failed` with the status it answered. `since` and `tenant` narrow it; reads are not logged.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","format":"date-time"},"required":false,"name":"since","in":"query"},{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":false,"name":"tenant","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"The rows, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^opact_[a-z0-9][a-z0-9_.:-]*$"},"operator_sub":{"type":"string"},"operator_email":{"type":"string","nullable":true},"action":{"type":"string"},"tenant_id":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"params":{"type":"object","additionalProperties":{"nullable":true}},"status":{"type":"string","enum":["started","ok","failed"]},"http_status":{"type":"integer","nullable":true},"created_at":{"type":"string"},"finished_at":{"type":"string","nullable":true}},"required":["id","operator_sub","operator_email","action","tenant_id","subject","params","status","http_status","created_at","finished_at"]}}},"required":["actions"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/firms":{"post":{"tags":["admin"],"summary":"Create a firm's organisation and invite its first admin (operators only)","description":"Two WorkOS calls, in this order: the organisation, then the invitation (role `admin` unless named). An invitation that fails after the organisation was made answers the failure with the organisation's id, and `POST /v1/admin/firms/{org}/invitations` finishes the job. Sends no email: the answer carries the sentence to send by hand and the download url.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"admin_email":{"type":"string","minLength":1},"role":{"type":"string","enum":["admin","billing","member"],"default":"admin"}},"required":["name","admin_email"]}}}},"responses":{"201":{"description":"The organisation and its first invitation.","content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","billing","member"]},"expires_at":{"type":"string"}},"required":["id","email","role","expires_at"]},"download_url":{"type":"string"},"message":{"type":"string"}},"required":["organization","invitation","download_url","message"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"get":{"tags":["admin"],"summary":"Every WorkOS organisation, newest first (operators only)","security":[{"bearer":[]}],"responses":{"200":{"description":"The organisations, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["organizations"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/firms/{org}/invitations":{"post":{"tags":["admin"],"summary":"Invite one more person to an existing firm (operators only)","description":"Reads the organisation for its name, then sends the invitation (role `member` unless named). Sends no email: the answer carries the sentence to send by hand and the download url.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"org","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":1},"role":{"type":"string","enum":["admin","billing","member"],"default":"member"}},"required":["email"]}}}},"responses":{"201":{"description":"The invitation.","content":{"application/json":{"schema":{"type":"object","properties":{"invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","billing","member"]},"expires_at":{"type":"string"}},"required":["id","email","role","expires_at"]},"download_url":{"type":"string"},"message":{"type":"string"}},"required":["invitation","download_url","message"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"get":{"tags":["admin"],"summary":"The pending invitations of one firm, oldest first (operators only)","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"org","in":"path"}],"responses":{"200":{"description":"The pending invitations.","content":{"application/json":{"schema":{"type":"object","properties":{"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"expires_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","email","role","expires_at","created_at"]}}},"required":["invitations"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/invitations/{id}":{"delete":{"tags":["admin"],"summary":"Revoke a pending invitation to any firm (operators only)","description":"Nobody can accept it afterwards.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"What was revoked.","content":{"application/json":{"schema":{"type":"object","properties":{"invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"]}},"required":["invitation"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/tier":{"put":{"tags":["admin"],"summary":"Set a firm's security tier; confidential purges its research cards (operators only)","description":"One statement changes `policy.security_tier` and nothing else, and commits. On `confidential` it then deletes the firm's stored research cards, irreversibly. `judged_text_purged` and `past_exports` are always null: no judged text is purged (D-249) and there is no research export. A purge that fails after the tier committed answers 500 `tier-purge-incomplete`; the same call again finishes it.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tier":{"type":"string","enum":["standard","confidential"]}},"required":["tier"]}}}},"responses":{"200":{"description":"The tier as it now stands, and on confidential what was purged.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"}},"required":["id","name"]},"security_tier":{"type":"string","enum":["standard","confidential"]},"cards_deleted":{"type":"integer","nullable":true},"judged_text_purged":{"type":"integer","nullable":true},"past_exports":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"operator":{"type":"string"},"from_at":{"type":"string"},"to_at":{"type":"string"},"created_at":{"type":"string"},"rows":{"type":"integer"}},"required":["id","tenant_id","operator","from_at","to_at","created_at","rows"]}},"past_exports_error":{"type":"string","nullable":true}},"required":["tenant","security_tier","cards_deleted","judged_text_purged","past_exports","past_exports_error"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"500":{"description":"HTTP 500","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/internal":{"put":{"tags":["admin"],"summary":"Mark a tenant as Unison's own, or not (operators only)","description":"Sets `tenants.internal`. Setting it false withdraws the raw archive flag in the same statement, so no firm is left holding it.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"internal":{"type":"boolean"}},"required":["internal"]}}}},"responses":{"200":{"description":"The mark and the raw archive flag as they now stand.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"},"internal":{"type":"boolean"},"raw_archive":{"type":"boolean"}},"required":["id","name","internal","raw_archive"]}},"required":["tenant"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/raw-archive":{"put":{"tags":["admin"],"summary":"Allow or revoke the raw capture archive for an internal tenant (operators only)","description":"Sets `policy.raw_archive`. Allowing reads the tenant's mark under a row lock and refuses a tenant not marked internal with 409 `tenant-not-internal`, writing nothing; the database refuses it again. Revoking is allowed on every tenant.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"allowed":{"type":"boolean"}},"required":["allowed"]}}}},"responses":{"200":{"description":"The mark and the raw archive flag as they now stand.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"},"internal":{"type":"boolean"},"raw_archive":{"type":"boolean"}},"required":["id","name","internal","raw_archive"]}},"required":["tenant"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/context-retention":{"put":{"tags":["admin"],"summary":"Set how many days a firm's interval contexts are kept (operators only)","description":"Sets `policy.context_retention_days` (1 to 365; zero retention is not built) and, in the same transaction, moves every stored expiry of the firm's device contexts and notes, decided cells' screen material, runs, steps, derivation cache and stored calendar by the difference in days, never recomputing it, so a shortening applies at once. Decisions and entries have no expiry and are not touched. Answers the counts moved, the old tables' included: they move too until the follow-up drops them.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"integer","minimum":1,"maximum":365}},"required":["days"]}}}},"responses":{"200":{"description":"The setting as it now stands, and the rows moved.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"}},"required":["id","name"]},"days":{"type":"integer"},"previous":{"type":"integer"},"shifted":{"type":"object","properties":{"interval_contexts":{"type":"integer"},"pipeline_runs":{"type":"integer"},"pipeline_steps":{"type":"integer"},"derivation_cache":{"type":"integer"},"pipeline_shadow":{"type":"integer","default":0},"pipeline_decisions":{"type":"integer","default":0},"intervals":{"type":"integer"},"device_contexts":{"type":"integer","default":0},"device_notes":{"type":"integer","default":0},"device_intervals":{"type":"integer","default":0},"calendar_events":{"type":"integer","default":0}},"required":["interval_contexts","pipeline_runs","pipeline_steps","derivation_cache","intervals"]}},"required":["tenant","days","previous","shifted"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/devices":{"get":{"tags":["admin"],"summary":"A firm's devices with the version each last called with (operators only)","description":"Devices that never sent a version first, then the oldest version first: the top of the list is who still reads the oldest shape (D-196). Read under the firm's own scope.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"The firm's devices.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"internal":{"type":"boolean"}},"required":["id","internal"]},"devices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"},"platform":{"type":"string"},"email":{"type":"string","nullable":true},"version":{"type":"string","nullable":true},"version_seen_at":{"type":"string","nullable":true},"last_seen_at":{"type":"string","nullable":true},"revoked":{"type":"boolean"}},"required":["id","name","platform","email","version","version_seen_at","last_seen_at","revoked"]}}},"required":["tenant","devices"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/entries/purge":{"post":{"tags":["admin"],"summary":"List, and unless dry_run delete, one author's demo or unmatched entry rows (operators only)","description":"DESTRUCTIVE: a deleted row cannot be undone and has no backup. `demo` selects the rows tools/demo-seed minted, its released ones listed under `kept` and never deleted; `unmatched` selects engine-written rows charged to no matter; at least one is required, and so is `author`. The listing and the delete run in ONE transaction in the author's own scope, and the delete removes exactly the listed ids. `dry_run` answers the list and writes nothing, and is not audited.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"author":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"demo":{"type":"boolean","default":false},"unmatched":{"type":"boolean","default":false},"dry_run":{"type":"boolean","default":false}},"required":["author"]}}}},"responses":{"200":{"description":"The listed rows, and on a real run the deleted counts.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"author":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"user":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"dry_run":{"type":"boolean"},"rows":{"type":"object","properties":{"demo":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"day":{"type":"string"},"worked_hours":{"type":"number"},"matter_id":{"type":"string","nullable":true},"status":{"type":"string"},"narrative":{"type":"string"}},"required":["id","day","worked_hours","matter_id","status","narrative"]}},"unmatched":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"day":{"type":"string"},"worked_hours":{"type":"number"},"matter_id":{"type":"string","nullable":true},"status":{"type":"string"},"narrative":{"type":"string"}},"required":["id","day","worked_hours","matter_id","status","narrative"]}}},"required":["demo","unmatched"]},"kept":{"type":"object","properties":{"demo":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"day":{"type":"string"},"worked_hours":{"type":"number"},"matter_id":{"type":"string","nullable":true},"status":{"type":"string"},"narrative":{"type":"string"}},"required":["id","day","worked_hours","matter_id","status","narrative"]}}},"default":{"demo":[]},"required":["demo"]},"deleted":{"type":"object","nullable":true,"properties":{"demo":{"type":"integer"},"unmatched":{"type":"integer"},"total":{"type":"integer"}},"required":["demo","unmatched","total"]}},"required":["tenant","author","user","dry_run","rows","deleted"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants":{"get":{"tags":["admin"],"summary":"Every firm with its WorkOS organisation, internal mark and tier (operators only)","description":"Oldest first. Answers which tenant an `org_...` id is.","security":[{"bearer":[]}],"responses":{"200":{"description":"Every firm.","content":{"application/json":{"schema":{"type":"object","properties":{"tenants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"},"workos_org_id":{"type":"string"},"internal":{"type":"boolean"},"security_tier":{"type":"string","enum":["standard","confidential"]},"created_at":{"type":"string"}},"required":["id","name","workos_org_id","internal","security_tier","created_at"]}}},"required":["tenants"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}":{"get":{"tags":["admin"],"summary":"One firm's policy, connector state and member count (operators only)","description":"The connector is its kind and status only, never its credentials.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"The firm.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"},"workos_org_id":{"type":"string"},"internal":{"type":"boolean"},"security_tier":{"type":"string","enum":["standard","confidential"]},"created_at":{"type":"string"},"policy":{"type":"object","properties":{"excluded_bundles":{"type":"array","items":{"type":"string","minLength":1},"default":[]},"security_tier":{"type":"string","enum":["standard","confidential"],"default":"standard"},"raw_archive":{"type":"boolean","default":false},"research_export":{"type":"boolean","default":false},"context_retention_days":{"type":"integer","minimum":0,"maximum":365,"default":30},"demo":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"default":{}},"connector":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]}},"required":["kind","status"]},"members":{"type":"object","properties":{"total":{"type":"integer"},"active":{"type":"integer"}},"required":["total","active"]}},"required":["id","name","workos_org_id","internal","security_tier","created_at","connector","members"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/narrative-instructions":{"get":{"tags":["admin"],"summary":"A firm's narrative instructions (operators only)","description":"The firm's narrative instructions, `tenants.settings.narrative.guidance`: rendered last in the narrative request, with standing over every default (R-1). At most 1,500 characters, no control character but a newline; empty is none.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"The firm's instructions.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"}},"required":["id","name"]},"instructions":{"type":"string"}},"required":["tenant","instructions"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"put":{"tags":["admin"],"summary":"Set a firm's narrative instructions (operators only)","description":"The firm's narrative instructions, `tenants.settings.narrative.guidance`: rendered last in the narrative request, with standing over every default (R-1). At most 1,500 characters, no control character but a newline; empty is none. Replaces the text whole; the firm's other narrative settings are kept.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"instructions":{"type":"string","maxLength":1500}},"required":["instructions"]}}}},"responses":{"200":{"description":"The firm's instructions as they now stand.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"}},"required":["id","name"]},"instructions":{"type":"string"}},"required":["tenant","instructions"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/narrative-activities":{"get":{"tags":["admin"],"summary":"A firm's narrative activities, by rank (operators only)","description":"The firm's narrative activities, by rank: the rank is the precedence, the first row whose `when` the evidence meets opens the line. Each row has a key, when it applies (English, stated by instrument) and a pattern per language. `language` is the firm's default narrative language.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"The firm's activities.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"}},"required":["id","name"]},"language":{"type":"string","enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"activities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"when":{"type":"string","minLength":1,"maxLength":800},"patterns":{"type":"object","properties":{"nl":{"type":"string","minLength":1,"maxLength":200},"en":{"type":"string","minLength":1,"maxLength":200},"de":{"type":"string","minLength":1,"maxLength":200},"fr":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200},"it":{"type":"string","minLength":1,"maxLength":200},"pt":{"type":"string","minLength":1,"maxLength":200},"pl":{"type":"string","minLength":1,"maxLength":200},"sv":{"type":"string","minLength":1,"maxLength":200},"da":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false}},"required":["key","when","patterns"]}}},"required":["tenant","language","activities"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"put":{"tags":["admin"],"summary":"Replace a firm's narrative activities (operators only)","description":"The firm's narrative activities, by rank: the rank is the precedence, the first row whose `when` the evidence meets opens the line. Each row has a key, when it applies (English, stated by instrument) and a pattern per language. `language` is the firm's default narrative language. The body is the whole table in rank order, and it replaces the firm's rows in one transaction: adding, removing, renaming and re-ranking are all this one write. Refused with 400, the rows left as they were, for an empty table, a repeated key, a size past its bound, or a table where no row has a pattern in the firm's default language.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"activities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"when":{"type":"string","minLength":1,"maxLength":800},"patterns":{"type":"object","properties":{"nl":{"type":"string","minLength":1,"maxLength":200},"en":{"type":"string","minLength":1,"maxLength":200},"de":{"type":"string","minLength":1,"maxLength":200},"fr":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200},"it":{"type":"string","minLength":1,"maxLength":200},"pt":{"type":"string","minLength":1,"maxLength":200},"pl":{"type":"string","minLength":1,"maxLength":200},"sv":{"type":"string","minLength":1,"maxLength":200},"da":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false}},"required":["key","when","patterns"]},"minItems":1,"maxItems":40}},"required":["activities"]}}}},"responses":{"200":{"description":"The firm's activities as they now stand.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"}},"required":["id","name"]},"language":{"type":"string","enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"activities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"when":{"type":"string","minLength":1,"maxLength":800},"patterns":{"type":"object","properties":{"nl":{"type":"string","minLength":1,"maxLength":200},"en":{"type":"string","minLength":1,"maxLength":200},"de":{"type":"string","minLength":1,"maxLength":200},"fr":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200},"it":{"type":"string","minLength":1,"maxLength":200},"pt":{"type":"string","minLength":1,"maxLength":200},"pl":{"type":"string","minLength":1,"maxLength":200},"sv":{"type":"string","minLength":1,"maxLength":200},"da":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false}},"required":["key","when","patterns"]}}},"required":["tenant","language","activities"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/learning/terms":{"get":{"tags":["admin"],"summary":"A firm's learned matter terms, opened (operators only, internal firms only)","description":"Every learned term of the member `member` names, or of every member of the firm, opened under the firm's key: the matter or client it is under, its kind, `candidate` or `promoted`, how many entries carried it, and when it was first and last seen. Ordered by member, then matter or client, then term. Served for an internal tenant alone: any other is 409 `urn:six-minute:problem:tenant-not-internal`. Each read is audited with the member it names, never a term.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"required":false,"name":"member","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"The terms, opened.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"}},"required":["id","name"]},"terms":{"type":"array","items":{"type":"object","properties":{"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"email":{"type":"string"},"scope":{"type":"string","enum":["matter","client"]},"owner_id":{"type":"string"},"matter_code":{"type":"string","nullable":true},"client_name":{"type":"string","nullable":true},"term":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["candidate","promoted"]},"sightings":{"type":"integer"},"first_seen":{"type":"string"},"last_seen":{"type":"string"}},"required":["member_id","email","scope","owner_id","matter_code","client_name","term","kind","status","sightings","first_seen","last_seen"]}}},"required":["tenant","terms"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/learning/report":{"get":{"tags":["admin"],"summary":"Matter learning's shadow comparison, per member (operators only)","description":"Over `from` to `to` (UTC dates, inclusive; the last 30 days where absent), per member: the intervals with a shadow row and how many each kind of run decided (`decided_by`), how many a learned term lifted, and, over the intervals under a released entry of the person (`scored`), how often its matter was first and in the first 20 of the word order without learned terms (`baseline`) and with them (`learned`), how often the matter call charged it (`picked_right`), and in how many lifted intervals learning ranked it higher (`helped`) or lower (`hurt`). `lifts` lists each lifted matter with how often it was the final matter. Matter ids and counts only.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"required":false,"name":"member","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"The comparison, per member.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"}},"required":["id","name"]},"from":{"type":"string"},"to":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"email":{"type":"string"},"intervals":{"type":"integer"},"decided_by":{"type":"object","additionalProperties":{"type":"integer"}},"lifted":{"type":"integer"},"scored":{"type":"integer"},"baseline":{"type":"object","properties":{"at1":{"type":"integer"},"top20":{"type":"integer"}},"required":["at1","top20"]},"learned":{"type":"object","properties":{"at1":{"type":"integer"},"top20":{"type":"integer"}},"required":["at1","top20"]},"picked_right":{"type":"integer"},"helped":{"type":"integer"},"hurt":{"type":"integer"},"lifts":{"type":"array","items":{"type":"object","properties":{"matter_id":{"type":"string"},"lifted":{"type":"integer"},"right":{"type":"integer"},"wrong":{"type":"integer"}},"required":["matter_id","lifted","right","wrong"]}}},"required":["member_id","email","intervals","decided_by","lifted","scored","baseline","learned","picked_right","helped","hurt","lifts"]}}},"required":["tenant","from","to","members"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/scrub-plaintext":{"post":{"tags":["admin"],"summary":"Start the plaintext scrub of a firm's old rows, one job per member (operators only)","description":"Clears the plaintext twin of each sealed value written before the sealed copies were the only ones: an entry's judged copy becomes the empty object and an old interval's summary and label become null, each only where the sealed value opens to the same content. Refused with 409 while a release older than this one may still be served. Idempotent.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"How many jobs were started.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"string"},"started":{"type":"integer","minimum":0}},"required":["tenant","started"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/pipeline/shadow-report":{"get":{"tags":["admin"],"summary":"Gone: the cloud pipeline's shadow is deleted (operators only)","description":"Answers 410 `gone`: the shadow is deleted (the generate-reliability plan, W6). Kept so its removal is not an API break; the follow-up removes it.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"day","in":"query"}],"responses":{"200":{"description":"Never answered since the shadow is deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"people":{"type":"array","items":{"type":"object","properties":{"member_id":{"type":"string"},"intervals_device":{"type":"integer","minimum":0},"intervals_cloud":{"type":"integer","minimum":0},"intervals_both":{"type":"integer","minimum":0},"matter_agree":{"type":"integer","minimum":0},"minutes_device":{"type":"number","minimum":0},"minutes_matter_agree":{"type":"number","minimum":0},"minutes_client_agree":{"type":"number","minimum":0},"minutes_cloud":{"type":"number","minimum":0},"latency_p50_s":{"type":"number","nullable":true,"minimum":0},"latency_p95_s":{"type":"number","nullable":true,"minimum":0},"cost_usd":{"type":"number","minimum":0},"runs_failed":{"type":"integer","minimum":0},"runs_held":{"type":"integer","minimum":0}},"required":["member_id","intervals_device","intervals_cloud","intervals_both","matter_agree","minutes_device","minutes_matter_agree","minutes_client_agree","minutes_cloud","latency_p50_s","latency_p95_s","cost_usd","runs_failed","runs_held"]}}},"required":["day","people"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"410":{"description":"The route is gone and changes nothing; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/activity-types":{"get":{"tags":["admin"],"summary":"For a firm: COMPAT(#180): the published activity types, for desktops from before the stream-only release (any role)","description":"Activity types are gone. A desktop from before the stream-only release still reads this list, so it answers the published eleven to every firm, in their fixed order, whatever the firm once stored. Removed by #180 once no such desktop has been seen for 30 days.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","deprecated":true,"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"The published eleven, in position order.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"},"title":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0},"source":{"type":"string","enum":["published","firm"],"default":"firm"}},"required":["key","title","description"]}}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/activity-types/{key}":{"put":{"tags":["admin"],"summary":"For a firm: COMPAT(#180): gone; activity types are no longer written","description":"Activity types are gone, so a write is a 410 of type `urn:six-minute:problem:activity-types-gone` and changes nothing. The body and the 200 stay documented only so a client built against the old route still matches; the 200 is never answered. Removed by #180.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","deprecated":true,"security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"},"required":true,"name":"key","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"},"title":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0},"source":{"type":"string","enum":["published","firm"],"default":"firm"}},"required":["key","title","description"]}}}},"responses":{"200":{"description":"Never answered: the route is gone.","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"},"title":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0},"source":{"type":"string","enum":["published","firm"],"default":"firm"}},"required":["key","title","description"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"410":{"description":"The route is gone and changes nothing; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/attributes":{"get":{"tags":["admin"],"summary":"For a firm: The firm's attributes: the fields its entries carry (any role)","description":"In `position` then `key` order. `required` blocks release where the matter's list is non-empty and the entry carries no value; `proposed` says the narrative call answers this attribute in the one call it already makes. On a row the connector owns or has bound (`source: connector`, or a `binding`), `label` and `proposed` are the firm's and the rest is the connector's, as are the row's sets. `position` is the server's on every row.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"In position then key order.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"required":{"type":"boolean","default":false},"proposed":{"type":"boolean","default":true},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"binding":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","minLength":1},"field":{"type":"string","minLength":1}},"default":null,"required":["kind","field"]},"default_set_ids":{"type":"array","items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"default":[]},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0}},"required":["key","label"]}}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/attributes/{key}":{"put":{"tags":["admin"],"summary":"For a firm: Create or replace one attribute (admin)","description":"The body's `key` must be the path's. `default_set_ids` must name sets this firm already holds AND holds under this attribute (422 otherwise, naming the set and both attributes): a default set of another attribute renders nothing on every matter that inherits it. The `position` is the server's and a body's is accepted and ignored: a new key goes one past the firm's last, and a key the firm holds keeps its place. On a row the connector owns or has bound, `label` and `proposed` are the firm's and the rest, `position` aside, is the connector's: a body that differs from the stored row in any other field is a 409 naming the fields, because the connector declared them and its options and sets are written by the sync. On any other row a body that says `source: connector`, or carries a `binding` the row does not already have, is a 409: both are set by connecting a practice system, never by a write.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":true,"name":"key","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"required":{"type":"boolean","default":false},"proposed":{"type":"boolean","default":true},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"binding":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","minLength":1},"field":{"type":"string","minLength":1}},"default":null,"required":["kind","field"]},"default_set_ids":{"type":"array","items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"default":[]},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0}},"required":["key","label"]}}}},"responses":{"200":{"description":"The attribute as stored.","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"required":{"type":"boolean","default":false},"proposed":{"type":"boolean","default":true},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"binding":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","minLength":1},"field":{"type":"string","minLength":1}},"default":null,"required":["kind","field"]},"default_set_ids":{"type":"array","items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"default":[]},"active":{"type":"boolean","default":true},"position":{"type":"integer","default":0}},"required":["key","label"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["admin"],"summary":"For a firm: Delete an attribute no entry carries (admin)","description":"204 while no entry carries the key, with the attribute's sets. 409 for a row a connector owns or has bound, and 409 once an entry carries the key: an attribute an entry carries is DEACTIVATED and never deleted, so a released line keeps meaning what it said. A matter that still names one of the deleted sets keeps naming it, and an id that names nothing is ignored when the entry's options are worked out.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":true,"name":"key","in":"path"}],"responses":{"204":{"description":"Deleted, with its sets."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/attribute-sets":{"get":{"tags":["admin"],"summary":"For a firm: Every option set the firm holds, or one attribute's (any role)","description":"`?attribute=` narrows it to one attribute's sets. A matter names the sets that apply to it and never owns options of its own, which is what keeps one list in one place however many matters read it. Where the firm's practice system shows each person their own matters, a set of the system's that only matters the caller is not shown name is left out.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":false,"name":"attribute","in":"query"}],"responses":{"200":{"description":"In attribute then id order.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"attribute_key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"name":{"type":"string","minLength":1},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"external_ref":{"type":"string","nullable":true,"default":null},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string","minLength":1},"description":{"type":"string","default":""},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"min_narrative_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null}},"required":["value","label"]}},"active":{"type":"boolean","default":true},"updated_at":{"type":"string","format":"date-time"}},"required":["id","attribute_key","name","options","updated_at"]}}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/attributes/{key}/sets/{id}":{"put":{"tags":["admin"],"summary":"For a firm: Create or replace one option set, whole (admin)","description":"The body's `id` and `attribute_key` must be the path's. A set is a LIST, so the body carries every option and an unchanged body leaves `updated_at` where it was. An attribute this firm does not hold is a 404; a connector-owned set, or an attribute the connector owns or has bound, is a 409, and so is a body that says `source: connector`; two options with one value is a 400. Leaving out an option an entry carries is a 409 `urn:six-minute:problem:option-in-use` naming the values: send it with `active: false`, which retires it.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":true,"name":"key","in":"path"},{"schema":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"attribute_key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"name":{"type":"string","minLength":1},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"external_ref":{"type":"string","nullable":true,"default":null},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string","minLength":1},"description":{"type":"string","default":""},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"min_narrative_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null}},"required":["value","label"]}},"active":{"type":"boolean","default":true}},"required":["id","attribute_key","name","options"]}}}},"responses":{"200":{"description":"The set as stored.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"attribute_key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"name":{"type":"string","minLength":1},"source":{"type":"string","enum":["firm","connector"],"default":"firm"},"external_ref":{"type":"string","nullable":true,"default":null},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string","minLength":1},"description":{"type":"string","default":""},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"min_narrative_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null}},"required":["value","label"]}},"active":{"type":"boolean","default":true},"updated_at":{"type":"string","format":"date-time"}},"required":["id","attribute_key","name","options","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["admin"],"summary":"For a firm: Delete an option set none of whose values an entry carries (admin)","description":"204 while no entry carries one of its values, 409 once one does, naming the count. A set whose values are in use is DEACTIVATED and never deleted: it is the only record of what those values meant.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"required":true,"name":"key","in":"path"},{"schema":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/clients":{"get":{"tags":["admin"],"summary":"For a firm: A page of clients, whole or changed since a position (any role)","description":"With no `since` the pages are the whole list. The last page carries an `ETag`, the position the read ended at: send it as `since` to read only what changed since then, and also as `If-None-Match`, so that a read finding nothing changed is a 304 with no body. Send each `next_cursor` as `since` to continue; a null `next_cursor` means the last page. A `since` the API cannot continue (from another sign-in) is a 400: read from the start. Where a practice system shows each person their own matters (`capabilities.matter_visibility` is `member`), the page holds the clients the firm made itself and the clients of the matters THE CALLER is served by `GET /v1/matters`, and no others: a client that system named is served only while one of its matters is the caller's to see, with an `updated_at` that is the later of its own and the instant such a matter came into the caller's sight, so it arrives on an incremental pull. Every other firm's answer is unchanged.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"since","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":2000,"default":500},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"if-none-match","in":"header"}],"responses":{"200":{"description":"The page.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null},"kind":{"type":"string","enum":["primary","billing","other"],"default":"other"}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"minLength":1}},"required":["rows","next_cursor"]}}}},"304":{"description":"Nothing changed since `since`."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["admin"],"summary":"For a firm: Create a client (billing, admin)","description":"The id may be given (a device minted it) or is minted here. A name already in use is 409.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither. Served for an internal tenant alone: any other is 409 `urn:six-minute:problem:tenant-not-internal`, before the audit row and before any write.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null},"kind":{"type":"string","enum":["primary","billing","other"],"default":"other"}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]}},"required":["name"]}}}},"responses":{"201":{"description":"The client as stored.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null},"kind":{"type":"string","enum":["primary","billing","other"],"default":"other"}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/clients/{id}":{"patch":{"tags":["admin"],"summary":"For a firm: Change a client's name, reference, rules or active flag (billing, admin)","security":[{"bearer":[]}],"description":"\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither. Served for an internal tenant alone: any other is 409 `urn:six-minute:problem:tenant-not-internal`, before the audit row and before any write.","parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null},"kind":{"type":"string","enum":["primary","billing","other"],"default":"other"}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]}}}}}},"responses":{"200":{"description":"The client after the patch.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null},"kind":{"type":"string","enum":["primary","billing","other"],"default":"other"}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/matters":{"get":{"tags":["admin"],"summary":"For a firm: A page of matters, whole or changed since a position (any role)","description":"With no `since` the pages are the whole list. The last page carries an `ETag`, the position the read ended at: send it as `since` to read only what changed since then, and also as `If-None-Match`, so that a read finding nothing changed is a 304 with no body. Send each `next_cursor` as `since` to continue; a null `next_cursor` means the last page. A `since` the API cannot continue (from another sign-in) is a 400: read from the start. Where the firm's practice system shows each person their own matters (`capabilities.matter_visibility` is `member`), the page holds the matters THE CALLER is shown there and no others, besides the matters the firm made itself, and only while the caller's own sign-in there is live (`member.system_link.status` is `connected` on `GET /v1/me`): a caller who has not signed in, or whose sign-in is no longer accepted, is served none of that system's matters until they sign in again, and so is everybody at a firm that disconnected it. Each such row's `updated_at` is the later of the matter's own and the instant the caller's access to it last changed, so a matter that became visible arrives on an incremental pull. One the system withdrew from the caller arrives once, with `active` false, on a pull whose `since` is from before the withdrawal, and never again whatever changes on it; a pull with no `since` holds none. Every other firm's answer is unchanged.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"since","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":2000,"default":500},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"if-none-match","in":"header"}],"responses":{"200":{"description":"The page.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"firm_internal":{"type":"boolean","default":false},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"attribute_required":{"type":"object","additionalProperties":{"type":"boolean"},"default":{}},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","client_id","name","opened_at","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"minLength":1}},"required":["rows","next_cursor"]}}}},"304":{"description":"Nothing changed since `since`."},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"post":{"tags":["admin"],"summary":"For a firm: Create a matter under a client of this firm (billing, admin)","description":"The id may be given (a device minted it) or is minted here; `opened_at` defaults to now. An unknown client is 422; a matter number already used within the client is 409.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither. Served for an internal tenant alone: any other is 409 `urn:six-minute:problem:tenant-not-internal`, before the audit row and before any write.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"}},"required":["client_id","name"]}}}},"responses":{"201":{"description":"The matter as stored.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"firm_internal":{"type":"boolean","default":false},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"attribute_required":{"type":"object","additionalProperties":{"type":"boolean"},"default":{}},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","client_id","name","opened_at","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/matters/{id}":{"patch":{"tags":["admin"],"summary":"For a firm: Change a matter's fields (billing, admin)","description":"The client is never changed. A temporary matter with entries on it cannot be deactivated: move the entries to the real matter first (409). `narrative_language` is an admin's to change (403 for billing), and not on a matter held by a connected practice system that supplies each matter's language, whose language is the system's (409); sending the value the matter already has changes nothing and is allowed. A matter the caller is not served by `GET /v1/matters` (a practice system that shows each person their own matters does not show it to them) is a 404, whatever their role.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither. A patch naming `attribute_sets` alone is served for any firm; one that changes anything else (the name, the number, the description, `active`, `narrative_language` and the rest) is served for an internal tenant alone, and any other is 409 `urn:six-minute:problem:tenant-not-internal`, before the audit row and before any write.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"}}}}}},"responses":{"200":{"description":"The matter after the patch.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"firm_internal":{"type":"boolean","default":false},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"attribute_required":{"type":"object","additionalProperties":{"type":"boolean"},"default":{}},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","client_id","name","opened_at","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/matters/{id}/firm-internal":{"put":{"tags":["admin"],"summary":"For a firm: Mark a matter as one of the firm's own, or clear the mark (admin)","description":"The firm's internal matters are listed in a section of their own in every matter request, whatever the screen shows. This is the one write of `firm_internal`: no other body takes it and no sync of a practice system changes it. A change raises `updated_at`, so every device's next pull carries it; the value the matter already has changes nothing. A matter the caller is not served by `GET /v1/matters` is a 404, as the patch's. The firm marks at most 10 active matters: marking one more is 409 `urn:six-minute:problem:list-full` and writes nothing; clearing a mark is never refused.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firm_internal":{"type":"boolean"}},"required":["firm_internal"]}}}},"responses":{"200":{"description":"The matter as it now stands.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"client_id":{"type":"string","pattern":"^client_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_activity_at":{"type":"string","nullable":true,"format":"date-time","default":null},"firm_internal":{"type":"boolean","default":false},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"attribute_required":{"type":"object","additionalProperties":{"type":"boolean"},"default":{}},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","client_id","name","opened_at","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/matters/import":{"post":{"tags":["admin"],"summary":"For a firm: The seed import: clients with their matters, matched by name, idempotent (billing, admin)","description":"The shape `six-minute matter import` reads. Clients are matched by exact name and matters by (client, name); missing rows are created, known rows are corrected in `code`, `description`, `external_ref`, `billing`, the record's own words, `temporary`, `billable` and `active` only where the seed differs, and an identical re-import changes nothing. One transaction: a refused row refuses the whole import.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither. Served for an internal tenant alone: any other is 409 `urn:six-minute:problem:tenant-not-internal`, before the audit row and before any write.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clients":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"external_ref":{"type":"string","nullable":true,"default":null},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null},"kind":{"type":"string","enum":["primary","billing","other"],"default":"other"}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"matters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"code":{"type":"string","nullable":true,"minLength":1,"default":null},"description":{"type":"string","nullable":true,"default":null},"billable":{"type":"boolean","default":true},"external_ref":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"temporary":{"type":"boolean","default":false},"parties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["counterparty","counterparty_counsel","co_party","court","other"],"default":"other"},"email":{"type":"string","nullable":true,"default":null},"organisation":{"type":"string","nullable":true,"default":null},"role":{"type":"string","nullable":true,"minLength":1,"default":null},"emails":{"type":"array","items":{"type":"string"},"default":[]},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","nullable":true,"default":null}},"required":["name"]},"default":[]},"reference":{"type":"string","nullable":true,"minLength":1,"default":null},"external_refs":{"type":"array","items":{"type":"string","minLength":1}}},"required":["name"]},"default":[]},"domains":{"type":"array","items":{"type":"string"},"default":[]},"folders":{"type":"array","items":{"type":"string"},"default":[]},"keywords":{"type":"array","items":{"type":"string"},"default":[]},"matter_type":{"type":"string","nullable":true,"minLength":1,"default":null},"references":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","default":"other"},"value":{"type":"string"}},"required":["value"]},"default":[]},"category":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"minLength":1,"default":null},"name":{"type":"string","minLength":1}},"default":null,"required":["name"]},"main_category":{"type":"string","nullable":true,"minLength":1,"default":null},"phase":{"type":"string","nullable":true,"minLength":1,"default":null},"billing":{"type":"object","properties":{"narrative_profile":{"type":"string","minLength":1,"default":"house"}},"default":{}},"attribute_sets":{"type":"object","additionalProperties":{"type":"array","nullable":true,"items":{"type":"string","pattern":"^aset_[a-z0-9][a-z0-9_.:-]*$"}},"default":{}},"sync_source":{"type":"string","enum":["manual","legalsense","urios","import"],"default":"manual"},"opened_at":{"type":"string","format":"date-time"}},"required":["name"]}}},"required":["name","matters"]}}},"required":["clients"]}}}},"responses":{"200":{"description":"What was created, updated and left alone.","content":{"application/json":{"schema":{"type":"object","properties":{"clients":{"type":"object","properties":{"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"}},"required":["created","updated","unchanged"]},"matters":{"type":"object","properties":{"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"}},"required":["created","updated","unchanged"]}},"required":["clients","matters"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/connector":{"put":{"tags":["admin"],"summary":"For a firm: Connect the firm's practice system, step 1: the credentials (billing, admin)","description":"The credentials are VERIFIED before anything is stored: the adapter connects and probes, and a failure is a 422 whose one error's path names the step that failed (`step.tls`, `step.login`, `step.schema`, `step.rights`) so an administrator is sent to the one screen in their own system where the answer is. On success the row is sealed under the firm's key, a NEW connector is stored as `pending_mapping`, the system's employees are written to the team table, and the answer carries the team proposal, matched to the firm's members by exact email and by nothing else (D-166). The adapter's declared pick-list fields are bound in the same step: one attribute per field, `source: connector`, keyed `<kind>_<field>` or by the standard it names, created or rebound to the row a former connection of the same system left behind, and a firm-wide field's one set with it (D-174). A connector of ANOTHER kind is a 409 naming Disconnect; the same kind again re-verifies, re-seals, keeps the team and its bindings and keeps a firm that was `connected` or `needs_reconnect` connected, because a firm that has already confirmed its team is not sent through that step again by a reconnection. The deliveries a former connection left keep the kind they were sent to, as history. For a kind each member signs in to with their own account (`capabilities.identity` is `sign_in`) the caller must be an ADMINISTRATOR (403 for billing) and the credentials are their OWN account (a username and password, or an `api_token` they made in the system): the firm's row seals which installation it is and no session, the connector is `connected` at once, the administrator's own session is stored as `PUT /v1/connector/account` stores a member's, and `team` is null. It answers as soon as the system accepted the sign-in and runs NO sync: the summary's counts are what the firm held before, and the client sends `POST /v1/connector/sync` itself, straight after, reading `GET /v1/connector/sync/progress` while it runs. The same installation again is that administrator signing in again; another installation while connected is a 409 naming Disconnect. An account of the system that another member already signed in with is a 409. An operator is refused such a connect with a 422: it takes a person's own password. A credential whose host resolves to a loopback, private, link-local or unspecified address is a 422 on the path `host`, before anything is dialled. The system's narrative ceiling is not copied into the firm's settings: the limit in force is the firm's own length under the ceiling, computed on every read.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["urios"]},"host":{"type":"string","minLength":1},"port":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":3306},"database":{"type":"string","minLength":1},"user":{"type":"string","minLength":1},"password":{"type":"string","minLength":1}},"required":["kind","host","database","user","password"]},{"type":"object","properties":{"kind":{"type":"string","enum":["legalsense"]},"host":{"type":"string","minLength":1,"pattern":"^[a-z0-9]([a-z0-9-]*[a-z0-9])?\\.legalsense\\.nl$"},"username":{"type":"string","minLength":1},"password":{"type":"string","minLength":1},"totp":{"type":"string","pattern":"^[0-9]{6}$"},"api_token":{"type":"string","minLength":1}},"required":["kind","host"]},{"type":"object","properties":{"kind":{"type":"string","enum":["fake"]},"seed":{"type":"string"}},"required":["kind"]}]}}}},"responses":{"200":{"description":"The connector, and the team table to confirm.","content":{"application/json":{"schema":{"type":"object","properties":{"connector":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false},"team":{"type":"object","nullable":true,"properties":{"rows":{"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"email":{"type":"string","nullable":true,"default":null},"code":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"member_id":{"type":"string","nullable":true,"pattern":"^member_[a-z0-9][a-z0-9_.:-]*$","default":null},"bound_by":{"type":"string","nullable":true,"enum":["email","admin","sign_in"],"default":null},"bound_at":{"type":"string","nullable":true,"format":"date-time","default":null},"note":{"type":"string","nullable":true,"default":null},"member_name":{"type":"string","nullable":true,"default":null},"member_email":{"type":"string","nullable":true,"default":null}},"required":["external_ref","name"]}},"unmatched_members":{"type":"array","items":{"type":"object","properties":{"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","default":""},"email":{"type":"string"}},"required":["member_id","email"]}}},"required":["rows","unmatched_members"]}},"required":["connector","team"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"get":{"tags":["admin"],"summary":"For a firm: The firm's connector: its kind, status, settings and counts (billing, admin)","description":"404 while the firm has none, which is what a settings page draws as Not connected. The page says what the firm is connected to from it.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"The connector. Never a credential.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"delete":{"tags":["admin"],"summary":"For a firm: Disconnect the practice system (billing, admin)","description":"The row goes and the team goes with it. The DELIVERIES stay, because they are the history of what a practice system took and disconnecting does not undo that, and so do the matters and the clients the sync wrote. The attributes the connector made are unbound and made inactive with their sets untouched, and the ones no entry ever carried are deleted with their sets and taken off every matter that named them; a standard's row the firm made is unbound and left as it was; a reconnect of the same system rebinds the ones that stayed. Connecting another system starts at step 1 again. Where the system keeps a session for the stored credential, it is ended there first, best effort: a system that cannot be reached does not stop the disconnect. For a system each member signs in to, every member's sealed session and their set of visible matters go with the row and NOTHING is sent to the practice system: the sessions there are the members' own. A firm connected to a system this service carries no adapter for answers the not-available 422.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"204":{"description":"Disconnected. The team is gone with it; the deliveries and the carried attributes are not."},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/connector/team":{"put":{"tags":["admin"],"summary":"For a firm: Connect step 2, and the settings table afterwards: bind the system's employees to members","description":"One line per employee, a member or nobody. A member bound to two employees is a 409: one employee of the practice system is one person here. A connector waiting on its team (`pending_mapping`) becomes `connected`; any other status, and its `last_error`, is left as it is. Where the firm's first read is done (the sync a client sends after the connect ran it while the connector waited on this step) the read made here is by change and quick; where it never ran it is made here, whole; and a read that is running already is not waited for, the summary being answered with what is in so far. The sync runs inline and the summary is the answer. The same route edits the table afterwards, where a new employee the sync found appears unbound. 404 for a kind whose identity is a per-user sign-in: nobody is shown a table there, and each person's own authorisation fills their row (D-166). A firm connected to a system this service carries no adapter for answers the not-available 422.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1},"member_id":{"type":"string","nullable":true,"pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}},"required":["external_ref","member_id"]}}}}},"responses":{"200":{"description":"The connector after the confirmation and the first sync.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"get":{"tags":["admin"],"summary":"For a firm: The employee table: the system's people beside the members they are bound to","description":"Unbound employees first, because they are the rows an administrator has something to do about. `unmatched_members` is the firm's own members nobody is bound to, so it is visible who is missing. For a system each member signs in to it is the same table, read-only: the people who have signed in, each bound to the member who did (`bound_by` is `sign_in`), and `unmatched_members` is the members who have not signed in yet. Its write stays a 404 there. A firm connected to a system this service carries no adapter for answers the not-available 422.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"The table, and the members nobody matched.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"email":{"type":"string","nullable":true,"default":null},"code":{"type":"string","nullable":true,"default":null},"active":{"type":"boolean","default":true},"member_id":{"type":"string","nullable":true,"pattern":"^member_[a-z0-9][a-z0-9_.:-]*$","default":null},"bound_by":{"type":"string","nullable":true,"enum":["email","admin","sign_in"],"default":null},"bound_at":{"type":"string","nullable":true,"format":"date-time","default":null},"note":{"type":"string","nullable":true,"default":null},"member_name":{"type":"string","nullable":true,"default":null},"member_email":{"type":"string","nullable":true,"default":null}},"required":["external_ref","name"]}},"unmatched_members":{"type":"array","items":{"type":"object","properties":{"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","default":""},"email":{"type":"string"}},"required":["member_id","email"]}}},"required":["rows","unmatched_members"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/connector/settings":{"put":{"tags":["admin"],"summary":"For a firm: Choose the connector's settings: who reviews a released entry (admin)","description":"Each key is the whole value. `reviewer` is who approves a released entry in a system that takes entries as drafts for approval: `null` or `{mode: \"timekeeper\"}` is each lawyer their own, and `{mode: \"person\", external_ref, name}` is one person of the firm's, who must be an ACTIVE employee on this connector's team (422 on `reviewer.external_ref` otherwise). The system may still refuse that person at the push, which answers `connector.reviewer`. A system that does not take entries as drafts for approval has no reviewer: any reviewer but `null` is a 422 on `reviewer` there, and so it is in a system where the person who released an entry is always its reviewer (`capabilities.reviewer` is `self`). A sync never changes the setting. 404 while the firm has no connector. A firm connected to a system this service carries no adapter for answers the not-available 422.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}]}},"required":["reviewer"]}}}},"responses":{"200":{"description":"The connector with the setting stored.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/connector/approval":{"put":{"tags":["admin"],"summary":"For a firm: Choose whether one member's released time waits for approval in the practice system or is written as approved time (admin)","description":"For a system that takes entries as drafts for approval (`capabilities.accepts_by` is `approval`). `mode: \"auto\"` is the default: the member's released time is written as approved time, on the member's own account, with no draft; where the system refuses that write the release fails and says why, as a refused draft does, and the entry stays a draft in Sixminute. `mode: \"review\"` leaves a draft there that waits until it is approved. One member per request, merged over the settings as they stand, so two administrators setting two people at once both land. The answer's `settings.auto_approve` lists the active members on Auto-approve. A sync never changes it. 422 on `mode` for `auto` in a system that does not accept by approval (`review` is always taken); 422 on `member_id` for somebody who is not an active member of this firm. 404 while the firm has no connector. A firm connected to a system this service carries no adapter for answers the not-available 422, as `PUT /v1/connector/settings` does.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"mode":{"type":"string","enum":["review","auto"]}},"required":["member_id","mode"]}}}},"responses":{"200":{"description":"The connector with the setting stored.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/connector/sync":{"post":{"tags":["admin"],"summary":"For a firm: Sync now: the presser's own matters and the firm's lists in, the deliveries' states back (billing, admin)","description":"Sync now, as the person who pressed it means it, run inside this request and answered when it ends. For a practice system each member signs in to (`tenant.connector.identity` is `sign_in` on `GET /v1/me`) it is the CALLER'S OWN sync: their complete list of matters compared with the system, what changed in them, and the firm's shared lists when those are due; it never reads as a colleague and never waits on one, and a caller who is not signed in to the system syncs nothing. For a system the firm connected once it is the firm's sync, compared whole. It is also the request a client sends straight after `PUT /v1/connector` answered, since a connect syncs nothing itself: a connector that still waits on its team step (`pending_mapping`) is read exactly as a connected one, so the firm's first read runs here, with progress, before anybody pressed Done, and its status stays `pending_mapping`. While it runs, `GET /v1/connector/sync/progress` says how far it is. Where a sync of the same subject is already running (the scheduled run has the firm, or the caller), this request WAITS for it, up to a minute, and then makes its own, so the answer is a sync that happened; one it cannot outwait is answered with an `error` saying a sync is still running and zero counts, never as a sync in which nothing changed, and the progress route goes on saying `running`. It pushes nothing: an entry is released only once the practice system has taken it, inside the release. A failure is reported in the answer's `error` and on the connector row rather than as a status code: the run happened, and what it could not do is what the report is for. `deliveries` is answered with zero counts: what the practice system did with released entries is measured, never shown to the firm (R-8). A firm connected to a system this service carries no adapter for answers the not-available 422. On the operator's mount it is the firm's whole run: every signed-in member, as the scheduler runs it.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"What the sync did.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"started_at":{"type":"string","format":"date-time"},"finished_at":{"type":"string","format":"date-time"},"clients":{"type":"object","properties":{"created":{"type":"integer","minimum":0},"updated":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0}},"required":["created","updated","unchanged"]},"matters":{"type":"object","properties":{"created":{"type":"integer","minimum":0},"updated":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0}},"required":["created","updated","unchanged"]},"timekeepers":{"type":"object","properties":{"created":{"type":"integer","minimum":0},"updated":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0}},"required":["created","updated","unchanged"]},"options":{"type":"object","properties":{"created":{"type":"integer","minimum":0},"updated":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0},"refused":{"type":"integer","minimum":0,"default":0}},"required":["created","updated","unchanged"]},"deliveries":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0},"rejected":{"type":"integer","minimum":0},"edited":{"type":"integer","minimum":0}},"required":["accepted","rejected","edited"]},"cursors":{"type":"object","additionalProperties":{"type":"string"},"default":{}},"error":{"type":"string","nullable":true,"default":null}},"required":["kind","started_at","finished_at","clients","matters","timekeepers","options","deliveries"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/connector/team/apply":{"post":{"tags":["admin"],"summary":"For a firm: bind and unbind on the team table as it stands, and send it with confirm","description":"The binds, in order, then the unbinds, laid on the table as it stands. A bind is a MOVE: the member is taken off whichever employee held them. While the connector is `pending_mapping`, a row nobody bound takes the email pre-match; on a connected firm it stays as it is. An employee the practice system does not have is a 422. Without `confirm` the answer is the whole table it would send and nothing is written; with it the table goes through `PUT /v1/connector/team`'s own code and the answer carries the connector after the confirmation and its sync. 404 with no connector, or for a kind whose identity is a per-user sign-in. Audited as `connector.team` either way, with `confirm`.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bind":{"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1},"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}},"required":["external_ref","member_id"]},"default":[]},"unbind":{"type":"array","items":{"type":"string","minLength":1},"default":[]},"confirm":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"The table sent, or the one confirm would send.","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"boolean"},"confirmation":{"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1},"member_id":{"type":"string","nullable":true,"pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}},"required":["external_ref","member_id"]}},"connector":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["urios","legalsense","fake"]},"status":{"type":"string","enum":["pending_mapping","connected","needs_reconnect","disabled"]},"capabilities":{"type":"object","properties":{"accepts_by":{"type":"string","enum":["billing","approval"]},"identity":{"type":"string","enum":["mapping","sign_in"]},"change_feed":{"type":"string","enum":["modified_since","full_list"]},"narrative_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"note_max_chars":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"insolvency_groups":{"type":"boolean","enum":[false]},"matter_visibility":{"type":"string","enum":["firm","member"],"default":"firm"},"reviewer":{"type":"string","enum":["self","configurable"],"default":"configurable"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1},"scope":{"type":"string","enum":["firm","matter"]},"required":{"type":"boolean"},"standard":{"type":"string","nullable":true,"enum":["utbms_task","utbms_activity"]}},"required":["key","label","scope","required","standard"]}}},"required":["accepts_by","identity","change_feed","narrative_max_chars","insolvency_groups","fields"]},"settings":{"type":"object","nullable":true,"properties":{"notation":{"type":"string","nullable":true,"default":null},"reviewer":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["timekeeper"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["person"]},"external_ref":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["mode","external_ref","name"]},{"nullable":true}],"default":null},"auto_approve":{"type":"array","items":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"}}},"default":null},"counts":{"type":"object","properties":{"matters":{"type":"integer","minimum":0},"clients":{"type":"integer","minimum":0},"timekeepers":{"type":"integer","minimum":0},"options":{"type":"integer","minimum":0}},"required":["matters","clients","timekeepers","options"]},"team_bound":{"type":"integer","minimum":0},"team_unbound":{"type":"integer","minimum":0},"last_sync_at":{"type":"string","nullable":true,"format":"date-time","default":null},"last_error":{"type":"string","nullable":true,"default":null}},"required":["kind","status","capabilities","counts","team_bound","team_unbound"],"additionalProperties":false}},"required":["sent","confirmation","connector"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/members":{"get":{"tags":["admin"],"summary":"For a firm: The firm's memberships and its pending invitations (admin)","description":"Memberships oldest first; invitations are WorkOS's pending ones for this firm's organisation, oldest first, with the expiry the list shows as \"invited, expires in 6 days\".\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"Both lists.","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"active":{"type":"boolean","default":true},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"entry_size":{"type":"string","nullable":true,"enum":["fewer","balanced","more"],"default":null},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"email":{"type":"string","format":"email"},"name":{"type":"string","default":""},"avatar":{"type":"object","nullable":true,"properties":{"updated_at":{"type":"string","format":"date-time"}},"default":null,"required":["updated_at"]}},"required":["id","user_id","role","created_at","updated_at","email"]}},"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"expires_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","email","role","expires_at","created_at"]},"default":[]}},"required":["members"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/members/{id}":{"patch":{"tags":["admin"],"summary":"For a firm: Change a membership's role or active flag (admin)","description":"The last active admin cannot be demoted or deactivated: 409 `urn:six-minute:problem:last-admin`. Deactivating a member of a firm whose practice system each person signs in to deletes that member's own session there and their binding; nothing is sent to the practice system. Deactivating a member also deletes their calendar account with its stored events and marks, and asks the provider to revoke where it allows. This is also how a former member comes back. The interval is the firm's (`PATCH /v1/tenant/settings`).\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["timekeeper","billing","admin"]},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The membership after the patch.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"role":{"type":"string","enum":["timekeeper","billing","admin"]},"active":{"type":"boolean","default":true},"narrative_language":{"type":"string","nullable":true,"enum":["nl","en","de","fr","es","it","pt","pl","sv","da","en-GB","pt-PT"]},"entry_size":{"type":"string","nullable":true,"enum":["fewer","balanced","more"],"default":null},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","user_id","role","created_at","updated_at"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/members/{id}/internal-matters":{"get":{"tags":["admin"],"summary":"For a firm: One member's own internal matters (admin)","description":"The matter ids the member marked as their own internal work, in the order they were marked. 404 for no such member.\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The member's own list.","content":{"application/json":{"schema":{"type":"object","properties":{"matter_ids":{"type":"array","items":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"}}},"required":["matter_ids"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/members/{id}/internal-matters/{matter}":{"put":{"tags":["admin"],"summary":"For a firm: Put a matter on one member's own internal matters, or take it off (admin)","description":"A list holds at most 10 active matters: one more is 409 `urn:six-minute:problem:list-full`, and nothing is written. Marking a matter already on the list changes nothing, and taking one off is never refused. 404 for no such member, or for a matter this firm does not hold (unless it is on the list already and is being taken off).\n\nOperator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"matter","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"internal":{"type":"boolean"}},"required":["internal"]}}}},"responses":{"200":{"description":"The member's own list as it now stands.","content":{"application/json":{"schema":{"type":"object","properties":{"matter_ids":{"type":"array","items":{"type":"string","pattern":"^matter_[a-z0-9][a-z0-9_.:-]*$"}}},"required":["matter_ids"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/demo":{"put":{"tags":["admin"],"summary":"Turn a firm's demo mode on or off (operators only, demo deployments only)","description":"Sets `policy.demo`: the demo caps for its members' runs, and the demo seed, reset and remove. Refused (409) for a firm that is not internal.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"The flag as it now stands.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"},"demo":{"type":"boolean"}},"required":["id","name","demo"]}},"required":["tenant"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}},"get":{"tags":["admin"],"summary":"The firm's demo flag, the caps in force and the operator's own seeded days (operators only, demo deployments only)","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"responses":{"200":{"description":"Ids, days and counts.","content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"object","properties":{"id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string"},"demo":{"type":"boolean"}},"required":["id","name","demo"]},"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"caps":{"type":"object","properties":{"calls_per_day":{"type":"integer"},"cost_usd_per_day":{"type":"number"}},"required":["calls_per_day","cost_usd_per_day"]},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mode":{"type":"string","enum":["live","replay"]},"recordings":{"type":"integer"},"entries":{"type":"integer"}},"required":["day","mode","recordings","entries"]}}},"required":["tenant","member_id","caps","days"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/demo/seed":{"post":{"tags":["admin"],"summary":"Seed a scenario into the operator's own account on one day, or a range of working days (operators only, demo deployments only)","description":"Matches or creates the scenario's clients and matters, stores each interval's context as a device uploads it, on the operator's newest enrolled device, and wakes the interval runs. `replay` writes each interval's decision and keeps the scenario's entries for Generate to answer from with no model. `generate` then starts the day's Generate. A day in the future, past retention or holding captured time is refused; the same seed again answers its contexts as repeats. With `anchor` or `days` (or `scenarios`) it seeds the last `days` working days up to the anchor (today by default), each from the scenario of its weekday, in replay, and writes each day's entries as drafts over free time; a day holding another version of its scenario is removed first, and the same seed again writes nothing twice. `members` are invited as administrators; one already a member or already invited is reported and skipped.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scenario":{"type":"object","properties":{"format":{"type":"number","enum":[1]},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"description":{"type":"string","default":""},"weekday":{"type":"integer","minimum":1,"maximum":5},"time_zone":{"type":"string","minLength":1},"unit_minutes":{"type":"integer","minimum":1,"maximum":60},"clients":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"name":{"type":"string","minLength":1}},"required":["key","name"],"additionalProperties":false}},"matters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"client":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"number":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["key","client","number","name"],"additionalProperties":false}},"codes":{"type":"object","properties":{"set":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"type":"string","minLength":1},"minItems":1}]}},"required":["set"],"additionalProperties":false},"recordings":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"stop":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"intervals":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"observations":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"app":{"type":"string","minLength":1},"bundle":{"type":"string","minLength":1},"title":{"type":"string"},"typed":{"type":"string","default":""},"url":{"type":"string","nullable":true,"default":null},"files":{"type":"array","items":{"type":"string","minLength":1},"default":[]},"screen":{"type":"string"}},"required":["from","to","app","bundle","title"],"additionalProperties":false},"default":[]},"decision":{"type":"object","properties":{"summary":{"type":"string","minLength":1},"activity":{"type":"string","nullable":true,"minLength":1},"matter":{"type":"string","nullable":true,"pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"}},"required":["summary","activity","matter"],"additionalProperties":false}},"required":["from","to"],"additionalProperties":false},"minItems":1}},"required":["start","stop","intervals"],"additionalProperties":false},"minItems":1},"entries":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"matter":{"type":"string","nullable":true,"pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"narrative":{"type":"string"},"codes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"released":{"type":"boolean"}},"required":["from","to","matter","narrative"],"additionalProperties":false},"default":[]}},"required":["format","name","time_zone","unit_minutes","clients","matters","recordings"],"additionalProperties":false},"scenarios":{"type":"array","items":{"type":"object","properties":{"format":{"type":"number","enum":[1]},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"description":{"type":"string","default":""},"weekday":{"type":"integer","minimum":1,"maximum":5},"time_zone":{"type":"string","minLength":1},"unit_minutes":{"type":"integer","minimum":1,"maximum":60},"clients":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"name":{"type":"string","minLength":1}},"required":["key","name"],"additionalProperties":false}},"matters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"client":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"number":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["key","client","number","name"],"additionalProperties":false}},"codes":{"type":"object","properties":{"set":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"type":"string","minLength":1},"minItems":1}]}},"required":["set"],"additionalProperties":false},"recordings":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"stop":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"intervals":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"observations":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"app":{"type":"string","minLength":1},"bundle":{"type":"string","minLength":1},"title":{"type":"string"},"typed":{"type":"string","default":""},"url":{"type":"string","nullable":true,"default":null},"files":{"type":"array","items":{"type":"string","minLength":1},"default":[]},"screen":{"type":"string"}},"required":["from","to","app","bundle","title"],"additionalProperties":false},"default":[]},"decision":{"type":"object","properties":{"summary":{"type":"string","minLength":1},"activity":{"type":"string","nullable":true,"minLength":1},"matter":{"type":"string","nullable":true,"pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"}},"required":["summary","activity","matter"],"additionalProperties":false}},"required":["from","to"],"additionalProperties":false},"minItems":1}},"required":["start","stop","intervals"],"additionalProperties":false},"minItems":1},"entries":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"matter":{"type":"string","nullable":true,"pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"narrative":{"type":"string"},"codes":{"type":"object","additionalProperties":{"type":"string","minLength":1},"default":{}},"released":{"type":"boolean"}},"required":["from","to","matter","narrative"],"additionalProperties":false},"default":[]}},"required":["format","name","time_zone","unit_minutes","clients","matters","recordings"],"additionalProperties":false},"minItems":1,"maxItems":7},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"anchor":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":1,"maximum":31},"members":{"type":"array","items":{"type":"string","format":"email"},"maxItems":20,"default":[]},"replay":{"type":"boolean","default":false},"generate":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"What was seeded.","content":{"application/json":{"schema":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mode":{"type":"string","enum":["live","replay"]},"recordings":{"type":"integer"},"contexts":{"type":"object","properties":{"stored":{"type":"integer"},"repeated":{"type":"integer"}},"required":["stored","repeated"]},"created":{"type":"object","properties":{"clients":{"type":"integer"},"matters":{"type":"integer"}},"required":["clients","matters"]},"generate_run":{"type":"string","nullable":true},"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"range":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"mode":{"type":"string","enum":["live","replay"]},"recordings":{"type":"integer"},"contexts":{"type":"object","properties":{"stored":{"type":"integer"},"repeated":{"type":"integer"}},"required":["stored","repeated"]},"created":{"type":"object","properties":{"clients":{"type":"integer"},"matters":{"type":"integer"}},"required":["clients","matters"]},"generate_run":{"type":"string","nullable":true},"scenario":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$"},"replaced":{"type":"boolean"},"entries":{"type":"object","properties":{"written":{"type":"integer"},"released":{"type":"integer"},"released_owed":{"type":"integer"}},"required":["written","released_owed"]}},"required":["day","mode","recordings","contexts","created","generate_run","scenario","replaced","entries"]}},"members":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"outcome":{"type":"string","enum":["invited","member","invited_before"]}},"required":["email","outcome"]}}},"required":["day","mode","recordings","contexts","created","generate_run","member_id"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/demo/reset":{"post":{"tags":["admin"],"summary":"Drop a seeded day's Generate runs and drafts so Generate runs again (operators only, demo deployments only)","description":"Over the seeded day only: the Generate runs of its device, and the drafts over its spans, edited or not. Released entries, the activity column and captured time stay.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"generate":{"type":"boolean","default":false}},"required":["day"]}}}},"responses":{"200":{"description":"What was deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"runs_deleted":{"type":"integer"},"drafts_deleted":{"type":"integer"},"released_kept":{"type":"integer"},"generate_run":{"type":"string","nullable":true}},"required":["member_id","day","runs_deleted","drafts_deleted","released_kept","generate_run"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/admin/tenants/{tenant}/demo/remove":{"post":{"tags":["admin"],"summary":"Delete a seeded day entirely (operators only, demo deployments only)","description":"Every row of the seeded device's day: the drafts over it, its decided cells, runs, contexts and the seed's record. Captured time is never touched.","security":[{"bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"generate":{"type":"boolean","default":false}},"required":["day"]}}}},"responses":{"200":{"description":"What was deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"member_id":{"type":"string","pattern":"^member_[a-z0-9][a-z0-9_.:-]*$"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"recordings_deleted":{"type":"integer"},"entries_deleted":{"type":"integer"}},"required":["member_id","day","recordings_deleted","entries_deleted"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/email/send":{"post":{"tags":["auth"],"summary":"Mail a one-time sign-in code, unauthenticated","description":"Asks WorkOS Magic Auth to mail a six-digit code. The answer is the same whether or not the address belongs to a user, so it cannot be used to discover accounts. Rate limited per address and per caller.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"format":"email"}},"required":["email"]}}}},"responses":{"200":{"description":"A code is on its way if that address is one of ours.","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"boolean","enum":[true]},"expires_in":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["sent","expires_in"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/email/verify":{"post":{"tags":["auth"],"summary":"Exchange a one-time code for a session, unauthenticated","description":"Redeems the code with WorkOS and returns exactly what the device's own PKCE exchange returns, so the daemon stores it through one code path. A wrong code is a 422 `invalid-code`, an expired one a 422 `code-expired`, too many attempts a 429 `rate-limited`. A person in more than one organisation is signed in to their one firm, never the operators organisation; none is a 403 `no-firm` and more than one a 403 `choose-firm`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"format":"email"},"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["email","code"]}}}},"responses":{"200":{"description":"The session: the tokens and the user.","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","minLength":1},"refresh_token":{"type":"string","minLength":1},"organization_id":{"type":"string","nullable":true,"minLength":1,"default":null},"user":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string"},"first_name":{"type":"string","nullable":true,"default":null},"last_name":{"type":"string","nullable":true,"default":null}},"required":["id","email"]}},"required":["access_token","refresh_token","user"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/organization-selection":{"post":{"tags":["auth"],"summary":"Finish a sign-in that must choose an organisation, unauthenticated","description":"For a Google or Microsoft sign-in that WorkOS answered with `organization_selection_required`: the device forwards the pending token and the organisations offered, and the service selects the person's one firm with the client secret the device does not hold. The operators organisation is never selected. Answers the session the email verify route answers; no firm is a 403 `no-firm`, more than one a 403 `choose-firm`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pending_authentication_token":{"type":"string","minLength":1,"maxLength":1024},"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128}},"required":["id"]},"minItems":1,"maxItems":100}},"required":["pending_authentication_token","organizations"]}}}},"responses":{"200":{"description":"The session: the tokens and the user.","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","minLength":1},"refresh_token":{"type":"string","minLength":1},"organization_id":{"type":"string","nullable":true,"minLength":1,"default":null},"user":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string"},"first_name":{"type":"string","nullable":true,"default":null},"last_name":{"type":"string","nullable":true,"default":null}},"required":["id","email"]}},"required":["access_token","refresh_token","user"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/sso":{"post":{"tags":["auth"],"summary":"A firm's single sign-on for an address, unauthenticated","description":"Our own sign-in page asks this for the address a person typed, and sends them straight to their firm's identity provider with the connection it names, so WorkOS's hosted page never shows. Null where the domain has no active connection. Only the domain is looked up; rate limited per caller.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"format":"email"}},"required":["email"]}}}},"responses":{"200":{"description":"The connection, or null.","content":{"application/json":{"schema":{"type":"object","properties":{"connection_id":{"type":"string","nullable":true,"minLength":1}},"required":["connection_id"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/page/email/verify":{"post":{"tags":["auth"],"summary":"The page's email sign-in: the code for a session whose refresh token stays in an http-only cookie","description":"The email verify for a page (the daemon keeps /v1/auth/email/verify). Requires X-Six-Minute-Page: 1 from an allowed Origin. Same refusals as the daemon's route.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"format":"email"},"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["email","code"]}}}},"responses":{"200":{"description":"The session without its refresh token, which is in the http-only cookie.","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","minLength":1},"organization_id":{"type":"string","nullable":true,"minLength":1,"default":null},"user":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string"},"first_name":{"type":"string","nullable":true,"default":null},"last_name":{"type":"string","nullable":true,"default":null}},"required":["id","email"]}},"required":["access_token","user"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/page/organization-selection":{"post":{"tags":["auth"],"summary":"The page's choice of firm, its refresh token kept in an http-only cookie","description":"The organisation selection for a page. Requires X-Six-Minute-Page: 1 from an allowed Origin.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pending_authentication_token":{"type":"string","minLength":1,"maxLength":1024},"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128}},"required":["id"]},"minItems":1,"maxItems":100}},"required":["pending_authentication_token","organizations"]}}}},"responses":{"200":{"description":"The session without its refresh token, which is in the http-only cookie.","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","minLength":1},"organization_id":{"type":"string","nullable":true,"minLength":1,"default":null},"user":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string"},"first_name":{"type":"string","nullable":true,"default":null},"last_name":{"type":"string","nullable":true,"default":null}},"required":["id","email"]}},"required":["access_token","user"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/page/refresh":{"post":{"tags":["auth"],"summary":"The page's session, rotated from its http-only cookie","description":"Spends the refresh token in the cookie once and sets the rotated one. Requires X-Six-Minute-Page: 1 from an allowed Origin; no cookie or a refused token is a 401.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","nullable":true,"minLength":1,"default":null}}}}}},"responses":{"200":{"description":"The session without its refresh token, which is in the http-only cookie.","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","minLength":1},"organization_id":{"type":"string","nullable":true,"minLength":1,"default":null},"user":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string"},"first_name":{"type":"string","nullable":true,"default":null},"last_name":{"type":"string","nullable":true,"default":null}},"required":["id","email"]}},"required":["access_token","user"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/page/session-handoff":{"post":{"tags":["auth"],"summary":"The page redeems the session hand-off's one-time code for its own session","description":"The code the daemon was answered at POST /v1/devices/session-handoff, handed over by the shell. Requires X-Six-Minute-Page: 1 from an allowed Origin, and is limited per caller. Works once per device, within its minute, while the device still holds the credential the exchange issued and is not revoked; anything else is 401. The refresh token is kept in the http-only cookie and is not in the answer, except for a page in storage mode (`storage: true`) on an environment with no custom authentication domain; asked elsewhere that is 403. Deleted at phase 7.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","maxLength":4096,"pattern":"^smh_[A-Za-z0-9_-]+$"},"storage":{"type":"boolean"}},"required":["code"]}}}},"responses":{"200":{"description":"The session; the refresh token is in the http-only cookie, or here for a page in storage mode.","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","minLength":1},"organization_id":{"type":"string","nullable":true,"minLength":1,"default":null},"user":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string"},"first_name":{"type":"string","nullable":true,"default":null},"last_name":{"type":"string","nullable":true,"default":null}},"required":["id","email"]},"refresh_token":{"type":"string","minLength":1}},"required":["access_token","user"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/page/sign-out":{"post":{"tags":["auth"],"summary":"End the page's session: the cookie is cleared","description":"Requires X-Six-Minute-Page: 1 from an allowed Origin.","responses":{"204":{"description":"Cleared."},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/authorize":{"post":{"tags":["auth"],"summary":"Our sign-in page proves the person and asks for an app's one-time code, unauthenticated","description":"Requires `X-Six-Minute-Page: 1` from an Origin this service serves (403 otherwise). Proves the person by the emailed code (`method: email`, with the email verify route's limits and refusals) or by WorkOS's code with the page's own verifier (`method: workos`, a wrong verifier is 422 `invalid-code`). Answers an `sma_` code that works once, for 60 seconds, at `POST /v1/auth/token` with the verifier of `code_challenge` for `client`. A person nobody invited is 403 `no-firm`; one in several firms gets a code all the same, and the token endpoint answers the choice. Rate limited per caller.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"method":{"type":"string","enum":["email"]},"client":{"type":"string","enum":["desktop","phone"]},"code_challenge":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"},"email":{"type":"string","minLength":3,"maxLength":320},"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["method","client","code_challenge","email","code"]},{"type":"object","properties":{"method":{"type":"string","enum":["workos"]},"client":{"type":"string","enum":["desktop","phone"]},"code_challenge":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"},"code":{"type":"string","minLength":1,"maxLength":512},"code_verifier":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"}},"required":["method","client","code_challenge","code","code_verifier"]}]}}}},"responses":{"200":{"description":"The one-time code.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"}},"required":["code"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/auth/token":{"post":{"tags":["auth"],"summary":"An app redeems its one-time code for what the register gives it, unauthenticated","description":"`authorization_code`: the `sma_` code with the verifier of its challenge, for the client it was issued to. Every code works once whatever the outcome; a used, expired, unknown or other client's code, or a wrong verifier, is 401. A person in several firms is answered `choose_firm` with an `smp_` handle bound to the client, challenge and device, alive ten minutes, which `organization_selection` redeems with the same verifier and device and one of the firms offered. `workos_code`, the desktop only: WorkOS's code from the browser leg with the window's verifier. The device names its platform, which must be one of the client's (400). The desktop requires `X-Six-Minute-Page: 1` from an allowed Origin and is answered a session, its refresh token in the page's http-only cookie; the phone refuses any request carrying an Origin (403) and is answered its device credential only. A sign-in is provisioned on the server as `POST /v1/me/provision` does. A phone's device id of another person is 409; a desktop's, or a revoked one, leaves the session tied to no device, for the engine's enrolment to register the machine. Rate limited per caller.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"grant_type":{"type":"string","enum":["authorization_code"]},"client":{"type":"string","enum":["desktop","phone"]},"code":{"type":"string","maxLength":200},"code_verifier":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"},"device":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1,"maxLength":200},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]}},"required":["id","name","platform"]}},"required":["grant_type","client","code","code_verifier","device"]},{"type":"object","properties":{"grant_type":{"type":"string","enum":["organization_selection"]},"client":{"type":"string","enum":["desktop","phone"]},"pending":{"type":"string","maxLength":200},"code_verifier":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"},"organization_id":{"type":"string","minLength":1,"maxLength":128},"device":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1,"maxLength":200},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]}},"required":["id","name","platform"]}},"required":["grant_type","client","pending","code_verifier","organization_id","device"]},{"type":"object","properties":{"grant_type":{"type":"string","enum":["workos_code"]},"client":{"type":"string","enum":["desktop"]},"code":{"type":"string","minLength":1,"maxLength":512},"code_verifier":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"},"device":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1,"maxLength":200},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]}},"required":["id","name","platform"]}},"required":["grant_type","client","code","code_verifier","device"]}]}}}},"responses":{"200":{"description":"The client's grant, or the firms to choose from.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"grant":{"type":"string","enum":["session"]},"session":{"type":"object","properties":{"access_token":{"type":"string","minLength":1},"organization_id":{"type":"string","nullable":true,"minLength":1,"default":null},"user":{"type":"object","properties":{"id":{"type":"string","minLength":1},"email":{"type":"string"},"first_name":{"type":"string","nullable":true,"default":null},"last_name":{"type":"string","nullable":true,"default":null}},"required":["id","email"]}},"required":["access_token","user"]}},"required":["grant","session"]},{"type":"object","properties":{"grant":{"type":"string","enum":["credential"]},"enrolled":{"type":"object","properties":{"credential":{"type":"string"},"device":{"type":"object","properties":{"id":{"type":"string","pattern":"^device_[a-z0-9][a-z0-9_.:-]*$"},"user_id":{"type":"string","pattern":"^user_[a-z0-9][a-z0-9_.:-]*$"},"name":{"type":"string","minLength":1},"platform":{"type":"string","enum":["macos","windows","ios","android","web"]},"created_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","nullable":true,"format":"date-time","default":null},"revoked_at":{"type":"string","nullable":true,"format":"date-time","default":null}},"required":["id","user_id","name","platform","created_at"]},"account":{"type":"string","minLength":1},"tenant_id":{"type":"string","pattern":"^tenant_[a-z0-9][a-z0-9_.:-]*$"}},"required":["credential","device"]}},"required":["grant","enrolled"]},{"type":"object","properties":{"choose_firm":{"type":"object","properties":{"pending":{"type":"string"},"firms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"type":"string"}},"required":["id","name"]},"minItems":2}},"required":["pending","firms"]}},"required":["choose_firm"]}]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"403":{"description":"The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"409":{"description":"The id or the email already belongs to something else.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"422":{"description":"The request is well-formed but cannot be carried out as it stands.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/newsletter/subscribe":{"post":{"tags":["newsletter"],"summary":"Ask for the confirmation mail, unauthenticated","description":"Records the intent to subscribe and mails a confirmation link. The answer is the same whether the address is new, already waiting or already confirmed, so it cannot be used to discover who is on the list. Called by the website with the shared header; rate limited per address and per caller.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320,"format":"email"},"source":{"type":"string","pattern":"^(footer|subscribed|update:[a-z0-9-]+)$"},"consent_text":{"type":"string","minLength":1,"maxLength":300}},"required":["email","source","consent_text"]}}}},"responses":{"200":{"description":"The confirmation mail is on its way, if one was owed.","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"boolean","enum":[true]}},"required":["sent"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"502":{"description":"An upstream this service depends on failed or answered nonsense.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/newsletter/confirm":{"post":{"tags":["newsletter"],"summary":"Spend the token from the confirmation mail, unauthenticated","description":"Called by the site's `/subscribed` page with the token from the link. Confirming twice is the same answer; an unknown token is a 404. On success the address is mirrored into the Resend segment, and a mirror that fails does not fail the confirmation: the table is the truth.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["token"]}}}},"responses":{"200":{"description":"The address is confirmed.","content":{"application/json":{"schema":{"type":"object","properties":{"confirmed":{"type":"boolean","enum":[true]}},"required":["confirmed"]}}}},"400":{"description":"The body, query or path did not validate; `errors` lists the fields.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"404":{"description":"No such row for this tenant.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"429":{"description":"Too many requests; `Retry-After` says how long to wait.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}},"/v1/newsletter/webhooks/resend":{"post":{"tags":["newsletter"],"summary":"Resend's contact events, verified by signature","description":"Resend signs with the Standard Webhooks headers (`svix-id`, `svix-timestamp`, `svix-signature`) over the raw body, which is why no body schema is declared here. An unsubscribe or a deletion marks the row; every other event is acknowledged and ignored.","responses":{"200":{"description":"The event was accepted, acted on or not.","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean","enum":[true]}},"required":["received"]}}}},"401":{"description":"No bearer token, or one that does not verify or has expired.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}},"503":{"description":"A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1},"code":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"rule":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["path","message"]}}},"required":["type","title","status"]}}}}}}}}}