{"openapi":"3.1.0","info":{"title":"Anchor API","description":"\nAnchor is a **multi-vertical voice-AI interview platform**. Tenants drive studies,\nsessions, and exports programmatically through this API.\n\n## Authentication\n\nAll customer endpoints require exactly one of:\n\n| Scheme | Header | Notes |\n|---|---|---|\n| **ApiKeyAuth** | `X-API-Key: ak_…` | Primary. Use for all server-to-server integrations. |\n| **ClerkBearer** | `Authorization: Bearer <jwt>` | Researcher console UI only — do not embed in integrations. |\n\nObtain an API key via the Anchor console or by provisioning a tenant through the admin\nAPI. Keys are prefixed `ak_` and are SHA-256 hashed before storage — store the raw key\nat issuance; it cannot be recovered.\n\n## Rate limits\n\n60 requests per minute per API key or Clerk token (sliding window, Redis-backed).\nPublic unauthenticated endpoints (participant join, consent): 20 req/min per IP.\nExceeded limits return **429 Too Many Requests** with `{\"detail\": \"Rate limit exceeded\"}`.\n\n## Versioning (`/v1`)\n\nWithin `/v1`, Anchor may add new optional request fields, new response fields, new\nendpoints, and new enumeration values without notice. Removing or renaming fields,\nchanging required fields, or removing endpoints constitutes a breaking change and will\nbe announced with a new major version path prefix.\n\n## Error format\n\nAll error responses return `{\"detail\": \"<human-readable message>\"}`.\nCommon status codes: `401` invalid/missing credential, `402` monthly quota exceeded,\n`403` forbidden, `404` resource not found or archived, `409` conflicting state,\n`410` expired/used link, `413` payload too large, `415` unsupported media type,\n`422` validation error, `429` rate limit, `503` service unavailable\n(misconfigured dependency).\n","contact":{"name":"Anchor Support","email":"support@anchor.dev"},"license":{"name":"Proprietary"},"version":"0.1.0"},"servers":[{"url":"http://localhost:8000","description":"Current"}],"paths":{"/v1/health/live":{"get":{"tags":["health"],"summary":"Liveness","operationId":"liveness_v1_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LivenessResponse"}}}}}}},"/v1/version":{"get":{"tags":["health"],"summary":"Which release is serving","description":"The package version and the deployed commit. Unauthenticated and touches no dependency: the release smoke test compares it with the release record. The same commit is already public in the UI bundle, so this discloses nothing new.","operationId":"version_v1_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseVersionResponse"}}}}}}},"/v1/health/ready":{"get":{"tags":["health"],"summary":"Readiness","operationId":"readiness_v1_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadinessResponse"}}}},"503":{"description":"A required dependency is down","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadinessResponse"}}}}}}},"/v1/health":{"get":{"tags":["health"],"summary":"Health Check","operationId":"health_check_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"503":{"description":"The database is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/telemetry/client-errors":{"post":{"tags":["telemetry"],"summary":"Report a browser error","description":"Records that a page failed, for error tracking. Accepts only the error's kind, constructor name, page template, release and digest: no message, stack or page content. Writes nothing and always answers 204.","operationId":"report_client_error_v1_telemetry_client_errors_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientErrorReport"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/audit":{"get":{"tags":["audit"],"summary":"Read the audit trail","description":"Newest first, within a bounded window. Filter by action, actor, outcome, study or capability. The response states the window it searched, so an empty page is never read as 'nothing happened'.","operationId":"list_audit_entries_v1_audit_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Defaults to 30 days ago.","title":"Since"},"description":"Defaults to 30 days ago."},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Defaults to now.","title":"Until"},"description":"Defaults to now."},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Action"}},{"name":"actor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Actor Id"}},{"name":"capability","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Capability"}},{"name":"study_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Study Id"}},{"name":"outcome","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Outcome"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor from a previous page's `next_cursor`.","title":"Before Id"},"description":"Cursor from a previous page's `next_cursor`."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditPage"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Requires the audit.view capability"},"422":{"description":"The window ends before it starts, or is too wide"}}}},"/v1/audit/actions":{"get":{"tags":["audit"],"summary":"Which actions appear in this workspace's trail","description":"For populating a filter without guessing at action names.","operationId":"list_actions_v1_audit_actions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response List Actions V1 Audit Actions Get"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Requires the audit.view capability"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/safeguarding/readiness":{"get":{"tags":["safeguarding"],"summary":"Could this deployment actually handle a disclosure?","description":"Every part of the safeguarding path can be healthy while the path as a whole notifies nobody: no provider configured, or a dispatcher that never started, or studies fielding with no approved wording behind them. None of that raises an error — it is silent until somebody discloses. This is the same check the API logs at startup.","operationId":"readiness_v1_safeguarding_readiness_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Readiness V1 Safeguarding Readiness Get"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Requires a safeguarding capability"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/safeguarding/resolution-vocabulary":{"get":{"tags":["safeguarding"],"summary":"The reasons and outcomes a case may be closed with","description":"Enumerated so resolutions are comparable across studies, and so the field never becomes somewhere to paste what a participant said.","operationId":"resolution_vocabulary_v1_safeguarding_resolution_vocabulary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolutionVocabulary"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Requires a safeguarding capability"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/safeguarding/cases":{"get":{"tags":["safeguarding"],"summary":"The queue","description":"Open cases first, oldest first — the one that has been waiting longest is the one that matters most. Carries no participant wording.","operationId":"list_cases_v1_safeguarding_cases_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","pattern":"^(open|resolved|all)$","default":"open","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CaseSummary"},"title":"Response List Cases V1 Safeguarding Cases Get"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Requires a safeguarding capability"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/safeguarding/cases/{case_id}":{"get":{"tags":["safeguarding"],"summary":"One case, without what the participant said","operationId":"get_case_v1_safeguarding_cases__case_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDetail"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Requires a safeguarding capability"},"404":{"description":"Case not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/safeguarding/cases/{case_id}/assign":{"post":{"tags":["safeguarding"],"summary":"Take a case, or give it to a colleague","operationId":"assign_case_v1_safeguarding_cases__case_id__assign_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseAssignRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSummary"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Requires a safeguarding capability"},"409":{"description":"Changed by someone else, already resolved, or an unusable assignee"},"422":{"description":"That person is not a member of this workspace"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/safeguarding/cases/{case_id}/resolve":{"post":{"tags":["safeguarding"],"summary":"Close a case","description":"Needs an enumerated reason and outcome, recent re-verification, and every outstanding obligation discharged first. Closing a case does **not** restart an interview the participant stopped.","operationId":"resolve_case_v1_safeguarding_cases__case_id__resolve_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResolveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseSummary"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Re-verification required, or not a person"},"409":{"description":"Changed by someone else, or obligations outstanding"},"422":{"description":"Unknown reason or outcome, or an unusable reference"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/safeguarding/cases/{case_id}/retry-delivery":{"post":{"tags":["safeguarding"],"summary":"Send a failed escalation again","operationId":"retry_delivery_v1_safeguarding_cases__case_id__retry_delivery_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseRetryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryAttempt"},"title":"Response Retry Delivery V1 Safeguarding Cases  Case Id  Retry Delivery Post"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Requires a safeguarding capability"},"409":{"description":"Nothing to retry, or changed by someone else"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/safeguarding/cases/{case_id}/session-link":{"get":{"tags":["safeguarding"],"summary":"Open the interview behind a case","description":"Deliberately a separate call with a separate capability: triaging a case does not entitle anyone to read what the participant said. Taking this route is audited.","operationId":"session_link_v1_safeguarding_cases__case_id__session_link_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Session Link V1 Safeguarding Cases  Case Id  Session Link Get"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Reading the interview needs study.view"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invitations/{token}/sign-up-ticket":{"post":{"tags":["invitations"],"summary":"A Clerk sign-up link for the address a workspace invitation was sent to","description":"The raw invitation token is never sent to Clerk; the page keeps it.","operationId":"sign_up_ticket_v1_invitations__token__sign_up_ticket_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Sign Up Ticket V1 Invitations  Token  Sign Up Ticket Post"}}}},"404":{"description":"Unknown, expired or already used"},"503":{"description":"Clerk is not configured or could not be reached"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/leads":{"post":{"tags":["leads"],"summary":"Send a demo request or contact message","operationId":"create_lead_v1_leads_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadCreate"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadReceived"}}}},"403":{"description":"The Turnstile check failed"},"422":{"description":"Invalid or temporary email address"},"429":{"description":"Too many requests from this address"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/tenant/cost-controls":{"get":{"tags":["cost-controls"],"summary":"This workspace's AI spend, limit and kill switch","operationId":"tenant_status_v1_tenant_cost_controls_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Tenant Status V1 Tenant Cost Controls Get"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/tenant/cost-controls/kill":{"post":{"tags":["cost-controls"],"summary":"Pause all paid AI work for this workspace","operationId":"tenant_kill_v1_tenant_cost_controls_kill_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantKillRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Tenant Kill V1 Tenant Cost Controls Kill Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/tenant/cost-controls/{control_id}/revoke":{"post":{"tags":["cost-controls"],"summary":"Lift a pause this workspace set","operationId":"tenant_revoke_v1_tenant_cost_controls__control_id__revoke_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"control_id","in":"path","required":true,"schema":{"type":"string","title":"Control Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tenant Revoke V1 Tenant Cost Controls  Control Id  Revoke Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/keys":{"get":{"tags":["keys"],"summary":"List API keys","description":"Metadata for this workspace's live API keys. Secrets are never returned — a key's value is shown once, when it is created.","operationId":"list_keys_v1_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/KeySummary"},"type":"array","title":"Response List Keys V1 Keys Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]},"post":{"tags":["keys"],"summary":"Create an API key","description":"Issue a key for server-to-server access. The secret is returned exactly once — store it now, it cannot be recovered.","operationId":"create_key_v1_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/keys/{key_id}":{"delete":{"tags":["keys"],"summary":"Revoke an API key","operationId":"revoke_key_v1_keys__key_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Key not found"},"409":{"description":"This key backs console sign-in and cannot be revoked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/keys/rotate":{"post":{"tags":["keys"],"summary":"Rotate API key","description":"Revoke the current API key and issue a new one. The new key is returned exactly once — store it immediately. The old key stops working immediately.","operationId":"rotate_key_v1_keys_rotate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/tenant/llm-config":{"get":{"tags":["tenant"],"summary":"Get LLM config","operationId":"get_llm_config_v1_tenant_llm_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantLLMConfigResponse"}}}},"401":{"description":"Missing or invalid credential"},"503":{"description":"Dependency misconfigured"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]},"put":{"tags":["tenant"],"summary":"Set LLM config","description":"Configure the LLM provider, model, and API key for extraction and AI interviewing.","operationId":"set_llm_config_v1_tenant_llm_config_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantLLMConfigRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantLLMConfigResponse"}}}},"401":{"description":"Missing or invalid credential"},"503":{"description":"Dependency misconfigured"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/tenant/llm/models":{"get":{"tags":["tenant"],"summary":"List selectable models","description":"The catalog of selectable models (gated by which provider keys are configured) plus the tenant's custom models, and the tenant's current default.","operationId":"list_models_v1_tenant_llm_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableModelsResponse"}}}},"401":{"description":"Missing or invalid credential"},"503":{"description":"Dependency misconfigured"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/tenant/stt-config":{"get":{"tags":["tenant"],"summary":"Get STT config","operationId":"get_stt_config_v1_tenant_stt_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantSTTConfigResponse"}}}},"401":{"description":"Missing or invalid credential"},"503":{"description":"Dependency misconfigured"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]},"put":{"tags":["tenant"],"summary":"Set STT config","description":"Configure the speech-to-text provider, model, language, and custom keyterms (up to 50).","operationId":"set_stt_config_v1_tenant_stt_config_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantSTTConfigRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantSTTConfigResponse"}}}},"401":{"description":"Missing or invalid credential"},"503":{"description":"Dependency misconfigured"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/tenant/tts-config":{"get":{"tags":["tenant"],"summary":"Get TTS config","operationId":"get_tts_config_v1_tenant_tts_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantTTSConfigResponse"}}}},"401":{"description":"Missing or invalid credential"},"503":{"description":"Dependency misconfigured"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]},"put":{"tags":["tenant"],"summary":"Set TTS config","description":"Configure the text-to-speech provider and model for the AI interviewer voice.","operationId":"set_tts_config_v1_tenant_tts_config_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantTTSConfigRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantTTSConfigResponse"}}}},"401":{"description":"Missing or invalid credential"},"503":{"description":"Dependency misconfigured"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/tenant/usage":{"get":{"tags":["tenant"],"summary":"Get usage summary","description":"Return aggregated usage metrics (STT seconds, TTS characters, LLM tokens, session count) for the tenant, optionally filtered by date range.","operationId":"get_usage_v1_tenant_usage_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummaryResponse"}}}},"401":{"description":"Missing or invalid credential"},"503":{"description":"Dependency misconfigured"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenant/quota":{"get":{"tags":["tenant"],"summary":"Get quota status","description":"Return the tenant's monthly spend limits and current-month consumption. Null limits mean unlimited. Exhausted quotas cause spend endpoints (session create, analysis, guide generation, extraction runs) to return `402`.","operationId":"get_quota_v1_tenant_quota_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotaStatusResponse"}}}},"401":{"description":"Missing or invalid credential"},"503":{"description":"Dependency misconfigured"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/personas/voices":{"get":{"tags":["personas"],"summary":"List selectable interviewer voices","description":"The voices a persona can use, limited to providers this deployment has credentials for. `providers_configured` is false when no TTS provider is set up — the catalog is still returned so the picker renders, but nothing will play.","operationId":"list_voices_v1_personas_voices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceCatalogResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/personas/languages":{"get":{"tags":["personas"],"summary":"Languages the configured providers can interview in","description":"No language list is built in. What speech recognition, the interviewer model and speech synthesis support is declared by the operator (`ANCHOR_LANGUAGES_STT`, `_LLM`, `_TTS`); `null` means undeclared. `options` are the languages every declared voice provider supports. Each carries its safety coverage: `full` (English, deterministic detection), `partial` (model-based classifier), `none` (cannot field).","operationId":"list_languages_v1_personas_languages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Languages V1 Personas Languages Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/personas/preview":{"post":{"tags":["personas"],"summary":"Hear a voice before assigning it","description":"Synthesise a sample line so a researcher can audition a voice. Nobody can choose an interviewer from a list of voice ids.","operationId":"preview_voice_v1_personas_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoicePreviewRequest"}}},"required":true},"responses":{"200":{"description":"Sample audio","content":{"application/json":{"schema":{}},"audio/mpeg":{}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Unknown voice"},"503":{"description":"No TTS provider configured"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/personas":{"get":{"tags":["personas"],"summary":"List personas","operationId":"list_personas_v1_personas_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PersonaResponse"},"type":"array","title":"Response List Personas V1 Personas Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]},"post":{"tags":["personas"],"summary":"Create persona","operationId":"create_persona_v1_personas_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/personas/{persona_id}":{"get":{"tags":["personas"],"summary":"Get persona","operationId":"get_persona_v1_personas__persona_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Persona not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["personas"],"summary":"Update persona","operationId":"update_persona_v1_personas__persona_id__put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Persona not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["personas"],"summary":"Delete persona","operationId":"delete_persona_v1_personas__persona_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Persona not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rubrics":{"get":{"tags":["rubrics"],"summary":"List rubrics","operationId":"list_rubrics_v1_rubrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RubricResponse"},"type":"array","title":"Response List Rubrics V1 Rubrics Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]},"post":{"tags":["rubrics"],"summary":"Create rubric","description":"Create a new interview rubric with sections, topics, and probes.","operationId":"create_rubric_v1_rubrics_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RubricCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RubricResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rubrics/templates":{"get":{"tags":["rubrics"],"summary":"List system templates","description":"Return Anchor-maintained rubric templates available to all tenants.","operationId":"list_templates_v1_rubrics_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RubricResponse"},"type":"array","title":"Response List Templates V1 Rubrics Templates Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rubrics/templates/copy":{"post":{"tags":["rubrics"],"summary":"Copy system template","description":"Copy a system template into the tenant's own rubric library. Returns `404` if template not found.","operationId":"copy_template_shortcut_v1_rubrics_templates_copy_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RubricCopyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RubricResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Template not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rubrics/{rubric_id}":{"get":{"tags":["rubrics"],"summary":"Get rubric","operationId":"get_rubric_v1_rubrics__rubric_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RubricResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Rubric not found or archived"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["rubrics"],"summary":"Update rubric","description":"Update a rubric. Creates a new version (immutable versioning); the old version is preserved for sessions that reference it.","operationId":"update_rubric_v1_rubrics__rubric_id__put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RubricUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RubricResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Rubric not found or archived"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["rubrics"],"summary":"Archive rubric","operationId":"delete_rubric_v1_rubrics__rubric_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Rubric not found or already archived"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rubrics/{rubric_id}/copy":{"post":{"tags":["rubrics"],"summary":"Copy rubric","description":"Duplicate any rubric (including templates) into the tenant's library. Useful for creating customised variants.","operationId":"copy_template_v1_rubrics__rubric_id__copy_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RubricCopyRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RubricResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Source rubric not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/projects":{"get":{"tags":["projects"],"summary":"List projects","operationId":"list_projects_v1_projects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProjectResponse"},"type":"array","title":"Response List Projects V1 Projects Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]},"post":{"tags":["projects"],"summary":"Create project","operationId":"create_project_v1_projects_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Rubric not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/projects/{project_id}":{"get":{"tags":["projects"],"summary":"Get project","operationId":"get_project_v1_projects__project_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectDetailResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Project not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["projects"],"summary":"Update project","operationId":"update_project_v1_projects__project_id__put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Project or rubric not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["projects"],"summary":"Archive project","operationId":"delete_project_v1_projects__project_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Project not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/projects/{project_id}/sessions":{"get":{"tags":["projects"],"summary":"List project sessions","operationId":"list_project_sessions_v1_projects__project_id__sessions_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionResponse"},"title":"Response List Project Sessions V1 Projects  Project Id  Sessions Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Project not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sessions/{session_id}/recording":{"get":{"tags":["recordings"],"summary":"Get the interview recording's state","description":"State, size, duration and capture start of one session's recording. Carries no URL: ask `/playback` or `/download` for one. `404` when the session was not recorded or belongs to another workspace.","operationId":"get_recording_v1_sessions__session_id__recording_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingOut"}}}},"404":{"description":"Session not found, or not recorded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["recordings"],"summary":"Delete the interview recording","description":"Revokes access at once, then deletes the object and verifies it is gone. If the object store is unreachable the recording stays `deleting` and is retried; it is never reported deleted while bytes remain. Idempotent. Copies already downloaded are not affected.","operationId":"delete_recording_v1_sessions__session_id__recording_delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/sessions/{session_id}/recording/playback":{"get":{"tags":["recordings"],"summary":"Issue a short-lived playback URL","description":"Authorises the caller, audits the issuance and returns a URL valid for at most five minutes that serves byte ranges for seeking. Ask again for a new one; each is re-authorised. `409` unless the recording is `available`; `503` when the object store cannot be reached.","operationId":"playback_url_v1_sessions__session_id__recording_playback_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingUrlOut"}}}},"404":{"description":"Not found"},"409":{"description":"Not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sessions/{session_id}/recording/download":{"get":{"tags":["recordings"],"summary":"Issue a short-lived download URL","description":"Needs `recording.download`. The file is served as an attachment. A downloaded copy cannot be revoked or deleted by Anchor afterwards.","operationId":"download_url_v1_sessions__session_id__recording_download_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingUrlOut"}}}},"403":{"description":"Missing recording.download"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sessions":{"post":{"tags":["sessions"],"summary":"Create session","description":"Create a new voice interview session. Specify `mode=live` for real-time AI interviewing (requires a participant link) or `mode=offline` for batch processing of uploaded transcripts.\n\n**Errors:** `404` if `project_id` or `rubric_id` does not exist or is archived.","operationId":"create_session_v1_sessions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"402":{"description":"Monthly session quota exceeded"},"404":{"description":"Project or rubric not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/sessions/batch":{"post":{"tags":["sessions"],"summary":"Create a batch of sessions with participant links","description":"Field a whole round of interviews in one call. Give `participants` to name each person yourself, or `count` for that many auto-numbered slots. Each session gets its own single-use participant link.\n\nEvery session in the batch counts against the monthly session quota; the batch is refused as a whole if it would exceed it.","operationId":"create_session_batch_v1_sessions_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionBatchCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionBatchResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"402":{"description":"Monthly session quota exceeded"},"404":{"description":"Rubric not found"},"422":{"description":"Neither participants nor count was supplied"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/sessions/validate-token":{"get":{"tags":["sessions"],"summary":"Validate participant token","description":"Check whether a participant link token is valid and return session metadata needed to bootstrap the participant UI. Does not consume the token. Returns `valid=false` for expired or already-used tokens.","operationId":"validate_session_token_v1_sessions_validate_token_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTokenValidationResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sessions/{session_id}":{"get":{"tags":["sessions"],"summary":"Get session","description":"Retrieve a session with document, run, and probe counts. Returns `404` if archived.","operationId":"get_session_v1_sessions__session_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionDetailResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Session not found or archived"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["sessions"],"summary":"Archive session","description":"Soft-delete (archive) a session. Archived sessions are excluded from list results.","operationId":"delete_session_v1_sessions__session_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Session not found or already archived"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/sessions/{session_id}/link":{"post":{"tags":["sessions"],"summary":"Create participant link","description":"Generate a single-use participant link for a `live` session. The link is valid for `expires_in_hours` hours and may only be used once; subsequent joins within the reconnect window (default 30 min) are permitted while the session is still live.\n\n**Errors:** `400` if session mode is not `live`, `404` if session not found.","operationId":"create_session_link_v1_sessions__session_id__link_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionLinkCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionLinkResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"400":{"description":"Session is not in live mode"},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/sessions/{session_id}/complete":{"post":{"tags":["sessions"],"summary":"Complete session","description":"Mark a session as completed and trigger post-session vertical pipelines (analysis, exports, compliance). Idempotent: only the first call on a live/active session triggers the pipelines; repeat calls return the current status. The pipeline runs asynchronously; poll the session or subscribe to `session.completed` webhooks for status.","operationId":"complete_session_v1_sessions__session_id__complete_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Complete Session V1 Sessions  Session Id  Complete Post"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Session not found or archived"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/me":{"get":{"tags":["identity"],"summary":"Who am I","operationId":"get_me_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"Missing or invalid credential"}},"security":[{"ClerkBearer":[]}]}},"/v1/me/workspaces":{"get":{"tags":["identity"],"summary":"Workspaces I may enter","operationId":"list_my_workspaces_v1_me_workspaces_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkspaceSummary"},"type":"array","title":"Response List My Workspaces V1 Me Workspaces Get"}}}},"401":{"description":"Missing or invalid credential"}},"security":[{"ClerkBearer":[]}]}},"/v1/me/preferred-workspace":{"put":{"tags":["identity"],"summary":"Remember a workspace for next time","description":"A convenience for the client only. The backend always verifies membership on each request; a stored preference confers no access.","operationId":"set_preferred_workspace_v1_me_preferred_workspace_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferredWorkspaceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Not a member of that workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ClerkBearer":[]}]}},"/v1/me/invitations/{token}":{"get":{"tags":["identity"],"summary":"Preview an invitation","operationId":"preview_invitation_v1_me_invitations__token__get","security":[{"ClerkBearer":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPreview"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Unknown, expired or already used"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/invitations/accept":{"post":{"tags":["identity"],"summary":"Accept an invitation","description":"Joins the workspace on exactly the terms offered. The recipient cannot change the workspace, role or capabilities the invitation carries.","operationId":"accept_invitation_v1_me_invitations_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Invitation is for a different, verified email"},"404":{"description":"Unknown, expired or already used"},"409":{"description":"Already a member"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ClerkBearer":[]}]}},"/v1/me/features":{"get":{"tags":["features","identity"],"summary":"Which features this workspace has switched on","description":"Any member may ask: the console needs it to decide what to render.","operationId":"my_features_v1_me_features_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagsOut"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/tenant/features/{flag}/readiness":{"get":{"tags":["features"],"summary":"What is still missing before a feature can be switched on","description":"Needs `tenant.manage`. The same reasons switching on would be refused with, so a screen can show them before anybody presses the switch.","operationId":"feature_readiness_v1_tenant_features__flag__readiness_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"flag","in":"path","required":true,"schema":{"type":"string","title":"Flag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureReadinessOut"}}}},"404":{"description":"No loaded vertical defines this flag"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenant/features/{flag}":{"put":{"tags":["features"],"summary":"Switch a feature on or off for this workspace","description":"Needs `tenant.manage` and a person, not a key. Switching on is refused with the reasons when the owning vertical says the workspace is not ready; switching off is never refused. Audited.","operationId":"set_feature_v1_tenant_features__flag__put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"flag","in":"path","required":true,"schema":{"type":"string","title":"Flag"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagSet"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagsOut"}}}},"404":{"description":"No loaded vertical defines this flag"},"409":{"description":"Not ready to switch on","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagRefusal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/workspaces":{"post":{"tags":["identity"],"summary":"Create a workspace","description":"Creates a workspace and makes the caller its first admin. Deliberate and authenticated: an integration credential cannot create one, because a workspace needs an accountable person to administer it.","operationId":"create_workspace_v1_workspaces_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreatedResponse"}}}},"401":{"description":"Missing or invalid credential"},"409":{"description":"Workspace creation limit reached"},"422":{"description":"No contact email available"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ClerkBearer":[]}]}},"/v1/members":{"get":{"tags":["members"],"summary":"List workspace members","description":"A minimal directory — display name, role and status — for anyone who belongs to the workspace. Email addresses, invitation details and capability grants appear only for callers holding the matching capability, because knowing who your colleagues are is a different question from seeing their contact details and security state.","operationId":"list_members_v1_members_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/MemberResponse"},"type":"array","title":"Response List Members V1 Members Get"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Insufficient role"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]},"post":{"tags":["members"],"summary":"Invite someone to this workspace","description":"Issues a single-use invitation token that expires. Deliver it to the recipient; they join by accepting it while signed in with the invited, verified email address. The token is returned exactly once.","operationId":"invite_member_v1_members_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberInviteRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationResponse"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Insufficient role"},"429":{"description":"Rate limit exceeded"},"409":{"description":"Already a member"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/members/invitations":{"get":{"tags":["members"],"summary":"Outstanding invitations","description":"Invitations that have been issued and not yet accepted. The token itself is never listed — it was shown once, at issue, and the stored form is a hash.","operationId":"list_invitations_v1_members_invitations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PendingInvitationResponse"},"type":"array","title":"Response List Invitations V1 Members Invitations Get"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Insufficient role"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/members/invitations/{invitation_id}":{"delete":{"tags":["members"],"summary":"Withdraw an invitation","description":"Revokes an issued invitation so the token can no longer be redeemed. Without this, an invitation sent to the wrong address stays valid until it expires — a standing key held by whoever received it.","operationId":"revoke_invitation_v1_members_invitations__invitation_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"403":{"description":"Insufficient role"},"429":{"description":"Rate limit exceeded"},"404":{"description":"No such outstanding invitation"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/members/{member_id}":{"patch":{"tags":["members"],"summary":"Change a member's role","operationId":"update_member_role_v1_members__member_id__patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberRoleUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberResponse"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Insufficient role"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Member not found"},"409":{"description":"Would leave the workspace with no admin"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["members"],"summary":"Remove someone from this workspace","operationId":"remove_member_v1_members__member_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"403":{"description":"Insufficient role"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Member not found"},"409":{"description":"Would leave the workspace with no admin"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/capabilities":{"get":{"tags":["members"],"summary":"What can be granted, and what each thing means","description":"Every capability with a label and the consequence of holding it, plus what each role preset includes. An admin cannot make a considered decision from a list of dotted identifiers.","operationId":"capability_catalogue_v1_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilityCatalogue"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/me/capabilities":{"get":{"tags":["members","identity"],"summary":"What I may do here","description":"The caller's own effective capabilities in the workspace they are acting in. Any member may ask — knowing what you may do is not a privilege. It exists so the console can show the actions a person actually holds instead of offering them refusals.","operationId":"my_capabilities_v1_me_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyCapabilities"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/members/{member_id}/capabilities":{"get":{"tags":["members"],"summary":"What this member may do","operationId":"get_member_capabilities_v1_members__member_id__capabilities_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberCapabilities"}}}},"404":{"description":"Member not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["members"],"summary":"Change what this member may do","description":"Replaces this member's grants and revocations together. Send the `membership_version` the edit was based on: if somebody else changed this member first, the edit is refused rather than applied to a state you never saw.","operationId":"set_member_capabilities_v1_members__member_id__capabilities_put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilityUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberCapabilities"}}}},"403":{"description":"Refused: self-edit, amplification, or re-verification needed"},"404":{"description":"Member not found"},"409":{"description":"Changed by someone else, or would leave nobody able to administer"},"422":{"description":"Unknown or contradictory capabilities"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/join/{token}/preview":{"get":{"tags":["participant"],"summary":"Preview a participant session before consenting","description":"Everything the consent screen needs, with no side effects: the link is not consumed, the session is not started, and no interviewer is dispatched. Call this to render the consent form, then POST to this token to actually join once the participant has agreed.","operationId":"preview_session_v1_join__token__preview_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinPreviewResponse"}}}},"404":{"description":"Participant link or session not found"},"410":{"description":"Link expired"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/join/{token}":{"post":{"tags":["participant"],"summary":"Join participant session","description":"Consume the participant link, create a LiveKit room token, and dispatch the AI interviewer. Call only after the participant has consented. A consumed token may reconnect to the same live session inside the reconnect window (default 30 minutes).","operationId":"join_session_post_v1_join__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinSessionResponse"}}}},"404":{"description":"Participant link or session not found"},"410":{"description":"Link expired or already used outside the reconnect window"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["participant"],"summary":"Join participant session (deprecated)","description":"DEPRECATED — use `GET /{token}/preview` to render the consent screen and `POST /{token}` to join. This verb consumes the link and dispatches the interviewer, so calling it to populate a page starts the interview before the participant has consented. Retained for one release.","operationId":"join_session_v1_join__token__get","deprecated":true,"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinSessionResponse"}}}},"404":{"description":"Participant link or session not found"},"410":{"description":"Link expired or already used outside the reconnect window"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/join/{token}/complete":{"post":{"tags":["participant"],"summary":"Complete participant session","description":"Mark a participant session complete using only the join token. This continues to work after link expiry so long-running interviews can end cleanly. The operation is idempotent and triggers post-session pipelines only once. Returns `409` if the link was never joined.","operationId":"complete_join_session_v1_join__token__complete_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/JoinCompleteRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinCompleteResponse"}}}},"404":{"description":"Participant link or session not found"},"410":{"description":"Participant link expired or already used"},"429":{"description":"Rate limit exceeded"},"409":{"description":"Session has not been joined"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/join/{token}/turn":{"post":{"tags":["participant"],"summary":"Send one message in a text interview","description":"The text modality's turn loop. Runs the same safety gate as the voice adapter, in the same order: the message is recorded, evaluated and escalated in one transaction; any approved wording comes back to be shown; only then may the interviewer reply.\n\n`client_turn_id` is required and must be stable across retries — it is the idempotency key, and a retried request returns `duplicate: true` rather than recording the message twice.\n\nWording returned in `utterances` carries an `acknowledgement_id`. Send those back in `acknowledged` on the next turn (or to `/acknowledge`) once they have been displayed: the obligation they carry is discharged on that confirmation, never on the response being sent.","operationId":"join_session_turn_v1_join__token__turn_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextTurnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextTurnResponse"}}}},"404":{"description":"Participant link or session not found"},"410":{"description":"Participant link expired or already used"},"429":{"description":"Rate limit exceeded"},"402":{"description":"Monthly LLM quota exceeded"},"409":{"description":"Not a text interview, or the interview is not open"},"422":{"description":"Empty message or missing turn id"},"503":{"description":"The interviewer could not respond"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/join/{token}/acknowledge":{"post":{"tags":["participant"],"summary":"Confirm required wording was displayed","description":"The text equivalent of audio finishing playout. An obligation raised by a disclosure is discharged when the participant's client confirms the words were shown — never when the response carrying them was sent, because a response that dies in transit was never read.","operationId":"join_session_acknowledge_v1_join__token__acknowledge_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextAcknowledgeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextAcknowledgeResponse"}}}},"404":{"description":"Participant link or session not found"},"410":{"description":"Participant link expired or already used"},"429":{"description":"Rate limit exceeded"},"409":{"description":"Not a text interview, or the interview is not open"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/join/{token}/status":{"get":{"tags":["participant"],"summary":"Get participant session status","description":"Read participant-visible session status after join or completion. This continues to work after link expiry, allowing the completion screen to show `completed` only after the backend confirms it.","operationId":"join_session_status_v1_join__token__status_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinStatusResponse"}}}},"404":{"description":"Participant link or session not found"},"410":{"description":"Participant link expired or already used"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sessions/{session_id}/documents":{"post":{"tags":["documents"],"summary":"Upload document","description":"Upload a transcript or document to an offline session for extraction. Accepted formats: `.txt`, `.json`, `.pdf`, `.docx`. Maximum 20 MB. The document is parsed into turns and stored; use `POST /runs` to trigger extraction.\n\n**Errors:** `409` session is not in offline mode, `413` file too large, `415` unsupported format, `422` unrecognised JSON shape.","operationId":"upload_document_v1_sessions__session_id__documents_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_v1_sessions__session_id__documents_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/anchor_api__schemas__document__DocumentResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"409":{"description":"Session is not in offline mode"},"413":{"description":"File exceeds 20 MB limit"},"415":{"description":"Unsupported file type"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["documents"],"summary":"List documents","operationId":"list_documents_v1_sessions__session_id__documents_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/anchor_api__schemas__document__DocumentResponse"},"title":"Response List Documents V1 Sessions  Session Id  Documents Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"409":{"description":"Session is not in offline mode"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sessions/{session_id}/runs":{"post":{"tags":["runs"],"summary":"Start extraction run","description":"Trigger claim extraction on an uploaded document. The run is scheduled immediately and executes asynchronously; poll `GET /runs/{run_id}` for status or subscribe to `run.completed`/`run.failed` webhooks.\n\n**Errors:** `404` session or document not found, `409` session is not in offline mode.","operationId":"create_run_v1_sessions__session_id__runs_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"402":{"description":"Monthly LLM token quota exceeded"},"404":{"description":"Session or document not found"},"409":{"description":"Session is not in offline mode"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/sessions/{session_id}/runs/{run_id}":{"get":{"tags":["runs"],"summary":"Get run","description":"Retrieve run status and, when `status=complete`, the full artifact (claims, evidence, metadata).","operationId":"get_run_v1_sessions__session_id__runs__run_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunDetailResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Run or session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sessions/{session_id}/probes":{"get":{"tags":["probes"],"summary":"List probes","description":"Return all follow-up questions generated by the extraction engine during this session.","operationId":"list_probes_v1_sessions__session_id__probes_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProbeResponse"},"title":"Response List Probes V1 Sessions  Session Id  Probes Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sessions/{session_id}/probes/{probe_id}/feedback":{"post":{"tags":["probes"],"summary":"Record probe feedback","description":"Submit researcher feedback (acted-on, useful, note) for a probe. Used to improve extraction quality over time.","operationId":"create_probe_feedback_v1_sessions__session_id__probes__probe_id__feedback_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"probe_id","in":"path","required":true,"schema":{"type":"string","title":"Probe Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeFeedbackRequest"}}}},"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Session not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks":{"get":{"tags":["webhooks"],"summary":"List webhooks","operationId":"list_webhooks_v1_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WebhookResponse"},"type":"array","title":"Response List Webhooks V1 Webhooks Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]},"post":{"tags":["webhooks"],"summary":"Subscribe to webhook","description":"Register a URL to receive webhook events. Supported events: `session.started`, `session.completed`, `session.failed`, `run.completed`, `run.failed`, `usage.threshold_exceeded`.\n\nThe response carries `secret` **once**; store it, it cannot be read back. Each delivery sends `X-Anchor-Signature: t=<unix seconds>,v1=<hex>`, where `v1` is HMAC-SHA256 keyed by that secret over `<t>.` followed by the raw request body. Verify against the raw body and reject a `t` older than five minutes. After a rotation a second `v1=` (the previous secret) is appended for 24 hours; accept either.\n\nDelivery is at-least-once: `X-Anchor-Delivery` is stable across retries and replays, so dedupe on it. Non-2xx answers are retried with exponential backoff for about 8.5 hours (10 attempts), then the delivery is dead and can be replayed while its payload is retained (7 days by default). Redirects are not followed.\n\nThe URL must be https and resolve only to public addresses.\n\n**Errors:** `400` if any requested event name is unsupported; `422` if the URL could reach a private network.","operationId":"create_webhook_v1_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreatedResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"400":{"description":"Unsupported event name"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/webhooks/{webhook_id}":{"delete":{"tags":["webhooks"],"summary":"Unsubscribe webhook","operationId":"delete_webhook_v1_webhooks__webhook_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Webhook not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/{webhook_id}/rotate-secret":{"post":{"tags":["webhooks"],"summary":"Rotate the signing secret","description":"Issue a new signing secret, returned once. For 24 hours deliveries carry a signature under both the new and the previous secret, so a receiver can switch over without dropping events.","operationId":"rotate_webhook_secret_v1_webhooks__webhook_id__rotate_secret_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecretRotatedResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Webhook not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/{webhook_id}/deliveries/{delivery_id}/replay":{"post":{"tags":["webhooks"],"summary":"Replay a dead delivery","description":"Send a delivery again after it exhausted its retries or was cancelled. It keeps its `X-Anchor-Delivery` id, so a receiver that did process it can ignore it.\n\n**Errors:** `404` unknown webhook or delivery; `409` the delivery is still being retried, already succeeded, or its payload has passed retention.","operationId":"replay_delivery_v1_webhooks__webhook_id__deliveries__delivery_id__replay_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}},{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","title":"Delivery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Not found"},"409":{"description":"Not replayable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/{webhook_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"List deliveries","description":"Return the last 100 deliveries for a webhook subscription, newest first.","operationId":"list_webhook_deliveries_v1_webhooks__webhook_id__deliveries_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryResponse"},"title":"Response List Webhook Deliveries V1 Webhooks  Webhook Id  Deliveries Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Webhook not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/plans":{"get":{"tags":["billing"],"summary":"Plans on sale (USD)","operationId":"list_plans_v1_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Plans V1 Billing Plans Get"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/billing":{"get":{"tags":["billing"],"summary":"This workspace's plan, entitlements, usage and invoices","operationId":"overview_v1_billing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Overview V1 Billing Get"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/billing/checkout":{"post":{"tags":["billing"],"summary":"Start a hosted checkout for a plan","description":"Returns the provider's hosted payment page. Anchor never handles card data.\n\nThe subscription starts when the provider reports the payment, through the\nsigned webhook — never because this call returned.","operationId":"checkout_v1_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Checkout V1 Billing Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/billing/cancel":{"post":{"tags":["billing"],"summary":"Cancel at the end of the current period","description":"Access continues until the period ends. Cancelling the provider's renewal\nis the operator's step until the provider's cancel API is wired (owner action).","operationId":"cancel_v1_billing_cancel_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Cancel V1 Billing Cancel Post"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rk/studies":{"get":{"tags":["rk-studies"],"summary":"List studies","operationId":"list_studies_v1_rk_studies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/StudyResponse"},"type":"array","title":"Response List Studies V1 Rk Studies Get"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]},"post":{"tags":["rk-studies"],"summary":"Create study","operationId":"create_study_v1_rk_studies_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rk/studies/{study_id}":{"get":{"tags":["rk-studies"],"summary":"Get study","operationId":"get_study_v1_rk_studies__study_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["rk-studies"],"summary":"Update study","operationId":"update_study_v1_rk_studies__study_id__patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["rk-studies"],"summary":"Archive study","operationId":"delete_study_v1_rk_studies__study_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/spark/status":{"get":{"tags":["rk-spark"],"summary":"Spark Status","description":"Whether the agent can run here, so the console can show or hide it without trying.","operationId":"spark_status_v1_rk_spark_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Spark Status V1 Rk Spark Status Get"}}}},"401":{"description":"Missing or invalid credential"},"402":{"description":"Monthly LLM token quota exceeded"},"404":{"description":"Study not found, or the agent is not enabled"},"503":{"description":"No model is available"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rk/spark/studies/{study_id}/turn":{"post":{"tags":["rk-spark"],"summary":"Spark Turn","operationId":"spark_turn_v1_rk_spark_studies__study_id__turn_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnResponse"}}}},"401":{"description":"Missing or invalid credential"},"402":{"description":"Monthly LLM token quota exceeded"},"404":{"description":"Study not found, or the agent is not enabled"},"503":{"description":"No model is available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/spark/turn":{"post":{"tags":["rk-spark"],"summary":"Spark Workspace Turn","description":"One conversational turn anywhere in the console, with or without a study open.","operationId":"spark_workspace_turn_v1_rk_spark_turn_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTurnRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnResponse"}}}},"401":{"description":"Missing or invalid credential"},"402":{"description":"Monthly LLM token quota exceeded"},"404":{"description":"Study not found, or the agent is not enabled"},"503":{"description":"No model is available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rk/spark/turn/stream":{"post":{"tags":["rk-spark"],"summary":"Spark Workspace Turn Stream","description":"The workspace turn as server-sent events: `status` and `tool` while Spark works,\nthen `done` (the same body `/turn` returns) or `error` (`status`, `detail`).","operationId":"spark_workspace_turn_stream_v1_rk_spark_turn_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTurnRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"text/event-stream":{}}},"401":{"description":"Missing or invalid credential"},"402":{"description":"Monthly LLM token quota exceeded"},"404":{"description":"Study not found, or the agent is not enabled"},"503":{"description":"No model is available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rk/studies/{study_id}/readiness":{"get":{"tags":["rk-onboarding"],"summary":"Is this study ready to conduct a real interview","operationId":"get_study_readiness_v1_rk_studies__study_id__readiness_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Study Readiness V1 Rk Studies  Study Id  Readiness Get"}}}},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/governance":{"get":{"tags":["rk-governance"],"summary":"This study's governance record","operationId":"get_governance_v1_rk_studies__study_id__governance_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GovernanceResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["rk-governance"],"summary":"Record or change this study's governance","description":"Unset fields are left alone, so a screen that edits one thing cannot blank the rest. A sensitive- or elevated-risk study must name an escalation contact: without one, a participant in distress reaches nobody.","operationId":"update_governance_v1_rk_studies__study_id__governance_patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GovernanceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GovernanceResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Governance would be internally inconsistent"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/speech":{"get":{"tags":["rk-governance"],"summary":"How this study's interviewer speaks","operationId":"get_speech_v1_rk_studies__study_id__speech_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["rk-governance"],"summary":"Change how this study's interviewer speaks","description":"What the interviewer calls the study aloud, the words the speech recogniser should expect, how written words are pronounced, and the language model. Takes effect for interviews that start afterwards.","operationId":"update_speech_v1_rk_studies__study_id__speech_patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Unknown model"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/sites":{"get":{"tags":["rk-governance"],"summary":"Sites","operationId":"list_sites_v1_rk_studies__study_id__sites_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SiteResponse"},"title":"Response List Sites V1 Rk Studies  Study Id  Sites Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-governance"],"summary":"Add a site","description":"A site carries its own jurisdiction and default language: a Kenyan site and a UK site in one study answer to different regulators and need different consent.","operationId":"create_site_v1_rk_studies__study_id__sites_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/sites/{site_id}":{"delete":{"tags":["rk-governance"],"summary":"Remove a site","operationId":"delete_site_v1_rk_studies__study_id__sites__site_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"site_id","in":"path","required":true,"schema":{"type":"string","title":"Site Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/cohorts":{"get":{"tags":["rk-governance"],"summary":"Cohorts","operationId":"list_cohorts_v1_rk_studies__study_id__cohorts_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CohortResponse"},"title":"Response List Cohorts V1 Rk Studies  Study Id  Cohorts Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-governance"],"summary":"Add a cohort","description":"A cohort's age band selects the consent package that applies to it, which is why a study involving minors cannot be described by a single consent document.","operationId":"create_cohort_v1_rk_studies__study_id__cohorts_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CohortCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CohortResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/cohorts/{cohort_id}":{"delete":{"tags":["rk-governance"],"summary":"Remove a cohort","operationId":"delete_cohort_v1_rk_studies__study_id__cohorts__cohort_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"cohort_id","in":"path","required":true,"schema":{"type":"string","title":"Cohort Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/arms":{"get":{"tags":["rk-governance"],"summary":"Arms","operationId":"list_arms_v1_rk_studies__study_id__arms_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ArmResponse"},"title":"Response List Arms V1 Rk Studies  Study Id  Arms Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-governance"],"summary":"Add an arm","operationId":"create_arm_v1_rk_studies__study_id__arms_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArmCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArmResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/arms/{arm_id}":{"delete":{"tags":["rk-governance"],"summary":"Remove an arm","operationId":"delete_arm_v1_rk_studies__study_id__arms__arm_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"arm_id","in":"path","required":true,"schema":{"type":"string","title":"Arm Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/documents":{"get":{"tags":["rk-dossier"],"summary":"This study's paperwork","operationId":"list_documents_v1_rk_studies__study_id__documents_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"doc_class","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Class"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/verticals__research_kit__api__dossier_schemas__DocumentResponse"},"title":"Response List Documents V1 Rk Studies  Study Id  Documents Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-dossier"],"summary":"Add a document, with its first version","operationId":"create_document_v1_rk_studies__study_id__documents_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_document_v1_rk_studies__study_id__documents_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/verticals__research_kit__api__dossier_schemas__DocumentResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"413":{"description":"File too large"},"415":{"description":"File type not accepted"},"422":{"description":"Unusable document class, sensitivity, or file contents"},"503":{"description":"The file could not be stored; nothing was saved"}}}},"/v1/rk/documents/{document_id}":{"get":{"tags":["rk-dossier"],"summary":"Get Document","operationId":"get_document_v1_rk_documents__document_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/verticals__research_kit__api__dossier_schemas__DocumentResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/documents/{document_id}/versions":{"get":{"tags":["rk-dossier"],"summary":"Every version, oldest first","operationId":"list_versions_v1_rk_documents__document_id__versions_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentVersionResponse"},"title":"Response List Versions V1 Rk Documents  Document Id  Versions Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-dossier"],"summary":"Upload a new version","description":"Supersedes the current version rather than replacing it. A version's bytes never change: a submission bundle names version ids, and a committee's decision answers a particular bundle.","operationId":"create_version_v1_rk_documents__document_id__versions_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_version_v1_rk_documents__document_id__versions_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentVersionResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"409":{"description":"Another upload is allocating a version number"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/document-versions/{version_id}/download":{"get":{"tags":["rk-dossier"],"summary":"The artifact itself","description":"Served only when the file has been verified, always as an attachment, always with the stored checksum re-checked. Corruption fails closed.","operationId":"download_version_v1_rk_document_versions__version_id__download_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"409":{"description":"Not verified, so not served"},"410":{"description":"The stored file is gone"},"500":{"description":"The stored bytes no longer match their checksum"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/document-versions/{version_id}/internal-approve":{"post":{"tags":["rk-dossier"],"summary":"Say this workspace considers a version ready","description":"**Not** an ethics decision. This says the study team has reviewed the version and is willing to submit it. What an external body determined is recorded separately, against a submission, and needs a different capability. Needs an accountable person: an integration may upload a draft and nothing more.","operationId":"internal_approve_v1_rk_document_versions__version_id__internal_approve_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InternalApprovalRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentVersionResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"403":{"description":"Re-verification required, or not a person"},"409":{"description":"Not approvable, or changed underneath you"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/authority-requirements":{"get":{"tags":["rk-authority"],"summary":"Every permission this study needs","operationId":"list_requirements_v1_rk_studies__study_id__authority_requirements_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RequirementResponse"},"title":"Response List Requirements V1 Rk Studies  Study Id  Authority Requirements Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-authority"],"summary":"Record a permission this study needs","description":"Each is its own track with its own submissions and decisions. An ethics approval never satisfies a research licence or a site authorisation, which is why they cannot share one.","operationId":"create_requirement_v1_rk_studies__study_id__authority_requirements_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Unknown kind, applicability, or out-of-study scope"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/authority-requirements/{requirement_id}":{"patch":{"tags":["rk-authority"],"summary":"Change a requirement, or decide whether it applies","operationId":"update_requirement_v1_rk_authority_requirements__requirement_id__patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"requirement_id","in":"path","required":true,"schema":{"type":"string","title":"Requirement Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/submissions":{"get":{"tags":["rk-authority"],"summary":"What has been sent to an external body","operationId":"list_submissions_v1_rk_studies__study_id__submissions_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"requirement_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requirement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubmissionResponse"},"title":"Response List Submissions V1 Rk Studies  Study Id  Submissions Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-authority"],"summary":"Record a bundle sent for review","description":"Names the exact document versions that went, in order, with their checksums as they stood. Only internally approved, verified versions may go: submitting a working draft to an ethics committee is a mistake the platform should catch, not record. Needs an accountable person.","operationId":"create_submission_v1_rk_studies__study_id__submissions_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"403":{"description":"Re-verification required, or not a person"},"422":{"description":"Unusable versions, duplicate items, or unknown track"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/authority-requirements/{requirement_id}/decisions":{"get":{"tags":["rk-authority"],"summary":"Every decision on this track, oldest first","description":"The full history. Decisions are immutable: a body that changes its mind issues another, and the first stays exactly as it was.","operationId":"list_decisions_v1_rk_authority_requirements__requirement_id__decisions_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"requirement_id","in":"path","required":true,"schema":{"type":"string","title":"Requirement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DecisionResponse"},"title":"Response List Decisions V1 Rk Authority Requirements  Requirement Id  Decisions Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/submissions/{submission_id}/decision":{"post":{"tags":["rk-authority"],"summary":"Record what the body determined","description":"A person records this, with recent re-verification. Nothing infers a determination from an upload or a date, and an integration credential cannot record one at all.\n\nRecording a decision does **not** automatically make it the one that answers the track: pass `make_current: false` when filing history, so a letter from last year does not displace this year's.","operationId":"record_decision_v1_rk_submissions__submission_id__decision_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"submission_id","in":"path","required":true,"schema":{"type":"string","title":"Submission Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"403":{"description":"Re-verification required, or not a person"},"409":{"description":"Somebody else moved the current decision"},"422":{"description":"Unknown determination, or evidence outside this study"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/authority-requirements/{requirement_id}/current-decision":{"post":{"tags":["rk-authority"],"summary":"Choose which decision answers this track","description":"Explicit, because 'the newest row' is the wrong rule: a letter filed late about last year would displace this year's. Version-checked.","operationId":"set_current_decision_v1_rk_authority_requirements__requirement_id__current_decision_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"requirement_id","in":"path","required":true,"schema":{"type":"string","title":"Requirement Id"}},{"name":"decision_id","in":"query","required":true,"schema":{"type":"string","title":"Decision Id"}},{"name":"expected_version","in":"query","required":true,"schema":{"type":"integer","title":"Expected Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequirementResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"409":{"description":"Somebody else moved it first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/authority-coverage":{"get":{"tags":["rk-authority"],"summary":"What each body has answered, by requirement and scope","description":"A matrix, not a verdict. An ethics approval and a research licence are different rows and neither satisfies the other. Whether the study may field is a composite question the fielding gate answers, not this.","operationId":"coverage_v1_rk_studies__study_id__authority_coverage_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorityCoverage"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/instrument-types":{"get":{"tags":["rk-instruments"],"summary":"What can be created, and what can be activated","description":"Every instrument type, with whether a validator is registered for it. A type with no validator can hold drafts and cannot be activated — stated here so a client never offers an action that is guaranteed to fail.","operationId":"list_instrument_types_v1_rk_instrument_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ValidatorInfo"},"type":"array","title":"Response List Instrument Types V1 Rk Instrument Types Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rk/studies/{study_id}/instruments":{"get":{"tags":["rk-instruments"],"summary":"This study's instruments","operationId":"list_instruments_v1_rk_studies__study_id__instruments_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InstrumentResponse"},"title":"Response List Instruments V1 Rk Studies  Study Id  Instruments Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-instruments"],"summary":"Create an instrument","description":"Creates the logical identity. A type with no registered validator is created as a **draft shell**: authoring is possible, activation is not, and `activatable` says which.","operationId":"create_instrument_v1_rk_studies__study_id__instruments_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstrumentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstrumentResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/instruments/{instrument_id}":{"patch":{"tags":["rk-instruments"],"summary":"Rename an instrument or restate its purpose","description":"Changes identity metadata only. A version's definition is never edited here, and an activated definition is never edited at all.","operationId":"update_instrument_v1_rk_instruments__instrument_id__patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"instrument_id","in":"path","required":true,"schema":{"type":"string","title":"Instrument Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstrumentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstrumentResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/instruments/{instrument_id}/versions":{"get":{"tags":["rk-instruments"],"summary":"Every version, newest first","operationId":"list_versions_v1_rk_instruments__instrument_id__versions_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"instrument_id","in":"path","required":true,"schema":{"type":"string","title":"Instrument Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VersionResponse"},"title":"Response List Versions V1 Rk Instruments  Instrument Id  Versions Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-instruments"],"summary":"Start a new draft version","operationId":"create_instrument_version_v1_rk_instruments__instrument_id__versions_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"instrument_id","in":"path","required":true,"schema":{"type":"string","title":"Instrument Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/instrument-versions/{version_id}":{"get":{"tags":["rk-instruments"],"summary":"One version, with its definition and checksum","operationId":"get_version_v1_rk_instrument_versions__version_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rk-instruments"],"summary":"Discard a draft version","operationId":"delete_draft_v1_rk_instrument_versions__version_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"409":{"description":"Activated versions are never deleted"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/instrument-versions/{version_id}/definition":{"put":{"tags":["rk-instruments"],"summary":"Replace a draft's definition","description":"Only while the version is a draft or in review. An activated version is frozen: participants answered it, and the pin on their responses is a claim about what they read.","operationId":"put_definition_v1_rk_instrument_versions__version_id__definition_put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefinitionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"409":{"description":"The version is activated and cannot be edited, or somebody else has changed this draft since it was loaded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/instrument-versions/{version_id}/activate":{"post":{"tags":["rk-instruments"],"summary":"Activate a version","description":"Validates the definition through the registered validator, freezes it, records the checksum of its canonical form, builds the projections, and supersedes the previous active version. Refused when no validator is registered for the instrument type, or when the definition is invalid.","operationId":"activate_v1_rk_instrument_versions__version_id__activate_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"409":{"description":"Already activated, or superseded"},"422":{"description":"The definition is invalid, or no validator is registered"},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/instrument-versions/{version_id}/integrity":{"get":{"tags":["rk-instruments"],"summary":"Does the stored definition still match its checksum","description":"A mismatch means something wrote to an activated definition outside the lifecycle. It blocks fielding rather than being repaired quietly — re-checksumming would erase the evidence that it changed.","operationId":"check_integrity_v1_rk_instrument_versions__version_id__integrity_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Check Integrity V1 Rk Instrument Versions  Version Id  Integrity Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/instrument-versions/{version_id}/check":{"post":{"tags":["rk-instruments"],"summary":"Check a definition without storing it","description":"Runs the same validator activation runs, and returns every problem at once rather than the first. Stores nothing and changes nothing. With no body, the version's own stored definition is checked.","operationId":"check_definition_v1_rk_instrument_versions__version_id__check_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FormCheckRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormCheckResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/instrument-versions/{version_id}/form":{"get":{"tags":["rk-instruments"],"summary":"The question model for a version","description":"For an activated version this is the stored projection — the rows a recorded answer references. For a draft it is built on request and marked `preview`: nothing may be answered against a preview.","operationId":"get_form_v1_rk_instrument_versions__version_id__form_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderedForm"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Not a form-shaped instrument, or the draft is invalid"}}}},"/v1/rk/instrument-versions/{version_id}/projection-integrity":{"get":{"tags":["rk-instruments"],"summary":"Do the stored questions still match the definition","description":"The projections are a view of `definition_json`. A disagreement means something wrote to a projection outside activation, which is reported rather than repaired — a quietly corrected row erases the evidence that it was wrong.","operationId":"projection_integrity_v1_rk_instrument_versions__version_id__projection_integrity_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectionIntegrity"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/instrument-versions/{version_id}/test-run":{"post":{"tags":["rk-instruments"],"summary":"Rehearse a form, storing nothing","description":"Evaluates supplied answers against this version's definition in test mode, with an explicit context — date, site, cohort, arm, wave, language — and returns what the runtime made of them.\n\n**Nothing is written.** Not stored-and-flagged: nothing at all, so there is no row for an export, an analysis, a claim, a safeguarding sweep or a participant record to include by mistake. The subject is synthetic and its id cannot be confused with a participant's.\n\n`is_test` must be `true`; there is no untagged path through this route.","operationId":"test_run_v1_rk_instrument_versions__version_id__test_run_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRunRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestRunResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Not a form-shaped instrument, or the definition is invalid"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/instrument-versions/{version_id}/diff":{"get":{"tags":["rk-instruments"],"summary":"What changed between two versions of one instrument","description":"Compares this version with `against`, which must belong to the same instrument lineage. Both canonical definitions are read the way activation reads them, so key order and formatting produce no changes, and a moved question is reported as a move rather than as a deletion and an addition.\n\nEach change carries a stable `code` and a `kind` — `structural`, `logic`, `cosmetic` or `governance`. That says what *sort* of thing was edited. It is **not** a claim that a change is small, safe, harmless or approved: rewording one question can change what people answer, and whether an amendment needs approval is a decision for people and an ethics committee.\n\nRead-only. Nothing is written, projected, activated or migrated.","operationId":"compare_versions_v1_rk_instrument_versions__version_id__diff_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}},{"name":"against","in":"query","required":true,"schema":{"type":"string","maxLength":36,"description":"The version to compare with — usually the one this succeeded.","title":"Against"},"description":"The version to compare with — usually the one this succeeded."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefinitionDiffResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Either version is not in this workspace"},"422":{"description":"The two versions belong to different instruments or studies, or the instrument is not form-shaped"}}}},"/v1/rk/instrument-versions/{version_id}/analysis-attributes":{"get":{"tags":["rk-form-analysis"],"summary":"Which questions of this form already feed analysis","description":"Definitions only, no values.","operationId":"list_form_attributes_v1_rk_instrument_versions__version_id__analysis_attributes_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormAttributesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-form-analysis"],"summary":"Use this question in analysis","description":"Needs `attribute.create_from_form` and `instrument.design`, and a form that is live in the study. Creates the attribute and records who. Already existing is a 200, not an error. Cannot edit or retire.","operationId":"use_in_analysis_v1_rk_instrument_versions__version_id__analysis_attributes_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UseInAnalysis"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormAttributeOut"}}}},"409":{"description":"The form is not live, so analysis would have nothing to read"},"422":{"description":"This kind of question cannot be analysed"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/instrument-versions/{version_id}/responses/summary":{"get":{"tags":["rk-form-responses"],"summary":"What this form's responses say, question by question","description":"Counted output passes the disclosure policy on the server.","operationId":"summary_v1_rk_instrument_versions__version_id__responses_summary_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSummaryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/instrument-versions/{version_id}/responses/export":{"get":{"tags":["rk-form-responses"],"summary":"Download this form's responses as CSV or Excel","description":"One row per response, keyed by participant code, no contact identity. A sensitive question is left out unless the caller holds `response.sensitive.view`. Always an attachment, never inline. Audited.","operationId":"export_v1_rk_instrument_versions__version_id__responses_export_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|xlsx)$","default":"csv","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/enrolments":{"post":{"tags":["rk-participants"],"summary":"Register a participant in a study","description":"Creates a pseudonymous participant record: site, cohort, arm, recruitment source and lifecycle state. Carries **no** contact identity — a name, address or telephone number is recorded separately through `PUT /enrolments/{id}/contact`, which needs `participant.contact.view` as well.","operationId":"create_enrolment_v1_rk_studies__study_id__enrolments_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrolmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrolmentOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-participants"],"summary":"List participant records","description":"Pseudonymous records only. Filterable by lifecycle state, site, cohort and arm. Never returns contact identity in any form, masked or otherwise.","operationId":"list_enrolments_v1_rk_studies__study_id__enrolments_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"lifecycle_state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle State"}},{"name":"site_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"}},{"name":"cohort_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Id"}},{"name":"arm_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Arm Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrolmentListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/enrolments/{enrolment_id}":{"get":{"tags":["rk-participants"],"summary":"Read one participant record","operationId":"get_enrolment_v1_rk_enrolments__enrolment_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrolmentOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/enrolments/{enrolment_id}/state":{"post":{"tags":["rk-participants"],"summary":"Move a participant record to a new lifecycle state","description":"Transitions are enumerated and checked inside the write transaction against `expected_version`. Withdrawn, ineligible, excluded and lost-to-follow-up are terminal: a record does not come back from a decision the participant made.","operationId":"transition_enrolment_v1_rk_enrolments__enrolment_id__state_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrolmentTransition"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrolmentOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Version conflict, or the record is terminal"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/enrolments/{enrolment_id}/contact/presence":{"get":{"tags":["rk-participants"],"summary":"Whether this participant is contactable","description":"Booleans and a retention date — **no values, masked or otherwise**. This is what fieldwork needs: a coordinator chasing completion has to know somebody can be reached without being shown how.","operationId":"contact_presence_v1_rk_enrolments__enrolment_id__contact_presence_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPresenceOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/enrolments/{enrolment_id}/contact":{"get":{"tags":["rk-participants"],"summary":"Read a participant's contact details","description":"Requires `participant.contact.view`, which no API key may hold and whose grant needs recent re-verification. **Every call writes an audit row**, including a masked one: `?masked=true` narrows a guess, it does not remove one.","operationId":"read_contact_v1_rk_enrolments__enrolment_id__contact_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}},{"name":"masked","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Masked"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"503":{"description":"No PII secret configured on this deployment"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["rk-participants"],"summary":"Record how to reach a participant","description":"Needs `participant.manage` **and** `participant.contact.view`: overwriting an address is a way of discovering what was there. Values are encrypted before storage and indexed only as keyed hashes. Returns presence, not the values that were written.","operationId":"write_contact_v1_rk_enrolments__enrolment_id__contact_put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactWrite"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPresenceOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Another record in this study already holds that address"},"503":{"description":"No PII secret configured on this deployment"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["rk-participants"],"summary":"Erase a participant's contact details","description":"An erasure, so it needs `rights.execute`. The contact **record** survives with every value nulled: what remains is the pseudonymous fact that details existed and were erased, on this date, for this reason. The participant record itself is untouched — erasing how to reach somebody does not erase that they took part.","operationId":"purge_contact_v1_rk_enrolments__enrolment_id__contact_delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSuppress"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPresenceOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/enrolments/{enrolment_id}/contact/suppress":{"post":{"tags":["rk-participants"],"summary":"Stop using a participant's contact details","description":"Keeps the details, marks them not to be used. Distinct from a purge: suppression is reversible by re-entering details, erasure is not.","operationId":"suppress_contact_v1_rk_enrolments__enrolment_id__contact_suppress_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSuppress"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPresenceOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/contact-lookup":{"post":{"tags":["rk-participants"],"summary":"Is this address already in the study?","description":"Duplicate detection over keyed hashes. Returns the matching **participant record**, never a contact value — the caller supplied the value they are checking, and learns nothing they did not type. `participant.manage` is enough, which is what lets a coordinator avoid enrolling somebody twice without being able to read anybody's details.","operationId":"contact_lookup_v1_rk_studies__study_id__contact_lookup_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactLookup"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactLookupOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/enrolments/{enrolment_id}/external-references":{"post":{"tags":["rk-participants"],"summary":"Record an identifier this participant has elsewhere","description":"A clinic number, panel id or registry code. Encrypted and gated exactly like contact details, because in the system it came from it *is* an identifier. Needs `participant.manage` **and** `participant.contact.view`.","operationId":"add_external_reference_v1_rk_enrolments__enrolment_id__external_references_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalReferenceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalReferenceOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-participants"],"summary":"Read this participant's external identifiers","description":"Requires `participant.contact.view` and is audited, like any other identifier read. The ordinary enrolment response reports only how many exist and which systems they name.","operationId":"list_external_references_v1_rk_enrolments__enrolment_id__external_references_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}},{"name":"masked","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Masked"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExternalReferenceOut"},"title":"Response List External References V1 Rk Enrolments  Enrolment Id  External References Get"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/enrolments/{enrolment_id}/contact/retention":{"get":{"tags":["rk-participants"],"summary":"What is keeping this contact record","description":"Contact retention is the latest of seven independent legitimate needs (§12.7), each its own hold with its own expiry. Reports purposes and dates — never values — so `participant.manage` is enough to see why a record is still held.","operationId":"retention_status_v1_rk_enrolments__enrolment_id__contact_retention_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionStatusOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/enrolments/{enrolment_id}/contact/retention-holds":{"post":{"tags":["rk-participants"],"summary":"Record a reason this contact may not be purged yet","description":"Every purpose but an institutional or legal hold must say when it stops applying. A hold that lapses on a timer is not a hold, and a hold with no purpose is not reviewable.","operationId":"add_retention_hold_v1_rk_enrolments__enrolment_id__contact_retention_holds_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionHoldCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionHoldOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/contact-retention-holds/{hold_id}/release":{"post":{"tags":["rk-participants"],"summary":"Release a retention hold","description":"Releasing one hold releases nothing else. When the last one is gone and the record's own boundary has passed, the scheduled purge erases it.","operationId":"release_retention_hold_v1_rk_contact_retention_holds__hold_id__release_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"hold_id","in":"path","required":true,"schema":{"type":"string","title":"Hold Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionHoldRelease"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionHoldOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/participants/vault-status":{"get":{"tags":["rk-participants"],"summary":"Whether this deployment can hold contact details","description":"Reports configuration, never a key. A deployment with no `ANCHOR_PII_SECRET` refuses to store contact details rather than storing them unencrypted, and this is how an operator finds that out before a coordinator does.","operationId":"vault_status_v1_rk_participants_vault_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Vault Status V1 Rk Participants Vault Status Get"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rk/enrolments/{enrolment_id}/portal-link":{"post":{"tags":["rk-participants"],"summary":"Issue a participant's portal link","description":"Mints a purpose-scoped link to this participant's own portal: their task list, the forms on it, their consent receipt, and the rights and correction requests they may raise.\n\n**Returned once.** The row stores only a SHA-256 of the token, so a lost link is reissued rather than recovered — the same rule an assignment's participant token follows, and the reason a stolen database yields no working links.\n\nThis is a different credential from an assignment's link and does not replace it: that one opens exactly one form, this one opens the record. Issuing it **sends nothing** — invitations and reminders are 8F, and nothing here tells the participant the link exists.\n\nThe link stops working on its own expiry, when it is withdrawn, and the moment the participant's record becomes terminal: withdrawal is a decision they made, and a link that kept working would quietly undo it.","operationId":"issue_portal_link_v1_rk_enrolments__enrolment_id__portal_link_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalLinkOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/enrolments/{enrolment_id}/portal-links":{"get":{"tags":["rk-participants"],"summary":"List a participant's portal links","description":"Every link ever issued for this record, newest first — when it was issued, when it expires, whether it has been opened, and whether it has been withdrawn.\n\n**No token and no hash.** A coordinator cannot act on either, and the hash is the one field on the row worth stealing. A lost link is reissued, never recovered, so there is nothing here to recover it from.","operationId":"list_portal_links_v1_rk_enrolments__enrolment_id__portal_links_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalLinkListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/portal-links/{token_id}/revoke":{"post":{"tags":["rk-participants"],"summary":"Withdraw a participant's portal link","description":"Stops the link working immediately: the next request it is used for resolves to nothing, with the same message an unknown link gets.\n\nRecorded rather than deleted, and kept separate from expiry, so \"we ended this early\" and \"it ran out\" stay distinguishable long afterwards. Idempotent — revoking twice does not move the timestamp of the first.","operationId":"revoke_portal_link_v1_rk_portal_links__token_id__revoke_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","title":"Token Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalLinkRevoke"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalLinkSummaryOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"No such link in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/imports/preview":{"post":{"tags":["rk-participants"],"summary":"Read a participant file and say what is in it","description":"**Nothing is written.** Returns the headers, the row count and the first few rows so a coordinator can decide what each column means.\n\nNothing is guessed from a column header (§J8.2): a column called `email` is not authority to write an email address into the contact vault. The mapping is stated separately and explicitly.\n\nThe file goes through the same hardened reader the instrument adapters use — macros, external links and XML entity declarations are refused by name, and every bound is checked before allocation. No spreadsheet formula is ever evaluated.","operationId":"preview_import_v1_rk_studies__study_id__imports_preview_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_preview_import_v1_rk_studies__study_id__imports_preview_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPreviewOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"413":{"description":"The file is larger than the limit"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/imports/validate":{"post":{"tags":["rk-participants"],"summary":"Judge a file against a mapping, before committing anything","description":"Applies the mapping and reports every row's problems at once. **No participant data is written** — the batch and its row states are recorded so a commit can refer to them, and the values stay in the caller's file until somebody commits.\n\nDuplicate detection runs on keyed hashes, scoped to this study. A caller without `participant.contact.view` receives counts and enrolment ids, **never addresses** (§2002/15): a finding names a row, a code, and the matched record's id, and nothing else.\n\nA mapping that writes contact details needs `participant.contact.view` as well as `participant.manage`, and is refused before a cell is read.","operationId":"validate_import_v1_rk_studies__study_id__imports_validate_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_validate_import_v1_rk_studies__study_id__imports_validate_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportValidateOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/imports/{batch_id}/commit":{"post":{"tags":["rk-participants"],"summary":"Write the rows this import was validated with","description":"The only step that writes. Applies the file and mapping this batch was validated with — a different file or a different mapping is refused, because a commit has to apply what somebody read and approved.\n\n**Idempotent, decided by the database.** Each row is claimed by a guarded transition on `UNIQUE (batch_id, row_number)`, so a retry finds the row already done and two workers produce one participant per row rather than two.\n\n**All or nothing.** §J8.3: an import that half-succeeded is worse than one that refused. A single failed row rolls the entire new batch back and `applied` comes back `false` — the coordinator fixes the rows named in the findings and commits again. Rows committed by an earlier successful run are untouched; a participant already in the study is *skipped*, which is not a failure.\n\n`dry_run` runs every check and decision and writes nothing.","operationId":"commit_import_v1_rk_imports__batch_id__commit_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_commit_import_v1_rk_imports__batch_id__commit_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportCommitOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The mapping writes contact details and the caller may not"},"404":{"description":"Not found in this workspace"},"409":{"description":"The file or mapping is not the validated one"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/imports/{batch_id}":{"get":{"tags":["rk-participants"],"summary":"What an import did","description":"Counts and state. The batch holds the file's checksum and the agreed mapping, and never the file's contents — an uploaded roster is participant administration data, and keeping it would be a second copy of the contact vault without any of its protections.","operationId":"read_import_v1_rk_imports__batch_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportBatchOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/consent-documents":{"get":{"tags":["rk-participant-invites"],"summary":"The consent wording this study will show, and what is left to fill in","operationId":"list_consent_documents_v1_rk_studies__study_id__consent_documents_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDocumentsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-participant-invites"],"summary":"Write a draft of the consent wording for one purpose","operationId":"create_consent_document_v1_rk_studies__study_id__consent_documents_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDocumentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDocumentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/consent-documents/import":{"post":{"tags":["rk-participant-invites"],"summary":"Import a consent form as a reviewable draft","description":"Extract text only; the owner must review and approve it before participants see it.","operationId":"import_consent_document_v1_rk_studies__study_id__consent_documents_import_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_consent_document_v1_rk_studies__study_id__consent_documents_import_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDocumentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/consent-documents/{document_id}":{"patch":{"tags":["rk-participant-invites"],"summary":"Say whether agreeing to this item is required","description":"The wording of an approved item never changes; whether it is required can. Applies to participants who have not yet agreed.","operationId":"update_consent_document_v1_rk_consent_documents__document_id__patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDocumentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDocumentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/consent-items":{"put":{"tags":["rk-participant-invites"],"summary":"Ask this study's consent items on the interview link (or stop)","description":"On: the link shows each approved item with its own tick, and a participant who declines a required recording item is offered a human interviewer. Off: the single consent text, as before.","operationId":"set_consent_items_v1_rk_studies__study_id__consent_items_put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentItemsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDocumentsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/consent-documents/{document_id}/approve":{"post":{"tags":["rk-participant-invites"],"summary":"Approve a draft, which freezes its wording","description":"Refused while any part is still to be filled in. Approved wording never changes: a new version supersedes it. Needs a person.","operationId":"approve_consent_document_v1_rk_consent_documents__document_id__approve_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentDocumentOut"}}}},"409":{"description":"Parts remain to fill in, or not a draft"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/enrolments/{enrolment_id}/invitations":{"post":{"tags":["rk-participant-invites"],"summary":"Make an invitation link for one participant","description":"The link is returned once and is not kept. It opens a page that shows no name and no number until the participant answers a short question. A new link replaces the old. 404 until participant-system v2 is on.","operationId":"create_invitation_v1_rk_enrolments__enrolment_id__invitations_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationCreated"}}}},"409":{"description":"Consent wording unfinished, participant has left, or no way to reach them"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/enrolments/{enrolment_id}/timeline":{"get":{"tags":["rk-participant-invites"],"summary":"Everything that has happened to this participant, newest first","description":"Kinds, times and ids only. Never message text, a name or an answer.","operationId":"timeline_v1_rk_enrolments__enrolment_id__timeline_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimelineOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/invite/{token}":{"get":{"tags":["rk-participant-invite"],"summary":"What this invitation is about","operationId":"preview_v1_rk_invite__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/invite/{token}/confirm":{"post":{"tags":["rk-participant-invite"],"summary":"Answer the short question","operationId":"confirm_v1_rk_invite__token__confirm_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/invite/{token}/consent":{"get":{"tags":["rk-participant-invite"],"summary":"The words to agree to","operationId":"consent_screen_v1_rk_invite__token__consent_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Language"}},{"name":"X-Invite-Proof","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invite-Proof"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentScreenOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-participant-invite"],"summary":"Record the decisions","operationId":"record_consent_v1_rk_invite__token__consent_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"X-Invite-Proof","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invite-Proof"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/invite/{token}/booking":{"get":{"tags":["rk-participant-invite"],"summary":"How and when to talk","operationId":"booking_options_v1_rk_invite__token__booking_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"X-Invite-Proof","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invite-Proof"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingOptionsOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-participant-invite"],"summary":"Choose how and when","operationId":"book_v1_rk_invite__token__booking_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"X-Invite-Proof","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invite-Proof"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/invite/{token}/forms-access":{"post":{"tags":["rk-participant-invite"],"summary":"Open the study form","operationId":"forms_access_v1_rk_invite__token__forms_access_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"X-Invite-Proof","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invite-Proof"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormsAccessOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/invite/{token}/interview":{"post":{"tags":["rk-participant-invite"],"summary":"Start, or resume, the interview","description":"Needs the proof and a granted consent. Creates the engine session for this participant (or resumes the one still open) and returns its link. Changes nothing about how the interview itself runs.","operationId":"start_interview_v1_rk_invite__token__interview_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"X-Invite-Proof","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invite-Proof"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterviewStartIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterviewStartOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/invite/{token}/resume-link":{"post":{"tags":["rk-participant-invite"],"summary":"Text me a link to carry on","description":"For a participant whose connection could not be recovered. Sends a fresh link by SMS (which replaces this one) that opens the same interview at the same place. Nothing is sent when no provider is configured.","operationId":"resume_link_v1_rk_invite__token__resume_link_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"X-Invite-Proof","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Invite-Proof"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/invite/{token}/withdraw":{"post":{"tags":["rk-participant-invite"],"summary":"Withdraw and delete","operationId":"withdraw_v1_rk_invite__token__withdraw_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/narration/{scope}/{token}":{"get":{"tags":["rk-narration"],"summary":"Participant Audio","operationId":"participant_audio_v1_rk_narration__scope___token__get","parameters":[{"name":"scope","in":"path","required":true,"schema":{"type":"string","title":"Scope"}},{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"screen","in":"query","required":true,"schema":{"type":"string","title":"Screen"}},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}},{"name":"wording","in":"query","required":false,"schema":{"type":"string","maxLength":1024,"default":"","title":"Wording"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/narration-media/{token}":{"get":{"tags":["rk-narration"],"summary":"Local Audio","operationId":"local_audio_v1_rk_narration_media__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/narration":{"get":{"tags":["rk-narration"],"summary":"Status","operationId":"status_v1_rk_studies__study_id__narration_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-narration"],"summary":"Regenerate","operationId":"regenerate_v1_rk_studies__study_id__narration_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"screen","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Screen"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/messaging/status":{"get":{"tags":["rk-participant-messaging"],"summary":"Whether this deployment can send messages, and how","operationId":"messaging_status_v1_rk_messaging_status_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagingStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/participants/messages":{"post":{"tags":["rk-participant-messaging"],"summary":"Send invitations or nudges to selected participants","description":"Each person gets one message built on the rules: neutral wording, a short opt-out link and the helpline in every message. A person who cannot be texted is skipped with a named reason, never an error. One audit row for the batch. 404 until participant-system v2 is on.","operationId":"send_messages_v1_rk_studies__study_id__participants_messages_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/optout/{token}":{"get":{"tags":["rk-participant-optout"],"summary":"What this opt-out link does","operationId":"preview_v1_rk_optout__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptoutPreview"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/optout/{token}/stop":{"post":{"tags":["rk-participant-optout"],"summary":"Stop all messages. Deletes nothing.","operationId":"stop_v1_rk_optout__token__stop_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/optout/{token}/withdraw":{"post":{"tags":["rk-participant-optout"],"summary":"Withdraw and delete, after the same short question as the invitation","operationId":"withdraw_v1_rk_optout__token__withdraw_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptoutWithdrawIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptoutWithdrawOut"}}}},"404":{"description":"This link is not available"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/pipeline":{"get":{"tags":["rk-participant-pipeline"],"summary":"Participants by stage, with the next step for each","description":"Codes only: no name, phone or email in any form. Stage is derived from what has happened, never stored. 404 until participant-system v2 is on.","operationId":"read_pipeline_v1_rk_studies__study_id__pipeline_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Filter"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"description":"Part of a participant code.","title":"Q"},"description":"Part of a participant code."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/pipeline/contacts":{"get":{"tags":["rk-participant-pipeline"],"summary":"Names and masked numbers for rows on the pipeline","description":"Needs `participant.contact.view`, which no API key may hold. **One audit row per request** (how many people, which study). Never returns a full number or an address. 404 until participant-system v2 is on.","operationId":"read_pipeline_contacts_v1_rk_studies__study_id__pipeline_contacts_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"ids","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated enrolment ids, at most 100.","title":"Ids"},"description":"Comma-separated enrolment ids, at most 100."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCardsOut"}}}},"503":{"description":"No PII secret configured on this deployment"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/data-queries":{"post":{"tags":["rk-data-quality"],"summary":"Flag an answer for somebody to check","description":"Raises a query against one answer. **Writes no answer**, and needs `data.query` rather than `response.amend`: noticing an implausible value and being allowed to change it are different things, and the person who does the first is often precisely the person who should not do the second.\n\n`query_code` is enumerated and there is no free-text field. A query about somebody's answer is the most tempting place in the system to record what they said, so there is nowhere to. `external_reference` is a pointer into the institution's own tracker and is refused if it contains whitespace.","operationId":"raise_query_v1_rk_studies__study_id__data_queries_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataQueryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataQueryOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-data-quality"],"summary":"The query queue","description":"Filterable by state and assignee. Carries the question code and the record, never the answer's value.","operationId":"list_queries_v1_rk_studies__study_id__data_queries_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"assigned_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataQueryListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/data-queries/{query_id}/assign":{"post":{"tags":["rk-data-quality"],"summary":"Give a query to somebody","description":"A queue nobody owns is a queue nobody works. `expected_version` is compared inside the write transaction, so two people assigning from two screens produce one winner and one told conflict.","operationId":"assign_query_v1_rk_data_queries__query_id__assign_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"query_id","in":"path","required":true,"schema":{"type":"string","title":"Query Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataQueryAssign"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataQueryOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/data-queries/{query_id}/resolve":{"post":{"tags":["rk-data-quality"],"summary":"Close a query, correcting the value only where that is the answer","description":"Needs **`response.amend`**, declared here rather than left to the capability floor: the floor derives `data.query` for this path, and relying on it alone would let anybody who can raise a query change an answer.\n\nA correction is delegated to the ordinary amendment path, which keeps the previous value, both missing reasons and the sequence. The query stores only the resulting `amendment_id` — there is one change history, and this is not a second one.\n\nResolving *without* a correction records that somebody checked and the value stands, which is a finding in its own right and stops the same value being queried again next month.","operationId":"resolve_query_v1_rk_data_queries__query_id__resolve_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"query_id","in":"path","required":true,"schema":{"type":"string","title":"Query Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataQueryResolve"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataQueryOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/locks":{"post":{"tags":["rk-data-quality"],"summary":"Stop the data changing","description":"While a lock is open, response saves and submissions, amendments and import commits all refuse — so an analysis, a monitoring visit or a regulatory readout can rely on the dataset standing still. Enforced in each writer rather than in one route, so it holds however the write is reached.\n\nScope is the whole study or one instrument version, so last year's baseline can be locked for analysis while this year's follow-up runs.\n\n**A lock is not a freeze.** A freeze (M22, 13F) captures an immutable snapshot so a finding can cite what the data said; this decides whether anything may still be written.","operationId":"lock_dataset_v1_rk_studies__study_id__locks_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetLockCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetLockOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-data-quality"],"summary":"Locks on this study, open and historical","description":"A released lock is kept: that the data was locked between two dates is part of the study's history, and an analysis citing figures from that window needs it.","operationId":"list_dataset_locks_v1_rk_studies__study_id__locks_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"open_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Open Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetLockListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/locks/{lock_id}/release":{"post":{"tags":["rk-data-quality"],"summary":"Let the data change again","description":"Recorded, never deleted. The row stays as the history of the window.","operationId":"release_dataset_lock_v1_rk_locks__lock_id__release_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"lock_id","in":"path","required":true,"schema":{"type":"string","title":"Lock Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetLockRelease"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetLockOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/quality-sweep":{"get":{"tags":["rk-data-quality"],"summary":"Answers worth a second look","description":"Re-evaluates stored responses against their own definitions and reports what looks wrong: constraint failures, genuinely missing required values, suspected duplicate submissions, and responses whose definition checksum no longer matches their version.\n\n**It finds and does not fix.** Every result is a candidate for a query that a person raises; nothing here writes an answer, an amendment or a query. A recorded refusal is **not** missing data — the four missing reasons stay distinct, and reading a refusal as a gap erases the finding.\n\nFindings name the question and the response, never the value.","operationId":"quality_sweep_v1_rk_studies__study_id__quality_sweep_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"instrument_version_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Instrument Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualitySweepOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/fielding-gate/preview":{"post":{"tags":["rk-fielding"],"summary":"Check whether an instrument could be assigned, and record the answer","description":"Runs the fielding gate and **records the result**, permitted or refused. A refusal is as much part of the record as a permission: \"we tried to field this and were stopped, on this date, for these reasons\" is what an auditor asks for.\n\nThe gate fails closed. An authority requirement whose applicability nobody has determined is unresolved, not permission; a missing safety configuration refuses; a definition whose checksum no longer matches its activation refuses.","operationId":"preview_gate_v1_rk_studies__study_id__fielding_gate_preview_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GateResultOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/assignments":{"post":{"tags":["rk-fielding"],"summary":"Assign an instrument to a participant","description":"Runs the fielding gate, records the result, and creates the assignment **only if it permits**. A refusal returns `409` naming every blocker, and the recorded gate result id so the refusal can be looked up later.\n\nReturns a participant token **once**. The row stores only a hash of it, so it cannot be recovered afterwards — reissue instead.\n\nCreating an assignment with a future window also raises a contact retention hold in the same transaction, so the participant cannot be purged from the contact vault while still owing a form.","operationId":"create_assignment_v1_rk_studies__study_id__assignments_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"The fielding gate refused, with named blockers"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-fielding"],"summary":"List assignments and their completion status","description":"Status, not content: who has been assigned what, and whether it has come back. `response.collect` is enough — a coordinator chasing completion does not need to read anybody's answers.","operationId":"list_assignments_v1_rk_studies__study_id__assignments_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"enrolment_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/assignments/{assignment_id}/gate-result":{"get":{"tags":["rk-fielding"],"summary":"Why this assignment was permitted","description":"The decision as it was recorded, with the inputs it read. Never recomputed: the day an approval expires, past assignments must still be able to say what permitted them.","operationId":"read_gate_result_v1_rk_assignments__assignment_id__gate_result_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GateResultOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/responses":{"get":{"tags":["rk-fielding"],"summary":"List responses for a study","description":"Pseudonymous throughout: an enrolment id and a participant code, never a name or an address. Test-mode responses are excluded — they are unreachable from analysis, exports and the case view by the same predicate everywhere.","operationId":"list_responses_v1_rk_studies__study_id__responses_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"enrolment_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/responses/{response_set_id}":{"get":{"tags":["rk-fielding"],"summary":"Read one response, with its answers and provenance","description":"Carries the presentation provenance that establishes what the participant actually received: the definition checksum, the runtime version that produced the branching path, the language, the collection mode and the realised order. A response that cannot say what was served is a number with no question attached to it.","operationId":"read_response_v1_rk_responses__response_set_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"response_set_id","in":"path","required":true,"schema":{"type":"string","title":"Response Set Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseSetOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/waves":{"post":{"tags":["rk-fielding"],"summary":"Define a follow-up wave","description":"A wave is a rule — \"ninety days after consent, open for fourteen days\" — not a calendar. Each participant's dates are computed from their own anchor when the wave is opened for them.\n\nOnly the **schedule** is validated here: ordering, dependencies, impossible windows and previous-wave cycles. Whether the study may still field is a question about *now*, answered per participant at opening time — a schedule written in January says nothing about September.","operationId":"create_wave_v1_rk_studies__study_id__waves_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaveCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaveOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"The schedule could never run, with the reason named"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-fielding"],"summary":"List a study's waves","description":"In sequence, with how many assignments each has produced by status.","operationId":"list_waves_v1_rk_studies__study_id__waves_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaveListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/waves/{wave_id}":{"patch":{"tags":["rk-fielding"],"summary":"Change a wave","description":"Re-validates the whole schedule, including this wave's place in it. Assignments already opened are untouched: a schedule changed in September does not retroactively move a window somebody already answered in.","operationId":"update_wave_v1_rk_waves__wave_id__patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"wave_id","in":"path","required":true,"schema":{"type":"string","title":"Wave Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaveUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaveOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/waves/{wave_id}/open":{"post":{"tags":["rk-fielding"],"summary":"Open a wave, creating assignments for everyone now due one","description":"Idempotent: run it twice, or twice at once, and each participant gets one assignment. The database decides — `UNIQUE (enrolment_id, instrument_id, wave_id)` — rather than a count checked before an insert.\n\nThe **fielding gate runs per participant, here**, and its result is recorded. A participant whose consent was withdrawn, or whose study's approval expired since the schedule was written, is skipped with the blockers named.\n\n**Sends nothing.** Opening a wave creates work and a participant link; telling anybody about it is a later slice. `dry_run` answers what would happen without writing.","operationId":"open_wave_v1_rk_waves__wave_id__open_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"wave_id","in":"path","required":true,"schema":{"type":"string","title":"Wave Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaveOpenIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaveOpenOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"The wave is not active, or does not exist"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/responses/{response_set_id}/attachments/{attachment_id}":{"get":{"tags":["rk-fielding"],"summary":"Download a file a participant attached","description":"Researcher credentials and `response.view`; a file attached to a question marked sensitive or special-category additionally needs `response.sensitive.view`, which no API key may hold. Sensitivity is per question, not per form — one special-category question does not make every file on the response sensitive, and does not make itself readable to somebody holding only `response.view`.\n\nAlways served as a download: `Content-Disposition: attachment`, `Content-Security-Policy: sandbox`, `X-Content-Type-Options: nosniff`, `Cache-Control: no-store`, and `application/octet-stream` whatever the file actually is. There is no inline preview, because inline preview of participant-supplied HTML, SVG or PDF is the whole problem.\n\nThe checksum is re-verified on every download and a mismatch refuses: bytes that no longer hash to what was scanned are not the bytes that were scanned.","operationId":"download_attachment_v1_rk_responses__response_set_id__attachments__attachment_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"response_set_id","in":"path","required":true,"schema":{"type":"string","title":"Response Set Id"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Missing response.view, or response.sensitive.view"},"404":{"description":"No such attachment on that response in this workspace"},"409":{"description":"Not clean, erased, withdrawn, or failed its integrity check"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/answers/{answer_id}/amendments":{"post":{"tags":["rk-fielding"],"summary":"Correct a submitted answer","description":"Corrections never overwrite. The answer row holds the current value; the amendment records what it was, what it became, who decided and why — and every one is audited.\n\nExactly one of `value` and `missing_reason`: an answer that is both a value and a recorded refusal is a contradiction. A correction may move between the two in either direction, which is why both are kept on both sides of the record.\n\n**This is not how a follow-up is recorded.** Employment, residence and income change; wave 3's answer is a new response set, not a correction to wave 1. An amendment says the earlier record was wrong about the moment it described.\n\nA calculated value cannot be corrected directly — correct the answers it is worked out from. An attachment answer is re-checked: the file must be clean and must belong to this response, question and repeat instance.","operationId":"amend_answer_v1_rk_answers__answer_id__amendments_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"answer_id","in":"path","required":true,"schema":{"type":"string","title":"Answer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmendAnswerIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmendmentOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Corrected by somebody else, or entered in error"},"422":{"description":"Not correctable, with the reason named"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-fielding"],"summary":"The correction history of one answer","description":"Oldest first. The history is the record — it is what an auditor asks for, and what shows that a value was corrected rather than always having said what it now says.","operationId":"list_amendments_v1_rk_answers__answer_id__amendments_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"answer_id","in":"path","required":true,"schema":{"type":"string","title":"Answer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmendmentListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/responses/{response_set_id}/entered-in-error":{"post":{"tags":["rk-fielding"],"summary":"Record that a response should not have existed","description":"Kept, never deleted. A response recorded against the wrong participant is a fact about the dataset, and deleting the row is how a study quietly loses a case nobody can afterwards account for. It is excluded from review and analysis by status, the same way a test response is.","operationId":"mark_entered_in_error_v1_rk_responses__response_set_id__entered_in_error_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"response_set_id","in":"path","required":true,"schema":{"type":"string","title":"Response Set Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnteredInErrorIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseSetOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/completion":{"get":{"tags":["rk-fielding"],"summary":"How much of the fieldwork has come back","description":"Read-only, and counted from rows that already exist: no assignment advances, no status is recomputed, no gate runs.\n\nRecords are separated into `scheduled`, `open`, `due`, `completed`, `expired`, `cancelled`, `blocked` and `entered_in_error`. `due` means open and past its due date — still answerable; `blocked` counts recorded fielding-gate **refusals**, which never became assignments at all, so it is a count of refusal events rather than of people.\n\n**The denominator is reported, not implied.** Cancelled assignments were never owed and responses entered in error are not somebody's answers, so both are excluded and both are shown. `completion_rate` is `null` rather than `0` when nothing is owed.\n\nWhatever leaves the denominator leaves the numerator: an assignment excluded from `counted` appears in `entered_in_error` and in no status bucket, so a rate can never exceed 1.\n\nPseudonymous: counts and instrument or wave labels only. No field here can carry a name, an address or a telephone number.\n\nScreening is **not** included. It has its own lawful basis and its own capability (C13) — see `/completion/screening`.","operationId":"study_completion_v1_rk_studies__study_id__completion_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"site_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Site Id"}},{"name":"cohort_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Cohort Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyCompletionOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"The site or cohort does not belong to this study"}}}},"/v1/rk/studies/{study_id}/completion/screening":{"get":{"tags":["rk-fielding"],"summary":"Screening progress, behind its own capability","description":"Separate from study completion on purpose. Screening data has its own notice, purpose, lawful basis and retention (C13), and is opened by `eligibility.manage` — never by `response.view` or `response.collect`. Returning these counts alongside response completion would make that boundary depend on which fields a caller happened to read.","operationId":"screening_completion_v1_rk_studies__study_id__completion_screening_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningCompletionOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/sessions/{session_id}/participant-context":{"get":{"tags":["rk-fielding"],"summary":"The form answers an interviewer is permitted to see","description":"Joins this interview to what its participant has already answered, through the enrolment the session is linked to. Nothing is copied: the answers stay where they were recorded, and this reads them.\n\n**Fails closed.** `moderator_context_policy` defaults to `hidden_from_moderator`, so a question whose author said nothing about moderator access shows nothing here. Only `moderator_may_know`, `moderator_may_reference` and `moderator_may_probe` appear, and each answer carries its policy — being allowed to *know* something is not permission to *raise* it.\n\n**Submitted answers only.** A participant's part-finished draft is not something they have said, and an interviewer reading one back would be quoting a sentence nobody finished.\n\nA question marked sensitive or special-category needs `response.sensitive.view` as well. What was withheld is **counted and reported**: an empty panel that held back nine answers and one with nothing to show are different facts, and an interviewer must be able to tell them apart.","operationId":"participant_context_v1_rk_sessions__session_id__participant_context_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantContextOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"No such interview, or it names no participant"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/screening-sessions":{"post":{"tags":["rk-screening"],"summary":"Open a screening session","description":"Screening happens **before** research consent exists, so the session carries its own notice version, purpose, lawful basis and retention deadline — none of them inherited from the study (C13).\n\nThe notice and basis are required. A session that cannot say what the person was shown is exactly the failure this boundary prevents.","operationId":"start_session_v1_rk_studies__study_id__screening_sessions_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningStartIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningSessionOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Reading screening needs eligibility.manage"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-screening"],"summary":"List screening sessions","description":"Needs `eligibility.manage`. Holding `response.view` does not open this: screening answers were collected under a different notice and basis.","operationId":"list_sessions_v1_rk_studies__study_id__screening_sessions_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"eligibility_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eligibility Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningSessionListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Reading screening needs eligibility.manage"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/screening-sessions/{session_id}/outcome":{"post":{"tags":["rk-screening"],"summary":"Close a screening session with an outcome","description":"Closing is not purging. The record is kept until its own retention deadline, because 'this person was screened and did not meet the criteria' is a record a study needs. Reasons are enumerated so the field cannot carry what somebody said.","operationId":"record_outcome_v1_rk_screening_sessions__session_id__outcome_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningOutcomeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningSessionOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Reading screening needs eligibility.manage"},"404":{"description":"Not found in this workspace"},"409":{"description":"Already closed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/screening-sessions/{session_id}/contact-capture":{"post":{"tags":["rk-screening"],"summary":"Record that contact details were collected, and why","description":"Contact identity is not collected during screening by default. Where it is, the justification is recorded rather than inferred from the fact that a telephone number exists.","operationId":"record_contact_capture_v1_rk_screening_sessions__session_id__contact_capture_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCaptureIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningSessionOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Reading screening needs eligibility.manage"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/screening-sessions/{session_id}/compatibility-decision":{"post":{"tags":["rk-screening"],"summary":"Record whether screening answers may be reused in the study","description":"ODPC's four-part test — solely for the research purpose, necessary, proportionate, safeguarded — recorded as four answers rather than one tick, because a decision that can be entered as a single flag is a decision nobody made.\n\nStored whichever way it went: a decision that reuse is **not** compatible is as much a record as one that it is, and a table holding only approvals cannot show the question was ever asked.","operationId":"record_compatibility_decision_v1_rk_screening_sessions__session_id__compatibility_decision_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatibilityDecisionIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompatibilityDecisionOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Reading screening needs eligibility.manage"},"404":{"description":"Not found in this workspace"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/screening-sessions/{session_id}/link":{"post":{"tags":["rk-screening"],"summary":"Record that a screened person enrolled","description":"**Linking is not mutating.** The screening response stays inside the screening purpose boundary, under the screening clock. This records the association and grants nothing — analysis reads enrolment-bound responses, never the screening corpus.\n\nSomebody who screened out does not receive a link. Reuse of screening answers additionally requires a compatibility decision that affirmed all four parts of the test.","operationId":"link_to_enrolment_v1_rk_screening_sessions__session_id__link_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningLinkIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningLinkOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Reading screening needs eligibility.manage"},"404":{"description":"Not found in this workspace"},"409":{"description":"Already linked, or the record was erased"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/screening-sessions/{session_id}/purge":{"post":{"tags":["rk-screening"],"summary":"Erase a screening record now","description":"C13 allows immediate deletion for somebody who screened out, rather than waiting for the clock. The answers and the recruitment trail go; the tombstone — that a screening happened under this notice and ended this way — is kept, because that is the auditable fact.","operationId":"purge_session_v1_rk_screening_sessions__session_id__purge_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningPurgeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreeningSessionOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"Reading screening needs eligibility.manage"},"404":{"description":"Not found in this workspace"},"409":{"description":"An uploaded file could not be deleted yet; it is unreadable and the purge can be retried"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/forms/{token}":{"get":{"tags":["rk-participant-forms"],"summary":"Open a participant form","description":"Returns the form and whatever is already saved, so a resumed form comes back exactly as it was left. Side-effect free: opening a link does not start anything, consume the link, or change a status.\n\nThe canonical definition travels with the response so the browser can run the shipped runtime and show branching immediately. It remains the server's evaluation that decides what is stored.","operationId":"open_form_v1_rk_forms__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalFormOut"}}}},"404":{"description":"This link is not valid, has expired, or has been used"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/forms/{token}/save":{"post":{"tags":["rk-participant-forms"],"summary":"Save progress","description":"Idempotent on `save_key`: a retry after a dropped connection replays the recorded outcome rather than writing a second time. Concurrency-checked on `expected_revision`: a second tab is refused with `409` rather than silently overwriting the first.\n\nThe response carries the **server's** view of every question — what is relevant, what is required, what is selectable, what was calculated. Values the client supplied for calculated or hidden questions are discarded and listed back, so a participant is never left believing something was recorded that was not.","operationId":"save_form_v1_rk_forms__token__save_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSaveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSaveOut"}}}},"404":{"description":"This link is not valid, has expired, or has been used"},"409":{"description":"Stale revision, or already submitted"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/forms/{token}/submit":{"post":{"tags":["rk-participant-forms"],"summary":"Submit a completed form","description":"Refuses an incomplete response and names every problem with the path it applies to. Completeness is the **server's** evaluation: a client that believes the form is finished does not make it finished, and a form submitted with a required question unanswered produces a gap nobody can explain later.\n\nA repeated submit with the same `save_key` replays rather than submitting twice.","operationId":"submit_form_v1_rk_forms__token__submit_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSaveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSaveOut"}}}},"404":{"description":"This link is not valid, has expired, or has been used"},"409":{"description":"Stale revision, or already submitted"},"422":{"description":"Incomplete, with the problems named"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/forms/{token}/attachments":{"post":{"tags":["rk-participant-forms"],"summary":"Attach a file to an answer","description":"The participant link is the only credential, and it reaches exactly one response: a token cannot attach to somebody else's form, nor to a question that does not take a file.\n\nThe file goes through the same pipeline shape the dossier uses and none of its code: quarantine, refuse executables and web documents, sniff what the bytes actually are, scan, then store. The browser's declared content type is never consulted — it is a claim the uploader made about their own file — and the declared size is checked **and** the real one.\n\nIdempotent on `upload_key`: a retry after a dropped connection returns the file already stored rather than storing it twice.\n\nWith no scanner configured this refuses, because nothing would ever become usable and the participant would be left waiting for a check that is never going to run.","operationId":"upload_attachment_v1_rk_forms__token__attachments_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_attachment_v1_rk_forms__token__attachments_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadOut"}}}},"404":{"description":"This link is not valid, has expired, or has been used"},"409":{"description":"Nothing saved yet, or the file was refused"},"413":{"description":"Larger than this question allows"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/forms/{token}/attachments/{attachment_id}":{"delete":{"tags":["rk-participant-forms"],"summary":"Remove a file the participant attached","description":"Erases the bytes through the same service a rights request will use, keeping the row as a tombstone so the removal is auditable. Only while the form is still open, and only for a file on this response.","operationId":"remove_attachment_v1_rk_forms__token__attachments__attachment_id__delete","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentOut"}}}},"404":{"description":"This link is not valid, has expired, or has been used"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/demo/sessions":{"post":{"tags":["demo"],"summary":"Start a demo interview","operationId":"start_demo_v1_rk_demo_sessions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoStart"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoStarted"}}}},"403":{"description":"The Turnstile check failed"},"429":{"description":"This visitor, or the day, is at its demo limit"},"503":{"description":"The demo is switched off"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/demo/sessions/{token}/result":{"get":{"tags":["demo"],"summary":"The visitor's own demo transcript","description":"Readable with the demo link itself; only ever for sessions in the demo study.","operationId":"demo_result_v1_rk_demo_sessions__token__result_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Demo Result V1 Rk Demo Sessions  Token  Result Get"}}}},"404":{"description":"Not a demo interview, or already deleted"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/portal/{token}":{"get":{"tags":["rk-participant-forms"],"summary":"Open a participant's task list","description":"Everything this participant is being asked for, grouped into what is due, what is optional, what is finished, what has closed and what is still to come.\n\nAdvances nothing. No assignment opens, no wave opens, no status is recomputed and the link is not consumed — a portal link is meant to be returned to across a follow-up wave, unlike a join token which is spent. What is shown is derived from the assignment's own dates, so a form that lapsed an hour ago reads as closed even though the hourly sweep has not moved it yet.\n\nCarries no contact identity and no participant code: the link is already scoped to a record, and naming that record in the response would hand a finder something to quote.","operationId":"task_list_v1_rk_portal__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalTaskListOut"}}}},"404":{"description":"This link is not valid, has expired, or has been withdrawn"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/portal/{token}/assignments/{assignment_id}":{"get":{"tags":["rk-participant-forms"],"summary":"Open one of this participant's forms","description":"The same form, the same projection and the same runtime the assignment-link surface serves — reached through the portal token instead. Side-effect free: opening a form starts nothing and changes no status.\n\nRefused with the same message as an unknown link if the form belongs to somebody else, is outside its own window, or has already been submitted.","operationId":"open_form_v1_rk_portal__token__assignments__assignment_id__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","title":"Assignment Id"}},{"name":"include_imported","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Imported"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalFormOut"}}}},"404":{"description":"This link is not valid, has expired, or has been withdrawn"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/portal/{token}/assignments/{assignment_id}/save":{"post":{"tags":["rk-participant-forms"],"summary":"Save progress on one of this participant's forms","description":"Idempotent on `save_key`: a retry after a dropped connection replays rather than writing twice. Concurrency-checked on `expected_revision`: a second tab is refused rather than silently overwriting the first.\n\nThe response carries the server's own view of every question, so the browser reconciles to it rather than the other way round. A dataset lock refuses the write with `409` — reading the task list and the consent receipt keeps working while one is open.","operationId":"save_form_v1_rk_portal__token__assignments__assignment_id__save_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSaveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSaveOut"}}}},"404":{"description":"This link is not valid, has expired, or has been withdrawn"},"409":{"description":"Stale revision, already submitted, or the data is locked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/portal/{token}/assignments/{assignment_id}/submit":{"post":{"tags":["rk-participant-forms"],"summary":"Submit one of this participant's completed forms","description":"Refuses an incomplete response and names every problem with the path it applies to. Completeness is the server's evaluation: a client that believes the form is finished does not make it finished.\n\nA repeated submit with the same `save_key` replays rather than submitting twice.","operationId":"submit_form_v1_rk_portal__token__assignments__assignment_id__submit_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSaveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSaveOut"}}}},"404":{"description":"This link is not valid, has expired, or has been withdrawn"},"409":{"description":"Stale revision, already submitted, or the data is locked"},"422":{"description":"Incomplete, with the problems named"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/portal/{token}/assignments/{assignment_id}/attachments":{"post":{"tags":["rk-participant-forms"],"summary":"Attach a file to an answer on one of this participant's forms","description":"The same upload the assignment-link surface takes, reached through the portal token. The assignment is resolved by this participant's **enrolment scope**, so a token cannot attach to somebody else's form: an assignment belonging elsewhere is refused with the identical message as one that does not exist.\n\nThe file goes through the same pipeline shape the dossier uses and none of its code: quarantine, refuse executables and web documents, sniff what the bytes actually are, scan, then store. The browser's declared content type is never consulted — it is a claim the uploader made about their own file — and the declared size is checked **and** the real one.\n\nIdempotent on `upload_key`: a retry after a dropped connection returns the file already stored rather than storing it twice.\n\nWith no scanner configured this refuses, because nothing would ever become usable and the participant would be left waiting for a check that is never going to run.","operationId":"upload_portal_attachment_v1_rk_portal__token__assignments__assignment_id__attachments_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_portal_attachment_v1_rk_portal__token__assignments__assignment_id__attachments_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadOut"}}}},"404":{"description":"No such link, form, or not answerable now"},"409":{"description":"Nothing saved yet, or the file was refused"},"413":{"description":"Larger than this question allows"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/portal/{token}/assignments/{assignment_id}/attachments/{attachment_id}":{"delete":{"tags":["rk-participant-forms"],"summary":"Remove a file from one of this participant's forms","description":"Erases the bytes through the same service a rights request will use, keeping the row as a tombstone so the removal is auditable. Only while the form is still open, and only for a file on this response.\n\nResolved through this participant's enrolment scope: a file on another participant's response is not found, which is the same answer an invented id gets.","operationId":"remove_portal_attachment_v1_rk_portal__token__assignments__assignment_id__attachments__attachment_id__delete","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","title":"Assignment Id"}},{"name":"attachment_id","in":"path","required":true,"schema":{"type":"string","title":"Attachment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentOut"}}}},"404":{"description":"No such link, form, file, or not answerable now"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/portal/{token}/consent-receipt":{"get":{"tags":["rk-participant-forms"],"summary":"Read what this participant consented to","description":"The version and hash of the document they actually agreed to, read from the stored consent record. **Never recomputed** from the study's current consent text: if the study has republished its document since, this still describes the one they read, which is the only thing a receipt can honestly say.\n\nReadable while a dataset lock is open — a lock stops data changing, not somebody reading their own consent.","operationId":"consent_receipt_v1_rk_portal__token__consent_receipt_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentReceiptOut"}}}},"404":{"description":"No consent record exists for this participant"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/portal/{token}/rights-request":{"post":{"tags":["rk-participant-forms"],"summary":"Exercise a right over one's own data","description":"Records the request, acknowledges it with a receipt the participant can quote, and holds their contact details so the answer can actually be delivered.\n\n**Executes nothing.** Deciding and executing are separate, human-only acts behind `rights.review` and `rights.execute` (§9 puts executing an erasure beside asserting ethics approval), and no participant link carries either.\n\n`request_kind` is enumerated and there is no free-text field. Somebody disputing a recorded *value* is asking a different question, which goes to `POST …/corrections`.","operationId":"submit_rights_request_v1_rk_portal__token__rights_request_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RightsRequestIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RightsRequestOut"}}}},"404":{"description":"This link is not valid, has expired, or has been withdrawn"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/portal/{token}/assignments/{assignment_id}/response":{"get":{"tags":["rk-participant-forms"],"summary":"Read what this participant answered","description":"The answers this participant gave to one of their own forms, so they can check what is recorded about them and say if any of it is wrong.\n\nThis **does** carry the values, unlike every researcher-facing response view. There the reader is a third party; here the reader is the person the answers are about, and asking somebody to dispute a value they cannot see would be absurd.\n\nEach answer says whether it may be disputed, and when it may not, why — a value the study team recorded, one worked out from other answers, one already reported, or a form not yet sent.","operationId":"read_response_v1_rk_portal__token__assignments__assignment_id__response_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalResponseOut"}}}},"404":{"description":"Nothing recorded for this form"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/portal/{token}/corrections":{"post":{"tags":["rk-participant-forms"],"summary":"Say that a recorded value is wrong","description":"Raises a data query against one of this participant's own answers so somebody holding `response.amend` can adjudicate it. **Changes no value**: a participant correcting their own submitted data directly would be an amendment nobody reviewed, and the correction itself runs through the ordinary amendment service where the previous value, both missing reasons and the sequence are preserved.\n\nThere is no field for what the value should be. The query row has nowhere to put participant content, which is deliberate.\n\nAllowed while a dataset lock is open: flagging a value writes no answer, and a lock stops data changing rather than stopping somebody reporting that it is wrong.","operationId":"request_correction_v1_rk_portal__token__corrections_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorrectionRequestIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Request Correction V1 Rk Portal  Token  Corrections Post"}}}},"404":{"description":"No such answer of this participant's"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/delegations":{"get":{"tags":["rk-governance"],"summary":"The delegation log","description":"Everyone the PI has authorised on this study, including delegations that have ended. History is the point of the log: removing a lapsed entry would erase the answer to when someone stopped being authorised.","operationId":"list_delegations_v1_rk_studies__study_id__delegations_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DelegationResponse"},"title":"Response List Delegations V1 Rk Studies  Study Id  Delegations Get"}}}},"401":{"description":"Missing or invalid credential"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-governance"],"summary":"Authorise someone on this study","operationId":"create_delegation_v1_rk_studies__study_id__delegations_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DelegationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DelegationResponse"}}}},"401":{"description":"Missing or invalid credential"},"409":{"description":"Already delegated on this study"},"422":{"description":"The delegation period ends before it starts"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/delegations/{delegation_id}/end":{"post":{"tags":["rk-governance"],"summary":"End a delegation","description":"Closes the delegation with today's date rather than deleting it. When someone stopped being authorised is part of the record.","operationId":"end_delegation_v1_rk_delegations__delegation_id__end_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"delegation_id","in":"path","required":true,"schema":{"type":"string","title":"Delegation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DelegationResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Delegation not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/training-records":{"get":{"tags":["rk-governance"],"summary":"Training held by the team","description":"Optionally filtered to one person. Expired records are included and marked: when a certificate lapsed is what an auditor asks about.","operationId":"list_training_v1_rk_training_records_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"member_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Member User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TrainingRecordResponse"},"title":"Response List Training V1 Rk Training Records Get"}}}},"401":{"description":"Missing or invalid credential"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-governance"],"summary":"Record training","operationId":"create_training_v1_rk_training_records_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingRecordCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingRecordResponse"}}}},"401":{"description":"Missing or invalid credential"},"422":{"description":"The training expires before it was completed"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/training-records/{record_id}":{"delete":{"tags":["rk-governance"],"summary":"Remove a training record","description":"For records entered in error. Lapsed training is kept, not deleted.","operationId":"delete_training_v1_rk_training_records__record_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/policy-bindings":{"get":{"tags":["rk-governance"],"summary":"Policy bindings","description":"Filterable by scope and kind. Superseded bindings are listed too — the history is what makes a past decision explainable.","operationId":"list_bindings_v1_rk_policy_bindings_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}},{"name":"scope_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Id"}},{"name":"policy_kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PolicyBindingResponse"},"title":"Response List Bindings V1 Rk Policy Bindings Get"}}}},"401":{"description":"Missing or invalid credential"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-governance"],"summary":"Bind a policy for a period","description":"Refuses a binding that overlaps an existing one for the same policy at the same scope: two answers to the same question over the same dates is not a policy, and resolving it arbitrarily at read time would make past decisions unexplainable.","operationId":"create_binding_v1_rk_policy_bindings_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyBindingCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyBindingResponse"}}}},"401":{"description":"Missing or invalid credential"},"409":{"description":"Overlaps an existing binding"},"422":{"description":"The period ends before it starts, or the scope needs an id"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/policy-bindings/{binding_id}/end":{"post":{"tags":["rk-governance"],"summary":"End a binding","description":"Closes the period rather than deleting the row. A binding that governed a decision must remain readable after it stops applying.","operationId":"end_binding_v1_rk_policy_bindings__binding_id__end_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"binding_id","in":"path","required":true,"schema":{"type":"string","title":"Binding Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyBindingResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Binding not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/policy-bindings/{binding_id}":{"delete":{"tags":["rk-governance"],"summary":"Delete a binding entered in error","description":"For a binding that never should have existed. A binding that has governed anything should be ended, not deleted.","operationId":"delete_binding_v1_rk_policy_bindings__binding_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"binding_id","in":"path","required":true,"schema":{"type":"string","title":"Binding Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/policy-bindings/resolve":{"get":{"tags":["rk-governance"],"summary":"Which policy applies here, and where it came from","description":"Walks cohort → site → study → tenant → platform and returns the first binding in force. The scope it came from is part of the answer: 'retention is 365 days' means something different from the platform default than from a site in another jurisdiction.","operationId":"resolve_policy_v1_rk_policy_bindings_resolve_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"policy_kind","in":"query","required":true,"schema":{"type":"string","title":"Policy Kind"}},{"name":"policy_key","in":"query","required":true,"schema":{"type":"string","title":"Policy Key"}},{"name":"study_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"}},{"name":"site_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"}},{"name":"cohort_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Id"}},{"name":"at","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Resolve as of this instant. Defaults to now — pass a past date to explain a decision by the policy that applied then.","title":"At"},"description":"Resolve as of this instant. Defaults to now — pass a past date to explain a decision by the policy that applied then."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResolvedPolicy"},{"type":"null"}],"title":"Response Resolve Policy V1 Rk Policy Bindings Resolve Get"}}}},"401":{"description":"Missing or invalid credential"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/safety-configurations":{"get":{"tags":["rk-safety-configuration"],"summary":"Every version of this study's safety wording","operationId":"list_configurations_v1_rk_studies__study_id__safety_configurations_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SafetyConfigurationResponse"},"title":"Response List Configurations V1 Rk Studies  Study Id  Safety Configurations Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-safety-configuration"],"summary":"Start a draft","operationId":"create_configuration_v1_rk_studies__study_id__safety_configurations_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyConfigurationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyConfigurationResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"The draft could not be written as given"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/safety-configurations/{config_id}":{"get":{"tags":["rk-safety-configuration"],"summary":"Get Configuration","operationId":"get_configuration_v1_rk_safety_configurations__config_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyConfigurationResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["rk-safety-configuration"],"summary":"Edit a draft","operationId":"update_configuration_v1_rk_safety_configurations__config_id__patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyConfigurationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyConfigurationResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"409":{"description":"Approved wording cannot be edited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/safety-configurations/{config_id}/preview":{"get":{"tags":["rk-safety-configuration"],"summary":"Exactly what a participant would hear","description":"The assembled wording, in order, as the runtime would say it — not a paraphrase and not a form. Somebody approving this is accountable for what a person in crisis actually hears, which means seeing it.","operationId":"preview_v1_rk_safety_configurations__config_id__preview_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WordingPreview"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/safety-coverage":{"get":{"tags":["rk-safety-configuration"],"summary":"Which sites and languages are actually covered","description":"A study with approved wording for English and participants interviewed in Swahili is exactly as unsafe as a study with none, and looks fine on any screen that only asks whether a configuration exists. This is the screen that asks the other question.","operationId":"coverage_v1_rk_studies__study_id__safety_coverage_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoverageReport"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/safety-configurations/{config_id}/approve":{"post":{"tags":["rk-safety-configuration"],"summary":"Approve wording for participants","description":"Puts these exact words in front of people at the worst moment of an interview. Requires recent re-verification, cannot be done by an integration, and makes the version immutable.","operationId":"approve_configuration_v1_rk_safety_configurations__config_id__approve_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyConfigurationResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"403":{"description":"Re-verification required, or not a person"},"409":{"description":"Already approved, or it overlaps approved wording"},"422":{"description":"Incomplete — approving would promise what cannot be delivered"},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/safety-configurations/{config_id}/withdraw":{"post":{"tags":["rk-safety-configuration"],"summary":"End a version's effect","description":"Stops this wording applying from now on. It is **not** deleted and the row is not edited: interviews fielded under it stay explainable by it.","operationId":"withdraw_configuration_v1_rk_safety_configurations__config_id__withdraw_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyConfigurationResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/safety-configurations/not-applicable":{"post":{"tags":["rk-safety-configuration"],"summary":"Record that no support information applies","description":"Permitted where an institution allows it — a study of catalogue metadata does not need a helpline. Never inferred from silence: it names an accountable person and a reason, and it is approved like any other wording.","operationId":"record_not_applicable_v1_rk_studies__study_id__safety_configurations_not_applicable_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotApplicableRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyConfigurationResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/sessions":{"get":{"tags":["rk-sessions"],"summary":"List sessions for study","operationId":"rk_list_study_sessions","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Rk List Study Sessions"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/guide":{"get":{"tags":["rk-guides"],"summary":"Get Latest Guide","operationId":"get_latest_guide_v1_rk_studies__study_id__guide_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-guides"],"summary":"Create Guide","operationId":"create_guide_v1_rk_studies__study_id__guide_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"The guide has problems, each named with its section and item"},"409":{"description":"The guide is unchanged, so no duplicate was created"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/guide/versions":{"get":{"tags":["rk-guides"],"summary":"List Guide Versions","operationId":"list_guide_versions_v1_rk_studies__study_id__guide_versions_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GuideResponse"},"title":"Response List Guide Versions V1 Rk Studies  Study Id  Guide Versions Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/guide/versions/{version}":{"get":{"tags":["rk-guides"],"summary":"Get Guide Version","operationId":"get_guide_version_v1_rk_studies__study_id__guide_versions__version__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/guide/preview":{"post":{"tags":["rk-guides"],"summary":"Preview exactly what the interviewer is told for one section","description":"Builds the system prompt and the first steering note the interviewer would get on entering the section, from the draft sent in the body. Nothing is saved and no model is called. Conditions are shown as they apply to any participant.","operationId":"preview_guide_section_v1_rk_studies__study_id__guide_preview_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuidePreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Guide Section V1 Rk Studies  Study Id  Guide Preview Post"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or section not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/guide/generate":{"post":{"tags":["rk-guides"],"summary":"Generate Guide","operationId":"generate_guide_v1_rk_studies__study_id__guide_generate_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideGenerateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"429":{"description":"Rate limit exceeded"},"402":{"description":"Monthly LLM token quota exceeded"},"503":{"description":"The configured AI provider or model could not generate a guide"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/guide/import":{"post":{"tags":["rk-guides"],"summary":"Propose a guide from a Word document","description":"Reads a .docx and returns a proposed guide with a report of what converted and what is uncertain. Nothing is saved; the file is not kept.","operationId":"import_guide_v1_rk_studies__study_id__guide_import_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_guide_v1_rk_studies__study_id__guide_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Import Guide V1 Rk Studies  Study Id  Guide Import Post"}}}},"401":{"description":"Missing or invalid credential"},"402":{"description":"Monthly LLM token quota exceeded"},"404":{"description":"Study not found"},"422":{"description":"The document cannot be read (a stable `code` says why)"},"502":{"description":"The proposal could not be produced; try again"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/captures":{"get":{"tags":["rk-captures"],"summary":"Captured data for a study, with what each capture item declares","operationId":"list_captures_v1_rk_studies__study_id__captures_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}},{"name":"item_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Captures V1 Rk Studies  Study Id  Captures Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or record not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/captures/{record_id}":{"patch":{"tags":["rk-captures"],"summary":"Correct a record's values","operationId":"edit_capture_v1_rk_studies__study_id__captures__record_id__patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureEdit"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Edit Capture V1 Rk Studies  Study Id  Captures  Record Id  Patch"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or record not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/captures/{record_id}/verify":{"post":{"tags":["rk-captures"],"summary":"Mark a record as checked against the transcript","operationId":"verify_capture_v1_rk_studies__study_id__captures__record_id__verify_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Verify Capture V1 Rk Studies  Study Id  Captures  Record Id  Verify Post"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or record not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/captures/{record_id}/reject":{"post":{"tags":["rk-captures"],"summary":"Discard a record that is wrong","operationId":"reject_capture_v1_rk_studies__study_id__captures__record_id__reject_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reject Capture V1 Rk Studies  Study Id  Captures  Record Id  Reject Post"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or record not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/captures/export":{"get":{"tags":["rk-captures"],"summary":"Captured data as CSV or Excel","operationId":"export_captures_v1_rk_studies__study_id__captures_export_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|xlsx)$","default":"csv","title":"Format"}},{"name":"verified_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Verified Only"}}],"responses":{"200":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or record not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/consent/processors":{"get":{"tags":["rk-consent"],"summary":"Who processes a participant's voice in this deployment","description":"From configuration (`processors.configured`). Public: it names services, not people.","operationId":"list_processors_v1_rk_consent_processors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProcessorOut"},"type":"array","title":"Response List Processors V1 Rk Consent Processors Get"}}}},"429":{"description":"Rate limit exceeded"}}}},"/v1/rk/consent/{study_id}/screen":{"get":{"tags":["rk-consent"],"summary":"Get Consent Screen","operationId":"get_consent_screen_v1_rk_consent__study_id__screen_get","parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentScreenResponse"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/consent/{token}/record":{"post":{"tags":["rk-consent"],"summary":"Record Consent","operationId":"record_consent_v1_rk_consent__token__record_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRecordRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRecordResponse"}}}},"429":{"description":"Rate limit exceeded"},"200":{"description":"Choices recorded; the interview will not start (declined, or recording declined: offered a human interviewer).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentNotGiven"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/consent/withdraw":{"post":{"tags":["rk-consent"],"summary":"Withdraw Consent","description":"Execute an approved erasure.\n\nThis is **event 6** of the seven distinct rights events — the irreversible\none. It is not the same as a participant ending an interview, withdrawing\nfrom further participation, or asking for their data to be deleted; those\nare separate events and none of them destroys data.\n\nRequires an accountable human. A raw API key is refused outright: a\ncredential in a config file cannot be answerable for destroying research\ndata, and the participant-rights workflow that will replace this route keeps\nthe same rule.","operationId":"withdraw_consent_v1_rk_consent_withdraw_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentWithdrawalRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rk/sessions/{session_id}/artifact":{"get":{"tags":["rk-artifacts"],"summary":"Get Artifact","operationId":"get_artifact_v1_rk_sessions__session_id__artifact_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or artifact not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/sessions/{session_id}/artifact/process":{"post":{"tags":["rk-artifacts"],"summary":"Trigger Artifact Processing","operationId":"trigger_artifact_processing_v1_rk_sessions__session_id__artifact_process_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trigger Artifact Processing V1 Rk Sessions  Session Id  Artifact Process Post"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or artifact not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/sessions/{session_id}/artifact/claims/{claim_id}":{"patch":{"tags":["rk-artifacts"],"summary":"Annotate Claim","operationId":"annotate_claim_v1_rk_sessions__session_id__artifact_claims__claim_id__patch","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"claim_id","in":"path","required":true,"schema":{"type":"string","title":"Claim Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimAnnotation"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Annotate Claim V1 Rk Sessions  Session Id  Artifact Claims  Claim Id  Patch"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or artifact not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/sessions/{session_id}/artifact/claims/{claim_id}/verify":{"post":{"tags":["rk-artifacts"],"summary":"Verify Claim","operationId":"verify_claim_v1_rk_sessions__session_id__artifact_claims__claim_id__verify_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"claim_id","in":"path","required":true,"schema":{"type":"string","title":"Claim Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Verify Claim V1 Rk Sessions  Session Id  Artifact Claims  Claim Id  Verify Post"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or artifact not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/sessions/{session_id}/transcript":{"get":{"tags":["rk-artifacts"],"summary":"Get Transcript","operationId":"get_transcript_v1_rk_sessions__session_id__transcript_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Transcript V1 Rk Sessions  Session Id  Transcript Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or artifact not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/sessions/{session_id}/coverage":{"get":{"tags":["rk-artifacts"],"summary":"Get Coverage","operationId":"get_coverage_v1_rk_sessions__session_id__coverage_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Coverage V1 Rk Sessions  Session Id  Coverage Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or artifact not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/themes":{"get":{"tags":["rk-themes"],"summary":"List Themes","operationId":"list_themes_v1_rk_studies__study_id__themes_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThemeResponse"},"title":"Response List Themes V1 Rk Studies  Study Id  Themes Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or theme not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rk-themes"],"summary":"Create Theme","operationId":"create_theme_v1_rk_studies__study_id__themes_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or theme not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/themes/{theme_id}":{"put":{"tags":["rk-themes"],"summary":"Update Theme","operationId":"update_theme_v1_rk_studies__study_id__themes__theme_id__put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"theme_id","in":"path","required":true,"schema":{"type":"string","title":"Theme Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or theme not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["rk-themes"],"summary":"Delete Theme","operationId":"delete_theme_v1_rk_studies__study_id__themes__theme_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"theme_id","in":"path","required":true,"schema":{"type":"string","title":"Theme Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or theme not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/themes/{theme_id}/merge":{"post":{"tags":["rk-themes"],"summary":"Merge Theme","description":"Fold `theme_id` into `into_theme_id` — an explicit researcher action,\nnever something the generator does on its own (theme_review.py).","operationId":"merge_theme_v1_rk_studies__study_id__themes__theme_id__merge_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"theme_id","in":"path","required":true,"schema":{"type":"string","title":"Theme Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeMergeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemeResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or theme not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/quotes":{"get":{"tags":["rk-themes"],"summary":"Get Quote Bank","operationId":"get_quote_bank_v1_rk_studies__study_id__quotes_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Quote Bank V1 Rk Studies  Study Id  Quotes Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or theme not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/themes/by-attribute/{attribute_code}":{"get":{"tags":["rk-themes"],"summary":"Get Themes By Attribute","description":"How each theme's evidencing sessions split by a structured attribute.\n\nThe bridge between the two analysis systems (theme_attributes.py):\n`response.view` is the same capability the structured-analysis case view,\ndistributions and cross-tabulations already require — this reads through\nthe identical, disclosure-aware case view, just crossed against interview\nthemes instead of form answers. An API key may never hold it (same rule\n§13 states for every route that returns answers, projected).","operationId":"get_themes_by_attribute_v1_rk_studies__study_id__themes_by_attribute__attribute_code__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"attribute_code","in":"path","required":true,"schema":{"type":"string","title":"Attribute Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Themes By Attribute V1 Rk Studies  Study Id  Themes By Attribute  Attribute Code  Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or theme not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/matrix":{"get":{"tags":["rk-themes"],"summary":"Get Participant Matrix","operationId":"get_participant_matrix_v1_rk_studies__study_id__matrix_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Participant Matrix V1 Rk Studies  Study Id  Matrix Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study or theme not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/analysis":{"post":{"tags":["rk-analysis"],"summary":"Trigger study analysis","description":"Start aggregate analysis for a study with at least two complete session artifacts. If an analysis is already pending or processing, the existing analysis id is returned instead of spawning another paid LLM pipeline.","operationId":"trigger_analysis_v1_rk_studies__study_id__analysis_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAnalysisTriggerResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"429":{"description":"Rate limit exceeded"},"402":{"description":"Monthly LLM token quota or analysis-run cap reached"},"422":{"description":"At least two complete sessions are required"},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-analysis"],"summary":"Get study analysis","description":"Return the latest aggregate analysis for the study. Returns `404` when analysis has not been triggered yet.","operationId":"get_analysis_v1_rk_studies__study_id__analysis_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAnalysisResponse"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Study not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/attributes":{"post":{"tags":["rk-structured-analysis"],"summary":"Approve a question as an analysable attribute","description":"Declares that analysis may group and compare by this question. Needs `attribute.manage`, which is **not** permission to read answers and **not** permission to approve a finding.\n\nFree-text questions cannot become attributes, and `ai_inference` is not an evidence domain: a model's guess about somebody's age must never become the study's record of it (§12.9).","operationId":"define_attribute_v1_rk_studies__study_id__attributes_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-structured-analysis"],"summary":"The study's attribute codebook","description":"Definitions only — no values, so this answers to the ordinary read floor. `stale_projections` counts current projections whose source answer has been amended since, so a console can say the table is out of date without rebuilding it.","operationId":"list_attributes_v1_rk_studies__study_id__attributes_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"include_retired","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Retired"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/attributes/{attribute_id}":{"delete":{"tags":["rk-structured-analysis"],"summary":"Retire an attribute","description":"Stops offering it. The projections built from it stay — they are history, and a finding that cited them must remain explicable.","operationId":"retire_attribute_v1_rk_studies__study_id__attributes__attribute_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"attribute_id","in":"path","required":true,"schema":{"type":"string","title":"Attribute Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/attributes/recompute":{"post":{"tags":["rk-structured-analysis"],"summary":"Rebuild projections from the answers as they now stand","description":"Idempotent — running it twice changes nothing the second time. A superseded projection is kept rather than deleted, so what the analysis said before a correction stays recoverable.","operationId":"recompute_v1_rk_studies__study_id__attributes_recompute_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecomputeOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/cases":{"get":{"tags":["rk-structured-analysis"],"summary":"The joined case view — one row per participant","description":"Pseudonymous by construction: the study's own display code, the site, cohort and arm, and the approved attribute values. Every value carries the answer id, response set, instrument version and amendment sequence it came from — a projection, not a copy.\n\n`filter` takes repeated `attribute_code=value` pairs. A case with no value for a filtered attribute is excluded: a missing value is not a match, and treating it as one silently widens the cohort.","operationId":"case_view_v1_rk_studies__study_id__cases_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"attribute","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Attribute"}},{"name":"wave_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Id"}},{"name":"filter","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseViewOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/distributions/{attribute_code}":{"get":{"tags":["rk-structured-analysis"],"summary":"A descriptive distribution, with missingness kept apart","description":"Counts, and nothing more: no p-value, no confidence interval, no significance claim. The four missing states are returned in their own mapping rather than as cells, so nothing can chart 'prefer not to answer' as a category while also counting it as data.\n\nCells below the study's minimum are suppressed and **marked**, never silently dropped — a table that quietly omits its smallest group reads as a table where that group was absent.","operationId":"distribution_v1_rk_studies__study_id__distributions__attribute_code__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"attribute_code","in":"path","required":true,"schema":{"type":"string","title":"Attribute Code"}},{"name":"wave_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Id"}},{"name":"filter","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DistributionOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/cross-tabulation":{"get":{"tags":["rk-structured-analysis"],"summary":"A two-attribute matrix over cases","description":"Every combination present in the axes gets a cell, including the empty ones — a zero is a finding, and a matrix that omits its empty cells leaves the reader guessing whether the combination was absent or simply not drawn. Descriptive; the policy runs before it returns.","operationId":"cross_tabulation_v1_rk_studies__study_id__cross_tabulation_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"rows","in":"query","required":true,"schema":{"type":"string","description":"Row attribute code","title":"Rows"},"description":"Row attribute code"},{"name":"columns","in":"query","required":true,"schema":{"type":"string","description":"Column attribute code","title":"Columns"},"description":"Column attribute code"},{"name":"wave_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Id"}},{"name":"filter","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/comparisons/{attribute_code}":{"get":{"tags":["rk-structured-analysis"],"summary":"Compare an attribute across cohorts, sites, arms or waves","description":"Site, cohort and arm are read from the **enrolment**, not the response: an assignment carries no site of its own, and reading one off a response would drop every case that has not answered yet — exactly the population a comparison must account for. `wave_id` comes from the response, because a wave is a property of the response, not the person.","operationId":"comparison_v1_rk_studies__study_id__comparisons__attribute_code__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"attribute_code","in":"path","required":true,"schema":{"type":"string","title":"Attribute Code"}},{"name":"dimension","in":"query","required":true,"schema":{"type":"string","description":"site_id · cohort_id · arm_id · wave_id","title":"Dimension"},"description":"site_id · cohort_id · arm_id · wave_id"},{"name":"filter","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/longitudinal/{attribute_code}":{"get":{"tags":["rk-structured-analysis"],"summary":"Each case's values across waves, as a series","description":"Nothing is collapsed and nothing is overwritten. Wave 3 is a separate point because employment, health and income change, and writing a later wave over an earlier one destroys the signal the study exists to observe. `pattern` says whether the series changed — never how, never why, and never a direction of effect. A series with a gap is `incomplete_series`, not `unchanged`.","operationId":"longitudinal_v1_rk_studies__study_id__longitudinal__attribute_code__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"attribute_code","in":"path","required":true,"schema":{"type":"string","title":"Attribute Code"}},{"name":"wave","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Wave ids in the study's own order.","title":"Wave"},"description":"Wave ids in the study's own order."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LongitudinalOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/negative-cases/{attribute_code}":{"get":{"tags":["rk-structured-analysis"],"summary":"The cases that do not fit","description":"Deviant-case analysis as a first-class question rather than a filter somebody inverts by hand: the participants who do not fit are where a finding either strengthens or falls over. Cases with no value are excluded — 'did not answer' is not 'answered differently'.","operationId":"negative_cases_v1_rk_studies__study_id__negative_cases__attribute_code__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"attribute_code","in":"path","required":true,"schema":{"type":"string","title":"Attribute Code"}},{"name":"expected","in":"query","required":true,"schema":{"type":"string","description":"The value these cases do *not* hold","title":"Expected"},"description":"The value these cases do *not* hold"},{"name":"wave_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseViewOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/disclosure-policies":{"put":{"tags":["rk-structured-analysis"],"summary":"Declare the study's disclosure policy","description":"Minimum cell size and what to do about a cell below it. Retired rather than edited, so a check that ran last month can still be explained by the policy in force when it ran.\n\nWith no policy declared the checker does **not** pass everything through: it applies a default minimum and says so in the report. A study that never configured disclosure control is exactly the study that should not be exporting rare combinations.","operationId":"set_disclosure_policy_v1_rk_studies__study_id__disclosure_policies_put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosurePolicyCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosurePolicyOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/quasi-identifier-sets":{"post":{"tags":["rk-structured-analysis"],"summary":"Declare which attribute combinations could identify somebody here","description":"Declared per study because the population decides. Age band + sex + sub-county is a small combination in a rural district and a large one in Nairobi; the platform has not seen the sampling frame.","operationId":"declare_quasi_identifier_set_v1_rk_studies__study_id__quasi_identifier_sets_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuasiIdentifierSetCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuasiIdentifierSetOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-structured-analysis"],"summary":"The study's declared quasi-identifier sets","operationId":"list_quasi_identifier_sets_v1_rk_studies__study_id__quasi_identifier_sets_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QuasiIdentifierSetOut"},"title":"Response List Quasi Identifier Sets V1 Rk Studies  Study Id  Quasi Identifier Sets Get"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/studies/{study_id}/disclosure-check":{"post":{"tags":["rk-structured-analysis"],"summary":"Ask whether this combination of attributes would disclose","description":"§12.10's third checkpoint — the on-demand one. Reports the combinations held by fewer than the minimum number of participants, naming the **combination** and a count, never who holds it. `output_checksum` fingerprints this exact result so a `disclosure.review` decision cannot be reused for a different one.","operationId":"disclosure_check_v1_rk_studies__study_id__disclosure_check_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosureCheckRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosureCheckOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/disclosure-reviews":{"post":{"tags":["rk-structured-analysis"],"summary":"Record a decision about an output that fails the policy","description":"Needs `disclosure.review`, which no API key may hold: deciding that an identifiable-enough output may leave is a human judgement.\n\nA **refusal** is recorded as well as a release — a table holding only approvals cannot show the question was asked. The decision is bound to `output_checksum`, so releasing one cross-tabulation does not retroactively authorise the next one.","operationId":"record_disclosure_review_v1_rk_studies__study_id__disclosure_reviews_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosureReviewCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosureReviewOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/dataset-exports":{"post":{"tags":["rk-structured-analysis"],"summary":"Export the de-identified joined dataset","description":"The case view as byte-stable CSV: fixed column order, fixed row order, no timestamp inside the file. The same dataset always produces the same bytes.\n\n**Fails closed.** A rare combination refuses the export with 403 and names the combination, rather than warning and continuing or quietly dropping the rows. Getting past it needs `export.identifiable` *and* a recorded `disclosure.review` release fingerprinted to this exact output.","operationId":"export_dataset_v1_rk_studies__study_id__dataset_exports_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetExportRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetExportOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/studies/{study_id}/freezes":{"post":{"tags":["rk-structured-analysis"],"summary":"Freeze the current dataset version","description":"**A freeze is not a lock.** A dataset lock decides whether data may still change; it is temporary and it is released. A freeze records what the data said, so a finding can cite it; it is permanent and it is never released. A study can be locked without a freeze, frozen without a lock, both, or neither.\n\nFreezing writes nothing to the responses and stops nobody writing. The manifest is a SHA-256 over every item in ordinal order, recomputable from the rows — which is what makes it verifiable rather than merely recorded.","operationId":"create_freeze_v1_rk_studies__study_id__freezes_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["rk-structured-analysis"],"summary":"This study's dataset freezes, newest first","operationId":"list_freezes_v1_rk_studies__study_id__freezes_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeListOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/freezes/{freeze_id}":{"get":{"tags":["rk-structured-analysis"],"summary":"One freeze, its manifest and its lineage","description":"`manifest_verified` recomputes the checksum from the stored rows and compares. A disagreement is **reported, never repaired** — a quietly corrected checksum erases the evidence that something wrote to a freeze after it was taken.","operationId":"freeze_detail_v1_rk_freezes__freeze_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"freeze_id","in":"path","required":true,"schema":{"type":"string","title":"Freeze Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeDetailOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/freezes/{freeze_id}/drift":{"get":{"tags":["rk-structured-analysis"],"summary":"What has changed in the live data since this freeze","description":"The question a reader of a six-month-old finding actually has: *is the study still saying what it said?* Reports; repairs nothing.","operationId":"freeze_drift_v1_rk_freezes__freeze_id__drift_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"freeze_id","in":"path","required":true,"schema":{"type":"string","title":"Freeze Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreezeDriftOut"}}}},"401":{"description":"Missing or invalid credential"},"403":{"description":"The caller does not hold the required capability"},"404":{"description":"Not found in this workspace"},"409":{"description":"Somebody else changed this first"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/exports":{"post":{"tags":["rk-exports"],"summary":"Create export job","description":"Create an asynchronous export job. If an identical export is already pending or processing, the existing job id is returned instead of spawning duplicate work. Poll `GET /v1/rk/exports/{export_id}` for status.","operationId":"create_export_job_v1_rk_exports_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJobCreate"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJobCreateResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Study or complete session artifact not found"},"422":{"description":"Invalid export format or scope"},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}]}},"/v1/rk/exports/{export_id}":{"get":{"tags":["rk-exports"],"summary":"Get export job","description":"Retrieve export job status and download metadata. When `status=complete`, use the download endpoint to fetch the file.","operationId":"get_export_job_v1_rk_exports__export_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"export_id","in":"path","required":true,"schema":{"type":"string","title":"Export Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJobResponse"}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"404":{"description":"Export job not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/exports/{export_id}/download":{"get":{"tags":["rk-exports"],"summary":"Download Export","operationId":"download_export_v1_rk_exports__export_id__download_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"export_id","in":"path","required":true,"schema":{"type":"string","title":"Export Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid credential"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/assistant/sessions/{session_id}/messages":{"post":{"tags":["rk-assistant"],"summary":"Post Message","operationId":"post_message_v1_rk_assistant_sessions__session_id__messages_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or thread not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/assistant/sessions/{session_id}/threads":{"get":{"tags":["rk-assistant"],"summary":"List Threads","operationId":"list_threads_v1_rk_assistant_sessions__session_id__threads_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThreadSummary"},"title":"Response List Threads V1 Rk Assistant Sessions  Session Id  Threads Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or thread not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/assistant/sessions/{session_id}/threads/{thread_id}":{"get":{"tags":["rk-assistant"],"summary":"Get Thread","operationId":"get_thread_v1_rk_assistant_sessions__session_id__threads__thread_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadDetail"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or thread not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rk-assistant"],"summary":"Delete Thread","operationId":"delete_thread_v1_rk_assistant_sessions__session_id__threads__thread_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or thread not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/assistant/studies/{study_id}/messages":{"post":{"tags":["rk-assistant"],"summary":"Post Study Message","operationId":"post_study_message_v1_rk_assistant_studies__study_id__messages_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or thread not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/assistant/studies/{study_id}/threads":{"get":{"tags":["rk-assistant"],"summary":"List Study Threads","operationId":"list_study_threads_v1_rk_assistant_studies__study_id__threads_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThreadSummary"},"title":"Response List Study Threads V1 Rk Assistant Studies  Study Id  Threads Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or thread not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/assistant/studies/{study_id}/threads/{thread_id}":{"get":{"tags":["rk-assistant"],"summary":"Get Study Thread","operationId":"get_study_thread_v1_rk_assistant_studies__study_id__threads__thread_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadDetail"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or thread not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rk-assistant"],"summary":"Delete Study Thread","operationId":"delete_study_thread_v1_rk_assistant_studies__study_id__threads__thread_id__delete","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"study_id","in":"path","required":true,"schema":{"type":"string","title":"Study Id"}},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid credential"},"404":{"description":"Session or thread not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/assistant/messages/{message_id}/citations/{citation_index}/feedback":{"put":{"tags":["rk-assistant"],"summary":"Mark one citation helpful or not helpful","description":"Idempotent per person and citation. Changing a verdict clears any adjudication.","operationId":"put_citation_feedback_v1_rk_assistant_messages__message_id__citations__citation_index__feedback_put","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}},{"name":"citation_index","in":"path","required":true,"schema":{"type":"integer","title":"Citation Index"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/assistant/citation-feedback":{"get":{"tags":["rk-assistant"],"summary":"Citation feedback awaiting or past adjudication","operationId":"list_citation_feedback_v1_rk_assistant_citation_feedback_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"enum":["pending","adjudicated"],"type":"string","default":"pending","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeedbackOut"},"title":"Response List Citation Feedback V1 Rk Assistant Citation Feedback Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/assistant/citation-feedback/{feedback_id}/adjudication":{"post":{"tags":["rk-assistant"],"summary":"Uphold or reject one piece of citation feedback","description":"Exactly once, by somebody other than the person who gave the feedback.","operationId":"adjudicate_citation_feedback_v1_rk_assistant_citation_feedback__feedback_id__adjudication_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"feedback_id","in":"path","required":true,"schema":{"type":"string","title":"Feedback Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjudicationIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/rk/agent-tasks":{"get":{"tags":["rk-agent-tasks"],"summary":"List Agent Tasks","operationId":"list_agent_tasks_v1_rk_agent_tasks_get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"study_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentTaskOut"},"title":"Response List Agent Tasks V1 Rk Agent Tasks Get"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Task not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/agent-tasks/{task_id}":{"get":{"tags":["rk-agent-tasks"],"summary":"Get Agent Task","operationId":"get_agent_task_v1_rk_agent_tasks__task_id__get","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTaskOut"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Task not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rk/agent-tasks/{task_id}/resolve":{"post":{"tags":["rk-agent-tasks"],"summary":"Resolve Agent Task","operationId":"resolve_agent_task_v1_rk_agent_tasks__task_id__resolve_post","security":[{"ApiKeyAuth":[]},{"ClerkBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveResult"}}}},"401":{"description":"Missing or invalid credential"},"404":{"description":"Task not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"413":{"description":"Payload too large. JSON requests are capped at 1 MB; document uploads are capped separately at 20 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service unavailable or dependency misconfigured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"AcceptInvitationRequest":{"properties":{"token":{"type":"string","maxLength":128,"title":"Token"}},"type":"object","required":["token"],"title":"AcceptInvitationRequest"},"AdjudicationIn":{"properties":{"decision":{"type":"string","enum":["upheld","rejected"],"title":"Decision"}},"additionalProperties":false,"type":"object","required":["decision"],"title":"AdjudicationIn"},"AdvisoryOut":{"properties":{"kind":{"type":"string","title":"Kind"},"question_code":{"type":"string","title":"Question Code"},"message":{"type":"string","title":"Message"}},"type":"object","required":["kind","question_code","message"],"title":"AdvisoryOut","description":"Something worth fixing that does not stop a form being saved or published."},"AgentTaskOut":{"properties":{"id":{"type":"string","title":"Id"},"agent":{"type":"string","title":"Agent"},"task_type":{"type":"string","title":"Task Type"},"status":{"$ref":"#/components/schemas/TaskStatus"},"title":{"type":"string","title":"Title"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"proposed_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proposed By"},"occurrence_count":{"type":"integer","title":"Occurrence Count","default":1},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","agent","task_type","status","title","created_at"],"title":"AgentTaskOut"},"AmendAnswerIn":{"properties":{"reason_code":{"type":"string","title":"Reason Code"},"value":{"title":"Value"},"missing_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Missing Reason"},"source_type":{"type":"string","title":"Source Type","default":"research_coordinator"},"expected_sequence":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Sequence"}},"type":"object","required":["reason_code"],"title":"AmendAnswerIn","description":"Correct one submitted answer.\n\nExactly one of `value` and `missing_reason`: an answer that is both a value\nand a recorded refusal is a contradiction, and picking a winner would be\ninventing a fact about somebody's response."},"AmendmentListOut":{"properties":{"amendments":{"items":{"$ref":"#/components/schemas/AmendmentOut"},"type":"array","title":"Amendments"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["amendments","count"],"title":"AmendmentListOut"},"AmendmentOut":{"properties":{"id":{"type":"string","title":"Id"},"answer_id":{"type":"string","title":"Answer Id"},"response_set_id":{"type":"string","title":"Response Set Id"},"question_code":{"type":"string","title":"Question Code"},"path":{"type":"string","title":"Path"},"previous_value":{"title":"Previous Value"},"new_value":{"title":"New Value"},"previous_missing_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Missing Reason"},"new_missing_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Missing Reason"},"reason_code":{"type":"string","title":"Reason Code"},"source_type":{"type":"string","title":"Source Type"},"amended_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amended By"},"amended_at":{"type":"string","format":"date-time","title":"Amended At"},"sequence":{"type":"integer","title":"Sequence"}},"type":"object","required":["id","answer_id","response_set_id","question_code","path","previous_missing_reason","new_missing_reason","reason_code","source_type","amended_by","amended_at","sequence"],"title":"AmendmentOut","description":"One correction. What it was, what it became, who decided, and why.\n\nCarries both the value and the missing reason on each side, so a correction\nbetween an answer and a refusal is legible rather than flattened."},"AnswerIn":{"properties":{"value":{"title":"Value"},"missing_reason":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Missing Reason"}},"type":"object","title":"AnswerIn","description":"One supplied answer, or one recorded reason there is none.\n\nExactly one of the two carries meaning. Both together is a contradiction the\nruntime reports rather than resolves — deciding which one wins would be\ninventing a fact about somebody's response."},"AnswerOut":{"properties":{"id":{"type":"string","title":"Id"},"path":{"type":"string","title":"Path"},"question_code":{"type":"string","title":"Question Code"},"instrument_question_version_id":{"type":"string","title":"Instrument Question Version Id"},"answer_type":{"type":"string","title":"Answer Type"},"value":{"title":"Value"},"missing_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Missing Reason"},"is_calculated":{"type":"boolean","title":"Is Calculated","default":false},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answered At"}},"type":"object","required":["id","path","question_code","instrument_question_version_id","answer_type"],"title":"AnswerOut","description":"One stored answer, as a reviewer sees it."},"ArmCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name"],"title":"ArmCreate"},"ArmResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["name","id","study_id","created_at"],"title":"ArmResponse"},"ArtifactResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"schema_version":{"type":"string","title":"Schema Version"},"status":{"type":"string","title":"Status"},"transcript":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Transcript"},"claims":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Claims"},"rubric_coverage":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rubric Coverage"},"probe_history":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Probe History"},"session_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Summary"},"participant_profile":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Participant Profile"},"degraded_stages":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Degraded Stages"},"processing_started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Processing Started At"},"processing_completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Processing Completed At"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","session_id","study_id","schema_version","status","transcript","claims","rubric_coverage","probe_history","session_summary","participant_profile","processing_started_at","processing_completed_at","error_message","created_at"],"title":"ArtifactResponse"},"AssignmentCreate":{"properties":{"instrument_version_id":{"type":"string","maxLength":36,"title":"Instrument Version Id"},"enrolment_id":{"type":"string","maxLength":36,"title":"Enrolment Id"},"placement":{"type":"string","title":"Placement","default":"manual"},"session_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Session Id"},"opens_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Opens At"},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"required":{"type":"boolean","title":"Required","default":false},"gating_behaviour":{"type":"string","title":"Gating Behaviour","default":"informational"},"requirement_explanation":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Requirement Explanation"},"language":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Language"},"collection_mode":{"type":"string","title":"Collection Mode","default":"self_web"}},"type":"object","required":["instrument_version_id","enrolment_id"],"title":"AssignmentCreate"},"AssignmentListOut":{"properties":{"assignments":{"items":{"$ref":"#/components/schemas/AssignmentOut"},"type":"array","title":"Assignments"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["assignments","count"],"title":"AssignmentListOut"},"AssignmentOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"instrument_id":{"type":"string","title":"Instrument Id"},"instrument_version_id":{"type":"string","title":"Instrument Version Id"},"enrolment_id":{"type":"string","title":"Enrolment Id"},"enrolment_display_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Display Code"},"fielding_gate_result_id":{"type":"string","title":"Fielding Gate Result Id"},"placement":{"type":"string","title":"Placement"},"wave_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Id"},"wave_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Code"},"status":{"type":"string","title":"Status"},"opens_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Opens At"},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"required":{"type":"boolean","title":"Required"},"gating_behaviour":{"type":"string","title":"Gating Behaviour"},"requirement_explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requirement Explanation"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"collection_mode":{"type":"string","title":"Collection Mode"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"version":{"type":"string","title":"Version"},"participant_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Token"},"participant_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Url"},"response_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Status"}},"type":"object","required":["id","study_id","instrument_id","instrument_version_id","enrolment_id","fielding_gate_result_id","placement","status","opens_at","due_at","expires_at","required","gating_behaviour","requirement_explanation","language","collection_mode","created_at","version"],"title":"AssignmentOut","description":"An assignment as a researcher sees it. Pseudonymous throughout."},"AssistantMode":{"type":"string","enum":["session_review","study_workspace"],"title":"AssistantMode","description":"Server-controlled context policy. Never free-form."},"AssistantRequest":{"properties":{"message":{"type":"string","maxLength":2000,"minLength":1,"title":"Message"},"history":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"History"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"model":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Model"},"mode":{"$ref":"#/components/schemas/AssistantMode","default":"session_review"},"stream":{"type":"boolean","title":"Stream","default":true}},"type":"object","required":["message"],"title":"AssistantRequest"},"AssistantScope":{"type":"string","enum":["session","study"],"title":"AssistantScope"},"AttachmentOut":{"properties":{"id":{"type":"string","title":"Id"},"path":{"type":"string","title":"Path"},"question_code":{"type":"string","title":"Question Code"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"byte_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Byte Size"},"scan_state":{"type":"string","title":"Scan State"},"refusal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refusal Code"},"uploaded_at":{"type":"string","format":"date-time","title":"Uploaded At"},"erased_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Erased At"}},"type":"object","required":["id","path","question_code","filename","content_type","byte_size","scan_state","uploaded_at"],"title":"AttachmentOut","description":"One attached file, as both the participant and the researcher see it.\n\nCarries no storage key: where the bytes live is not the caller's business,\nand a key in a response is a key in a browser history. `filename` is what the\nparticipant typed and is untrusted display text — anything rendering it\ntreats it as a text node, never as markup and never as a path."},"AttachmentPolicyOut":{"properties":{"question_code":{"type":"string","title":"Question Code"},"accepted_file_types":{"items":{"type":"string"},"type":"array","title":"Accepted File Types"},"max_bytes":{"type":"integer","title":"Max Bytes"}},"type":"object","required":["question_code","accepted_file_types","max_bytes"],"title":"AttachmentPolicyOut","description":"What a question will accept, so the participant is told before they try."},"AttachmentUploadOut":{"properties":{"attachment":{"$ref":"#/components/schemas/AttachmentOut"},"replayed":{"type":"boolean","title":"Replayed","default":false}},"type":"object","required":["attachment"],"title":"AttachmentUploadOut","description":"The result of one upload, and the value the answer should now carry."},"AttributeCreate":{"properties":{"code":{"type":"string","maxLength":64,"title":"Code","description":"Stable identity across versions."},"label":{"type":"string","maxLength":255,"title":"Label"},"source_question_code":{"type":"string","maxLength":64,"title":"Source Question Code","description":"The question this projects from, by **code** rather than version, so the attribute survives a new instrument version asking the same thing."},"value_kind":{"type":"string","title":"Value Kind","description":"categorical · ordinal · numeric · date · boolean. Free text is deliberately absent: an attribute built from a free-text question would put whatever somebody typed into the analysis graph."},"evidence_domain":{"type":"string","title":"Evidence Domain","description":"self_reported · researcher_entered · administrative. `ai_inference` is not offered — a model's guess about somebody's age is not the study's record of it (§12.9).","default":"self_reported"},"generalisation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Generalisation","description":"Optional bands used when a policy asks for generalisation."}},"type":"object","required":["code","label","source_question_code","value_kind"],"title":"AttributeCreate"},"AttributeListOut":{"properties":{"attributes":{"items":{"$ref":"#/components/schemas/AttributeOut"},"type":"array","title":"Attributes"},"stale_projections":{"type":"integer","title":"Stale Projections"}},"type":"object","required":["attributes","stale_projections"],"title":"AttributeListOut"},"AttributeOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"code":{"type":"string","title":"Code"},"label":{"type":"string","title":"Label"},"source_question_code":{"type":"string","title":"Source Question Code"},"value_kind":{"type":"string","title":"Value Kind"},"evidence_domain":{"type":"string","title":"Evidence Domain"},"generalisation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Generalisation"},"approved_by":{"type":"string","title":"Approved By"},"approved_at":{"type":"string","format":"date-time","title":"Approved At"},"retired_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retired At"},"version":{"type":"integer","title":"Version"}},"type":"object","required":["id","study_id","code","label","source_question_code","value_kind","evidence_domain","generalisation","approved_by","approved_at","retired_at","version"],"title":"AttributeOut"},"AuditEntry":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"actor_type":{"type":"string","title":"Actor Type"},"actor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Id"},"action":{"type":"string","title":"Action"},"capability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capability"},"target_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Type"},"target_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Id"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"outcome":{"type":"string","title":"Outcome"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["id","created_at","actor_type","action","outcome"],"title":"AuditEntry","description":"One recorded action.\n\nCarries identifiers, capability and outcome — never participant content. An\naudit trail that leaked transcripts would be a second copy of the data it\nexists to protect."},"AuditPage":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/AuditEntry"},"type":"array","title":"Entries"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"since":{"type":"string","format":"date-time","title":"Since"},"until":{"type":"string","format":"date-time","title":"Until"}},"type":"object","required":["entries","since","until"],"title":"AuditPage","description":"A page of entries, newest first."},"AuthorityCoverage":{"properties":{"study_id":{"type":"string","title":"Study Id"},"cells":{"items":{"$ref":"#/components/schemas/CoverageCell"},"type":"array","title":"Cells"},"versions":{"items":{"$ref":"#/components/schemas/VersionCoverageEntry"},"type":"array","title":"Versions"},"outstanding":{"items":{"type":"string"},"type":"array","title":"Outstanding"},"undetermined":{"items":{"type":"string"},"type":"array","title":"Undetermined"},"unsubmitted":{"items":{"type":"string"},"type":"array","title":"Unsubmitted"},"lapsed":{"items":{"type":"string"},"type":"array","title":"Lapsed"}},"type":"object","required":["study_id"],"title":"AuthorityCoverage","description":"The matrix: what each body has answered, per requirement and scope.\n\nNot a single verdict. An ERC approval and a NACOSTI licence are different\nrows here and neither can satisfy the other, which is the whole reason this\nis a matrix rather than a flag."},"AvailableModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/CatalogModelResponse"},"type":"array","title":"Models"},"default_model":{"type":"string","title":"Default Model"}},"type":"object","required":["models","default_model"],"title":"AvailableModelsResponse","description":"The selectable model list for a tenant: key-gated catalog + their customs,\nplus the tenant's current default."},"BlockerOut":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"detail":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["code","message"],"title":"BlockerOut","description":"One named reason the gate refused. Branchable, not prose."},"Body_commit_import_v1_rk_imports__batch_id__commit_post":{"properties":{"mapping":{"type":"string","title":"Mapping","description":"The mapping document, as JSON."},"dry_run":{"type":"boolean","title":"Dry Run","default":false},"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["mapping","file"],"title":"Body_commit_import_v1_rk_imports__batch_id__commit_post"},"Body_create_document_v1_rk_studies__study_id__documents_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"doc_class":{"type":"string","title":"Doc Class"},"doc_type":{"type":"string","title":"Doc Type"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"sensitivity":{"type":"string","title":"Sensitivity","default":"routine"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"}},"type":"object","required":["file","doc_class","doc_type","title"],"title":"Body_create_document_v1_rk_studies__study_id__documents_post"},"Body_create_version_v1_rk_documents__document_id__versions_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"}},"type":"object","required":["file"],"title":"Body_create_version_v1_rk_documents__document_id__versions_post"},"Body_import_consent_document_v1_rk_studies__study_id__consent_documents_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"purpose":{"type":"string","title":"Purpose","default":"interview"},"language":{"type":"string","title":"Language","default":"en"},"required":{"type":"boolean","title":"Required","default":false}},"type":"object","required":["file"],"title":"Body_import_consent_document_v1_rk_studies__study_id__consent_documents_import_post"},"Body_import_guide_v1_rk_studies__study_id__guide_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_guide_v1_rk_studies__study_id__guide_import_post"},"Body_preview_import_v1_rk_studies__study_id__imports_preview_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"A .csv or .xlsx participant roster."},"format":{"type":"string","title":"Format","description":"`csv` or `xlsx`.","default":"csv"}},"type":"object","required":["file"],"title":"Body_preview_import_v1_rk_studies__study_id__imports_preview_post"},"Body_upload_attachment_v1_rk_forms__token__attachments_post":{"properties":{"path":{"type":"string","title":"Path"},"upload_key":{"type":"string","title":"Upload Key"},"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["path","upload_key","file"],"title":"Body_upload_attachment_v1_rk_forms__token__attachments_post"},"Body_upload_document_v1_sessions__session_id__documents_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_document_v1_sessions__session_id__documents_post"},"Body_upload_portal_attachment_v1_rk_portal__token__assignments__assignment_id__attachments_post":{"properties":{"path":{"type":"string","title":"Path"},"upload_key":{"type":"string","title":"Upload Key"},"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["path","upload_key","file"],"title":"Body_upload_portal_attachment_v1_rk_portal__token__assignments__assignment_id__attachments_post"},"Body_validate_import_v1_rk_studies__study_id__imports_validate_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"format":{"type":"string","title":"Format","default":"csv"},"mapping":{"type":"string","title":"Mapping","description":"The mapping document, as JSON."}},"type":"object","required":["file","mapping"],"title":"Body_validate_import_v1_rk_studies__study_id__imports_validate_post"},"BookingIn":{"properties":{"mode":{"type":"string","title":"Mode"},"date":{"type":"string","title":"Date"},"part":{"type":"string","title":"Part"},"language":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Language"},"caller_note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Caller Note"}},"type":"object","required":["mode","date","part"],"title":"BookingIn"},"BookingOptionsOut":{"properties":{"modes":{"items":{"$ref":"#/components/schemas/ModeOut"},"type":"array","title":"Modes"},"days":{"items":{"$ref":"#/components/schemas/DayOut"},"type":"array","title":"Days"},"windows":{"items":{"$ref":"#/components/schemas/WindowOut"},"type":"array","title":"Windows"},"timezone":{"type":"string","title":"Timezone"},"current_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Label"},"phone_display":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Display"}},"type":"object","required":["modes","days","windows","timezone","current_label"],"title":"BookingOptionsOut"},"BookingOut":{"properties":{"label":{"type":"string","title":"Label"},"next_step":{"type":"string","title":"Next Step"}},"type":"object","required":["label","next_step"],"title":"BookingOut"},"CapabilityCatalogue":{"properties":{"capabilities":{"items":{"$ref":"#/components/schemas/CapabilityDescriptor"},"type":"array","title":"Capabilities"},"roles":{"items":{"$ref":"#/components/schemas/RolePreset"},"type":"array","title":"Roles"},"reauthentication_window_minutes":{"type":"integer","title":"Reauthentication Window Minutes"}},"type":"object","required":["capabilities","roles","reauthentication_window_minutes"],"title":"CapabilityCatalogue","description":"Everything an admin needs to decide, in one payload."},"CapabilityDescriptor":{"properties":{"name":{"type":"string","title":"Name"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description"},"audited":{"type":"boolean","title":"Audited","default":false},"requires_reauthentication":{"type":"boolean","title":"Requires Reauthentication","default":false}},"type":"object","required":["name","label","description"],"title":"CapabilityDescriptor","description":"One capability, described in the terms an admin decides in."},"CapabilityUpdateRequest":{"properties":{"grants":{"items":{"type":"string"},"type":"array","maxItems":64,"title":"Grants"},"revocations":{"items":{"type":"string"},"type":"array","maxItems":64,"title":"Revocations"},"membership_version":{"type":"integer","minimum":1.0,"title":"Membership Version"}},"type":"object","required":["membership_version"],"title":"CapabilityUpdateRequest","description":"A complete replacement of this member's grants and revocations.\n\nDeliberately not a patch: two admins each adding one capability to a partial\npayload would leave the result depending on arrival order, and neither would\nsee what the other did."},"CaptureEdit":{"properties":{"values":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object","maxProperties":40,"title":"Values"}},"additionalProperties":false,"type":"object","required":["values"],"title":"CaptureEdit"},"CaseAssignRequest":{"properties":{"assign_to":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Assign To"},"acknowledge":{"type":"boolean","title":"Acknowledge","default":true},"version":{"type":"integer","minimum":1.0,"title":"Version"}},"type":"object","required":["version"],"title":"CaseAssignRequest"},"CaseDetail":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"status":{"type":"string","title":"Status"},"escalation_state":{"type":"string","title":"Escalation State"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"event_count":{"type":"integer","title":"Event Count","default":1},"safety_config_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Safety Config Version"},"version":{"type":"integer","title":"Version","default":1},"created_at":{"type":"string","format":"date-time","title":"Created At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"opened_by_event_id":{"type":"string","title":"Opened By Event Id"},"assigned_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned By"},"assigned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Assigned At"},"acknowledged_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acknowledged By"},"acknowledged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Acknowledged At"},"resolution_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Reason"},"resolution_outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Outcome"},"resolution_external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution External Reference"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By"},"timeline":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Timeline"},"deliveries":{"items":{"$ref":"#/components/schemas/DeliveryAttempt"},"type":"array","title":"Deliveries"}},"type":"object","required":["id","session_id","status","escalation_state","created_at","opened_by_event_id"],"title":"CaseDetail"},"CaseResolveRequest":{"properties":{"reason":{"type":"string","maxLength":48,"title":"Reason"},"outcome":{"type":"string","maxLength":48,"title":"Outcome"},"external_reference":{"anyOf":[{"type":"string","maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:/#-]{0,63}$"},{"type":"null"}],"title":"External Reference"},"version":{"type":"integer","minimum":1.0,"title":"Version"}},"type":"object","required":["reason","outcome","version"],"title":"CaseResolveRequest"},"CaseRetryRequest":{"properties":{"version":{"type":"integer","minimum":1.0,"title":"Version"}},"type":"object","required":["version"],"title":"CaseRetryRequest","description":"Re-queueing a failed escalation is a human decision like any other.\n\nVersion-checked for the same reason assignment is: somebody looking at a\ncase another person has since resolved should not be able to notify an\nescalation contact about it again."},"CaseRowOut":{"properties":{"enrolment_id":{"type":"string","title":"Enrolment Id"},"display_code":{"type":"string","title":"Display Code","description":"The study's own pseudonymous label. Not contact identity."},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"},"cohort_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Id"},"arm_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Arm Id"},"lifecycle_state":{"type":"string","title":"Lifecycle State"},"values":{"additionalProperties":{"$ref":"#/components/schemas/ValueCellOut"},"type":"object","title":"Values"}},"type":"object","required":["enrolment_id","display_code","site_id","cohort_id","arm_id","lifecycle_state","values"],"title":"CaseRowOut"},"CaseSeriesOut":{"properties":{"enrolment_id":{"type":"string","title":"Enrolment Id"},"display_code":{"type":"string","title":"Display Code"},"points":{"items":{"$ref":"#/components/schemas/WavePointOut"},"type":"array","title":"Points","description":"One point per wave, in order. Never collapsed, never overwritten."},"pattern":{"type":"string","title":"Pattern","description":"unchanged · changed · incomplete_series. A statement about the data, not about the participant, and never a direction of effect."}},"type":"object","required":["enrolment_id","display_code","points","pattern"],"title":"CaseSeriesOut"},"CaseSummary":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"status":{"type":"string","title":"Status"},"escalation_state":{"type":"string","title":"Escalation State"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"event_count":{"type":"integer","title":"Event Count","default":1},"safety_config_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Safety Config Version"},"version":{"type":"integer","title":"Version","default":1},"created_at":{"type":"string","format":"date-time","title":"Created At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"}},"type":"object","required":["id","session_id","status","escalation_state","created_at"],"title":"CaseSummary"},"CaseViewOut":{"properties":{"study_id":{"type":"string","title":"Study Id"},"basis":{"type":"string","title":"Basis","description":"Always `descriptive`. A purposive qualitative sample does not support statistical inference, and nothing here produces one."},"attribute_codes":{"items":{"type":"string"},"type":"array","title":"Attribute Codes"},"cases":{"items":{"$ref":"#/components/schemas/CaseRowOut"},"type":"array","title":"Cases"},"sample_size":{"type":"integer","title":"Sample Size"}},"type":"object","required":["study_id","basis","attribute_codes","cases","sample_size"],"title":"CaseViewOut"},"CatalogModelResponse":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"provider":{"type":"string","title":"Provider"}},"type":"object","required":["id","label","provider"],"title":"CatalogModelResponse"},"CellOut":{"properties":{"key":{"items":{"type":"string"},"type":"array","title":"Key"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count","description":"**None when suppressed.** Never the real figure behind a flag."},"suppressed":{"type":"boolean","title":"Suppressed","default":false},"generalised":{"type":"boolean","title":"Generalised","default":false},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["key"],"title":"CellOut"},"ChangeOut":{"properties":{"path":{"type":"string","title":"Path"},"code":{"type":"string","title":"Code"},"kind":{"type":"string","title":"Kind"},"summary":{"type":"string","title":"Summary"},"before":{"title":"Before"},"after":{"title":"After"}},"type":"object","required":["path","code","kind","summary"],"title":"ChangeOut","description":"One difference, at one place."},"ChatMessage":{"properties":{"role":{"$ref":"#/components/schemas/ChatRole"},"content":{"type":"string","maxLength":8000,"title":"Content"}},"type":"object","required":["role","content"],"title":"ChatMessage"},"ChatRole":{"type":"string","enum":["user","assistant"],"title":"ChatRole"},"CheckoutRequest":{"properties":{"plan_code":{"type":"string","maxLength":48,"minLength":1,"title":"Plan Code"}},"type":"object","required":["plan_code"],"title":"CheckoutRequest"},"ChoiceCountOut":{"properties":{"value":{"type":"string","title":"Value"},"label":{"type":"string","title":"Label"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"suppressed":{"type":"boolean","title":"Suppressed"}},"type":"object","required":["value","label","count","suppressed"],"title":"ChoiceCountOut"},"ChoiceOut":{"properties":{"value":{"type":"string","title":"Value"},"label":{"type":"string","title":"Label"},"display_order":{"type":"integer","title":"Display Order"},"exclusive":{"type":"boolean","title":"Exclusive","default":false},"external_code_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Code System"},"external_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Code"},"selectable_when":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selectable When"}},"type":"object","required":["value","label","display_order"],"title":"ChoiceOut"},"Citation":{"properties":{"id":{"type":"string","title":"Id"},"source_type":{"$ref":"#/components/schemas/SourceType"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"turn_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Turn Id"},"claim_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Id"},"theme_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Id"},"guide_section_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guide Section Id"},"quote":{"type":"string","title":"Quote"},"start_time":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"End Time"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"confidence_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence Label"},"epistemic_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Epistemic Status"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","required":["id","source_type","quote"],"title":"Citation","description":"A pointer to concrete ResearchKit evidence behind an answer.\n\n`quote` MUST be a verbatim substring of the cited transcript turn or claim\nanchor; `citations.citation_quote_is_grounded` enforces this before any\ncitation is returned to the client."},"ClaimAnnotation":{"properties":{"researcher_tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Researcher Tags"},"researcher_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Researcher Note"}},"type":"object","title":"ClaimAnnotation"},"ClientAction":{"properties":{"type":{"type":"string","title":"Type"},"page_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Id"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"topic_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topic Id"},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"}},"type":"object","required":["type"],"title":"ClientAction"},"ClientErrorReport":{"properties":{"kind":{"type":"string","enum":["render","unhandled_error","unhandled_rejection"],"title":"Kind"},"surface":{"type":"string","enum":["participant","researcher","admin","public"],"title":"Surface"},"name":{"type":"string","maxLength":64,"title":"Name","description":"Error constructor name, e.g. TypeError."},"route":{"type":"string","maxLength":300,"title":"Route","description":"Page path; reduced to a template here."},"release":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Release"},"digest":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Digest","description":"Next.js server error digest, to correlate with server logs."}},"additionalProperties":false,"type":"object","required":["kind","surface","name","route"],"title":"ClientErrorReport","description":"One browser-side failure. Shapes only; nothing a person typed or read."},"CohortCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"age_band":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Age Band"},"guardian_required":{"type":"boolean","title":"Guardian Required","default":false},"target_n":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Target N"}},"type":"object","required":["name"],"title":"CohortCreate"},"CohortResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"age_band":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Age Band"},"guardian_required":{"type":"boolean","title":"Guardian Required","default":false},"target_n":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Target N"},"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["name","id","study_id","created_at"],"title":"CohortResponse"},"CompatibilityDecisionIn":{"properties":{"solely_for_research_purpose":{"type":"boolean","title":"Solely For Research Purpose"},"necessary":{"type":"boolean","title":"Necessary"},"proportionate":{"type":"boolean","title":"Proportionate"},"safeguarded":{"type":"boolean","title":"Safeguarded"},"assessment_reference":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Assessment Reference"},"policy_version":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Policy Version"}},"type":"object","required":["solely_for_research_purpose","necessary","proportionate","safeguarded"],"title":"CompatibilityDecisionIn","description":"ODPC's four-part test, as four answers rather than one tick.\n\nA decision that can be entered as a single flag is a decision nobody made,\nso each limb is recorded separately and a reviewer can see which were\nactually considered."},"CompatibilityDecisionOut":{"properties":{"id":{"type":"string","title":"Id"},"screening_session_id":{"type":"string","title":"Screening Session Id"},"solely_for_research_purpose":{"type":"boolean","title":"Solely For Research Purpose"},"necessary":{"type":"boolean","title":"Necessary"},"proportionate":{"type":"boolean","title":"Proportionate"},"safeguarded":{"type":"boolean","title":"Safeguarded"},"permits_reuse":{"type":"boolean","title":"Permits Reuse"},"assessment_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assessment Reference"},"decided_by":{"type":"string","title":"Decided By"},"decided_at":{"type":"string","format":"date-time","title":"Decided At"}},"type":"object","required":["id","screening_session_id","solely_for_research_purpose","necessary","proportionate","safeguarded","permits_reuse","assessment_reference","decided_by","decided_at"],"title":"CompatibilityDecisionOut"},"CompletionGroupOut":{"properties":{"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"sequence":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sequence"},"buckets":{"additionalProperties":{"type":"integer"},"type":"object","title":"Buckets"},"denominator":{"$ref":"#/components/schemas/DenominatorOut"},"completed":{"type":"integer","title":"Completed"},"completion_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Completion Rate"}},"type":"object","required":["buckets","denominator","completed"],"title":"CompletionGroupOut","description":"One row of the dashboard: the study, an instrument, or a wave."},"ConfirmIn":{"properties":{"answer":{"type":"string","maxLength":64,"title":"Answer"}},"type":"object","required":["answer"],"title":"ConfirmIn"},"ConfirmOut":{"properties":{"ok":{"type":"boolean","title":"Ok"},"attempts_left":{"type":"integer","title":"Attempts Left","default":0},"locked":{"type":"boolean","title":"Locked","default":false},"proof":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proof"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"phone_display":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Display"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"next_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Step"}},"type":"object","required":["ok"],"title":"ConfirmOut"},"ConsentDecisionIn":{"properties":{"purpose":{"type":"string","title":"Purpose"},"decision":{"type":"string","pattern":"^(granted|declined)$","title":"Decision"},"text_hash":{"type":"string","title":"Text Hash"},"language":{"type":"string","title":"Language","default":"en"}},"type":"object","required":["purpose","decision","text_hash"],"title":"ConsentDecisionIn"},"ConsentDocumentCreate":{"properties":{"purpose":{"type":"string","title":"Purpose"},"language":{"type":"string","title":"Language","default":"en"},"text":{"type":"string","maxLength":20000,"minLength":1,"title":"Text"},"required":{"type":"boolean","title":"Required","default":false}},"type":"object","required":["purpose","text"],"title":"ConsentDocumentCreate"},"ConsentDocumentOut":{"properties":{"id":{"type":"string","title":"Id"},"purpose":{"type":"string","title":"Purpose"},"language":{"type":"string","title":"Language"},"version_no":{"type":"integer","title":"Version No"},"state":{"type":"string","title":"State"},"text":{"type":"string","title":"Text"},"text_hash":{"type":"string","title":"Text Hash"},"placeholders":{"items":{"type":"string"},"type":"array","title":"Placeholders"},"required":{"type":"boolean","title":"Required","default":false}},"type":"object","required":["id","purpose","language","version_no","state","text","text_hash","placeholders"],"title":"ConsentDocumentOut"},"ConsentDocumentUpdate":{"properties":{"required":{"type":"boolean","title":"Required"}},"type":"object","required":["required"],"title":"ConsentDocumentUpdate"},"ConsentDocumentsOut":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/ConsentDocumentOut"},"type":"array","title":"Documents"},"effective":{"items":{"$ref":"#/components/schemas/EffectiveConsentOut"},"type":"array","title":"Effective"},"items_enabled":{"type":"boolean","title":"Items Enabled","default":false}},"type":"object","required":["documents","effective"],"title":"ConsentDocumentsOut"},"ConsentIn":{"properties":{"decisions":{"items":{"$ref":"#/components/schemas/ConsentDecisionIn"},"type":"array","title":"Decisions"}},"type":"object","required":["decisions"],"title":"ConsentIn"},"ConsentItemChoice":{"properties":{"purpose":{"type":"string","maxLength":32,"title":"Purpose"},"decision":{"type":"string","maxLength":16,"title":"Decision"},"text_hash":{"type":"string","maxLength":64,"title":"Text Hash"}},"type":"object","required":["purpose","decision","text_hash"],"title":"ConsentItemChoice","description":"One tick: agree or decline, against the exact wording shown (its hash)."},"ConsentItemsUpdate":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"ConsentItemsUpdate"},"ConsentNotGiven":{"properties":{"outcome":{"type":"string","title":"Outcome"},"message":{"type":"string","title":"Message"}},"type":"object","required":["outcome","message"],"title":"ConsentNotGiven","description":"The choices were recorded and the interview will not start.\n\n`human_interview`: recording was declined, so the participant is offered a\nmember of the team. `declined`: they chose not to take part."},"ConsentOut":{"properties":{"outcome":{"type":"string","title":"Outcome"},"next_step":{"type":"string","title":"Next Step"}},"type":"object","required":["outcome","next_step"],"title":"ConsentOut"},"ConsentPurposeOut":{"properties":{"purpose":{"type":"string","title":"Purpose"},"title":{"type":"string","title":"Title"},"text":{"type":"string","title":"Text"},"text_hash":{"type":"string","title":"Text Hash"},"version":{"type":"string","title":"Version"},"language":{"type":"string","title":"Language"},"decision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision"}},"type":"object","required":["purpose","title","text","text_hash","version","language","decision"],"title":"ConsentPurposeOut"},"ConsentReceiptOut":{"properties":{"consent_text_version":{"type":"string","title":"Consent Text Version"},"consent_text_hash":{"type":"string","title":"Consent Text Hash"},"consented_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Consented At"},"withdrawal_requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Withdrawal Requested At"},"withdrawal_completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Withdrawal Completed At"}},"type":"object","required":["consent_text_version","consent_text_hash"],"title":"ConsentReceiptOut","description":"What this participant agreed to, as recorded when they agreed.\n\nRead from the stored consent record — never recomputed from the study's\ncurrent consent text. If the study has since republished its document, this\nstill describes the one they read, which is the only thing a receipt can\nhonestly say."},"ConsentRecordRequest":{"properties":{"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConsentItemChoice"},"type":"array"},{"type":"null"}],"title":"Items"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"consent_text_version":{"type":"string","title":"Consent Text Version"},"consent_text_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Text Hash"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"}},"type":"object","required":["consent_text_version"],"title":"ConsentRecordRequest"},"ConsentRecordResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"consent_text_version":{"type":"string","title":"Consent Text Version"},"consented_at":{"type":"string","format":"date-time","title":"Consented At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","session_id","study_id","consent_text_version","consented_at","created_at"],"title":"ConsentRecordResponse"},"ConsentScreenOut":{"properties":{"requested_language":{"type":"string","title":"Requested Language"},"purposes":{"items":{"$ref":"#/components/schemas/ConsentPurposeOut"},"type":"array","title":"Purposes"},"withdrawal_text":{"type":"string","title":"Withdrawal Text"},"field_worker_offered":{"type":"boolean","title":"Field Worker Offered"}},"type":"object","required":["requested_language","purposes","withdrawal_text","field_worker_offered"],"title":"ConsentScreenOut"},"ConsentScreenResponse":{"properties":{"study_id":{"type":"string","title":"Study Id"},"study_name":{"type":"string","title":"Study Name"},"consent_text_version":{"type":"string","title":"Consent Text Version"},"consent_text":{"type":"string","title":"Consent Text"},"session_duration_minutes":{"type":"integer","title":"Session Duration Minutes"},"data_retention_days":{"type":"integer","title":"Data Retention Days"},"anonymise_on_export":{"type":"boolean","title":"Anonymise On Export"}},"type":"object","required":["study_id","study_name","consent_text_version","consent_text","session_duration_minutes","data_retention_days","anonymise_on_export"],"title":"ConsentScreenResponse"},"ConsentWithdrawalRequest":{"properties":{"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["session_id"],"title":"ConsentWithdrawalRequest"},"ContactCaptureIn":{"properties":{"justification_ref":{"type":"string","maxLength":64,"title":"Justification Ref"}},"type":"object","required":["justification_ref"],"title":"ContactCaptureIn","description":"Collecting contact details during screening has to say why."},"ContactCardOut":{"properties":{"enrolment_id":{"type":"string","title":"Enrolment Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"phone_display":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Display"},"channel":{"type":"string","title":"Channel"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}},"type":"object","required":["enrolment_id","name","phone_display","channel","language"],"title":"ContactCardOut"},"ContactCardsOut":{"properties":{"cards":{"items":{"$ref":"#/components/schemas/ContactCardOut"},"type":"array","title":"Cards"}},"type":"object","required":["cards"],"title":"ContactCardsOut"},"ContactLookup":{"properties":{"kind":{"type":"string","title":"Kind"},"value":{"type":"string","maxLength":320,"title":"Value"}},"type":"object","required":["kind","value"],"title":"ContactLookup","description":"A duplicate check. Returns an enrolment or nothing — never a value."},"ContactLookupOut":{"properties":{"matched":{"type":"boolean","title":"Matched"},"enrolment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Id"},"display_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Code"},"lifecycle_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle State"}},"type":"object","required":["matched"],"title":"ContactLookupOut","description":"Whether this study already holds that address, and if so, as which record.\n\nCarries no contact value. The caller supplied the value they are checking;\nthis endpoint tells them nothing they did not already type."},"ContactOut":{"properties":{"enrolment_id":{"type":"string","title":"Enrolment Id"},"masked":{"type":"boolean","title":"Masked"},"preferred_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"communication_preferences":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Communication Preferences"},"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"},"lawful_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lawful Basis"},"recontact_permitted":{"type":"boolean","title":"Recontact Permitted"},"retention_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retention Until"},"suppressed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Suppressed At"},"purged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Purged At"},"key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Id"}},"type":"object","required":["enrolment_id","masked","preferred_name","email","phone","communication_preferences","purpose","lawful_basis","recontact_permitted","retention_until","suppressed_at","purged_at","key_id"],"title":"ContactOut","description":"Contact identity. Requires `participant.contact.view`; every read audited.\n\n`masked` says which shape this is. A masked value is still contact data and\nstill needs the capability — a mask narrows a guess, it does not remove one."},"ContactPresenceOut":{"properties":{"enrolment_id":{"type":"string","title":"Enrolment Id"},"has_record":{"type":"boolean","title":"Has Record"},"has_email":{"type":"boolean","title":"Has Email"},"has_phone":{"type":"boolean","title":"Has Phone"},"has_preferred_name":{"type":"boolean","title":"Has Preferred Name"},"external_reference_count":{"type":"integer","title":"External Reference Count"},"external_reference_systems":{"items":{"type":"string"},"type":"array","title":"External Reference Systems"},"recontact_permitted":{"type":"boolean","title":"Recontact Permitted"},"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"},"retention_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retention Until"},"suppressed":{"type":"boolean","title":"Suppressed"},"purged":{"type":"boolean","title":"Purged"}},"type":"object","required":["enrolment_id","has_record","has_email","has_phone","has_preferred_name","external_reference_count","external_reference_systems","recontact_permitted","purpose","retention_until","suppressed","purged"],"title":"ContactPresenceOut","description":"What `participant.manage` alone may know: that a way to reach them exists."},"ContactSuppress":{"properties":{"reason_code":{"type":"string","title":"Reason Code"}},"type":"object","required":["reason_code"],"title":"ContactSuppress"},"ContactWrite":{"properties":{"preferred_name":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Preferred Name"},"email":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Phone"},"communication_preferences":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Communication Preferences"},"purpose":{"type":"string","title":"Purpose","default":"study_communication"},"lawful_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lawful Basis"},"recontact_permitted":{"type":"boolean","title":"Recontact Permitted","default":false},"retention_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retention Until"}},"type":"object","title":"ContactWrite","description":"Record how to reach a participant.\n\nWriting requires `participant.manage` **and** `participant.contact.view`:\nsomebody who may not read an address may not overwrite one either, because\noverwriting is how you find out what was there."},"CorrectionRequestIn":{"properties":{"answer_id":{"type":"string","maxLength":36,"title":"Answer Id"}},"type":"object","required":["answer_id"],"title":"CorrectionRequestIn","description":"\"This value about me is wrong.\"\n\nRaises a data query against one answer; it does **not** change it. A\nparticipant correcting their own submitted data directly would be an\namendment nobody reviewed, so this flags the answer for somebody holding\n`response.amend` and stops there.\n\nThere is no field for what the value should be. That is deliberate: the\nquery row has nowhere to put participant content, and the correction itself\ngoes through the amendment service where the previous value, both missing\nreasons and the sequence are preserved."},"CoverageCell":{"properties":{"requirement_id":{"type":"string","title":"Requirement Id"},"requirement_kind":{"type":"string","title":"Requirement Kind"},"authority_body":{"type":"string","title":"Authority Body"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"},"cohort_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Id"},"applicability":{"type":"string","title":"Applicability"},"state":{"type":"string","title":"State"},"determination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Determination"},"decision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Id"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"submission_count":{"type":"integer","title":"Submission Count","default":0}},"type":"object","required":["requirement_id","requirement_kind","authority_body","applicability","state"],"title":"CoverageCell","description":"One requirement's state, in its own scope."},"CoverageReport":{"properties":{"study_id":{"type":"string","title":"Study Id"},"approved_versions":{"type":"integer","title":"Approved Versions"},"draft_versions":{"type":"integer","title":"Draft Versions"},"covered":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Covered"},"gaps":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Gaps"},"overlaps":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Overlaps"}},"type":"object","required":["study_id","approved_versions","draft_versions","covered","gaps","overlaps"],"title":"CoverageReport","description":"Which cohorts are covered, which are not, and where two answers collide."},"CustomModel":{"properties":{"id":{"type":"string","maxLength":128,"title":"Id"},"label":{"type":"string","maxLength":128,"title":"Label"},"provider":{"type":"string","enum":["anthropic","openai","groq","openrouter","self_hosted"],"title":"Provider"}},"type":"object","required":["id","label","provider"],"title":"CustomModel","description":"A tenant-added model beyond the curated catalog."},"DataQueryAssign":{"properties":{"assigned_to":{"type":"string","maxLength":128,"title":"Assigned To"},"expected_version":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Expected Version"}},"type":"object","required":["assigned_to"],"title":"DataQueryAssign"},"DataQueryCreate":{"properties":{"answer_id":{"type":"string","maxLength":36,"title":"Answer Id"},"query_code":{"type":"string","maxLength":48,"title":"Query Code"},"assigned_to":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Assigned To"},"external_reference":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"External Reference"}},"type":"object","required":["answer_id","query_code"],"title":"DataQueryCreate","description":"Flag one answer for somebody to check. Writes no answer."},"DataQueryListOut":{"properties":{"queries":{"items":{"$ref":"#/components/schemas/DataQueryOut"},"type":"array","title":"Queries"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["queries","count"],"title":"DataQueryListOut"},"DataQueryOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"answer_id":{"type":"string","title":"Answer Id"},"response_set_id":{"type":"string","title":"Response Set Id"},"question_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question Code"},"state":{"type":"string","title":"State"},"query_code":{"type":"string","title":"Query Code"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"raised_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raised By"},"raised_by_participant":{"type":"boolean","title":"Raised By Participant","default":false},"raised_at":{"type":"string","format":"date-time","title":"Raised At"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"assigned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Assigned At"},"resolution_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Code"},"amendment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amendment Id"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"version":{"type":"string","title":"Version"}},"type":"object","required":["id","study_id","answer_id","response_set_id","state","query_code","raised_at","version"],"title":"DataQueryOut","description":"A query as a researcher sees it. Carries no answer value, ever."},"DataQueryResolve":{"properties":{"resolution_code":{"type":"string","maxLength":48,"title":"Resolution Code"},"value":{"title":"Value"},"missing_reason":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Missing Reason"},"amendment_reason_code":{"anyOf":[{"type":"string","maxLength":48},{"type":"null"}],"title":"Amendment Reason Code"},"expected_version":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Expected Version"}},"type":"object","required":["resolution_code"],"title":"DataQueryResolve","description":"Close a query, correcting the value only where that is the answer."},"DatasetExportOut":{"properties":{"study_id":{"type":"string","title":"Study Id"},"columns":{"items":{"type":"string"},"type":"array","title":"Columns"},"row_count":{"type":"integer","title":"Row Count"},"csv":{"type":"string","title":"Csv"},"checksum":{"type":"string","title":"Checksum"},"disclosure":{"$ref":"#/components/schemas/DisclosureReportOut"}},"type":"object","required":["study_id","columns","row_count","csv","checksum","disclosure"],"title":"DatasetExportOut"},"DatasetExportRequest":{"properties":{"attribute_codes":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Attribute Codes"},"wave_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Id"},"include_provenance":{"type":"boolean","title":"Include Provenance","default":true},"quasi_identifier_codes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Quasi Identifier Codes"},"released_review_checksum":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Released Review Checksum","description":"A standing `disclosure.review` release for *this exact* output. Checked against the checksum this call computes, so a release granted for a narrower export does not carry."}},"type":"object","required":["attribute_codes"],"title":"DatasetExportRequest"},"DatasetLockCreate":{"properties":{"reason_code":{"type":"string","maxLength":48,"title":"Reason Code"},"scope":{"type":"string","title":"Scope","default":"study"},"instrument_version_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Instrument Version Id"},"external_reference":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"External Reference"}},"type":"object","required":["reason_code"],"title":"DatasetLockCreate"},"DatasetLockListOut":{"properties":{"locks":{"items":{"$ref":"#/components/schemas/DatasetLockOut"},"type":"array","title":"Locks"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["locks","count"],"title":"DatasetLockListOut"},"DatasetLockOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"scope":{"type":"string","title":"Scope"},"instrument_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instrument Version Id"},"reason_code":{"type":"string","title":"Reason Code"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"locked_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locked By"},"locked_at":{"type":"string","format":"date-time","title":"Locked At"},"released_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Released By"},"released_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Released At"},"release_reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Release Reason Code"},"open":{"type":"boolean","title":"Open"}},"type":"object","required":["id","study_id","scope","reason_code","locked_at","open"],"title":"DatasetLockOut"},"DatasetLockRelease":{"properties":{"reason_code":{"type":"string","maxLength":48,"title":"Reason Code"}},"type":"object","required":["reason_code"],"title":"DatasetLockRelease"},"DayOut":{"properties":{"date":{"type":"string","title":"Date"},"weekday":{"type":"string","title":"Weekday"},"day":{"type":"integer","title":"Day"}},"type":"object","required":["date","weekday","day"],"title":"DayOut"},"DecisionCreate":{"properties":{"determination":{"type":"string","maxLength":48,"title":"Determination"},"decision_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Decision Date"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"reference":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Reference"},"conditions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Conditions"},"evidence_document_version_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Evidence Document Version Id"},"make_current":{"type":"boolean","title":"Make Current","default":true},"expected_current_version":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Expected Current Version"},"supersedes_decision_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Supersedes Decision Id"}},"type":"object","required":["determination"],"title":"DecisionCreate","description":"What the body determined. Recorded by a person, never inferred.\n\nEleven determinations, including `exempt` and `review_not_required`, because\nforcing every study to produce an approval reference makes commercial,\nexempt and out-of-remit research invent one."},"DecisionResponse":{"properties":{"id":{"type":"string","title":"Id"},"submission_id":{"type":"string","title":"Submission Id"},"requirement_id":{"type":"string","title":"Requirement Id"},"sequence":{"type":"integer","title":"Sequence","default":1},"determination":{"type":"string","title":"Determination"},"decision_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Decision Date"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"conditions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conditions"},"evidence_document_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Document Version Id"},"supersedes_decision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supersedes Decision Id"},"recorded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recorded By"},"recorded_at":{"type":"string","format":"date-time","title":"Recorded At"},"is_current":{"type":"boolean","title":"Is Current","default":false},"current_permissive_determination":{"type":"boolean","title":"Current Permissive Determination","default":false}},"type":"object","required":["id","submission_id","requirement_id","determination","recorded_at"],"title":"DecisionResponse"},"DefinitionDiffResponse":{"properties":{"base":{"$ref":"#/components/schemas/VersionRefOut"},"compared":{"$ref":"#/components/schemas/VersionRefOut"},"identical":{"type":"boolean","title":"Identical"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"},"summary":{"type":"string","title":"Summary"},"unreadable":{"items":{"type":"string"},"type":"array","title":"Unreadable"},"changes":{"items":{"$ref":"#/components/schemas/ChangeOut"},"type":"array","title":"Changes"}},"type":"object","required":["base","compared","identical","summary"],"title":"DefinitionDiffResponse"},"DefinitionUpdate":{"properties":{"definition":{"additionalProperties":true,"type":"object","title":"Definition"},"expected_revision":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Expected Revision"}},"type":"object","required":["definition"],"title":"DefinitionUpdate"},"DelegationCreate":{"properties":{"member_user_id":{"type":"string","maxLength":128,"minLength":1,"title":"Member User Id"},"study_role":{"type":"string","maxLength":64,"minLength":1,"title":"Study Role"},"delegated_tasks":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":32},{"type":"null"}],"title":"Delegated Tasks"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"}},"type":"object","required":["member_user_id","study_role"],"title":"DelegationCreate","description":"What the PI has authorised one person to do on this study.\n\nDistinct from workspace capabilities: a capability says what someone *can*\ndo in the product, a delegation records what they were authorised to do on\na particular study. Ethics committees ask for this log, and nothing else\nrecords it."},"DelegationResponse":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"member_user_id":{"type":"string","title":"Member User Id"},"study_role":{"type":"string","title":"Study Role"},"delegated_tasks":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Delegated Tasks"},"delegated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delegated By"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"},"active":{"type":"boolean","title":"Active","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","study_id","member_user_id","study_role","created_at"],"title":"DelegationResponse"},"DeliveryAttempt":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"attempts":{"type":"integer","title":"Attempts","default":0},"destination_known":{"type":"boolean","title":"Destination Known","default":false},"failure_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Code"},"provider_delivery_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Delivery Id"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","status","created_at"],"title":"DeliveryAttempt","description":"Whether the escalation reached anyone, without saying who."},"DemoStart":{"properties":{"turnstile_token":{"type":"string","maxLength":2048,"title":"Turnstile Token","default":""}},"type":"object","title":"DemoStart"},"DemoStarted":{"properties":{"token":{"type":"string","title":"Token"},"path":{"type":"string","title":"Path"},"minutes":{"type":"integer","title":"Minutes"}},"type":"object","required":["token","path","minutes"],"title":"DemoStarted"},"DenominatorOut":{"properties":{"assignments_total":{"type":"integer","title":"Assignments Total"},"excluded_cancelled":{"type":"integer","title":"Excluded Cancelled"},"excluded_entered_in_error":{"type":"integer","title":"Excluded Entered In Error"},"counted":{"type":"integer","title":"Counted"}},"type":"object","required":["assignments_total","excluded_cancelled","excluded_entered_in_error","counted"],"title":"DenominatorOut","description":"What a completion figure is a fraction of, itemised.\n\nIts own object so a rate cannot be reported without the arithmetic behind\nit. \"68% complete\" with no denominator is a number a study cannot defend in\na monitoring visit."},"DisclosureCheckOut":{"properties":{"study_id":{"type":"string","title":"Study Id"},"report":{"$ref":"#/components/schemas/DisclosureReportOut"},"rare_combinations":{"items":{"$ref":"#/components/schemas/RareCombinationOut"},"type":"array","title":"Rare Combinations"},"output_checksum":{"type":"string","title":"Output Checksum","description":"Fingerprint of this exact result, for a disclosure review."}},"type":"object","required":["study_id","report","rare_combinations","output_checksum"],"title":"DisclosureCheckOut"},"DisclosureCheckRequest":{"properties":{"attribute_codes":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Attribute Codes"},"applies_to":{"type":"string","title":"Applies To","default":"all"}},"type":"object","required":["attribute_codes"],"title":"DisclosureCheckRequest"},"DisclosurePolicyCreate":{"properties":{"min_cell_size":{"type":"integer","minimum":1.0,"title":"Min Cell Size","default":5},"strategy":{"type":"string","title":"Strategy","description":"suppress · generalise · warn_only","default":"suppress"},"applies_to":{"type":"string","title":"Applies To","description":"export · report · all","default":"all"}},"type":"object","title":"DisclosurePolicyCreate"},"DisclosurePolicyOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"min_cell_size":{"type":"integer","title":"Min Cell Size"},"strategy":{"type":"string","title":"Strategy"},"applies_to":{"type":"string","title":"Applies To"},"set_by":{"type":"string","title":"Set By"},"set_at":{"type":"string","format":"date-time","title":"Set At"},"retired_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retired At"}},"type":"object","required":["id","study_id","min_cell_size","strategy","applies_to","set_by","set_at","retired_at"],"title":"DisclosurePolicyOut"},"DisclosureReportOut":{"properties":{"min_cell_size":{"type":"integer","title":"Min Cell Size"},"strategy":{"type":"string","title":"Strategy"},"policy_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Id"},"policy_declared":{"type":"boolean","title":"Policy Declared","description":"False when no policy was declared and the default was applied. 'This study decided 5' and 'nobody decided' are different facts."},"cells_total":{"type":"integer","title":"Cells Total"},"cells_suppressed":{"type":"integer","title":"Cells Suppressed"},"cells_generalised":{"type":"integer","title":"Cells Generalised"},"rare_combinations":{"items":{"items":{"type":"string"},"type":"array"},"type":"array","title":"Rare Combinations"},"passed":{"type":"boolean","title":"Passed"}},"type":"object","required":["min_cell_size","strategy","policy_id","policy_declared","cells_total","cells_suppressed","cells_generalised","rare_combinations","passed"],"title":"DisclosureReportOut"},"DisclosureReviewCreate":{"properties":{"output_kind":{"type":"string","title":"Output Kind","description":"export · report · check"},"output_checksum":{"type":"string","maxLength":128,"title":"Output Checksum"},"decision":{"type":"string","title":"Decision","description":"released · refused"},"basis_code":{"type":"string","title":"Basis Code","description":"Enumerated. Kenya's DPA s.53(3) makes identifiable publication an exception requiring a recorded basis, not a checkbox."},"policy_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Id"},"external_reference":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"External Reference","description":"A pointer into your own system. Refused if it contains whitespace."}},"type":"object","required":["output_kind","output_checksum","decision","basis_code"],"title":"DisclosureReviewCreate"},"DisclosureReviewOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"output_kind":{"type":"string","title":"Output Kind"},"output_checksum":{"type":"string","title":"Output Checksum"},"policy_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Id"},"decision":{"type":"string","title":"Decision"},"basis_code":{"type":"string","title":"Basis Code"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Reference"},"reviewed_by":{"type":"string","title":"Reviewed By"},"reviewed_at":{"type":"string","format":"date-time","title":"Reviewed At"}},"type":"object","required":["id","study_id","output_kind","output_checksum","policy_id","decision","basis_code","external_reference","reviewed_by","reviewed_at"],"title":"DisclosureReviewOut"},"DistributionOut":{"properties":{"attribute_code":{"type":"string","title":"Attribute Code"},"basis":{"type":"string","title":"Basis"},"answered":{"type":"integer","title":"Answered"},"missing":{"additionalProperties":{"type":"integer"},"type":"object","title":"Missing","description":"One entry per missing state present — never summed."},"cells":{"items":{"$ref":"#/components/schemas/CellOut"},"type":"array","title":"Cells"},"sample_size":{"type":"integer","title":"Sample Size"},"disclosure":{"$ref":"#/components/schemas/DisclosureReportOut"}},"type":"object","required":["attribute_code","basis","answered","missing","cells","sample_size","disclosure"],"title":"DistributionOut"},"DocumentVersionResponse":{"properties":{"id":{"type":"string","title":"Id"},"document_id":{"type":"string","title":"Document Id"},"study_id":{"type":"string","title":"Study Id"},"version_no":{"type":"integer","title":"Version No"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"detected_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detected Mime Type"},"byte_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Byte Size"},"checksum_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checksum Sha256"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"},"internal_state":{"type":"string","title":"Internal State"},"review_version":{"type":"integer","title":"Review Version","default":1},"scan_state":{"type":"string","title":"Scan State","default":"receiving"},"scan_verdict_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scan Verdict Code"},"scanner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scanner Name"},"scanned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scanned At"},"supersedes_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supersedes Version Id"},"generated_from_instrument_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated From Instrument Version Id"},"uploaded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uploaded By"},"internally_approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internally Approved By"},"internally_approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Internally Approved At"},"usable":{"type":"boolean","title":"Usable","default":false},"submittable":{"type":"boolean","title":"Submittable","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","document_id","study_id","version_no","internal_state","created_at"],"title":"DocumentVersionResponse","description":"One immutable artifact, and where it sits in *internal* review."},"EffectiveConsentOut":{"properties":{"purpose":{"type":"string","title":"Purpose"},"language":{"type":"string","title":"Language"},"version":{"type":"string","title":"Version"},"text":{"type":"string","title":"Text"},"placeholders":{"items":{"type":"string"},"type":"array","title":"Placeholders"},"source":{"type":"string","title":"Source"}},"type":"object","required":["purpose","language","version","text","placeholders","source"],"title":"EffectiveConsentOut"},"EnrolmentCreate":{"properties":{"site_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Site Id"},"cohort_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Cohort Id"},"arm_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Arm Id"},"recruitment_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recruitment Source"},"recruitment_detail":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Recruitment Detail"},"lifecycle_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle State"}},"type":"object","title":"EnrolmentCreate","description":"Register a participant. Carries nothing identifying, by construction."},"EnrolmentListOut":{"properties":{"enrolments":{"items":{"$ref":"#/components/schemas/EnrolmentOut"},"type":"array","title":"Enrolments"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["enrolments","count"],"title":"EnrolmentListOut"},"EnrolmentOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"display_code":{"type":"string","title":"Display Code"},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"},"cohort_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Id"},"arm_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Arm Id"},"recruitment_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recruitment Source"},"recruitment_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recruitment Detail"},"lifecycle_state":{"type":"string","title":"Lifecycle State"},"lifecycle_reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle Reason Code"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"state_changed_at":{"type":"string","format":"date-time","title":"State Changed At"},"enrolled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Enrolled At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"withdrawn_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Withdrawn At"},"version":{"type":"string","title":"Version"},"has_contact_record":{"type":"boolean","title":"Has Contact Record","default":false},"external_reference_count":{"type":"integer","title":"External Reference Count","default":0}},"type":"object","required":["id","study_id","display_code","site_id","cohort_id","arm_id","recruitment_source","recruitment_detail","lifecycle_state","lifecycle_reason_code","created_at","state_changed_at","enrolled_at","completed_at","withdrawn_at","version"],"title":"EnrolmentOut","description":"A participant record as everyone with `participant.manage` sees it.\n\nThere is no name, email or phone field here and there must never be one.\nContact identity has its own route, its own capability and its own audit row."},"EnrolmentTransition":{"properties":{"to_state":{"type":"string","title":"To State"},"reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason Code"},"expected_version":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Expected Version"}},"type":"object","required":["to_state"],"title":"EnrolmentTransition"},"EnteredInErrorIn":{"properties":{"reason_code":{"type":"string","title":"Reason Code"}},"type":"object","required":["reason_code"],"title":"EnteredInErrorIn"},"ExportJobCreate":{"properties":{"format":{"type":"string","title":"Format"},"scope":{"type":"string","title":"Scope"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"}},"type":"object","required":["format","scope"],"title":"ExportJobCreate"},"ExportJobCreateResponse":{"properties":{"export_id":{"type":"string","title":"Export Id"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["export_id","status","message"],"title":"ExportJobCreateResponse"},"ExportJobResponse":{"properties":{"id":{"type":"string","title":"Id"},"format":{"type":"string","title":"Format"},"scope":{"type":"string","title":"Scope"},"status":{"type":"string","title":"Status"},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","format","scope","status","download_url","expires_at","created_at","completed_at"],"title":"ExportJobResponse"},"ExternalReferenceCreate":{"properties":{"system":{"type":"string","maxLength":64,"title":"System"},"reference":{"type":"string","maxLength":320,"title":"Reference"},"purpose":{"type":"string","title":"Purpose","default":"record_linkage"},"retention_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retention Until"}},"type":"object","required":["system","reference"],"title":"ExternalReferenceCreate"},"ExternalReferenceOut":{"properties":{"id":{"type":"string","title":"Id"},"system":{"type":"string","title":"System"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"masked":{"type":"boolean","title":"Masked"},"purpose":{"type":"string","title":"Purpose"},"retention_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retention Until"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","system","reference","masked","purpose","retention_until","created_at"],"title":"ExternalReferenceOut","description":"A reference the caller holds `participant.contact.view` to see."},"FeatureFlagRefusal":{"properties":{"detail":{"type":"string","title":"Detail"},"problems":{"items":{"type":"string"},"type":"array","title":"Problems"}},"type":"object","required":["detail","problems"],"title":"FeatureFlagRefusal"},"FeatureFlagSet":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"FeatureFlagSet"},"FeatureFlagsOut":{"properties":{"flags":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Flags"}},"type":"object","required":["flags"],"title":"FeatureFlagsOut"},"FeatureReadinessOut":{"properties":{"problems":{"items":{"type":"string"},"type":"array","title":"Problems"}},"type":"object","required":["problems"],"title":"FeatureReadinessOut"},"FeedbackIn":{"properties":{"verdict":{"type":"string","enum":["helpful","not_helpful"],"title":"Verdict"},"reason_code":{"anyOf":[{"type":"string","enum":["quote_not_in_source","quote_out_of_context","wrong_session_or_participant","does_not_support_answer","irrelevant_to_question","duplicate_citation","other"]},{"type":"null"}],"title":"Reason Code"}},"additionalProperties":false,"type":"object","required":["verdict"],"title":"FeedbackIn"},"FeedbackOut":{"properties":{"id":{"type":"string","title":"Id"},"message_id":{"type":"string","title":"Message Id"},"citation_index":{"type":"integer","title":"Citation Index"},"verdict":{"type":"string","enum":["helpful","not_helpful"],"title":"Verdict"},"reason_code":{"anyOf":[{"type":"string","enum":["quote_not_in_source","quote_out_of_context","wrong_session_or_participant","does_not_support_answer","irrelevant_to_question","duplicate_citation","other"]},{"type":"null"}],"title":"Reason Code"},"adjudication":{"anyOf":[{"type":"string","enum":["upheld","rejected"]},{"type":"null"}],"title":"Adjudication"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"adjudicated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Adjudicated At"}},"type":"object","required":["id","message_id","citation_index","verdict","reason_code","adjudication","created_at","adjudicated_at"],"title":"FeedbackOut"},"FindingOut":{"properties":{"code":{"type":"string","title":"Code"},"severity":{"type":"string","title":"Severity"},"message":{"type":"string","title":"Message"},"row":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Row"},"column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Column"},"enrolment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Id"},"location":{"type":"string","title":"Location"}},"type":"object","required":["code","severity","message","location"],"title":"FindingOut","description":"One thing an import has to say about one row.\n\nMirrors `intake/diagnostics.Finding`, including what it does **not** have:\nthere is no `value` field. An instrument-import diagnostic quotes the\noffending construct because the construct is a formula; here it would be\nsomebody's email address, so the wire format has nowhere to put one.\n\n`enrolment_id` is the exception §2002/15 allows: a caller without\n`participant.contact.view` may learn *which record* a row matched, and\nnever the address that matched it."},"FormAttributeOut":{"properties":{"id":{"type":"string","title":"Id"},"code":{"type":"string","title":"Code"},"label":{"type":"string","title":"Label"},"source_question_code":{"type":"string","title":"Source Question Code"},"value_kind":{"type":"string","title":"Value Kind"},"approved_by":{"type":"string","title":"Approved By"},"created":{"type":"boolean","title":"Created","default":false}},"type":"object","required":["id","code","label","source_question_code","value_kind","approved_by"],"title":"FormAttributeOut"},"FormAttributesOut":{"properties":{"attributes":{"items":{"$ref":"#/components/schemas/FormAttributeOut"},"type":"array","title":"Attributes"}},"type":"object","required":["attributes"],"title":"FormAttributesOut"},"FormCheckRequest":{"properties":{"definition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Definition"}},"type":"object","title":"FormCheckRequest","description":"A definition to judge without storing it.\n\nOptional: with no body, the version's own stored definition is checked,\nwhich is what a builder wants after saving a draft."},"FormCheckResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"schema_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Version"},"question_count":{"type":"integer","title":"Question Count","default":0},"section_count":{"type":"integer","title":"Section Count","default":0},"advisories":{"items":{"$ref":"#/components/schemas/AdvisoryOut"},"type":"array","title":"Advisories"}},"type":"object","required":["ok"],"title":"FormCheckResponse"},"FormSummaryOut":{"properties":{"response_count":{"type":"integer","title":"Response Count"},"complete":{"type":"integer","title":"Complete"},"partial":{"type":"integer","title":"Partial"},"questions":{"items":{"$ref":"#/components/schemas/QuestionSummaryOut"},"type":"array","title":"Questions"},"disclosure":{"additionalProperties":true,"type":"object","title":"Disclosure"}},"type":"object","required":["response_count","complete","partial","questions","disclosure"],"title":"FormSummaryOut"},"FormsAccessOut":{"properties":{"portal_token":{"type":"string","title":"Portal Token"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["portal_token","expires_at"],"title":"FormsAccessOut"},"FreezeCreate":{"properties":{"label":{"type":"string","maxLength":255,"title":"Label"},"purpose_code":{"type":"string","title":"Purpose Code","description":"interim_analysis · final_analysis · finding · publication · regulatory_submission · data_sharing"},"parent_freeze_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Freeze Id","description":"What this freeze was taken from. Lineage, not order."},"instrument_version_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Instrument Version Ids"}},"type":"object","required":["label","purpose_code"],"title":"FreezeCreate"},"FreezeDetailOut":{"properties":{"freeze":{"$ref":"#/components/schemas/FreezeOut"},"items":{"items":{"$ref":"#/components/schemas/FreezeItemOut"},"type":"array","title":"Items"},"lineage":{"items":{"$ref":"#/components/schemas/FreezeOut"},"type":"array","title":"Lineage"},"manifest_verified":{"type":"boolean","title":"Manifest Verified","description":"Recomputed from the stored rows and compared. Reported, never repaired: a quietly corrected checksum erases the evidence that something wrote to a freeze after it was taken."}},"type":"object","required":["freeze","items","lineage","manifest_verified"],"title":"FreezeDetailOut"},"FreezeDriftOut":{"properties":{"freeze_id":{"type":"string","title":"Freeze Id"},"changed":{"items":{"type":"string"},"type":"array","title":"Changed"},"withdrawn":{"items":{"type":"string"},"type":"array","title":"Withdrawn"},"added":{"items":{"type":"string"},"type":"array","title":"Added"},"clean":{"type":"boolean","title":"Clean"}},"type":"object","required":["freeze_id","changed","withdrawn","added","clean"],"title":"FreezeDriftOut"},"FreezeItemOut":{"properties":{"ordinal":{"type":"integer","title":"Ordinal"},"response_set_id":{"type":"string","title":"Response Set Id"},"instrument_version_id":{"type":"string","title":"Instrument Version Id"},"enrolment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Id"},"wave_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Id"},"response_revision":{"type":"integer","title":"Response Revision"},"response_status":{"type":"string","title":"Response Status"},"definition_checksum":{"type":"string","title":"Definition Checksum"},"answer_count":{"type":"integer","title":"Answer Count"},"amendment_high_water":{"type":"integer","title":"Amendment High Water"}},"type":"object","required":["ordinal","response_set_id","instrument_version_id","enrolment_id","wave_id","response_revision","response_status","definition_checksum","answer_count","amendment_high_water"],"title":"FreezeItemOut"},"FreezeListOut":{"properties":{"freezes":{"items":{"$ref":"#/components/schemas/FreezeOut"},"type":"array","title":"Freezes"}},"type":"object","required":["freezes"],"title":"FreezeListOut"},"FreezeOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"label":{"type":"string","title":"Label"},"sequence":{"type":"integer","title":"Sequence"},"purpose_code":{"type":"string","title":"Purpose Code"},"parent_freeze_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Freeze Id"},"manifest_checksum":{"type":"string","title":"Manifest Checksum"},"item_count":{"type":"integer","title":"Item Count"},"enrolment_count":{"type":"integer","title":"Enrolment Count"},"frozen_by":{"type":"string","title":"Frozen By"},"frozen_at":{"type":"string","format":"date-time","title":"Frozen At"}},"type":"object","required":["id","study_id","label","sequence","purpose_code","parent_freeze_id","manifest_checksum","item_count","enrolment_count","frozen_by","frozen_at"],"title":"FreezeOut"},"GateResultOut":{"properties":{"id":{"type":"string","title":"Id"},"decision":{"type":"string","title":"Decision"},"permitted":{"type":"boolean","title":"Permitted"},"blockers":{"items":{"$ref":"#/components/schemas/BlockerOut"},"type":"array","title":"Blockers"},"instrument_version_id":{"type":"string","title":"Instrument Version Id"},"definition_checksum":{"type":"string","title":"Definition Checksum"},"enrolment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Id"},"placement":{"type":"string","title":"Placement"},"gate_version":{"type":"string","title":"Gate Version"},"evaluated_at":{"type":"string","format":"date-time","title":"Evaluated At"},"inputs":{"additionalProperties":true,"type":"object","title":"Inputs"}},"type":"object","required":["id","decision","permitted","blockers","instrument_version_id","definition_checksum","enrolment_id","placement","gate_version","evaluated_at","inputs"],"title":"GateResultOut","description":"The recorded decision. Read back, never recomputed."},"GovernanceResponse":{"properties":{"study_id":{"type":"string","title":"Study Id"},"risk_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Risk Level"},"pi_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pi Name"},"pi_contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pi Contact"},"escalation_contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Contact"},"helpline_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Helpline Name"},"helpline_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Helpline Number"},"helpline_in_effect":{"type":"boolean","title":"Helpline In Effect","default":false},"permitted_modalities":{"items":{"type":"string"},"type":"array","title":"Permitted Modalities"},"fielding_policy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fielding Policy"},"jurisdiction_policy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction Policy"},"institutional_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Institutional Template Id"},"outstanding":{"items":{"type":"string"},"type":"array","title":"Outstanding"}},"type":"object","required":["study_id","permitted_modalities"],"title":"GovernanceResponse"},"GovernanceUpdate":{"properties":{"risk_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Risk Level"},"pi_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Pi Name"},"pi_contact":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Pi Contact"},"escalation_contact":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Escalation Contact"},"helpline_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Helpline Name"},"helpline_number":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Helpline Number"},"permitted_modalities":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":4},{"type":"null"}],"title":"Permitted Modalities"},"fielding_policy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fielding Policy"},"jurisdiction_policy":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Jurisdiction Policy"},"institutional_template_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Institutional Template Id"}},"type":"object","title":"GovernanceUpdate","description":"Change what a study says about its own governance.\n\nEvery field is optional and unset fields are left alone, so a screen that\nedits one thing cannot blank the rest."},"GuideCaptureField":{"properties":{"name":{"type":"string","maxLength":128,"title":"Name"},"description":{"type":"string","maxLength":500,"title":"Description","default":""}},"additionalProperties":false,"type":"object","required":["name"],"title":"GuideCaptureField"},"GuideCreate":{"properties":{"source":{"type":"string","title":"Source","default":"manual"},"sections":{"items":{"$ref":"#/components/schemas/GuideSection"},"type":"array","maxItems":50,"title":"Sections"},"guide":{"anyOf":[{"$ref":"#/components/schemas/GuideLevel"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["sections"],"title":"GuideCreate"},"GuideEntry":{"properties":{"name":{"type":"string","maxLength":200,"title":"Name"},"local_names":{"items":{"type":"string","maxLength":200},"type":"array","maxItems":20,"title":"Local Names"}},"additionalProperties":false,"type":"object","required":["name"],"title":"GuideEntry"},"GuideGenerateRequest":{"properties":{"objective":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Objective"},"target_profile":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Target Profile"},"num_sections":{"anyOf":[{"type":"integer","maximum":15.0,"minimum":1.0},{"type":"null"}],"title":"Num Sections"},"questions_per_section":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Questions Per Section"}},"additionalProperties":false,"type":"object","title":"GuideGenerateRequest"},"GuideGlossaryEntry":{"properties":{"term":{"type":"string","maxLength":200,"title":"Term"},"local_names":{"items":{"type":"string","maxLength":200},"type":"array","maxItems":20,"title":"Local Names"},"definition":{"type":"string","maxLength":4000,"title":"Definition","default":""},"image_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Image Url"}},"additionalProperties":false,"type":"object","required":["term"],"title":"GuideGlossaryEntry"},"GuideItem":{"properties":{"id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Id"},"kind":{"type":"string","enum":["question","inventory","loop","checklist","transition","capture"],"title":"Kind"},"text":{"type":"string","maxLength":4000,"title":"Text","default":""},"notes":{"type":"string","maxLength":4000,"title":"Notes","default":""},"probes":{"items":{"$ref":"#/components/schemas/GuideProbe"},"type":"array","maxItems":30,"title":"Probes"},"condition":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Condition"},"required":{"type":"boolean","title":"Required","default":true},"time_weight":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Time Weight","default":1.0},"done_when":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Done When"},"lenses_apply":{"type":"boolean","title":"Lenses Apply","default":false},"sets_flag":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Sets Flag"},"max_items":{"anyOf":[{"type":"integer","maximum":30.0,"minimum":1.0},{"type":"null"}],"title":"Max Items"},"over":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Over"},"max_per_thing":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Max Per Thing"},"time_share":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Time Share"},"entries":{"items":{"$ref":"#/components/schemas/GuideEntry"},"type":"array","maxItems":60,"title":"Entries"},"fields":{"items":{"$ref":"#/components/schemas/GuideCaptureField"},"type":"array","maxItems":30,"title":"Fields"},"from_item":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"From Item"}},"additionalProperties":false,"type":"object","required":["kind"],"title":"GuideItem"},"GuideLens":{"properties":{"id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Id"},"name":{"type":"string","maxLength":200,"title":"Name"},"description":{"type":"string","maxLength":500,"title":"Description","default":""}},"additionalProperties":false,"type":"object","required":["name"],"title":"GuideLens"},"GuideLevel":{"properties":{"interviewer_rules":{"type":"string","maxLength":4000,"title":"Interviewer Rules","default":""},"lenses":{"items":{"$ref":"#/components/schemas/GuideLens"},"type":"array","maxItems":20,"title":"Lenses"},"glossary":{"items":{"$ref":"#/components/schemas/GuideGlossaryEntry"},"type":"array","maxItems":200,"title":"Glossary"}},"additionalProperties":false,"type":"object","title":"GuideLevel","description":"What belongs to the guide as a whole rather than to one section."},"GuidePreviewRequest":{"properties":{"section_id":{"type":"string","maxLength":128,"title":"Section Id"},"sections":{"items":{"$ref":"#/components/schemas/GuideSection"},"type":"array","maxItems":50,"title":"Sections"},"guide":{"anyOf":[{"$ref":"#/components/schemas/GuideLevel"},{"type":"null"}]},"participant":{"anyOf":[{"$ref":"#/components/schemas/PreviewParticipant"},{"type":"null"}]}},"type":"object","required":["section_id","sections"],"title":"GuidePreviewRequest","description":"The draft as it stands in the editor, so the preview shows unsaved edits."},"GuideProbe":{"properties":{"text":{"type":"string","maxLength":4000,"title":"Text"},"condition":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Condition"}},"additionalProperties":false,"type":"object","required":["text"],"title":"GuideProbe"},"GuideResponse":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"version":{"type":"integer","title":"Version"},"source":{"type":"string","title":"Source"},"sections":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sections"},"guide":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Guide"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["id","study_id","tenant_id","version","source","sections","created_at","created_by","notes"],"title":"GuideResponse"},"GuideSection":{"properties":{"id":{"type":"string","maxLength":128,"title":"Id"},"name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Name"},"title":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"order":{"type":"integer","title":"Order","default":0},"weight":{"type":"number","title":"Weight","default":0.25},"time_budget_pct":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Time Budget Pct"},"required":{"type":"boolean","title":"Required","default":true},"topics":{"items":{"type":"string","maxLength":500},"type":"array","maxItems":50,"title":"Topics"},"pre_built_probes":{"items":{"type":"string","maxLength":500},"type":"array","maxItems":50,"title":"Pre Built Probes"},"questions":{"items":{"type":"string","maxLength":500},"type":"array","maxItems":50,"title":"Questions"},"completion_criteria":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Completion Criteria"},"comfort_calibration":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Comfort Calibration"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"},"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/GuideItem"},"type":"array","maxItems":40},{"type":"null"}],"title":"Items"}},"additionalProperties":false,"type":"object","required":["id"],"title":"GuideSection","description":"One section of a discussion guide.\n\nUnknown fields are refused, not ignored: a field the server silently strips is a\nsetting that looks saved and does nothing. Every field here has a stated fate in\n`guide_sync.FIELD_HANDLING`."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","enum":["ok","error"],"title":"Status"},"version":{"type":"string","title":"Version"},"db":{"type":"string","enum":["ok","error"],"title":"Db"}},"type":"object","required":["status","version","db"],"title":"HealthResponse"},"HistoryItem":{"properties":{"role":{"type":"string","pattern":"^(user|assistant)$","title":"Role"},"content":{"type":"string","maxLength":2000,"title":"Content"}},"additionalProperties":false,"type":"object","required":["role","content"],"title":"HistoryItem"},"ImportBatchOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"file_byte_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Byte Size"},"source_format":{"type":"string","title":"Source Format"},"state":{"type":"string","title":"State"},"row_count":{"type":"integer","title":"Row Count"},"committed_row_count":{"type":"integer","title":"Committed Row Count"},"instrument_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instrument Version Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"committed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Committed At"}},"type":"object","required":["id","study_id","source_format","state","row_count","committed_row_count","created_at"],"title":"ImportBatchOut","description":"An import as a coordinator sees it afterwards. Counts and codes only."},"ImportCommitOut":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"applied":{"type":"boolean","title":"Applied"},"committed":{"type":"integer","title":"Committed"},"skipped":{"type":"integer","title":"Skipped"},"failed":{"type":"integer","title":"Failed"},"dry_run":{"type":"boolean","title":"Dry Run"},"findings":{"items":{"$ref":"#/components/schemas/FindingOut"},"type":"array","title":"Findings"}},"type":"object","required":["batch_id","applied","committed","skipped","failed","dry_run","findings"],"title":"ImportCommitOut"},"ImportPreviewOut":{"properties":{"file_checksum":{"type":"string","title":"File Checksum"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"file_byte_size":{"type":"integer","title":"File Byte Size"},"source_format":{"type":"string","title":"Source Format"},"headers":{"items":{"type":"string"},"type":"array","title":"Headers"},"row_count":{"type":"integer","title":"Row Count"},"sample_rows":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Sample Rows"},"findings":{"items":{"$ref":"#/components/schemas/FindingOut"},"type":"array","title":"Findings"},"persisted":{"type":"boolean","title":"Persisted","default":false}},"type":"object","required":["file_checksum","file_byte_size","source_format","headers","row_count","sample_rows","findings"],"title":"ImportPreviewOut","description":"What is in the file, before anybody has said what it means."},"ImportValidateOut":{"properties":{"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"row_count":{"type":"integer","title":"Row Count"},"ready_count":{"type":"integer","title":"Ready Count"},"blocked_count":{"type":"integer","title":"Blocked Count"},"matched_count":{"type":"integer","title":"Matched Count"},"findings":{"items":{"$ref":"#/components/schemas/FindingOut"},"type":"array","title":"Findings"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"},"worst_severity":{"type":"string","title":"Worst Severity"}},"type":"object","required":["row_count","ready_count","blocked_count","matched_count","findings","counts","worst_severity"],"title":"ImportValidateOut","description":"The whole file judged against a mapping. Writes no participant data."},"ImportedAnswerOut":{"properties":{"question":{"type":"string","title":"Question"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["question","answer"],"title":"ImportedAnswerOut"},"InstrumentCreate":{"properties":{"instrument_type":{"type":"string","maxLength":48,"title":"Instrument Type"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"}},"type":"object","required":["instrument_type","name"],"title":"InstrumentCreate"},"InstrumentResponse":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"instrument_type":{"type":"string","title":"Instrument Type"},"name":{"type":"string","title":"Name"},"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"},"current_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Version Id"},"lifecycle_state":{"type":"string","title":"Lifecycle State"},"activatable":{"type":"boolean","title":"Activatable","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","study_id","instrument_type","name","lifecycle_state","created_at"],"title":"InstrumentResponse"},"InstrumentUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"}},"type":"object","title":"InstrumentUpdate"},"InternalApprovalRequest":{"properties":{"decision":{"type":"string","maxLength":16,"title":"Decision","default":"approve"},"review_version":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Review Version"}},"type":"object","title":"InternalApprovalRequest","description":"A review outcome inside this workspace. Not an authority decision."},"InterviewStartIn":{"properties":{"mode":{"type":"string","pattern":"^(web_voice|web_text)$","title":"Mode"}},"type":"object","required":["mode"],"title":"InterviewStartIn"},"InterviewStartOut":{"properties":{"join_token":{"type":"string","title":"Join Token"},"modality":{"type":"string","title":"Modality"},"resumed":{"type":"boolean","title":"Resumed"}},"type":"object","required":["join_token","modality","resumed"],"title":"InterviewStartOut"},"InvitationCreated":{"properties":{"invitation_id":{"type":"string","title":"Invitation Id"},"path":{"type":"string","title":"Path"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["invitation_id","path","url","expires_at"],"title":"InvitationCreated"},"InvitationPreview":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"workspace_name":{"type":"string","title":"Workspace Name"},"role":{"type":"string","title":"Role"},"email":{"type":"string","title":"Email"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"email_matches":{"type":"boolean","title":"Email Matches"}},"type":"object","required":["tenant_id","workspace_name","role","email","expires_at","email_matches"],"title":"InvitationPreview"},"InvitationResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"token":{"type":"string","title":"Token"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"email_delivery":{"type":"string","title":"Email Delivery","default":"not_configured"}},"type":"object","required":["id","tenant_id","email","role","expires_at","token","created_at"],"title":"InvitationResponse","description":"An issued invitation. `token` appears exactly once, at creation."},"JoinCompleteRequest":{"properties":{"reason":{"anyOf":[{"type":"string","enum":["manual_end","connection_lost"]},{"type":"null"}],"title":"Reason"}},"type":"object","title":"JoinCompleteRequest"},"JoinCompleteResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["session_id","status"],"title":"JoinCompleteResponse"},"JoinPreviewResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"organiser_name":{"type":"string","title":"Organiser Name"},"interviewer_name":{"type":"string","title":"Interviewer Name"},"duration_minutes":{"type":"integer","title":"Duration Minutes"},"study_name":{"type":"string","title":"Study Name"},"contact_email":{"type":"string","title":"Contact Email"},"consent_text":{"type":"string","title":"Consent Text"},"consent_text_version":{"type":"string","title":"Consent Text Version"},"consent_text_hash":{"type":"string","title":"Consent Text Hash"},"data_retention_days":{"type":"integer","title":"Data Retention Days"},"records_audio":{"type":"boolean","title":"Records Audio","default":false},"modality":{"type":"string","enum":["voice","text"],"title":"Modality","default":"voice"},"consent_items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Consent Items","default":[]}},"type":"object","required":["session_id","organiser_name","interviewer_name","duration_minutes","study_name","contact_email","consent_text","consent_text_version","consent_text_hash","data_retention_days"],"title":"JoinPreviewResponse","description":"Everything the pre-join consent screen needs, and nothing that starts a session.\n\nReading this must have no side effects: the link stays unused, the session\nstays scheduled, and no interviewer is dispatched. A participant who reads\nthe consent form and walks away can come back to a working link."},"JoinSessionResponse":{"properties":{"token":{"type":"string","title":"Token"},"url":{"type":"string","title":"Url"},"room_name":{"type":"string","title":"Room Name"},"identity":{"type":"string","title":"Identity"},"session_id":{"type":"string","title":"Session Id"},"organiser_name":{"type":"string","title":"Organiser Name"},"duration_minutes":{"type":"integer","title":"Duration Minutes"},"study_name":{"type":"string","title":"Study Name"},"contact_email":{"type":"string","title":"Contact Email"},"modality":{"type":"string","enum":["voice","text"],"title":"Modality","default":"voice"},"opening_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Opening Message"}},"type":"object","required":["token","url","room_name","identity","session_id","organiser_name","duration_minutes","study_name","contact_email"],"title":"JoinSessionResponse","description":"What a joining participant's client needs to start the interview.\n\nThe LiveKit fields are empty strings for a text interview: there is no room\nto join. They stay on the response rather than becoming optional so one\nclient can handle both modalities by reading `modality` first."},"JoinStatusResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"status":{"type":"string","title":"Status"},"persona_name":{"type":"string","title":"Persona Name"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["session_id","status","persona_name"],"title":"JoinStatusResponse"},"KeyCreateRequest":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","title":"KeyCreateRequest"},"KeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"key":{"type":"string","title":"Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","key","created_at"],"title":"KeyResponse"},"KeySummary":{"properties":{"id":{"type":"string","title":"Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"is_login_key":{"type":"boolean","title":"Is Login Key","default":false}},"type":"object","required":["id","created_at"],"title":"KeySummary","description":"A key's metadata. The secret is never included — it is shown once, at creation."},"LanguageOut":{"properties":{"code":{"type":"string","title":"Code"},"label":{"type":"string","title":"Label"}},"type":"object","required":["code","label"],"title":"LanguageOut"},"LeadCreate":{"properties":{"name":{"type":"string","maxLength":160,"minLength":1,"title":"Name"},"work_email":{"type":"string","maxLength":254,"minLength":3,"title":"Work Email"},"organisation":{"type":"string","maxLength":200,"title":"Organisation","default":""},"sector":{"type":"string","maxLength":80,"title":"Sector","default":""},"message":{"type":"string","maxLength":5000,"title":"Message","default":""},"source_page":{"type":"string","maxLength":120,"title":"Source Page","default":""},"turnstile_token":{"type":"string","maxLength":2048,"title":"Turnstile Token","default":""},"website":{"type":"string","maxLength":200,"title":"Website","default":""}},"type":"object","required":["name","work_email"],"title":"LeadCreate"},"LeadReceived":{"properties":{"status":{"type":"string","title":"Status","default":"received"}},"type":"object","title":"LeadReceived"},"LivenessResponse":{"properties":{"status":{"type":"string","const":"alive","title":"Status"},"version":{"type":"string","title":"Version"}},"type":"object","required":["status","version"],"title":"LivenessResponse"},"LongitudinalOut":{"properties":{"attribute_code":{"type":"string","title":"Attribute Code"},"basis":{"type":"string","title":"Basis"},"series":{"items":{"$ref":"#/components/schemas/CaseSeriesOut"},"type":"array","title":"Series"},"sample_size":{"type":"integer","title":"Sample Size"}},"type":"object","required":["attribute_code","basis","series","sample_size"],"title":"LongitudinalOut"},"MatrixOut":{"properties":{"row_attribute":{"type":"string","title":"Row Attribute"},"column_attribute":{"type":"string","title":"Column Attribute"},"basis":{"type":"string","title":"Basis"},"row_values":{"items":{"type":"string"},"type":"array","title":"Row Values"},"column_values":{"items":{"type":"string"},"type":"array","title":"Column Values"},"cells":{"items":{"$ref":"#/components/schemas/CellOut"},"type":"array","title":"Cells"},"sample_size":{"type":"integer","title":"Sample Size"},"disclosure":{"$ref":"#/components/schemas/DisclosureReportOut"}},"type":"object","required":["row_attribute","column_attribute","basis","row_values","column_values","cells","sample_size","disclosure"],"title":"MatrixOut"},"MeResponse":{"properties":{"platform_user_id":{"type":"string","title":"Platform User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"preferred_workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Workspace Id"},"workspaces":{"items":{"$ref":"#/components/schemas/WorkspaceSummary"},"type":"array","title":"Workspaces"},"requires_workspace_selection":{"type":"boolean","title":"Requires Workspace Selection"}},"type":"object","required":["platform_user_id","workspaces","requires_workspace_selection"],"title":"MeResponse"},"MemberCapabilities":{"properties":{"member_id":{"type":"string","title":"Member Id"},"role":{"type":"string","title":"Role"},"preset":{"items":{"type":"string"},"type":"array","title":"Preset"},"grants":{"items":{"type":"string"},"type":"array","title":"Grants"},"revocations":{"items":{"type":"string"},"type":"array","title":"Revocations"},"effective":{"items":{"type":"string"},"type":"array","title":"Effective"},"membership_version":{"type":"integer","title":"Membership Version"}},"type":"object","required":["member_id","role","preset","grants","revocations","effective","membership_version"],"title":"MemberCapabilities","description":"What this member holds, and where each part came from.\n\nPreset, grants and revocations are separate rather than pre-merged: an admin\ndeciding whether to take something away has to see whether it came from the\nrole or from a deliberate grant, and `effective` alone cannot answer that."},"MemberInviteRequest":{"properties":{"email":{"type":"string","maxLength":512,"title":"Email"},"role":{"type":"string","maxLength":32,"title":"Role","default":"researcher"},"capability_grants":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":32},{"type":"null"}],"title":"Capability Grants"}},"type":"object","required":["email"],"title":"MemberInviteRequest"},"MemberResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status","default":"active"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"invited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Invited At"},"clerk_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clerk User Id"},"capability_grants":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Capability Grants"},"capability_revocations":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Capability Revocations"}},"type":"object","required":["id","tenant_id","role","created_at"],"title":"MemberResponse","description":"A membership, rendered at the detail level the caller is entitled to.\n\nRestricted fields are **omitted**, not blanked, so an absent value is never\nmistaken for an empty one."},"MemberRoleUpdateRequest":{"properties":{"role":{"type":"string","maxLength":32,"title":"Role"}},"type":"object","required":["role"],"title":"MemberRoleUpdateRequest"},"MessageOut":{"properties":{"id":{"type":"string","title":"Id"},"role":{"$ref":"#/components/schemas/ChatRole"},"content":{"type":"string","title":"Content"},"citations":{"items":{"$ref":"#/components/schemas/Citation"},"type":"array","title":"Citations"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","role","content","created_at"],"title":"MessageOut"},"MessagingStatus":{"properties":{"configured":{"type":"boolean","title":"Configured"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"sandbox":{"type":"boolean","title":"Sandbox"},"supports_inbound":{"type":"boolean","title":"Supports Inbound"},"helpline_set":{"type":"boolean","title":"Helpline Set"},"public_url_set":{"type":"boolean","title":"Public Url Set"}},"type":"object","required":["configured","provider","sandbox","supports_inbound","helpline_set","public_url_set"],"title":"MessagingStatus"},"ModeOut":{"properties":{"mode":{"type":"string","title":"Mode"},"label":{"type":"string","title":"Label"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["mode","label","detail"],"title":"ModeOut"},"MyCapabilities":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"role":{"type":"string","title":"Role"},"effective":{"items":{"type":"string"},"type":"array","title":"Effective"},"credential_type":{"type":"string","title":"Credential Type"},"first_factor_age_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"First Factor Age Minutes"},"reauthentication_window_minutes":{"type":"integer","title":"Reauthentication Window Minutes"}},"type":"object","required":["tenant_id","role","effective","credential_type","reauthentication_window_minutes"],"title":"MyCapabilities","description":"What the caller may do in the workspace they are acting in.\n\nThe console needs this to decide what to *show*. A coordinator who cannot\nresolve a safeguarding case should not be handed a Resolve button that\nrefuses them — a permission model is only humane if the interface reflects\nit. This is presentation, never enforcement: every route still checks."},"NotApplicableRequest":{"properties":{"config_version":{"type":"string","maxLength":64,"title":"Config Version"},"reason":{"type":"string","maxLength":1000,"minLength":10,"title":"Reason"},"language":{"type":"string","maxLength":16,"title":"Language","default":"*"},"site_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Site Id"}},"type":"object","required":["config_version","reason"],"title":"NotApplicableRequest","description":"A recorded decision that this study needs no support information."},"OptoutPreview":{"properties":{"organiser_name":{"type":"string","title":"Organiser Name"},"can_withdraw":{"type":"boolean","title":"Can Withdraw"},"question_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question Kind"}},"type":"object","required":["organiser_name","can_withdraw"],"title":"OptoutPreview"},"OptoutWithdrawIn":{"properties":{"answer":{"type":"string","maxLength":64,"title":"Answer"}},"type":"object","required":["answer"],"title":"OptoutWithdrawIn"},"OptoutWithdrawOut":{"properties":{"withdrawn":{"type":"boolean","title":"Withdrawn"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"attempts_left":{"type":"integer","title":"Attempts Left","default":0}},"type":"object","required":["withdrawn"],"title":"OptoutWithdrawOut"},"PageRef":{"properties":{"id":{"type":"string","maxLength":64,"title":"Id"},"label":{"type":"string","maxLength":80,"title":"Label"},"about":{"type":"string","maxLength":300,"title":"About","default":""},"scope":{"type":"string","pattern":"^(global|study)$","title":"Scope"}},"additionalProperties":false,"type":"object","required":["id","label","scope"],"title":"PageRef","description":"A page the console says this person can open. Data, never instructions."},"ParticipantContextItemOut":{"properties":{"question_code":{"type":"string","title":"Question Code"},"label":{"type":"string","title":"Label"},"answer_type":{"type":"string","title":"Answer Type"},"value":{"title":"Value"},"missing_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Missing Reason"},"moderator_context_policy":{"type":"string","title":"Moderator Context Policy"},"sensitivity":{"type":"string","title":"Sensitivity"},"instrument_version_id":{"type":"string","title":"Instrument Version Id"},"response_set_id":{"type":"string","title":"Response Set Id"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answered At"}},"type":"object","required":["question_code","label","answer_type","moderator_context_policy","sensitivity","instrument_version_id","response_set_id"],"title":"ParticipantContextItemOut","description":"One answer an interviewer is permitted to see, and how they may use it.\n\nThe policy is carried rather than flattened to a boolean. \"You may know\nthis\" and \"you may raise this\" are different permissions: a question\nmarked `moderator_may_know` gives the interviewer background they must not\nintroduce, and one marked `moderator_may_probe` invites them to follow it\nup. An interviewer who cannot tell the two apart will do the wrong one."},"ParticipantContextOut":{"properties":{"session_id":{"type":"string","title":"Session Id"},"enrolment_id":{"type":"string","title":"Enrolment Id"},"enrolment_display_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Display Code"},"items":{"items":{"$ref":"#/components/schemas/ParticipantContextItemOut"},"type":"array","title":"Items"},"hidden_count":{"type":"integer","title":"Hidden Count","default":0},"withheld_for_sensitivity":{"type":"integer","title":"Withheld For Sensitivity","default":0},"sensitive_withheld_for_permission":{"type":"boolean","title":"Sensitive Withheld For Permission","default":false}},"type":"object","required":["session_id","enrolment_id","items"],"title":"ParticipantContextOut","description":"The permitted background for one interview.\n\nPseudonymous by construction: an enrolment id and a display code, and no\nfield that could hold a name, an address or a telephone number."},"ParticipantSlot":{"properties":{"participant_label":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Participant Label"},"participant_ref":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Participant Ref"}},"type":"object","title":"ParticipantSlot","description":"One participant to field, as named by the researcher."},"PendingInvitationResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"expired":{"type":"boolean","title":"Expired","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","tenant_id","email","role","expires_at","created_at"],"title":"PendingInvitationResponse","description":"An outstanding invitation, without its token.\n\nThe token is shown once, at issue. What is stored is a hash, so listing\ninvitations can never hand anyone a second way in."},"PersonaCreateRequest":{"properties":{"name":{"type":"string","maxLength":256,"title":"Name"},"voice_id":{"type":"string","maxLength":128,"title":"Voice Id"},"system_prompt":{"type":"string","maxLength":8000,"title":"System Prompt"},"tone":{"type":"string","maxLength":64,"title":"Tone","default":"professional"},"language":{"type":"string","maxLength":16,"title":"Language","default":"en"},"speech_rate":{"type":"string","pattern":"^(slow|normal|fast)$","title":"Speech Rate","default":"normal"},"voice_settings":{"anyOf":[{"$ref":"#/components/schemas/PersonaVoiceSettings"},{"type":"null"}]}},"type":"object","required":["name","voice_id","system_prompt"],"title":"PersonaCreateRequest"},"PersonaResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"voice_id":{"type":"string","title":"Voice Id"},"tts_provider":{"type":"string","title":"Tts Provider"},"system_prompt":{"type":"string","title":"System Prompt"},"tone":{"type":"string","title":"Tone"},"language":{"type":"string","title":"Language"},"speech_rate":{"type":"string","title":"Speech Rate","default":"normal"},"voice_settings":{"anyOf":[{"$ref":"#/components/schemas/PersonaVoiceSettings"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","tenant_id","name","voice_id","tts_provider","system_prompt","tone","language","created_at"],"title":"PersonaResponse"},"PersonaUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Name"},"voice_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Voice Id"},"system_prompt":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"System Prompt"},"tone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Tone"},"language":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Language"},"speech_rate":{"anyOf":[{"type":"string","pattern":"^(slow|normal|fast)$"},{"type":"null"}],"title":"Speech Rate"},"voice_settings":{"anyOf":[{"$ref":"#/components/schemas/PersonaVoiceSettings"},{"type":"null"}]}},"type":"object","title":"PersonaUpdateRequest"},"PersonaVoiceSettings":{"properties":{"endpointing_min_delay":{"anyOf":[{"type":"number","maximum":5.0,"minimum":0.2},{"type":"null"}],"title":"Endpointing Min Delay"},"endpointing_max_delay":{"anyOf":[{"type":"number","maximum":15.0,"minimum":0.5},{"type":"null"}],"title":"Endpointing Max Delay"}},"type":"object","title":"PersonaVoiceSettings","description":"How the interviewer listens. Unset fields keep the deployment defaults."},"PipelineOut":{"properties":{"summary":{"$ref":"#/components/schemas/PipelineSummary"},"rows":{"items":{"$ref":"#/components/schemas/PipelineRow"},"type":"array","title":"Rows"},"languages":{"items":{"$ref":"#/components/schemas/LanguageOut"},"type":"array","title":"Languages"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["summary","rows","languages","total"],"title":"PipelineOut"},"PipelineRow":{"properties":{"enrolment_id":{"type":"string","title":"Enrolment Id"},"display_code":{"type":"string","title":"Display Code"},"stage":{"type":"string","title":"Stage"},"side_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Side State"},"label":{"type":"string","title":"Label"},"next_step":{"type":"string","title":"Next Step"},"needs_nudge":{"type":"boolean","title":"Needs Nudge"},"forms_done":{"type":"integer","title":"Forms Done"},"forms_total":{"type":"integer","title":"Forms Total"}},"type":"object","required":["enrolment_id","display_code","stage","side_state","label","next_step","needs_nudge","forms_done","forms_total"],"title":"PipelineRow","description":"One participant, by code. Deliberately has no name, phone or email field."},"PipelineSummary":{"properties":{"milestones":{"additionalProperties":{"type":"integer"},"type":"object","title":"Milestones"},"chips":{"additionalProperties":{"type":"integer"},"type":"object","title":"Chips"}},"type":"object","required":["milestones","chips"],"title":"PipelineSummary"},"PolicyBindingCreate":{"properties":{"scope":{"type":"string","title":"Scope"},"scope_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Scope Id"},"policy_kind":{"type":"string","title":"Policy Kind"},"policy_key":{"type":"string","maxLength":64,"minLength":1,"title":"Policy Key"},"policy_value":{"additionalProperties":true,"type":"object","title":"Policy Value"},"policy_version":{"type":"string","maxLength":32,"minLength":1,"title":"Policy Version"},"effective_from":{"type":"string","format":"date-time","title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"}},"type":"object","required":["scope","policy_kind","policy_key","policy_version","effective_from"],"title":"PolicyBindingCreate"},"PolicyBindingResponse":{"properties":{"id":{"type":"string","title":"Id"},"scope":{"type":"string","title":"Scope"},"scope_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Id"},"policy_kind":{"type":"string","title":"Policy Kind"},"policy_key":{"type":"string","title":"Policy Key"},"policy_value":{"additionalProperties":true,"type":"object","title":"Policy Value"},"policy_version":{"type":"string","title":"Policy Version"},"effective_from":{"type":"string","format":"date-time","title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"},"recorded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recorded By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","scope","policy_kind","policy_key","policy_value","policy_version","effective_from","created_at"],"title":"PolicyBindingResponse"},"PortalAnswerOut":{"properties":{"answer_id":{"type":"string","title":"Answer Id"},"question_code":{"type":"string","title":"Question Code"},"label":{"type":"string","title":"Label"},"value":{"title":"Value"},"missing_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Missing Reason"},"disputable":{"type":"boolean","title":"Disputable"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["answer_id","question_code","label","disputable"],"title":"PortalAnswerOut","description":"One of this participant's own answers, as they see it.\n\nCarries the **value** — deliberately, and unlike every researcher-facing\nresponse schema. There the reader is a third party; here the reader is the\nperson the answer is about, and asking somebody to dispute a value they\ncannot see would be absurd."},"PortalFormOut":{"properties":{"assignment_id":{"type":"string","title":"Assignment Id"},"title":{"type":"string","title":"Title"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"status":{"type":"string","title":"Status"},"required":{"type":"boolean","title":"Required","default":false},"requirement_explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requirement Explanation"},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"form":{"additionalProperties":true,"type":"object","title":"Form"},"answers":{"additionalProperties":true,"type":"object","title":"Answers","default":{}},"imported_answers":{"items":{"$ref":"#/components/schemas/ImportedAnswerOut"},"type":"array","title":"Imported Answers","default":[]},"attachments":{"items":{"$ref":"#/components/schemas/AttachmentOut"},"type":"array","title":"Attachments","default":[]},"attachment_policies":{"items":{"$ref":"#/components/schemas/AttachmentPolicyOut"},"type":"array","title":"Attachment Policies","default":[]},"revision":{"type":"integer","title":"Revision","default":1}},"type":"object","required":["assignment_id","title","status","form"],"title":"PortalFormOut","description":"Everything the participant's browser needs, and nothing else.\n\n`form` is the **projection** — the same `RenderedForm` the builder preview\nuses, and the rows a recorded answer actually references. Sending that\nrather than the raw definition means the browser runs the shipped runtime\nover exactly what the server will evaluate against, instead of a second\ninterpretation of the same JSON.\n\nIt carries nothing about the person: no enrolment id, no study id, no\nparticipant code. A link is scoped to one form, not to a record."},"PortalLinkListOut":{"properties":{"links":{"items":{"$ref":"#/components/schemas/PortalLinkSummaryOut"},"type":"array","title":"Links"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["links","count"],"title":"PortalLinkListOut"},"PortalLinkOut":{"properties":{"token":{"type":"string","title":"Token"},"url":{"type":"string","title":"Url"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"token_id":{"type":"string","title":"Token Id"}},"type":"object","required":["token","url","expires_at","token_id"],"title":"PortalLinkOut","description":"A participant's portal link, returned exactly once.\n\nThe raw token appears here and nowhere else: the row stores only its\nSHA-256, so a lost link is **reissued**, never recovered. `token_id` is the\nhandle for withdrawing it later — revoking needs the row, not the secret.\n\n`url` is relative, matching the assignment link's convention: where the\nparticipant surface is hosted is a deployment question, and an absolute URL\nbuilt from this process's environment would be wrong the first time the two\ndiffer."},"PortalLinkRevoke":{"properties":{"reason_code":{"type":"string","maxLength":48,"title":"Reason Code"}},"type":"object","required":["reason_code"],"title":"PortalLinkRevoke","description":"Withdraw a link before its expiry.\n\n`reason_code` is enumerated for the reason every other reason column here\nis: a free-text field beside a participant's record is a place somebody\neventually types something about them."},"PortalLinkSummaryOut":{"properties":{"id":{"type":"string","title":"Id"},"issued_at":{"type":"string","format":"date-time","title":"Issued At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"revoked_reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked Reason Code"},"live":{"type":"boolean","title":"Live"}},"type":"object","required":["id","issued_at","expires_at","live"],"title":"PortalLinkSummaryOut","description":"A link's life, never its value.\n\nThere is no token and no hash here, deliberately. A coordinator needs to\nknow that a link exists, when it expires, whether it has been opened and\nwhether it has been withdrawn — none of which requires the secret, and the\nhash is the one field on the row worth stealing. `live` is derived so a\nlist can be read at a glance rather than by comparing dates in one's head."},"PortalProblemOut":{"properties":{"path":{"type":"string","title":"Path"},"code":{"type":"string","title":"Code"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["path","code","detail"],"title":"PortalProblemOut"},"PortalQuestionStateOut":{"properties":{"path":{"type":"string","title":"Path"},"code":{"type":"string","title":"Code"},"relevant":{"type":"boolean","title":"Relevant"},"required":{"type":"boolean","title":"Required"},"calculated":{"type":"boolean","title":"Calculated"},"selectable":{"items":{"type":"string"},"type":"array","title":"Selectable","default":[]},"value":{"title":"Value"},"missing_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Missing Reason"}},"type":"object","required":["path","code","relevant","required","calculated"],"title":"PortalQuestionStateOut","description":"What the **server** concluded about one question.\n\nThe browser evaluates the same rules so the form feels immediate, but this\nis the account that counts, and the client reconciles to it."},"PortalResponseOut":{"properties":{"assignment_id":{"type":"string","title":"Assignment Id"},"title":{"type":"string","title":"Title"},"status":{"type":"string","title":"Status"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"answers":{"items":{"$ref":"#/components/schemas/PortalAnswerOut"},"type":"array","title":"Answers","default":[]}},"type":"object","required":["assignment_id","title","status"],"title":"PortalResponseOut","description":"A form this participant has already answered."},"PortalSaveIn":{"properties":{"answers":{"additionalProperties":true,"type":"object","title":"Answers"},"save_key":{"type":"string","maxLength":64,"title":"Save Key"},"expected_revision":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Revision"}},"type":"object","required":["save_key"],"title":"PortalSaveIn","description":"A save from the participant's browser.\n\n`save_key` makes the call idempotent: a retry after a dropped connection\nreplays rather than writing again. `expected_revision` makes it\nconcurrency-safe: a second tab loses rather than silently overwriting."},"PortalSaveOut":{"properties":{"status":{"type":"string","title":"Status"},"revision":{"type":"integer","title":"Revision"},"complete":{"type":"boolean","title":"Complete"},"replayed":{"type":"boolean","title":"Replayed","default":false},"states":{"items":{"$ref":"#/components/schemas/PortalQuestionStateOut"},"type":"array","title":"States","default":[]},"problems":{"items":{"$ref":"#/components/schemas/PortalProblemOut"},"type":"array","title":"Problems","default":[]},"rejected_calculated":{"items":{"type":"string"},"type":"array","title":"Rejected Calculated","default":[]},"rejected_irrelevant":{"items":{"type":"string"},"type":"array","title":"Rejected Irrelevant","default":[]},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"}},"type":"object","required":["status","revision","complete"],"title":"PortalSaveOut"},"PortalTaskListOut":{"properties":{"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"study_name":{"type":"string","title":"Study Name"},"due":{"items":{"$ref":"#/components/schemas/PortalTaskOut"},"type":"array","title":"Due","default":[]},"optional":{"items":{"$ref":"#/components/schemas/PortalTaskOut"},"type":"array","title":"Optional","default":[]},"completed":{"items":{"$ref":"#/components/schemas/PortalTaskOut"},"type":"array","title":"Completed","default":[]},"closed":{"items":{"$ref":"#/components/schemas/PortalTaskOut"},"type":"array","title":"Closed","default":[]},"upcoming":{"items":{"$ref":"#/components/schemas/PortalTaskOut"},"type":"array","title":"Upcoming","default":[]}},"type":"object","required":["generated_at","study_name"],"title":"PortalTaskListOut","description":"Everything outstanding for one participant, grouped as J10 describes it.\n\nReading this changes nothing: no assignment advances, no wave opens, no link\nis consumed and no status is recomputed."},"PortalTaskOut":{"properties":{"assignment_id":{"type":"string","title":"Assignment Id"},"title":{"type":"string","title":"Title"},"status":{"type":"string","title":"Status"},"required":{"type":"boolean","title":"Required"},"requirement_explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requirement Explanation"},"opens_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Opens At"},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"wave_sequence":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wave Sequence"},"response_status":{"type":"string","title":"Response Status"},"answerable":{"type":"boolean","title":"Answerable"}},"type":"object","required":["assignment_id","title","status","required","response_status","answerable"],"title":"PortalTaskOut","description":"One thing asked of this participant, as their own screen shows it.\n\nCarries no enrolment id, no study id and no participant code — the same rule\n`PortalFormOut` follows. The link is already scoped to a record; handing that\nrecord's identifiers to the browser adds nothing the page needs and gives a\nfinder something to quote."},"PreferredWorkspaceRequest":{"properties":{"tenant_id":{"type":"string","maxLength":36,"title":"Tenant Id"}},"type":"object","required":["tenant_id"],"title":"PreferredWorkspaceRequest"},"PreviewOut":{"properties":{"study_name":{"type":"string","title":"Study Name"},"organiser_name":{"type":"string","title":"Organiser Name"},"duration_minutes":{"type":"integer","title":"Duration Minutes"},"languages":{"items":{"$ref":"#/components/schemas/LanguageOut"},"type":"array","title":"Languages"},"helpline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Helpline"},"data_use_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Data Use Mb"},"asks_who_you_are":{"type":"boolean","title":"Asks Who You Are"},"question_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question Kind"},"locked":{"type":"boolean","title":"Locked"}},"type":"object","required":["study_name","organiser_name","duration_minutes","languages","helpline","data_use_mb","asks_who_you_are","question_kind","locked"],"title":"PreviewOut"},"PreviewParticipant":{"properties":{"enrolment_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Enrolment Id"},"profile":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"type":"object","maxProperties":40,"title":"Profile"},"form":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"type":"object","maxProperties":40,"title":"Form"},"flags":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"type":"object","maxProperties":40,"title":"Flags"}},"additionalProperties":false,"type":"object","title":"PreviewParticipant","description":"Who the preview is for, so conditions can be seen to apply or not.\n\nA real enrolment (its profile and the form answers the interviewer may use are read\nexactly as an interview would read them) and/or sample values typed in. Names are given\nwithout their `profile.` / `form.` / `flag.` prefix."},"ProbeFeedbackRequest":{"properties":{"acted_on":{"type":"boolean","title":"Acted On"},"useful":{"type":"boolean","title":"Useful"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["acted_on","useful"],"title":"ProbeFeedbackRequest"},"ProbeResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"probe_type":{"type":"string","title":"Probe Type"},"content":{"type":"string","title":"Content"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","session_id","probe_type","content","created_at"],"title":"ProbeResponse"},"ProblemOut":{"properties":{"path":{"type":"string","title":"Path"},"code":{"type":"string","title":"Code"},"detail":{"type":"string","title":"Detail"},"expression_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expression Error"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["path","code","detail"],"title":"ProblemOut"},"ProcessorOut":{"properties":{"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"}},"type":"object","required":["name","role"],"title":"ProcessorOut"},"ProjectAnalysisResponse":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"status":{"type":"string","title":"Status"},"session_count":{"type":"integer","title":"Session Count"},"participant_matrix":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Participant Matrix"},"theme_summary":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Theme Summary"},"synthesis_narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Synthesis Narrative"},"synthesis_citations":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Synthesis Citations"},"saturation_report":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Saturation Report"},"triggered_by":{"type":"string","title":"Triggered By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","study_id","status","session_count","participant_matrix","theme_summary","synthesis_narrative","saturation_report","triggered_by","created_at","completed_at"],"title":"ProjectAnalysisResponse"},"ProjectAnalysisTriggerResponse":{"properties":{"message":{"type":"string","title":"Message"},"analysis_id":{"type":"string","title":"Analysis Id"}},"type":"object","required":["message","analysis_id"],"title":"ProjectAnalysisTriggerResponse"},"ProjectCreateRequest":{"properties":{"name":{"type":"string","title":"Name"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"}},"type":"object","required":["name"],"title":"ProjectCreateRequest"},"ProjectDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"session_count":{"type":"integer","title":"Session Count","default":0},"active_session_count":{"type":"integer","title":"Active Session Count","default":0}},"type":"object","required":["id","tenant_id","name","status","created_at"],"title":"ProjectDetailResponse"},"ProjectResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","tenant_id","name","status","created_at"],"title":"ProjectResponse"},"ProjectUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"ProjectUpdateRequest"},"ProjectionIntegrity":{"properties":{"checked":{"type":"boolean","title":"Checked"},"intact":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Intact"},"differences":{"items":{"type":"string"},"type":"array","title":"Differences"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["checked"],"title":"ProjectionIntegrity","description":"Whether the stored rows still say what the definition says."},"Pronunciation":{"properties":{"term":{"type":"string","maxLength":80,"minLength":1,"title":"Term"},"say":{"type":"string","maxLength":120,"minLength":1,"pattern":"^[^\\n\\r]+$","title":"Say"}},"type":"object","required":["term","say"],"title":"Pronunciation","description":"How the direct Cartesia voice should say one of the study's key terms.\n\n`say` is a sounds-like spelling. Reviewed study configuration, written by a\nperson and never by a model (slice 016)."},"PronunciationOut":{"properties":{"term":{"type":"string","maxLength":80,"minLength":1,"title":"Term"},"say":{"type":"string","maxLength":120,"minLength":1,"pattern":"^[^\\n\\r]+$","title":"Say"},"reviewed_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed By"},"reviewed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed At"}},"type":"object","required":["term","say"],"title":"PronunciationOut"},"QualityFindingOut":{"properties":{"answer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer Id"},"response_set_id":{"type":"string","title":"Response Set Id"},"question_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question Code"},"query_code":{"type":"string","title":"Query Code"},"enrolment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Id"}},"type":"object","required":["response_set_id","query_code"],"title":"QualityFindingOut","description":"One answer worth checking. Names the question, never the value."},"QualitySweepOut":{"properties":{"study_id":{"type":"string","title":"Study Id"},"findings":{"items":{"$ref":"#/components/schemas/QualityFindingOut"},"type":"array","title":"Findings"},"count":{"type":"integer","title":"Count"},"counts_by_code":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts By Code"}},"type":"object","required":["study_id","findings","count","counts_by_code"],"title":"QualitySweepOut"},"QuasiIdentifierSetCreate":{"properties":{"label":{"type":"string","maxLength":255,"title":"Label"},"attribute_codes":{"items":{"type":"string"},"type":"array","minItems":2,"title":"Attribute Codes","description":"A quasi-identifier set is a *combination*; one attribute is not one. Declared per study because the population decides what is rare."}},"type":"object","required":["label","attribute_codes"],"title":"QuasiIdentifierSetCreate"},"QuasiIdentifierSetOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"label":{"type":"string","title":"Label"},"attribute_codes":{"items":{"type":"string"},"type":"array","title":"Attribute Codes"},"declared_by":{"type":"string","title":"Declared By"},"declared_at":{"type":"string","format":"date-time","title":"Declared At"}},"type":"object","required":["id","study_id","label","attribute_codes","declared_by","declared_at"],"title":"QuasiIdentifierSetOut"},"QuestionOut":{"properties":{"id":{"type":"string","title":"Id"},"code":{"type":"string","title":"Code"},"section_code":{"type":"string","title":"Section Code"},"parent_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Code"},"label":{"type":"string","title":"Label"},"help_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Help Text"},"answer_type":{"type":"string","title":"Answer Type"},"display_order":{"type":"integer","title":"Display Order"},"flat_order":{"type":"integer","title":"Flat Order"},"value_set_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Set Code"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"required":{"type":"boolean","title":"Required","default":false},"required_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Required Expression"},"relevant_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relevant Expression"},"constraint_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Constraint Expression"},"constraint_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Constraint Message"},"calculation_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calculation Expression"},"calculation_order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Calculation Order"},"choice_filter_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Choice Filter Expression"},"default_value":{"title":"Default Value"},"prefill_source":{"type":"string","title":"Prefill Source","default":"none"},"allow_prefer_not_to_answer":{"type":"boolean","title":"Allow Prefer Not To Answer","default":false},"min_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Min Value"},"max_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Max Value"},"min_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Min Date"},"max_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Max Date"},"max_length":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Length"},"decimal_places":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Decimal Places"},"scale_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scale Step"},"accepted_file_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Accepted File Types"},"max_file_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max File Bytes"},"repeat_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repeat Kind"},"repeat_maximum":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Repeat Maximum"},"repeat_count_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repeat Count Expression"},"repeat_item_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repeat Item Label"},"sensitivity":{"type":"string","title":"Sensitivity","default":"routine"},"identifier_class":{"type":"string","title":"Identifier Class","default":"none"},"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"},"lawful_basis_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lawful Basis Ref"},"consent_item_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Item Ref"},"retention_rule_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retention Rule Ref"},"may_view_capability":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"May View Capability"},"usable_for_eligibility":{"type":"boolean","title":"Usable For Eligibility","default":false},"usable_for_quota":{"type":"boolean","title":"Usable For Quota","default":false},"usable_for_analysis":{"type":"boolean","title":"Usable For Analysis","default":true},"may_appear_in_exports":{"type":"boolean","title":"May Appear In Exports","default":true},"moderator_context_policy":{"type":"string","title":"Moderator Context Policy","default":"hidden_from_moderator"},"missing_value_coding":{"additionalProperties":{"type":"integer"},"type":"object","title":"Missing Value Coding"},"external_code_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Code System"},"external_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Code"}},"type":"object","required":["id","code","section_code","label","answer_type","display_order","flat_order"],"title":"QuestionOut"},"QuestionStateOut":{"properties":{"path":{"type":"string","title":"Path"},"code":{"type":"string","title":"Code"},"answer_type":{"type":"string","title":"Answer Type"},"relevant":{"type":"boolean","title":"Relevant"},"required":{"type":"boolean","title":"Required"},"value":{"title":"Value"},"missing_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Missing Reason"},"selectable":{"items":{"type":"string"},"type":"array","title":"Selectable"},"calculated":{"type":"boolean","title":"Calculated","default":false}},"type":"object","required":["path","code","answer_type","relevant","required"],"title":"QuestionStateOut"},"QuestionSummaryOut":{"properties":{"code":{"type":"string","title":"Code"},"label":{"type":"string","title":"Label"},"answer_type":{"type":"string","title":"Answer Type"},"withheld":{"type":"boolean","title":"Withheld"},"answered":{"type":"integer","title":"Answered"},"missing":{"additionalProperties":{"type":"integer"},"type":"object","title":"Missing"},"choices":{"items":{"$ref":"#/components/schemas/ChoiceCountOut"},"type":"array","title":"Choices"},"numeric":{"additionalProperties":{"type":"string"},"type":"object","title":"Numeric"},"numeric_suppressed":{"type":"boolean","title":"Numeric Suppressed"},"calculated":{"type":"boolean","title":"Calculated"}},"type":"object","required":["code","label","answer_type","withheld","answered","missing","choices","numeric","numeric_suppressed","calculated"],"title":"QuestionSummaryOut"},"QuotaStatusResponse":{"properties":{"monthly_llm_token_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Llm Token Limit"},"llm_tokens_used":{"type":"number","title":"Llm Tokens Used"},"llm_tokens_remaining":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Llm Tokens Remaining"},"monthly_session_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Session Limit"},"sessions_used":{"type":"integer","title":"Sessions Used"},"sessions_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sessions Remaining"},"caps":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Caps","default":{}}},"type":"object","required":["monthly_llm_token_limit","llm_tokens_used","llm_tokens_remaining","monthly_session_limit","sessions_used","sessions_remaining"],"title":"QuotaStatusResponse","description":"Current-month spend against the tenant's quota (null limit = unlimited)."},"RareCombinationOut":{"properties":{"values":{"items":{"type":"string"},"type":"array","title":"Values","description":"The combination. Never who holds it."},"count":{"type":"integer","title":"Count"}},"type":"object","required":["values","count"],"title":"RareCombinationOut"},"ReadinessResponse":{"properties":{"status":{"type":"string","enum":["ready","degraded","unready"],"title":"Status"},"version":{"type":"string","title":"Version"},"checks":{"additionalProperties":{"type":"string"},"type":"object","title":"Checks"}},"type":"object","required":["status","version","checks"],"title":"ReadinessResponse"},"RecomputeOut":{"properties":{"created":{"type":"integer","title":"Created"},"superseded":{"type":"integer","title":"Superseded"},"unchanged":{"type":"integer","title":"Unchanged"},"skipped_calculated":{"type":"integer","title":"Skipped Calculated"}},"type":"object","required":["created","superseded","unchanged","skipped_calculated"],"title":"RecomputeOut"},"RecordingOut":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"state":{"type":"string","title":"State"},"format":{"type":"string","title":"Format"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"byte_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Byte Size"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"available_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Available At"},"failure_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Code"},"deletion_requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deletion Requested At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"}},"type":"object","required":["id","session_id","state","format","duration_ms","byte_size","started_at","available_at","failure_code","deletion_requested_at","deleted_at"],"title":"RecordingOut"},"RecordingUrlOut":{"properties":{"url":{"type":"string","title":"Url"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"notice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notice"}},"type":"object","required":["url","expires_at"],"title":"RecordingUrlOut"},"ReleaseVersionResponse":{"properties":{"version":{"type":"string","title":"Version"},"git_sha":{"type":"string","title":"Git Sha"}},"type":"object","required":["version","git_sha"],"title":"ReleaseVersionResponse"},"RenderedForm":{"properties":{"version_id":{"type":"string","title":"Version Id"},"instrument_id":{"type":"string","title":"Instrument Id"},"internal_state":{"type":"string","title":"Internal State"},"title":{"type":"string","title":"Title"},"default_language":{"type":"string","title":"Default Language"},"languages":{"items":{"type":"string"},"type":"array","title":"Languages"},"source":{"type":"string","title":"Source"},"definition_checksum":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition Checksum"},"projection_algorithm":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Projection Algorithm"},"sections":{"items":{"$ref":"#/components/schemas/SectionOut"},"type":"array","title":"Sections"},"questions":{"items":{"$ref":"#/components/schemas/QuestionOut"},"type":"array","title":"Questions"},"value_sets":{"items":{"$ref":"#/components/schemas/ValueSetOut"},"type":"array","title":"Value Sets"},"translations":{"items":{"$ref":"#/components/schemas/TranslationOut"},"type":"array","title":"Translations"},"calculation_order":{"items":{"type":"string"},"type":"array","title":"Calculation Order"}},"type":"object","required":["version_id","instrument_id","internal_state","title","default_language","source"],"title":"RenderedForm"},"RequirementCreate":{"properties":{"requirement_kind":{"type":"string","maxLength":48,"title":"Requirement Kind"},"authority_body":{"type":"string","maxLength":255,"title":"Authority Body"},"jurisdiction":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Jurisdiction"},"site_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Site Id"},"cohort_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Cohort Id"},"applicability":{"type":"string","maxLength":24,"title":"Applicability","default":"undetermined"},"applicability_reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Applicability Reason"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"}},"type":"object","required":["requirement_kind","authority_body"],"title":"RequirementCreate","description":"One independent permission a study needs.\n\nNothing is created by default. A study with no requirements is a study that\nhas recorded no external permissions — which is a legitimate state, and\nbetter than a fabricated ethics track nobody applied for."},"RequirementResponse":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"requirement_kind":{"type":"string","title":"Requirement Kind"},"authority_body":{"type":"string","title":"Authority Body"},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction"},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"},"cohort_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Id"},"applicability":{"type":"string","title":"Applicability"},"applicability_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applicability Reason"},"applicability_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Applicability Source"},"determined_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Determined By"},"determined_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Determined At"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"},"current_decision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Decision Id"},"current_decision_version":{"type":"integer","title":"Current Decision Version","default":1},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","study_id","requirement_kind","authority_body","applicability","created_at"],"title":"RequirementResponse"},"RequirementUpdate":{"properties":{"applicability":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"Applicability"},"applicability_reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Applicability Reason"},"jurisdiction":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Jurisdiction"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"}},"type":"object","title":"RequirementUpdate","description":"Changing what a requirement is, or whether it applies.\n\nDeciding a requirement does **not** apply is a judgement with a named person\nbehind it, which is why `applicability_reason` is required alongside it."},"ResolutionVocabulary":{"properties":{"reasons":{"items":{"type":"string"},"type":"array","title":"Reasons"},"outcomes":{"items":{"type":"string"},"type":"array","title":"Outcomes"}},"type":"object","required":["reasons","outcomes"],"title":"ResolutionVocabulary","description":"The enumerated reasons and outcomes a case may be closed with."},"ResolveAction":{"type":"string","enum":["approve","reject","dismiss"],"title":"ResolveAction"},"ResolveRequest":{"properties":{"action":{"$ref":"#/components/schemas/ResolveAction"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"}},"type":"object","required":["action"],"title":"ResolveRequest"},"ResolveResult":{"properties":{"task":{"$ref":"#/components/schemas/AgentTaskOut"},"executed":{"type":"boolean","title":"Executed","default":false},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["task"],"title":"ResolveResult"},"ResolvedPolicy":{"properties":{"policy_kind":{"type":"string","title":"Policy Kind"},"policy_key":{"type":"string","title":"Policy Key"},"policy_value":{"additionalProperties":true,"type":"object","title":"Policy Value"},"policy_version":{"type":"string","title":"Policy Version"},"resolved_from_scope":{"type":"string","title":"Resolved From Scope"},"resolved_from_scope_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved From Scope Id"},"binding_id":{"type":"string","title":"Binding Id"},"effective_from":{"type":"string","format":"date-time","title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"}},"type":"object","required":["policy_kind","policy_key","policy_value","policy_version","resolved_from_scope","binding_id","effective_from"],"title":"ResolvedPolicy","description":"The binding that applies, and where it came from.\n\nThe scope it resolved from is part of the answer: \"retention is 365 days\"\nmeans something different when it comes from the platform default than when\na site in another jurisdiction set it."},"ResponseListOut":{"properties":{"responses":{"items":{"$ref":"#/components/schemas/ResponseSetOut"},"type":"array","title":"Responses"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["responses","count"],"title":"ResponseListOut"},"ResponseSetOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"assignment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Id"},"wave_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Id"},"wave_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Code"},"wave_sequence":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wave Sequence"},"enrolment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Id"},"enrolment_display_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Display Code"},"instrument_version_id":{"type":"string","title":"Instrument Version Id"},"status":{"type":"string","title":"Status"},"is_test":{"type":"boolean","title":"Is Test"},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"},"cohort_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Id"},"arm_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Arm Id"},"definition_checksum":{"type":"string","title":"Definition Checksum"},"definition_schema_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition Schema Version"},"runtime_version":{"type":"string","title":"Runtime Version"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"translation_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Translation Version"},"collection_mode":{"type":"string","title":"Collection Mode"},"rendered_path":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rendered Path"},"consent_package_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Package Version Id"},"consent_evidence":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Consent Evidence"},"policy_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Version"},"subject_type":{"type":"string","title":"Subject Type"},"source_type":{"type":"string","title":"Source Type"},"author_type":{"type":"string","title":"Author Type"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"revision":{"type":"integer","title":"Revision"},"answers":{"items":{"$ref":"#/components/schemas/AnswerOut"},"type":"array","title":"Answers","default":[]}},"type":"object","required":["id","study_id","assignment_id","enrolment_id","instrument_version_id","status","is_test","site_id","cohort_id","arm_id","definition_checksum","definition_schema_version","runtime_version","language","translation_version","collection_mode","rendered_path","consent_package_version_id","consent_evidence","policy_version","subject_type","source_type","author_type","started_at","submitted_at","revision"],"title":"ResponseSetOut","description":"A response as a researcher reviews it.\n\nEvery field is either about the instrument, the pseudonymous subject, or\nwhat was served. None of them can carry contact identity."},"ResumeOut":{"properties":{"sent":{"type":"boolean","title":"Sent"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["sent"],"title":"ResumeOut"},"RetentionHoldCreate":{"properties":{"purpose":{"type":"string","title":"Purpose"},"source":{"type":"string","title":"Source"},"source_ref":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Source Ref"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["purpose","source"],"title":"RetentionHoldCreate"},"RetentionHoldOut":{"properties":{"id":{"type":"string","title":"Id"},"enrolment_id":{"type":"string","title":"Enrolment Id"},"purpose":{"type":"string","title":"Purpose"},"source":{"type":"string","title":"Source"},"source_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Ref"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"legal_hold":{"type":"boolean","title":"Legal Hold"},"released_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Released At"},"release_reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Release Reason Code"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","enrolment_id","purpose","source","source_ref","expires_at","legal_hold","released_at","release_reason_code","created_at"],"title":"RetentionHoldOut"},"RetentionHoldRelease":{"properties":{"reason_code":{"type":"string","title":"Reason Code"}},"type":"object","required":["reason_code"],"title":"RetentionHoldRelease"},"RetentionStatusOut":{"properties":{"enrolment_id":{"type":"string","title":"Enrolment Id"},"purgeable":{"type":"boolean","title":"Purgeable"},"boundary":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Boundary"},"blocking_purposes":{"items":{"type":"string"},"type":"array","title":"Blocking Purposes"},"legal_hold":{"type":"boolean","title":"Legal Hold"},"holds":{"items":{"$ref":"#/components/schemas/RetentionHoldOut"},"type":"array","title":"Holds"}},"type":"object","required":["enrolment_id","purgeable","boundary","blocking_purposes","legal_hold","holds"],"title":"RetentionStatusOut","description":"Whether this contact may be purged yet, and what is keeping it.\n\nPseudonymous: purposes and dates, no values. Readable with\n`participant.manage`, because knowing *that* a record is held under a legal\nhold is fieldwork information, and knowing *whose* address it is is not."},"RightsRequestIn":{"properties":{"request_kind":{"type":"string","maxLength":32,"title":"Request Kind"}},"type":"object","required":["request_kind"],"title":"RightsRequestIn","description":"Exercise one right over one's own data.\n\n`request_kind` is enumerated and there is no free-text field. Somebody\ndisputing a recorded *value* is asking a different question, which goes to\n`POST …/corrections` and ends in an amendment with its own history — so\nthere is nowhere here for a participant's prose to land, by construction."},"RightsRequestOut":{"properties":{"id":{"type":"string","title":"Id"},"request_kind":{"type":"string","title":"Request Kind"},"state":{"type":"string","title":"State"},"receipt_code":{"type":"string","title":"Receipt Code"},"received_at":{"type":"string","format":"date-time","title":"Received At"},"acknowledged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Acknowledged At"}},"type":"object","required":["id","request_kind","state","receipt_code","received_at"],"title":"RightsRequestOut","description":"The receipt. Entering a request executes nothing (§9).\n\nDeciding and executing are separate, human-only acts behind `rights.review`\nand `rights.execute`, and no participant link carries either."},"RolePreset":{"properties":{"role":{"type":"string","title":"Role"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities"}},"type":"object","required":["role","capabilities"],"title":"RolePreset"},"RubricCopyRequest":{"properties":{"template_id":{"type":"string","title":"Template Id"},"name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Name"}},"type":"object","required":["template_id"],"title":"RubricCopyRequest"},"RubricCreateRequest":{"properties":{"name":{"type":"string","maxLength":512,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"sections":{"items":{"$ref":"#/components/schemas/RubricSection"},"type":"array","maxItems":50,"title":"Sections"},"is_template":{"type":"boolean","title":"Is Template","default":false}},"type":"object","required":["name","sections"],"title":"RubricCreateRequest"},"RubricResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"version":{"type":"integer","title":"Version"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"sections":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sections"},"is_template":{"type":"boolean","title":"Is Template"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","tenant_id","name","version","sections","is_template","status","created_at"],"title":"RubricResponse"},"RubricSection":{"properties":{"id":{"type":"string","maxLength":128,"title":"Id"},"name":{"type":"string","maxLength":512,"title":"Name"},"weight":{"type":"number","minimum":0.0,"title":"Weight","default":1.0},"time_budget_pct":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Time Budget Pct","default":0.0},"required":{"type":"boolean","title":"Required","default":true},"order":{"type":"integer","title":"Order","default":0},"topics":{"items":{"type":"string","maxLength":500},"type":"array","maxItems":50,"title":"Topics"},"pre_built_probes":{"items":{"type":"string","maxLength":500},"type":"array","maxItems":50,"title":"Pre Built Probes"},"completion_criteria":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Completion Criteria"}},"type":"object","required":["id","name"],"title":"RubricSection"},"RubricUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"sections":{"anyOf":[{"items":{"$ref":"#/components/schemas/RubricSection"},"type":"array","maxItems":50},{"type":"null"}],"title":"Sections"}},"type":"object","title":"RubricUpdateRequest"},"RunCreateRequest":{"properties":{"document_id":{"type":"string","title":"Document Id"}},"type":"object","required":["document_id"],"title":"RunCreateRequest"},"RunDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"document_id":{"type":"string","title":"Document Id"},"status":{"type":"string","enum":["pending","running","complete","failed"],"title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"artifact":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Artifact"}},"type":"object","required":["id","session_id","document_id","status","created_at"],"title":"RunDetailResponse"},"RunResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"document_id":{"type":"string","title":"Document Id"},"status":{"type":"string","enum":["pending","running","complete","failed"],"title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","session_id","document_id","status","created_at"],"title":"RunResponse"},"SafetyConfigurationCreate":{"properties":{"config_version":{"type":"string","maxLength":64,"title":"Config Version"},"language":{"type":"string","maxLength":16,"title":"Language","default":"*"},"site_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Site Id"},"support_information":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Support Information"},"escalation_contact":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Escalation Contact"},"acknowledgement":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Acknowledgement"},"pause_offer":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Pause Offer"},"stop_offer":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Stop Offer"},"closing":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Closing"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"}},"type":"object","required":["config_version"],"title":"SafetyConfigurationCreate","description":"A new draft. Nothing here is served until somebody approves it."},"SafetyConfigurationResponse":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"},"language":{"type":"string","title":"Language"},"config_version":{"type":"string","title":"Config Version"},"support_information":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Support Information"},"escalation_contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Contact"},"acknowledgement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acknowledgement"},"pause_offer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pause Offer"},"stop_offer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stop Offer"},"closing":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closing"},"approval_state":{"type":"string","title":"Approval State"},"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"},"not_applicable_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Not Applicable Reason"},"not_applicable_recorded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Not Applicable Recorded By"},"editable":{"type":"boolean","title":"Editable","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","study_id","language","config_version","approval_state","created_at"],"title":"SafetyConfigurationResponse"},"SafetyConfigurationUpdate":{"properties":{"language":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Language"},"site_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Site Id"},"support_information":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Support Information"},"escalation_contact":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Escalation Contact"},"acknowledgement":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Acknowledgement"},"pause_offer":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Pause Offer"},"stop_offer":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Stop Offer"},"closing":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Closing"},"effective_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective From"},"effective_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Until"}},"type":"object","title":"SafetyConfigurationUpdate","description":"A change to a draft. Approved versions are immutable and refuse this.\n\n`config_version` is deliberately absent: renaming a version after the fact\nbreaks the one thing a version identifier is for."},"ScreeningCompletionOut":{"properties":{"study_id":{"type":"string","title":"Study Id"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"buckets":{"additionalProperties":{"type":"integer"},"type":"object","title":"Buckets"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["study_id","generated_at","buckets","total"],"title":"ScreeningCompletionOut","description":"Screening progress. Its own route, its own capability (C13)."},"ScreeningLinkIn":{"properties":{"enrolment_id":{"type":"string","maxLength":36,"title":"Enrolment Id"},"compatibility_decision_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Compatibility Decision Id"}},"type":"object","required":["enrolment_id"],"title":"ScreeningLinkIn","description":"Record that a screened person enrolled. Moves nothing, grants nothing."},"ScreeningLinkOut":{"properties":{"id":{"type":"string","title":"Id"},"screening_session_id":{"type":"string","title":"Screening Session Id"},"enrolment_id":{"type":"string","title":"Enrolment Id"},"compatibility_decision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compatibility Decision Id"},"linked_by":{"type":"string","title":"Linked By"},"linked_at":{"type":"string","format":"date-time","title":"Linked At"}},"type":"object","required":["id","screening_session_id","enrolment_id","compatibility_decision_id","linked_by","linked_at"],"title":"ScreeningLinkOut"},"ScreeningOutcomeIn":{"properties":{"status":{"type":"string","title":"Status"},"reason_code":{"type":"string","title":"Reason Code"}},"type":"object","required":["status","reason_code"],"title":"ScreeningOutcomeIn"},"ScreeningPurgeIn":{"properties":{"reason_code":{"type":"string","title":"Reason Code"}},"type":"object","required":["reason_code"],"title":"ScreeningPurgeIn"},"ScreeningSessionListOut":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/ScreeningSessionOut"},"type":"array","title":"Sessions"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["sessions","count"],"title":"ScreeningSessionListOut"},"ScreeningSessionOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"notice_version_id":{"type":"string","title":"Notice Version Id"},"collection_purpose":{"type":"string","title":"Collection Purpose"},"lawful_basis_ref":{"type":"string","title":"Lawful Basis Ref"},"policy_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Version"},"eligibility_status":{"type":"string","title":"Eligibility Status"},"outcome_reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome Reason Code"},"contact_captured":{"type":"boolean","title":"Contact Captured"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"retention_deadline":{"type":"string","format":"date-time","title":"Retention Deadline"},"purged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Purged At"},"purge_reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purge Reason Code"}},"type":"object","required":["id","study_id","notice_version_id","collection_purpose","lawful_basis_ref","policy_version","eligibility_status","outcome_reason_code","contact_captured","started_at","expires_at","retention_deadline","purged_at","purge_reason_code"],"title":"ScreeningSessionOut","description":"A screening session. Carries its own notice, purpose, basis and clock.\n\nThere is no `enrolment_id` here and there must never be one: a screened\nperson becomes a participant through an explicit audited link, never through\na column quietly appearing on their screening record."},"ScreeningStartIn":{"properties":{"notice_version_id":{"type":"string","maxLength":64,"title":"Notice Version Id"},"lawful_basis_ref":{"type":"string","maxLength":64,"title":"Lawful Basis Ref"},"collection_purpose":{"type":"string","title":"Collection Purpose","default":"eligibility_screening"},"recruitment_link_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Recruitment Link Id"},"policy_version":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Policy Version"},"retention_days":{"type":"integer","minimum":1.0,"title":"Retention Days","default":90}},"type":"object","required":["notice_version_id","lawful_basis_ref"],"title":"ScreeningStartIn","description":"Open a screening session.\n\nThe notice and the lawful basis are required, not defaulted. A session that\ncannot say what the person was shown is the failure C13 exists to prevent,\nand a default would let it happen quietly."},"SectionOut":{"properties":{"id":{"type":"string","title":"Id"},"code":{"type":"string","title":"Code"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"display_order":{"type":"integer","title":"Display Order"},"relevant_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relevant Expression"},"repeat_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repeat Kind"},"repeat_maximum":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Repeat Maximum"},"repeat_count_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repeat Count Expression"},"repeat_item_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repeat Item Label"}},"type":"object","required":["id","code","title","display_order"],"title":"SectionOut"},"SendIn":{"properties":{"enrolment_ids":{"items":{"type":"string"},"type":"array","maxItems":100,"minItems":1,"title":"Enrolment Ids"},"kind":{"type":"string","pattern":"^(invite|nudge)$","title":"Kind","default":"invite"}},"type":"object","required":["enrolment_ids"],"title":"SendIn"},"SendOut":{"properties":{"results":{"items":{"$ref":"#/components/schemas/SendResultOut"},"type":"array","title":"Results"},"sent":{"type":"integer","title":"Sent"},"skipped":{"type":"integer","title":"Skipped"},"failed":{"type":"integer","title":"Failed"}},"type":"object","required":["results","sent","skipped","failed"],"title":"SendOut"},"SendResultOut":{"properties":{"enrolment_id":{"type":"string","title":"Enrolment Id"},"status":{"type":"string","title":"Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["enrolment_id","status","reason"],"title":"SendResultOut"},"SessionBatchCreateRequest":{"properties":{"participants":{"anyOf":[{"items":{"$ref":"#/components/schemas/ParticipantSlot"},"type":"array","maxItems":100},{"type":"null"}],"title":"Participants"},"count":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Count"},"duration_minutes":{"type":"integer","maximum":240.0,"minimum":1.0,"title":"Duration Minutes","default":30},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"persona_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Id"},"expires_in_hours":{"type":"integer","maximum":720.0,"minimum":1.0,"title":"Expires In Hours","default":48},"link_label":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Link Label"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","title":"SessionBatchCreateRequest","description":"Create a batch of sessions and their participant links in one action.\n\nFielding used to be one session at a time through a modal, each labelled\n\"P\" — a twenty-person study meant twenty round trips and no way to tell the\nparticipants apart afterwards.\n\nEither give `participants` (one entry per person, with your own labels) or\n`count` for that many auto-numbered slots (P01, P02, …)."},"SessionBatchItem":{"properties":{"session_id":{"type":"string","title":"Session Id"},"participant_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Label"},"participant_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Ref"},"url":{"type":"string","title":"Url"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["session_id","url"],"title":"SessionBatchItem"},"SessionBatchResponse":{"properties":{"created":{"type":"integer","title":"Created"},"link_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link Label"},"items":{"items":{"$ref":"#/components/schemas/SessionBatchItem"},"type":"array","title":"Items"}},"type":"object","required":["created","items"],"title":"SessionBatchResponse"},"SessionCreateRequest":{"properties":{"mode":{"type":"string","enum":["offline","live"],"title":"Mode"},"delivery":{"type":"string","enum":["human_assist","ai_interviewer"],"title":"Delivery","default":"human_assist"},"modality":{"type":"string","enum":["voice","text"],"title":"Modality","default":"voice"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"persona_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Id"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"},"duration_minutes":{"type":"integer","maximum":240.0,"minimum":1.0,"title":"Duration Minutes","default":30},"participant_label":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Participant Label"},"participant_ref":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Participant Ref"},"enrolment_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Enrolment Id"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["mode"],"title":"SessionCreateRequest"},"SessionDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"participant_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Label"},"participant_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Ref"},"enrolment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Id"},"mode":{"type":"string","enum":["offline","live"],"title":"Mode"},"delivery":{"type":"string","enum":["human_assist","ai_interviewer"],"title":"Delivery","default":"human_assist"},"modality":{"type":"string","enum":["voice","text"],"title":"Modality","default":"voice"},"persona_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"rubric_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rubric Version"},"duration_minutes":{"type":"integer","title":"Duration Minutes","default":30},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"needs_human_interview":{"type":"boolean","title":"Needs Human Interview","default":false},"document_count":{"type":"integer","title":"Document Count"},"run_count":{"type":"integer","title":"Run Count"},"probe_count":{"type":"integer","title":"Probe Count"}},"type":"object","required":["id","tenant_id","mode","status","created_at","document_count","run_count","probe_count"],"title":"SessionDetailResponse"},"SessionLinkCreateRequest":{"properties":{"expires_in_hours":{"type":"integer","maximum":720.0,"minimum":1.0,"title":"Expires In Hours","default":48},"link_label":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Link Label"}},"type":"object","title":"SessionLinkCreateRequest"},"SessionLinkResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"url":{"type":"string","title":"Url"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","session_id","url","created_at"],"title":"SessionLinkResponse"},"SessionResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"participant_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Label"},"participant_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Ref"},"enrolment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enrolment Id"},"mode":{"type":"string","enum":["offline","live"],"title":"Mode"},"delivery":{"type":"string","enum":["human_assist","ai_interviewer"],"title":"Delivery","default":"human_assist"},"modality":{"type":"string","enum":["voice","text"],"title":"Modality","default":"voice"},"persona_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"rubric_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rubric Version"},"duration_minutes":{"type":"integer","title":"Duration Minutes","default":30},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"needs_human_interview":{"type":"boolean","title":"Needs Human Interview","default":false}},"type":"object","required":["id","tenant_id","mode","status","created_at"],"title":"SessionResponse"},"SessionTokenValidationResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"persona_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Name"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","required":["valid"],"title":"SessionTokenValidationResponse"},"ShownUtteranceResponse":{"properties":{"acknowledgement_id":{"type":"string","title":"Acknowledgement Id"},"text":{"type":"string","title":"Text"},"satisfies":{"items":{"type":"string"},"type":"array","title":"Satisfies"}},"type":"object","required":["acknowledgement_id","text"],"title":"ShownUtteranceResponse","description":"Approved wording to display, and the receipt to send back for it."},"SiteCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Country"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"},"default_language":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Default Language"},"jurisdiction_policy":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Jurisdiction Policy"}},"type":"object","required":["name"],"title":"SiteCreate"},"SiteResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Country"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"},"default_language":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Default Language"},"jurisdiction_policy":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Jurisdiction Policy"},"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["name","id","study_id","created_at"],"title":"SiteResponse"},"SourceType":{"type":"string","enum":["transcript_turn","claim","theme","guide_section","analysis","session_summary","participant_profile"],"title":"SourceType","description":"What kind of ResearchKit record a citation points at."},"SpeechReplacement":{"properties":{"from":{"type":"string","maxLength":80,"minLength":1,"title":"From"},"to":{"type":"string","maxLength":160,"minLength":1,"title":"To"}},"type":"object","required":["from","to"],"title":"SpeechReplacement","description":"Say `to` wherever the interviewer would say `from` aloud."},"SpeechResponse":{"properties":{"study_id":{"type":"string","title":"Study Id"},"spoken_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Spoken Name"},"stt_keyterms":{"items":{"type":"string"},"type":"array","title":"Stt Keyterms","default":[]},"speech_replacements":{"items":{"$ref":"#/components/schemas/SpeechReplacement"},"type":"array","title":"Speech Replacements","default":[]},"interviewer_llm_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Interviewer Llm Model"},"allowed_llm_models":{"items":{"type":"string"},"type":"array","title":"Allowed Llm Models","default":[]},"pronunciations":{"items":{"$ref":"#/components/schemas/PronunciationOut"},"type":"array","title":"Pronunciations","default":[]},"pronunciation_candidates":{"items":{"type":"string"},"type":"array","title":"Pronunciation Candidates","default":[]}},"type":"object","required":["study_id"],"title":"SpeechResponse"},"SpeechUpdate":{"properties":{"spoken_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Spoken Name"},"stt_keyterms":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":200},{"type":"null"}],"title":"Stt Keyterms"},"speech_replacements":{"anyOf":[{"items":{"$ref":"#/components/schemas/SpeechReplacement"},"type":"array","maxItems":200},{"type":"null"}],"title":"Speech Replacements"},"interviewer_llm_model":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Interviewer Llm Model"},"pronunciations":{"anyOf":[{"items":{"$ref":"#/components/schemas/Pronunciation"},"type":"array","maxItems":100},{"type":"null"}],"title":"Pronunciations"}},"type":"object","title":"SpeechUpdate","description":"How this study's interviewer speaks. Unset fields are left alone."},"StopOut":{"properties":{"stopped":{"type":"boolean","title":"Stopped"}},"type":"object","required":["stopped"],"title":"StopOut"},"StudyCompletionOut":{"properties":{"study_id":{"type":"string","title":"Study Id"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"site_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Site Id"},"cohort_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Id"},"overall":{"$ref":"#/components/schemas/CompletionGroupOut"},"by_instrument":{"items":{"$ref":"#/components/schemas/CompletionGroupOut"},"type":"array","title":"By Instrument"},"by_wave":{"items":{"$ref":"#/components/schemas/CompletionGroupOut"},"type":"array","title":"By Wave"}},"type":"object","required":["study_id","generated_at","overall","by_instrument","by_wave"],"title":"StudyCompletionOut"},"StudyCreate":{"properties":{"name":{"type":"string","maxLength":512,"title":"Name"},"objective":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Objective"},"target_n":{"type":"integer","title":"Target N","default":0},"target_profile":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Target Profile"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"persona_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"session_duration_minutes":{"type":"integer","title":"Session Duration Minutes","default":30},"consent_text_version":{"type":"string","title":"Consent Text Version","default":"1.0"},"data_retention_days":{"type":"integer","title":"Data Retention Days","default":365},"anonymise_on_export":{"type":"boolean","title":"Anonymise On Export","default":false},"recording_enabled":{"type":"boolean","title":"Recording Enabled","default":true},"recording_max_mb":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Recording Max Mb"}},"additionalProperties":false,"type":"object","required":["name"],"title":"StudyCreate"},"StudyResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"name":{"type":"string","title":"Name"},"objective":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective"},"target_n":{"type":"integer","title":"Target N"},"actual_n":{"type":"integer","title":"Actual N"},"session_count":{"type":"integer","title":"Session Count"},"target_profile":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Target Profile"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"persona_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Id"},"status":{"type":"string","title":"Status"},"session_duration_minutes":{"type":"integer","title":"Session Duration Minutes"},"max_participant_turns":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Participant Turns"},"wrap_up_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wrap Up Seconds"},"wrap_up_turns":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Wrap Up Turns"},"default_max_participant_turns":{"type":"integer","title":"Default Max Participant Turns","default":100},"default_wrap_up_seconds":{"type":"integer","title":"Default Wrap Up Seconds","default":120},"default_wrap_up_turns":{"type":"integer","title":"Default Wrap Up Turns","default":3},"consent_text_version":{"type":"string","title":"Consent Text Version"},"data_retention_days":{"type":"integer","title":"Data Retention Days"},"anonymise_on_export":{"type":"boolean","title":"Anonymise On Export"},"guide_items_v2":{"type":"boolean","title":"Guide Items V2","default":false},"recording_enabled":{"type":"boolean","title":"Recording Enabled","default":false},"recording_max_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recording Max Mb"},"recording_platform_max_mb":{"type":"integer","title":"Recording Platform Max Mb","default":200},"recording_problems":{"items":{"type":"string"},"type":"array","title":"Recording Problems","default":[]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","tenant_id","project_id","name","objective","target_n","actual_n","session_count","target_profile","rubric_id","persona_id","status","session_duration_minutes","consent_text_version","data_retention_days","anonymise_on_export","created_at","updated_at"],"title":"StudyResponse"},"StudyUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Name"},"objective":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Objective"},"consent_text":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}],"title":"Consent Text"},"interviewer_introduction":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}],"title":"Interviewer Introduction"},"target_n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target N"},"target_profile":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Target Profile"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id"},"persona_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"session_duration_minutes":{"anyOf":[{"type":"integer","maximum":240.0,"minimum":1.0},{"type":"null"}],"title":"Session Duration Minutes"},"max_participant_turns":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":10.0},{"type":"null"}],"title":"Max Participant Turns"},"wrap_up_seconds":{"anyOf":[{"type":"integer","maximum":1800.0,"minimum":30.0},{"type":"null"}],"title":"Wrap Up Seconds"},"wrap_up_turns":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":1.0},{"type":"null"}],"title":"Wrap Up Turns"},"consent_text_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Text Version"},"data_retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Data Retention Days"},"anonymise_on_export":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Anonymise On Export"},"guide_items_v2":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Guide Items V2"},"recording_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Recording Enabled"},"recording_max_mb":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Recording Max Mb"}},"additionalProperties":false,"type":"object","title":"StudyUpdate"},"SubmissionCreate":{"properties":{"requirement_id":{"type":"string","maxLength":36,"title":"Requirement Id"},"submission_type":{"type":"string","maxLength":32,"title":"Submission Type","default":"initial"},"items":{"items":{"$ref":"#/components/schemas/SubmissionItemInput"},"type":"array","maxItems":200,"minItems":1,"title":"Items"},"reference":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Reference"},"cover_note":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Cover Note"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"}},"type":"object","required":["requirement_id","items"],"title":"SubmissionCreate","description":"The exact bundle sent to one body, on one track.\n\nThe items are the point of this record: coverage is derivable because a\ndocument version is covered when it appears in a bundle whose decision\npermits it. A decision attached straight to a document cannot express\n\"approved as part of the March protocol package\"."},"SubmissionItemInput":{"properties":{"dossier_document_version_id":{"type":"string","maxLength":36,"title":"Dossier Document Version Id"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"manifest_note":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Manifest Note"}},"type":"object","required":["dossier_document_version_id"],"title":"SubmissionItemInput","description":"One document version, in a stated position in the bundle."},"SubmissionItemResponse":{"properties":{"id":{"type":"string","title":"Id"},"ordinal":{"type":"integer","title":"Ordinal"},"dossier_document_version_id":{"type":"string","title":"Dossier Document Version Id"},"checksum_at_submission":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checksum At Submission"},"media_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Type"},"manifest_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manifest Note"}},"type":"object","required":["id","ordinal","dossier_document_version_id"],"title":"SubmissionItemResponse"},"SubmissionResponse":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"requirement_id":{"type":"string","title":"Requirement Id"},"authority_body":{"type":"string","title":"Authority Body"},"submission_type":{"type":"string","title":"Submission Type"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"items":{"items":{"$ref":"#/components/schemas/SubmissionItemResponse"},"type":"array","title":"Items"},"version_ids":{"items":{"type":"string"},"type":"array","title":"Version Ids"},"manifest_checksum":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manifest Checksum"},"cover_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cover Note"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"submitted_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"decision":{"anyOf":[{"$ref":"#/components/schemas/DecisionResponse"},{"type":"null"}]}},"type":"object","required":["id","study_id","requirement_id","authority_body","submission_type","created_at"],"title":"SubmissionResponse"},"SyntheticSubjectOut":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"is_synthetic":{"type":"boolean","title":"Is Synthetic","default":true}},"type":"object","required":["id","label"],"title":"SyntheticSubjectOut"},"TaskStatus":{"type":"string","enum":["pending","approved","rejected","dismissed"],"title":"TaskStatus"},"TenantKillRequest":{"properties":{"reason":{"type":"string","enum":["cost_spike","suspected_abuse","provider_incident","planned_maintenance","pilot_allowance","evaluation_run","owner_request","recorded_externally","security_incident","tenant_request","tenant_offboarding","routine_operation"],"title":"Reason"},"expires_in_hours":{"anyOf":[{"type":"number","maximum":24.0,"minimum":0.01},{"type":"null"}],"title":"Expires In Hours"}},"type":"object","required":["reason"],"title":"TenantKillRequest"},"TenantLLMConfigRequest":{"properties":{"provider":{"type":"string","enum":["anthropic","openai","groq","openrouter","self_hosted"],"title":"Provider","default":"anthropic"},"model":{"type":"string","title":"Model","default":"claude-haiku-4-5-20251001"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url"},"max_tokens":{"type":"integer","maximum":4096.0,"minimum":1.0,"title":"Max Tokens","default":150},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","default":0.7},"fallback_provider":{"anyOf":[{"type":"string","enum":["anthropic","openai","groq","openrouter","self_hosted"]},{"type":"null"}],"title":"Fallback Provider"},"custom_models":{"anyOf":[{"items":{"$ref":"#/components/schemas/CustomModel"},"type":"array"},{"type":"null"}],"title":"Custom Models"}},"type":"object","title":"TenantLLMConfigRequest"},"TenantLLMConfigResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"},"has_api_key":{"type":"boolean","title":"Has Api Key"},"base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url"},"max_tokens":{"type":"integer","title":"Max Tokens"},"temperature":{"type":"number","title":"Temperature"},"fallback_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fallback Provider"},"custom_models":{"items":{"$ref":"#/components/schemas/CustomModel"},"type":"array","title":"Custom Models"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["tenant_id","provider","model","has_api_key","max_tokens","temperature"],"title":"TenantLLMConfigResponse"},"TenantSTTConfigRequest":{"properties":{"provider":{"type":"string","title":"Provider","default":"elevenlabs_scribe_v2"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"language":{"type":"string","title":"Language","default":"en"},"sample_rate":{"type":"integer","maximum":48000.0,"minimum":8000.0,"title":"Sample Rate","default":16000},"keyterms":{"items":{"type":"string"},"type":"array","title":"Keyterms"}},"type":"object","title":"TenantSTTConfigRequest"},"TenantSTTConfigResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"provider":{"type":"string","title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"has_api_key":{"type":"boolean","title":"Has Api Key"},"language":{"type":"string","title":"Language"},"sample_rate":{"type":"integer","title":"Sample Rate"},"keyterms":{"items":{"type":"string"},"type":"array","title":"Keyterms"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["tenant_id","provider","has_api_key","language","sample_rate","keyterms"],"title":"TenantSTTConfigResponse"},"TenantTTSConfigRequest":{"properties":{"provider":{"type":"string","title":"Provider","default":"elevenlabs"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},"type":"object","title":"TenantTTSConfigRequest"},"TenantTTSConfigResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"provider":{"type":"string","title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"has_api_key":{"type":"boolean","title":"Has Api Key"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["tenant_id","provider","has_api_key"],"title":"TenantTTSConfigResponse"},"TestRunRequest":{"properties":{"is_test":{"type":"boolean","title":"Is Test"},"answers":{"additionalProperties":{"$ref":"#/components/schemas/AnswerIn"},"type":"object","title":"Answers"},"today":{"type":"string","format":"date","title":"Today"},"subject_label":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Subject Label"},"site_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Site Code"},"cohort_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Cohort Code"},"arm_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Arm Code"},"wave":{"anyOf":[{"type":"integer","maximum":999.0,"minimum":0.0},{"type":"null"}],"title":"Wave"},"language":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Language"},"definition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Definition"}},"type":"object","required":["is_test","today"],"title":"TestRunRequest","description":"A rehearsal of a form, with the context to rehearse it in.\n\n`is_test` has no default and must be `true`. There is no path through this\nendpoint that produces an untagged evaluation, and nothing it does is\nwritten down."},"TestRunResponse":{"properties":{"is_test":{"type":"boolean","title":"Is Test","default":true},"persisted":{"type":"boolean","title":"Persisted","default":false},"subject":{"$ref":"#/components/schemas/SyntheticSubjectOut"},"runtime_version":{"type":"string","title":"Runtime Version"},"complete":{"type":"boolean","title":"Complete"},"states":{"items":{"$ref":"#/components/schemas/QuestionStateOut"},"type":"array","title":"States"},"problems":{"items":{"$ref":"#/components/schemas/ProblemOut"},"type":"array","title":"Problems"},"instances":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Instances"}},"type":"object","required":["subject","runtime_version","complete"],"title":"TestRunResponse","description":"What the runtime made of a rehearsal. None of it is stored."},"TextAcknowledgeRequest":{"properties":{"acknowledged":{"items":{"type":"string"},"type":"array","maxItems":16,"minItems":1,"title":"Acknowledged"}},"type":"object","required":["acknowledged"],"title":"TextAcknowledgeRequest"},"TextAcknowledgeResponse":{"properties":{"may_continue":{"type":"boolean","title":"May Continue"},"pending":{"items":{"type":"string"},"type":"array","title":"Pending"}},"type":"object","required":["may_continue"],"title":"TextAcknowledgeResponse"},"TextTurnRequest":{"properties":{"text":{"type":"string","maxLength":8000,"minLength":1,"title":"Text"},"client_turn_id":{"type":"string","maxLength":128,"minLength":1,"title":"Client Turn Id"},"acknowledged":{"items":{"type":"string"},"type":"array","maxItems":16,"title":"Acknowledged"}},"type":"object","required":["text","client_turn_id"],"title":"TextTurnRequest","description":"One participant message in a text interview."},"TextTurnResponse":{"properties":{"turn_id":{"type":"integer","title":"Turn Id"},"utterances":{"items":{"$ref":"#/components/schemas/ShownUtteranceResponse"},"type":"array","title":"Utterances"},"reply":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply"},"may_continue":{"type":"boolean","title":"May Continue","default":true},"must_end":{"type":"boolean","title":"Must End","default":false},"duplicate":{"type":"boolean","title":"Duplicate","default":false}},"type":"object","required":["turn_id"],"title":"TextTurnResponse"},"ThemeCreate":{"properties":{"name":{"type":"string","maxLength":512,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"rubric_section_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Section Id"}},"type":"object","required":["name"],"title":"ThemeCreate"},"ThemeMergeRequest":{"properties":{"into_theme_id":{"type":"string","minLength":1,"title":"Into Theme Id"}},"type":"object","required":["into_theme_id"],"title":"ThemeMergeRequest"},"ThemeResponse":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"source":{"type":"string","title":"Source"},"frequency":{"type":"integer","title":"Frequency"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"saturation_score":{"type":"number","title":"Saturation Score"},"evidence":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Evidence"},"parent_theme_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Theme Id"},"status":{"type":"string","title":"Status","default":"proposed"},"rubric_section_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Section Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","study_id","name","description","source","frequency","sentiment","saturation_score","evidence","created_at"],"title":"ThemeResponse"},"ThemeUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"evidence":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Evidence"},"saturation_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Saturation Score"},"status":{"anyOf":[{"type":"string","pattern":"^(proposed|reviewed)$"},{"type":"null"}],"title":"Status"},"parent_theme_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Theme Id"}},"type":"object","title":"ThemeUpdate"},"ThreadDetail":{"properties":{"id":{"type":"string","title":"Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"scope":{"$ref":"#/components/schemas/AssistantScope"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"message_count":{"type":"integer","title":"Message Count","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"messages":{"items":{"$ref":"#/components/schemas/MessageOut"},"type":"array","title":"Messages"}},"type":"object","required":["id","scope","created_at"],"title":"ThreadDetail"},"ThreadSummary":{"properties":{"id":{"type":"string","title":"Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"scope":{"$ref":"#/components/schemas/AssistantScope"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"study_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Study Id"},"message_count":{"type":"integer","title":"Message Count","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","scope","created_at"],"title":"ThreadSummary"},"TimelineEvent":{"properties":{"kind":{"type":"string","title":"Kind"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"actor_type":{"type":"string","title":"Actor Type"},"occurred_at":{"type":"string","title":"Occurred At"},"ref_table":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref Table"},"ref_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref Id"}},"type":"object","required":["kind","actor_type","occurred_at","ref_table","ref_id"],"title":"TimelineEvent"},"TimelineOut":{"properties":{"events":{"items":{"$ref":"#/components/schemas/TimelineEvent"},"type":"array","title":"Events"}},"type":"object","required":["events"],"title":"TimelineOut"},"ToolUse":{"properties":{"tool":{"type":"string","title":"Tool"},"ok":{"type":"boolean","title":"Ok"}},"type":"object","required":["tool","ok"],"title":"ToolUse"},"TopicRef":{"properties":{"id":{"type":"string","maxLength":64,"title":"Id"},"title":{"type":"string","maxLength":120,"title":"Title"},"summary":{"type":"string","maxLength":600,"title":"Summary","default":""},"steps":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Steps"}},"additionalProperties":false,"type":"object","required":["id","title"],"title":"TopicRef","description":"A curated help topic the console holds. Data, never instructions."},"TrainingRecordCreate":{"properties":{"member_user_id":{"type":"string","maxLength":128,"minLength":1,"title":"Member User Id"},"training_name":{"type":"string","maxLength":255,"minLength":1,"title":"Training Name"},"provider":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Provider"},"reference":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Reference"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"evidence_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Uri"}},"type":"object","required":["member_user_id","training_name"],"title":"TrainingRecordCreate"},"TrainingRecordResponse":{"properties":{"member_user_id":{"type":"string","maxLength":128,"minLength":1,"title":"Member User Id"},"training_name":{"type":"string","maxLength":255,"minLength":1,"title":"Training Name"},"provider":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Provider"},"reference":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Reference"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"evidence_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Uri"},"id":{"type":"string","title":"Id"},"expired":{"type":"boolean","title":"Expired","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["member_user_id","training_name","id","created_at"],"title":"TrainingRecordResponse"},"TranslationOut":{"properties":{"language":{"type":"string","title":"Language"},"target_kind":{"type":"string","title":"Target Kind"},"target_code":{"type":"string","title":"Target Code"},"target_child_code":{"type":"string","title":"Target Child Code","default":""},"field_name":{"type":"string","title":"Field Name"},"text":{"type":"string","title":"Text"}},"type":"object","required":["language","target_kind","target_code","field_name","text"],"title":"TranslationOut"},"TurnRequest":{"properties":{"message":{"type":"string","maxLength":2000,"minLength":1,"title":"Message"},"history":{"items":{"$ref":"#/components/schemas/HistoryItem"},"type":"array","maxItems":24,"title":"History"}},"additionalProperties":false,"type":"object","required":["message"],"title":"TurnRequest"},"TurnResponse":{"properties":{"reply":{"type":"string","title":"Reply"},"proposal":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Proposal"},"tools_used":{"items":{"$ref":"#/components/schemas/ToolUse"},"type":"array","title":"Tools Used","default":[]},"actions":{"items":{"$ref":"#/components/schemas/ClientAction"},"type":"array","title":"Actions","default":[]},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"prompt_version":{"type":"string","title":"Prompt Version","default":"spark-agent-3"}},"type":"object","required":["reply"],"title":"TurnResponse"},"UsageSummaryResponse":{"properties":{"session_count":{"type":"integer","title":"Session Count"},"stt_seconds":{"type":"number","title":"Stt Seconds"},"tts_characters":{"type":"number","title":"Tts Characters"},"llm_tokens":{"type":"number","title":"Llm Tokens"}},"type":"object","required":["session_count","stt_seconds","tts_characters","llm_tokens"],"title":"UsageSummaryResponse"},"UseInAnalysis":{"properties":{"question_code":{"type":"string","maxLength":64,"minLength":1,"title":"Question Code"},"as":{"type":"string","pattern":"^(number|band)$","title":"As","default":"number"}},"type":"object","required":["question_code"],"title":"UseInAnalysis"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValidatorInfo":{"properties":{"instrument_type":{"type":"string","title":"Instrument Type"},"validator_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Validator Id"},"schema_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Version"},"activatable":{"type":"boolean","title":"Activatable"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["instrument_type","activatable"],"title":"ValidatorInfo","description":"What can currently be activated, and by what."},"ValueCellOut":{"properties":{"attribute_code":{"type":"string","title":"Attribute Code"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"value_numeric":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Numeric"},"missing_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Missing Reason","description":"missing · unknown · not_applicable · prefer_not_to_answer, kept distinct. A refusal is not missing data."},"response_set_id":{"type":"string","title":"Response Set Id"},"answer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer Id"},"instrument_version_id":{"type":"string","title":"Instrument Version Id"},"question_code":{"type":"string","title":"Question Code"},"amendment_sequence":{"type":"integer","title":"Amendment Sequence"},"wave_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Id"}},"type":"object","required":["attribute_code","value","value_numeric","response_set_id","answer_id","instrument_version_id","question_code","amendment_sequence","wave_id"],"title":"ValueCellOut"},"ValueSetOut":{"properties":{"id":{"type":"string","title":"Id"},"code":{"type":"string","title":"Code"},"label":{"type":"string","title":"Label"},"items":{"items":{"$ref":"#/components/schemas/ChoiceOut"},"type":"array","title":"Items"}},"type":"object","required":["id","code","label"],"title":"ValueSetOut"},"VersionCoverageEntry":{"properties":{"version_id":{"type":"string","title":"Version Id"},"document_id":{"type":"string","title":"Document Id"},"document_title":{"type":"string","title":"Document Title"},"version_no":{"type":"integer","title":"Version No"},"internal_state":{"type":"string","title":"Internal State"},"scan_state":{"type":"string","title":"Scan State"},"covered_by_requirements":{"items":{"type":"string"},"type":"array","title":"Covered By Requirements"},"submitted_to_requirements":{"items":{"type":"string"},"type":"array","title":"Submitted To Requirements"}},"type":"object","required":["version_id","document_id","document_title","version_no","internal_state","scan_state"],"title":"VersionCoverageEntry","description":"Which tracks a particular document version has actually been through."},"VersionCreate":{"properties":{"definition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Definition"},"derived_from_document_version_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Derived From Document Version Id"}},"type":"object","title":"VersionCreate"},"VersionRefOut":{"properties":{"version_id":{"type":"string","title":"Version Id"},"version_no":{"type":"integer","title":"Version No"},"internal_state":{"type":"string","title":"Internal State"},"definition_checksum":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition Checksum"},"draft_revision":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Draft Revision"}},"type":"object","required":["version_id","version_no","internal_state"],"title":"VersionRefOut","description":"Which version this is, and enough to spot a stale comparison."},"VersionResponse":{"properties":{"id":{"type":"string","title":"Id"},"instrument_id":{"type":"string","title":"Instrument Id"},"version_no":{"type":"integer","title":"Version No"},"internal_state":{"type":"string","title":"Internal State"},"draft_revision":{"type":"integer","title":"Draft Revision","default":1},"definition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Definition"},"definition_schema_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition Schema Version"},"definition_checksum":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Definition Checksum"},"canonicalisation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonicalisation"},"validator_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Validator Id"},"projection_algorithm":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Projection Algorithm"},"derived_from_document_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Derived From Document Version Id"},"supersedes_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supersedes Id"},"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"activated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Activated At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","instrument_id","version_no","internal_state","created_at"],"title":"VersionResponse"},"VoiceCatalogResponse":{"properties":{"voices":{"items":{"$ref":"#/components/schemas/VoiceOption"},"type":"array","title":"Voices"},"providers_configured":{"type":"boolean","title":"Providers Configured"}},"type":"object","required":["voices","providers_configured"],"title":"VoiceCatalogResponse"},"VoiceOption":{"properties":{"id":{"type":"string","title":"Id"},"provider":{"type":"string","title":"Provider"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"language":{"type":"string","title":"Language","default":"en"},"accent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accent"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"is_pro":{"type":"boolean","title":"Is Pro","default":false},"locales":{"items":{"type":"string"},"type":"array","title":"Locales"}},"type":"object","required":["id","provider","name","description"],"title":"VoiceOption","description":"One selectable interviewer voice, described for the person choosing it."},"VoicePreviewRequest":{"properties":{"voice_id":{"type":"string","title":"Voice Id"},"text":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Text"}},"type":"object","required":["voice_id"],"title":"VoicePreviewRequest"},"WaveCreate":{"properties":{"code":{"type":"string","maxLength":64,"title":"Code"},"name":{"type":"string","maxLength":255,"title":"Name"},"sequence":{"type":"integer","minimum":1.0,"title":"Sequence"},"offset_from":{"type":"string","title":"Offset From"},"offset_days":{"type":"integer","minimum":0.0,"title":"Offset Days","default":0},"window_days":{"type":"integer","minimum":1.0,"title":"Window Days","default":14},"previous_wave_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Previous Wave Id"},"auto_open_version_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Auto Open Version Id"},"required":{"type":"boolean","title":"Required","default":false},"state":{"type":"string","title":"State","default":"draft"}},"type":"object","required":["code","name","sequence","offset_from"],"title":"WaveCreate","description":"A follow-up time point, expressed as a rule rather than a date.\n\nThere is no `opens_at` here on purpose. Each participant's dates come from\ntheir own anchor when the wave is opened for them; a date on the definition\nwould give everybody the same due date regardless of when they consented."},"WaveListOut":{"properties":{"waves":{"items":{"$ref":"#/components/schemas/WaveOut"},"type":"array","title":"Waves"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["waves","count"],"title":"WaveListOut"},"WaveOpenIn":{"properties":{"instrument_version_id":{"type":"string","maxLength":36,"title":"Instrument Version Id"},"dry_run":{"type":"boolean","title":"Dry Run","default":false}},"type":"object","required":["instrument_version_id"],"title":"WaveOpenIn","description":"Materialise this wave's assignments.\n\n`dry_run` answers \"what would happen\" without writing, which is what a\ncoordinator wants before opening a wave across three hundred participants."},"WaveOpenOut":{"properties":{"wave_id":{"type":"string","title":"Wave Id"},"instrument_version_id":{"type":"string","title":"Instrument Version Id"},"dry_run":{"type":"boolean","title":"Dry Run"},"opened":{"items":{"type":"string"},"type":"array","title":"Opened"},"already_open":{"items":{"type":"string"},"type":"array","title":"Already Open"},"skipped":{"items":{"$ref":"#/components/schemas/WaveSkipOut"},"type":"array","title":"Skipped"},"messages_sent":{"type":"integer","title":"Messages Sent","default":0}},"type":"object","required":["wave_id","instrument_version_id","dry_run","opened","already_open","skipped"],"title":"WaveOpenOut","description":"What the job did, per participant, with a reason for every omission.\n\n\"Forty of sixty opened\" with no account of the other twenty is a number\nnobody can act on."},"WaveOut":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"sequence":{"type":"integer","title":"Sequence"},"offset_from":{"type":"string","title":"Offset From"},"offset_days":{"type":"integer","title":"Offset Days"},"window_days":{"type":"integer","title":"Window Days"},"previous_wave_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Wave Id"},"auto_open_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auto Open Version Id"},"required":{"type":"boolean","title":"Required","default":false},"state":{"type":"string","title":"State"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"assignment_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Assignment Counts","default":{}}},"type":"object","required":["id","study_id","code","name","sequence","offset_from","offset_days","window_days","previous_wave_id","state","created_at"],"title":"WaveOut"},"WavePointOut":{"properties":{"wave_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wave Id"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"missing_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Missing Reason"},"response_set_id":{"type":"string","title":"Response Set Id"}},"type":"object","required":["wave_id","value","missing_reason","response_set_id"],"title":"WavePointOut"},"WaveSkipOut":{"properties":{"enrolment_id":{"type":"string","title":"Enrolment Id"},"reason":{"type":"string","title":"Reason"},"detail":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["enrolment_id","reason"],"title":"WaveSkipOut"},"WaveUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"sequence":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Sequence"},"offset_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Offset From"},"offset_days":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Offset Days"},"window_days":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Window Days"},"previous_wave_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Previous Wave Id"},"auto_open_version_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Auto Open Version Id"},"required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Required"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},"type":"object","title":"WaveUpdate","description":"Change a wave. Every field optional; unset fields are left alone."},"WebhookCreateRequest":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"}},"type":"object","required":["url"],"title":"WebhookCreateRequest"},"WebhookCreatedResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"active":{"type":"boolean","title":"Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"secret":{"type":"string","title":"Secret","description":"Signing secret. Returned only here, at registration; it cannot be read back."}},"type":"object","required":["id","tenant_id","url","events","active","created_at","secret"],"title":"WebhookCreatedResponse"},"WebhookDeliveryResponse":{"properties":{"id":{"type":"string","title":"Id"},"config_id":{"type":"string","title":"Config Id"},"event_type":{"type":"string","title":"Event Type"},"status":{"type":"string","title":"Status"},"attempts":{"type":"integer","title":"Attempts"},"last_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Attempt At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"response_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Response Status","description":"The receiver's last HTTP status, if it answered."},"job_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Status","description":"pending, running, succeeded, dead or cancelled. `dead` can be replayed."},"replayable":{"type":"boolean","title":"Replayable","default":false}},"type":"object","required":["id","config_id","event_type","status","attempts","created_at"],"title":"WebhookDeliveryResponse"},"WebhookResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"active":{"type":"boolean","title":"Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","tenant_id","url","events","active","created_at"],"title":"WebhookResponse"},"WebhookSecretRotatedResponse":{"properties":{"id":{"type":"string","title":"Id"},"secret":{"type":"string","title":"Secret","description":"The new signing secret. Returned only here."},"previous_valid_until":{"type":"string","format":"date-time","title":"Previous Valid Until","description":"Until then each delivery also carries a `v1=` signed with the old secret."}},"type":"object","required":["id","secret","previous_valid_until"],"title":"WebhookSecretRotatedResponse"},"WindowOut":{"properties":{"part":{"type":"string","title":"Part"},"label":{"type":"string","title":"Label"},"hours":{"type":"string","title":"Hours"},"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"}},"type":"object","required":["part","label","hours","start","end"],"title":"WindowOut"},"WithdrawIn":{"properties":{"answer":{"type":"string","maxLength":64,"title":"Answer"}},"type":"object","required":["answer"],"title":"WithdrawIn"},"WithdrawOut":{"properties":{"withdrawn":{"type":"boolean","title":"Withdrawn"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"attempts_left":{"type":"integer","title":"Attempts Left","default":0},"notes":{"items":{"type":"string"},"type":"array","title":"Notes","default":[]}},"type":"object","required":["withdrawn"],"title":"WithdrawOut"},"WordingPreview":{"properties":{"config_id":{"type":"string","title":"Config Id"},"config_version":{"type":"string","title":"Config Version"},"language":{"type":"string","title":"Language"},"approval_state":{"type":"string","title":"Approval State"},"on_disclosure":{"items":{"type":"string"},"type":"array","title":"On Disclosure"},"on_distress":{"items":{"type":"string"},"type":"array","title":"On Distress"},"escalation_goes_to":{"type":"boolean","title":"Escalation Goes To"},"uses_platform_failsafe":{"type":"boolean","title":"Uses Platform Failsafe","default":false},"not_applicable_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Not Applicable Reason"}},"type":"object","required":["config_id","config_version","language","approval_state","on_disclosure","on_distress","escalation_goes_to"],"title":"WordingPreview","description":"What a participant would actually hear, in order.\n\nPlanned by the same function the runtime uses, so a preview cannot drift\nfrom the thing it previews."},"WorkspaceCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"contact_email":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Contact Email"}},"type":"object","required":["name"],"title":"WorkspaceCreateRequest","description":"What someone must supply to open a workspace of their own."},"WorkspaceCreatedResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"membership_id":{"type":"string","title":"Membership Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["tenant_id","name","role","membership_id","created_at"],"title":"WorkspaceCreatedResponse","description":"The new workspace, and the creator's standing in it."},"WorkspaceSummary":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"membership_id":{"type":"string","title":"Membership Id"},"is_test":{"type":"boolean","title":"Is Test","default":false}},"type":"object","required":["tenant_id","name","role","membership_id"],"title":"WorkspaceSummary","description":"A workspace this person may enter. Deliberately minimal — no capability\ndetail, because a picker does not need it."},"WorkspaceTurnRequest":{"properties":{"message":{"type":"string","maxLength":2000,"minLength":1,"title":"Message"},"history":{"items":{"$ref":"#/components/schemas/HistoryItem"},"type":"array","maxItems":24,"title":"History"},"study_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Study Id"},"page":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Page"},"routes":{"items":{"$ref":"#/components/schemas/PageRef"},"type":"array","maxItems":80,"title":"Routes"},"topics":{"items":{"$ref":"#/components/schemas/TopicRef"},"type":"array","maxItems":80,"title":"Topics"}},"additionalProperties":false,"type":"object","required":["message"],"title":"WorkspaceTurnRequest"},"anchor_api__schemas__document__DocumentResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"filename":{"type":"string","title":"Filename"},"turn_count":{"type":"integer","title":"Turn Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","session_id","filename","turn_count","created_at"],"title":"DocumentResponse"},"verticals__research_kit__api__dossier_schemas__DocumentResponse":{"properties":{"id":{"type":"string","title":"Id"},"study_id":{"type":"string","title":"Study Id"},"doc_class":{"type":"string","title":"Doc Class"},"doc_type":{"type":"string","title":"Doc Type"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"sensitivity":{"type":"string","title":"Sensitivity"},"current_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Version Id"},"version_count":{"type":"integer","title":"Version Count","default":0},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"versions":{"items":{"$ref":"#/components/schemas/DocumentVersionResponse"},"type":"array","title":"Versions"}},"type":"object","required":["id","study_id","doc_class","doc_type","title","sensitivity","created_at"],"title":"DocumentResponse"},"ErrorResponse":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string"}},"additionalProperties":true},"SessionWebhookPayload":{"type":"object","required":["session_id"],"properties":{"session_id":{"type":"string"}},"additionalProperties":false},"RunCompletedWebhookPayload":{"type":"object","required":["run_id","document_id"],"properties":{"run_id":{"type":"string"},"document_id":{"type":"string"}},"additionalProperties":false},"RunFailedWebhookPayload":{"type":"object","required":["run_id"],"properties":{"run_id":{"type":"string"},"error_message":{"type":"string","nullable":true}},"additionalProperties":false},"UsageThresholdWebhookPayload":{"type":"object","required":["metric","used","limit","threshold_pct"],"properties":{"metric":{"type":"string","enum":["llm_tokens"]},"used":{"type":"number"},"limit":{"type":"number"},"threshold_pct":{"type":"integer","enum":[80,100]},"period_start":{"type":"string","format":"date-time"}},"additionalProperties":false},"AnchorWebhookEnvelope":{"type":"object","required":["event","payload"],"properties":{"event":{"type":"string","enum":["session.started","session.completed","session.failed","run.completed","run.failed","usage.threshold_exceeded"]},"payload":{"oneOf":[{"$ref":"#/components/schemas/SessionWebhookPayload"},{"$ref":"#/components/schemas/RunCompletedWebhookPayload"},{"$ref":"#/components/schemas/RunFailedWebhookPayload"},{"$ref":"#/components/schemas/UsageThresholdWebhookPayload"}]}},"additionalProperties":false}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"ClerkBearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"sessions","description":"Voice interview sessions — create, inspect, link, and complete."},{"name":"projects","description":"Organisational containers that group sessions under a shared rubric."},{"name":"rubrics","description":"Interview guides — sections, topics, and probes that drive the AI interviewer."},{"name":"personas","description":"AI interviewer identity: voice, tone, system prompt, and language."},{"name":"documents","description":"Offline transcript uploads (.txt/.json/.pdf/.docx) attached to a session."},{"name":"runs","description":"Offline extraction runs — trigger claim extraction on uploaded documents."},{"name":"probes","description":"Real-time follow-up questions generated by the extraction engine."},{"name":"identity","description":"Who the signed-in person is and which workspaces they may enter. These endpoints do not require a workspace to be selected."},{"name":"members","description":"Workspace membership: who is on the team and what they may do (admin / researcher / viewer)."},{"name":"keys","description":"Tenant-facing API key rotation."},{"name":"tenant","description":"Per-tenant configuration (LLM, STT, TTS providers) and usage telemetry."},{"name":"webhooks","description":"Outbound webhook subscriptions for `session.*`, `run.*`, and `usage.*` events. At-least-once delivery with retries, secret rotation and replay."},{"name":"billing","description":"Workspace plan, entitlements, metered usage and invoices, in USD. Checkout is provider-hosted; Anchor never handles card data."},{"name":"health","description":"Liveness and readiness probes."},{"name":"rk-studies","description":"ResearchKit: study lifecycle — create, configure, and archive studies."},{"name":"rk-governance","description":"ResearchKit: the questions an ethics committee asks that a transcript cannot answer — responsibility, risk, sites, cohorts, delegation."},{"name":"rk-participants","description":"ResearchKit: participant records. Enrolments are pseudonymous — no name, email or telephone column exists on them — and contact identity lives in a separate encrypted vault reached only with `participant.contact.view`, which is audited on every read and never held by an API key (§3.3)."},{"name":"rk-participant-forms","description":"ResearchKit: the surface a participant themselves uses. Opened by a hashed, purpose-scoped assignment token rather than a credential; a token opens exactly one assignment, and every unavailable reason returns the same message so a guessed token is not an oracle."},{"name":"rk-screening","description":"ResearchKit: pre-consent eligibility screening. **Not study data** (C13): a screening session carries its own notice version, collection purpose, lawful basis and retention deadline, none of them inherited from the study, and is opened by `eligibility.manage` rather than `response.view`. Linking a screened person to an enrolment records an association and grants no access."},{"name":"rk-data-quality","description":"ResearchKit: data queries and dataset locks. A query flags one answer for somebody to check and writes nothing — it needs `data.query`, not `response.amend`, because noticing an implausible value and being allowed to change it are different things. Resolving *by correcting* needs `response.amend` and goes through the ordinary amendment path, so the previous value is kept. A dataset lock stops responses, amendments and imports while an analysis relies on the data; it is not a freeze. No route here returns an answer's value."},{"name":"rk-structured-analysis","description":"ResearchKit: the joined case view, descriptive distributions and matrices, disclosure control and dataset freezes. Values reach analysis only as approved attribute projections that name the answer and amendment they came from. Every output is descriptive and carries its sample size. A cell below the study's minimum is suppressed and marked, never dropped, and an export containing a rare combination is refused. A freeze records the dataset version a finding used; unlike a lock, it stops nobody writing."},{"name":"rk-fielding","description":"ResearchKit: putting an instrument in front of a participant and seeing what comes back — the recorded fielding gate, assignments, waves, saved and submitted responses, amendments, attachments and completion. Two capabilities are held apart here: `response.collect` is fieldwork and `response.view` is reading what people said, and neither implies access to contact identity."},{"name":"rk-dossier","description":"ResearchKit: the paperwork a study runs on. Documents are stored as immutable, checksummed versions; uploaded bytes are quarantined, content-checked and scanned before anything may download, approve or submit them. Internal approval is this workspace's own sign-off and is **not** an ethics decision."},{"name":"rk-authority","description":"ResearchKit: the independent permissions a study needs, each its own track. An ethics approval never satisfies a research licence or a site authorisation, so coverage is a matrix and no single decision claims to permit fieldwork."},{"name":"rk-instruments","description":"ResearchKit: instrument identity and the canonical definition envelope. An activated version is immutable and its integrity is checkable."},{"name":"rk-safety-configuration","description":"ResearchKit: the approved words a distressed participant hears, and who is told. Versioned, approval-gated and pinned per session."},{"name":"rk-sessions","description":"ResearchKit: per-study session management."},{"name":"rk-guides","description":"ResearchKit: interview guides scoped to a study."},{"name":"rk-consent","description":"ResearchKit: participant consent capture and withdrawal."},{"name":"rk-artifacts","description":"ResearchKit: session analysis artifacts (transcripts, claims, summaries)."},{"name":"rk-themes","description":"ResearchKit: theme extraction and cross-session thematic analysis."},{"name":"rk-analysis","description":"ResearchKit: aggregate analysis across a study's completed sessions."},{"name":"rk-exports","description":"ResearchKit: data exports (CSV, JSON). Anonymisation is enforced when `anonymise_on_export` is set on the study."},{"name":"rk-assistant","description":"ResearchKit: evidence-grounded session assistant. Answers cite real transcript turns and validated claims, or report that evidence is missing. Conversations are persisted as tenant-scoped threads."},{"name":"rk-agent-tasks","description":"ResearchKit: the agent-task approval queue (Inbox). Agents propose work; the Research Lead approves/rejects/dismisses. Approving an action-gated task runs its handler — no consequential write happens before approval."},{"name":"participant","description":"Participant join-token endpoints used by the public interview flow. These are authorized by the opaque participant link token, not API keys."}],"webhooks":{"anchorEvent":{"post":{"tags":["webhooks"],"summary":"Receive Anchor webhook event","description":"Anchor sends this request to subscribed webhook URLs. Verify `X-Anchor-Signature` before trusting the payload.","parameters":[{"name":"X-Anchor-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"HMAC-SHA256 signature of the JSON request body."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnchorWebhookEnvelope"},"examples":{"sessionCompleted":{"summary":"Session completed","value":{"event":"session.completed","payload":{"session_id":"sess_123"}}},"runCompleted":{"summary":"Run completed","value":{"event":"run.completed","payload":{"run_id":"run_123","document_id":"doc_123"}}}}}}},"responses":{"200":{"description":"Webhook accepted"},"400":{"description":"Webhook rejected by subscriber"},"500":{"description":"Subscriber server error"}}}}}}