{"openapi": "3.1.0", "info": {"title": "CANTAB Pathway API", "version": "1", "description": "Create cognitive assessments by API. <p><a href=\"/api/docs\">See the \"Getting Started\" guide.</a></p>"}, "paths": {"/api/v1/tokens/": {"post": {"operationId": "api_endpoints_tokens_create_token", "summary": "Create Token", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessCreateResponse_CreateTokenData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Use your username and password (via basicauth) to create a new bearer token.\n\nThis token is used to authenticate all other API requests.\n\nIt does expire, but you can create a new one at any time.\n\nTo customize expiry, provide a body with `expires_at` as an ISO 8601\ndatetime in UTC with no timezone suffix (e.g. \"2025-01-31T12:00:00\").\nThis value must be in the future and cannot exceed the maximum lifetime\nconfigured by the server.", "requestBody": {"content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/CreateTokenRequest"}, {"type": "null"}]}}}, "required": false}, "security": [{"BasicAuth": []}]}}, "/api/v1/tokens/{token}": {"delete": {"operationId": "api_endpoints_tokens_delete_token", "summary": "Delete Token", "parameters": [{"in": "path", "name": "token", "schema": {"title": "Token", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_TokenDeletedData_"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Revoke a bearer token so it can no longer be used for authentication.\n\nProvide the token string in the path. If you are a system admin, you can\nrevoke any token. Organization admins can revoke tokens belonging to users\nin their organization. Regular API users can only revoke their own tokens.", "security": [{"BearerAuth": []}]}}, "/api/v1/users/": {"post": {"operationId": "api_endpoints_users_create_user", "summary": "Create User", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessCreateResponse_CreateUserData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Create a new Coghealth user.\n\nA Coghealth admin can create a user of any role in any organization.\n\nAn organization admin can create an \"api_user\" in their organization.\nFrom there, you must call the \"add user to project\" endpoint to give\nthem admin or member access to a project.\n\nAn api_user with admin on at least one project can create other\napi_users, and assign them to any project they have admin on.", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateUserRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}, "get": {"operationId": "api_endpoints_users_list_users", "summary": "List Users", "parameters": [{"in": "query", "name": "username", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Username"}, "required": false}, {"in": "query", "name": "email", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "required": false}, {"in": "query", "name": "organization_id", "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Organization Id"}, "required": false}, {"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedGetUserData"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "List users according to caller's permissions and project admin roles.\n\nA Coghealth admin can list all users.\nAn organization admin can list all users in their organization.\nAn api_user can list all users in their project(s).", "security": [{"BearerAuth": []}]}}, "/api/v1/users/{username}": {"get": {"operationId": "api_endpoints_users_get_user", "summary": "Get User", "parameters": [{"in": "path", "name": "username", "schema": {"title": "Username", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_GetUserData_"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Get details for a user the caller is authorized to view.\n\nA Coghealth admin can view any user.\n\nAn organization admin can view any user in their organization.\n\nAn api_user can view any user in their project(s).", "security": [{"BearerAuth": []}]}}, "/api/v1/users/{username}/projects/": {"post": {"operationId": "api_endpoints_users_add_user_to_project", "summary": "Add User To Project", "parameters": [{"in": "path", "name": "username", "schema": {"title": "Username", "type": "string"}, "required": true}], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessCreateResponse_GetUserData_"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Add a user to a project or update their role on that project.\n\nA Coghealth admin can add any user to any project.\n\nAn organization admin can add any user in their organization to any project in their organization.\n\nAn api_user can add any user in their project(s) to any project they have admin on.", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/AddUserToProjectRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}}, "/api/v1/organizations/": {"post": {"operationId": "api_endpoints_organizations_create_organization", "summary": "Create Organization", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessCreateResponse_CreateOrganizationData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Create a new organization.\n\nOnly a Coghealth admin can create an organization.", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateOrganizationRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}, "get": {"operationId": "api_endpoints_organizations_list_organizations", "summary": "List Organizations", "parameters": [{"in": "query", "name": "id", "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Id"}, "required": false}, {"in": "query", "name": "name", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "required": false}, {"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedGetOrganizationData"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "List organizations.\n\nA Coghealth admin can list all organizations.\n\nOther users will only see their own organization in the list.", "security": [{"BearerAuth": []}]}}, "/api/v1/organizations/{organization_id}": {"get": {"operationId": "api_endpoints_organizations_get_organization", "summary": "Get Organization", "parameters": [{"in": "path", "name": "organization_id", "schema": {"format": "uuid", "title": "Organization Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_GetOrganizationData_"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Get details for an organization.\n\nA Coghealth admin can view any organization.\n\nAny user can view their own organization.", "security": [{"BearerAuth": []}]}, "patch": {"operationId": "api_endpoints_organizations_update_organization", "summary": "Update Organization", "parameters": [{"in": "path", "name": "organization_id", "schema": {"format": "uuid", "title": "Organization Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_GetOrganizationData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Update an organization.\n\nCoghealth admins can update any organization. Organization admins can update their own organization.", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateOrganizationRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}}, "/api/v1/projects/": {"post": {"operationId": "api_endpoints_projects_create_project", "summary": "Create Project", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessCreateResponse_CreateProjectData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Create a new project.\n\nAn organization admin can create a project in their organization. They must omit the organization_id.", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateProjectRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}, "get": {"operationId": "api_endpoints_projects_list_projects", "summary": "List Projects", "parameters": [{"in": "query", "name": "id", "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Id"}, "required": false}, {"in": "query", "name": "name", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "required": false}, {"in": "query", "name": "organization_id", "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Organization Id"}, "required": false}, {"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedGetProjectData"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "List projects visible to the caller.\n\nAn organization admin can list all projects in their organization.\n\nAn api_user can list all projects they are a member of.", "security": [{"BearerAuth": []}]}}, "/api/v1/projects/{project_id}": {"get": {"operationId": "api_endpoints_projects_get_project", "summary": "Get Project", "parameters": [{"in": "path", "name": "project_id", "schema": {"format": "uuid", "title": "Project Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_GetProjectData_"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Get details for a project the caller is authorized to view.\n\nA Coghealth admin can view any project.\n\nAn organization admin can view any project in their organization.\n\nAn api_user can view any project they are a member of.", "security": [{"BearerAuth": []}]}, "patch": {"operationId": "api_endpoints_projects_update_project", "summary": "Update Project", "parameters": [{"in": "path", "name": "project_id", "schema": {"format": "uuid", "title": "Project Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_GetProjectData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Update selected fields on a project.\n\nAn organization admin can update any project in their organization.\n\nAn api_user can update any project they are a member of.", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateProjectRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}}, "/api/v1/subjects/": {"post": {"operationId": "api_endpoints_subjects_create_subject", "summary": "Create Subject", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessCreateResponse_SubjectData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Create a new subject in a project.\n\nA Coghealth admin can create a subject in any project.\n\nAn organization admin can create a subject in any project in their organization.\n\nAn api_user can create a subject in any project they are a member of.\n\n`external_id` is a unique identifier that you maintain for each subject. It is distinct from the subject's API id, and is only used for your reference.", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateSubjectRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}, "get": {"operationId": "api_endpoints_subjects_list_subjects", "summary": "List Subjects", "parameters": [{"in": "query", "name": "id", "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Id"}, "required": false}, {"in": "query", "name": "project_id", "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Project Id"}, "required": false}, {"in": "query", "name": "external_id", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "External Id"}, "required": false}, {"in": "query", "name": "locale", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Locale"}, "required": false}, {"in": "query", "name": "meta", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Meta"}, "required": false}, {"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedSubjectData"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "List subjects visible to the caller.\n\nA Coghealth admin can list all subjects.\n\nAn organization admin can list all subjects in their organization.\n\nAn api_user can list all subjects in their project(s).", "security": [{"BearerAuth": []}]}}, "/api/v1/subjects/{subject_id}": {"patch": {"operationId": "api_endpoints_subjects_update_subject", "summary": "Update Subject", "parameters": [{"in": "path", "name": "subject_id", "schema": {"format": "uuid", "title": "Subject Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_SubjectData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Update fields on an existing subject.\n\nCallers can update any combination of the subject's mutable fields in a single request.\nCoghealth admins can update any subject. Organization admins can update subjects in their\norganization. Project members can update subjects in projects they belong to.", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateSubjectRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}, "get": {"operationId": "api_endpoints_subjects_get_subject", "summary": "Get Subject", "parameters": [{"in": "path", "name": "subject_id", "schema": {"format": "uuid", "title": "Subject Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_SubjectData_"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Get details for a subject the caller is authorized to view.\n\nA Coghealth admin can view any subject.\n\nAn organization admin can view any subject in their organization.\n\nAn api_user can view any subject in their project(s).", "security": [{"BearerAuth": []}]}}, "/api/v1/assessments/": {"post": {"operationId": "api_endpoints_assessments_create_subject_assessment", "summary": "Create Subject Assessment", "parameters": [], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessCreateResponse_SubjectAssessmentData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Create a new subject assessment. This endpoint is slower than others and will require a few seconds to complete.\n\nA Coghealth admin can create a subject assessment in any project.\n\nAn organization admin can create a subject assessment in any project in their organization.\n\nAn api_user can create a subject assessment in any project they are a member of.\n\n`external_id` is a unique identifier that you maintain for each assessment. It is distinct from the assessment's API id, and is only used for your reference.\n\nThe assessment type is dependent on your project's configuration, but can be any of the following:\n\n- cantab-one\n\n- cantab-insights\n\n- cantab-plus-pd\n\n- cantab-plus-adhd\n\n- cantab-plus-dementia\n\n- cantab-plus-depression\n\n- cantab-plus-hd\n\n- cantab-plus-ms", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateSubjectAssessmentRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}, "get": {"operationId": "api_endpoints_assessments_list_subject_assessments", "summary": "List Subject Assessments", "parameters": [{"in": "query", "name": "id", "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Id"}, "required": false}, {"in": "query", "name": "subject_id", "schema": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Subject Id"}, "required": false}, {"in": "query", "name": "external_id", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "External Id"}, "required": false}, {"in": "query", "name": "assessment_type", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Assessment Type"}, "required": false}, {"in": "query", "name": "status", "schema": {"anyOf": [{"$ref": "#/components/schemas/AssessmentStatus"}, {"type": "null"}]}, "required": false}, {"in": "query", "name": "failure_reason", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Failure Reason"}, "required": false}, {"in": "query", "name": "meta", "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Meta"}, "required": false}, {"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedSubjectAssessmentData"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "List subject assessments visible to the caller.\n\nA Coghealth admin can list all subject assessments.\n\nAn organization admin can list all subject assessments in their organization.\n\nAn api_user can list all subject assessments in their project(s).", "security": [{"BearerAuth": []}]}}, "/api/v1/assessments/{assessment_id}": {"get": {"operationId": "api_endpoints_assessments_get_subject_assessment", "summary": "Get Subject Assessment", "parameters": [{"in": "path", "name": "assessment_id", "schema": {"format": "uuid", "title": "Assessment Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_SubjectAssessmentData_"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Get details for a subject assessment the caller is authorized to view.\n\nA Coghealth admin can view any subject assessment.\n\nAn organization admin can view any subject assessment in their organization.\n\nAn api_user can view any subject assessment in their project(s).", "security": [{"BearerAuth": []}]}}, "/api/v1/assessments/{assessment_id}/report/download": {"get": {"operationId": "api_endpoints_assessments_download_assessment_report", "summary": "Download Assessment Report", "parameters": [{"in": "path", "name": "assessment_id", "schema": {"format": "uuid", "title": "Assessment Id", "type": "string"}, "required": true}], "responses": {"400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Download the PDF report for a report-ready assessment.\n\nA Coghealth admin can download any subject assessment report.\n\nAn organization admin can download any subject assessment report in their organization.\n\nAn api_user can download any subject assessment report in their project(s).\n\nThe success response from this endpoint will not be JSON, but an attachment containing the PDF report for download (content-disposition header will be set to `attachment; filename=\"<report_name>.pdf\"`).", "security": [{"BearerAuth": []}]}}, "/api/v1/tricks/assessments/{assessment_id}": {"post": {"operationId": "api_endpoints_tricks_run_assessment_trick", "summary": "Run Assessment Trick", "parameters": [{"in": "path", "name": "assessment_id", "schema": {"format": "uuid", "title": "Assessment Id", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_SubjectAssessmentData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "403": {"description": "Forbidden", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Force an assessment transition for test projects. Only available to project\nadmins, organization admins, and Coghealth admins.\n\nAvailable actions:\n- complete_assessment_high: mark an in-progress assessment as completed with synthetic high-performing measures.\n- complete_assessment_low: mark an in-progress assessment as completed with synthetic low-performing measures.\n- complete_assessment_mixed: mark an in-progress assessment as completed with synthetic mixed-performing measures.\n- create_report: transition a completed assessment to report_ready and attach a placeholder PDF which can be downloaded.\n- expire_assessment: mark an in-progress assessment as failed with the expired failure reason.\n- fail_assessment: mark an in-progress assessment as failed with the technical issue failure reason.", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunAssessmentTrickRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}}, "/api/v1/projects/{project_id}/report-variants": {"post": {"operationId": "api_endpoints_report_variants_create_report_variant", "summary": "Create Report Variant", "parameters": [{"in": "path", "name": "project_id", "schema": {"format": "uuid", "title": "Project Id", "type": "string"}, "required": true}], "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessCreateResponse_ReportVariantData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Create a new report variant for a project.", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateReportVariantRequest"}}}, "required": true}, "security": [{"BearerAuth": []}]}, "get": {"operationId": "api_endpoints_report_variants_list_report_variants", "summary": "List Report Variants", "parameters": [{"in": "path", "name": "project_id", "schema": {"format": "uuid", "title": "Project Id", "type": "string"}, "required": true}, {"in": "query", "name": "limit", "schema": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "required": false}, {"in": "query", "name": "offset", "schema": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PagedReportVariantData"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "List all report variants for a project.", "security": [{"BearerAuth": []}]}}, "/api/v1/projects/{project_id}/report-variants/{key}": {"delete": {"operationId": "api_endpoints_report_variants_delete_report_variant", "summary": "Delete Report Variant", "parameters": [{"in": "path", "name": "project_id", "schema": {"format": "uuid", "title": "Project Id", "type": "string"}, "required": true}, {"in": "path", "name": "key", "schema": {"title": "Key", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DeleteSuccessResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Delete a report variant. Also clears the project default and in-progress\nassessment references if they point to this variant.", "security": [{"BearerAuth": []}]}, "get": {"operationId": "api_endpoints_report_variants_get_report_variant", "summary": "Get Report Variant", "parameters": [{"in": "path", "name": "project_id", "schema": {"format": "uuid", "title": "Project Id", "type": "string"}, "required": true}, {"in": "path", "name": "key", "schema": {"title": "Key", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_ReportVariantData_"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Get details for a report variant.", "security": [{"BearerAuth": []}]}}, "/api/v1/projects/{project_id}/report-variants/{key}/logo": {"post": {"operationId": "api_endpoints_report_variants_upload_report_variant_logo", "summary": "Upload Report Variant Logo", "parameters": [{"in": "path", "name": "project_id", "schema": {"format": "uuid", "title": "Project Id", "type": "string"}, "required": true}, {"in": "path", "name": "key", "schema": {"title": "Key", "type": "string"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SuccessDetailResponse_ReportVariantData_"}}}}, "400": {"description": "Bad Request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}, "404": {"description": "Not Found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorWithReasonResponse"}}}}}, "description": "Upload a logo for a report variant. The logo must have a 3:1 aspect ratio\nand be at least 160px tall. Maximum file size is 50MB. The image will be\nresized asynchronously.", "requestBody": {"content": {"multipart/form-data": {"schema": {"properties": {"file": {"format": "binary", "title": "File", "type": "string"}}, "required": ["file"], "title": "FileParams", "type": "object"}}}, "required": true}, "security": [{"BearerAuth": []}]}}}, "components": {"schemas": {"CreateTokenData": {"description": "Create token response data.\n\ntoken: A bearer token string. Use it with `Authorization: Bearer <token>` in the request headers.\n\nexpires_at: The date and time the token will expire, in ISO 8601 format.", "properties": {"token": {"title": "Token", "type": "string"}, "expires_at": {"format": "date-time", "title": "Expires At", "type": "string"}}, "required": ["token", "expires_at"], "title": "CreateTokenData", "type": "object"}, "SuccessCreateResponse_CreateTokenData_": {"properties": {"status_code": {"const": 201, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/CreateTokenData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessCreateResponse[CreateTokenData]", "type": "object"}, "ErrorCode": {"enum": ["BAD_REQUEST", "UNAUTHORIZED", "FORBIDDEN", "NOT_FOUND", "ALREADY_EXISTS", "CONFLICT", "LICENCE_EXCEEDED", "VALIDATION_ERROR", "HTTP_ERROR"], "title": "ErrorCode", "type": "string"}, "ErrorWithReasonResponse": {"properties": {"status_code": {"title": "Status Code", "type": "integer"}, "ok": {"title": "Ok", "type": "boolean"}, "error": {"$ref": "#/components/schemas/ErrorCode"}, "reason": {"title": "Reason", "type": "string"}}, "required": ["status_code", "ok", "error", "reason"], "title": "ErrorWithReasonResponse", "type": "object"}, "CreateTokenRequest": {"description": "Optional request body to customize token expiry.\n\n- expires_at: ISO 8601 datetime in UTC with no timezone suffix (naive).\n  If omitted, defaults to API_TOKEN_EXPIRATION_DAYS.", "properties": {"expires_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "title": "Expires At"}}, "title": "CreateTokenRequest", "type": "object"}, "SuccessDetailResponse_TokenDeletedData_": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/TokenDeletedData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessDetailResponse[TokenDeletedData]", "type": "object"}, "TokenDeletedData": {"description": "Empty payload for delete token responses.", "properties": {"deleted": {"const": true, "title": "Deleted", "type": "boolean"}}, "required": ["deleted"], "title": "TokenDeletedData", "type": "object"}, "CreateUserData": {"properties": {"username": {"title": "Username", "type": "string"}, "email": {"title": "Email", "type": "string"}, "organization_id": {"format": "uuid", "title": "Organization Id", "type": "string"}, "generated_password": {"title": "Generated Password", "type": "string"}}, "required": ["username", "email", "organization_id", "generated_password"], "title": "CreateUserData", "type": "object"}, "SuccessCreateResponse_CreateUserData_": {"properties": {"status_code": {"const": 201, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/CreateUserData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessCreateResponse[CreateUserData]", "type": "object"}, "CoghealthUserRole": {"enum": ["coghealth_admin", "organization_admin", "api_user", "admin_app_user"], "title": "CoghealthUserRole", "type": "string"}, "CreateUserRequest": {"description": "Create user request data.\n\nusername: The username of the user to create.\n\nemail: The email of the user to create.\n\norganization_id: The organization ID to create the user in. Omit this unless you are a coghealth admin.\n\nrole: The role of the user to create. One of `coghealth_admin`, `organization_admin`, or `api_user`.", "properties": {"username": {"maxLength": 150, "minLength": 3, "title": "Username", "type": "string"}, "email": {"maxLength": 255, "minLength": 3, "title": "Email", "type": "string"}, "organization_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Organization Id"}, "role": {"$ref": "#/components/schemas/CoghealthUserRole"}}, "required": ["username", "email", "role"], "title": "CreateUserRequest", "type": "object"}, "Input": {"properties": {"limit": {"default": 100, "minimum": 1, "title": "Limit", "type": "integer"}, "offset": {"default": 0, "minimum": 0, "title": "Offset", "type": "integer"}}, "title": "Input", "type": "object"}, "UserFilter": {"properties": {"username": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Username"}, "email": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Email"}, "organization_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Organization Id"}}, "title": "UserFilter", "type": "object"}, "GetUserData": {"properties": {"username": {"title": "Username", "type": "string"}, "email": {"title": "Email", "type": "string"}, "date_joined": {"format": "date-time", "title": "Date Joined", "type": "string"}, "last_login": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "title": "Last Login"}, "organization_id": {"format": "uuid", "title": "Organization Id", "type": "string"}, "projects": {"items": {"$ref": "#/components/schemas/ProjectMembershipData"}, "title": "Projects", "type": "array"}}, "required": ["username", "email", "date_joined", "last_login", "organization_id", "projects"], "title": "GetUserData", "type": "object"}, "PagedGetUserData": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"title": "Ok", "type": "boolean"}, "data": {"items": {"$ref": "#/components/schemas/GetUserData"}, "title": "Data", "type": "array"}, "total": {"title": "Total", "type": "integer"}, "per_page": {"title": "Per Page", "type": "integer"}}, "required": ["status_code", "ok", "data", "total", "per_page"], "title": "PagedGetUserData", "type": "object"}, "ProjectMembershipData": {"description": "Project membership data.\n\nproject_id: The ID of the project that the user is a member of.\n\nrole: The role of the user in the project. One of `member` or `admin`.", "properties": {"project_id": {"format": "uuid", "title": "Project Id", "type": "string"}, "role": {"title": "Role", "type": "string"}}, "required": ["project_id", "role"], "title": "ProjectMembershipData", "type": "object"}, "SuccessDetailResponse_GetUserData_": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/GetUserData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessDetailResponse[GetUserData]", "type": "object"}, "SuccessCreateResponse_GetUserData_": {"properties": {"status_code": {"const": 201, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/GetUserData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessCreateResponse[GetUserData]", "type": "object"}, "AddUserToProjectRequest": {"description": "Add user to project request data.\n\nproject_id: The ID of the project to add the user to.\n\nrole: The role of the user in the project. One of `admin` or `member`.", "properties": {"project_id": {"format": "uuid", "title": "Project Id", "type": "string"}, "role": {"enum": ["admin", "member"], "title": "Role", "type": "string"}}, "required": ["project_id", "role"], "title": "AddUserToProjectRequest", "type": "object"}, "CreateOrganizationData": {"description": "Create organization response data.\n\nid: The ID of the organization that was created.\n\nname: The name of the organization that was created.\n\ndefault_project_connect_config_key: The default connect config key used for new projects.\n\ncreated_at: When the organization record was created.", "properties": {"id": {"format": "uuid", "title": "Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "created_at": {"format": "date-time", "title": "Created At", "type": "string"}}, "required": ["id", "name", "created_at"], "title": "CreateOrganizationData", "type": "object"}, "SuccessCreateResponse_CreateOrganizationData_": {"properties": {"status_code": {"const": 201, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/CreateOrganizationData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessCreateResponse[CreateOrganizationData]", "type": "object"}, "CreateOrganizationRequest": {"description": "Create organization request data.\n\nname: The name of the organization to create.\ndefault_project_connect_config_key: Default connect config key to use for new projects in this organization.", "properties": {"name": {"maxLength": 255, "minLength": 3, "title": "Name", "type": "string"}, "default_project_connect_config_key": {"maxLength": 255, "minLength": 1, "title": "Default Project Connect Config Key", "type": "string"}}, "required": ["name", "default_project_connect_config_key"], "title": "CreateOrganizationRequest", "type": "object"}, "OrganizationFilter": {"properties": {"id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Id"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}}, "title": "OrganizationFilter", "type": "object"}, "GetOrganizationData": {"description": "Get organization response data.\n\nid: The ID of the organization.\n\nname: The name of the organization.\n\ndefault_project_connect_config_key: The default connect config key used for new projects.\n\ncreated_at: When the organization record was created.", "properties": {"id": {"format": "uuid", "title": "Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "created_at": {"format": "date-time", "title": "Created At", "type": "string"}}, "required": ["id", "name", "created_at"], "title": "GetOrganizationData", "type": "object"}, "PagedGetOrganizationData": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"title": "Ok", "type": "boolean"}, "data": {"items": {"$ref": "#/components/schemas/GetOrganizationData"}, "title": "Data", "type": "array"}, "total": {"title": "Total", "type": "integer"}, "per_page": {"title": "Per Page", "type": "integer"}}, "required": ["status_code", "ok", "data", "total", "per_page"], "title": "PagedGetOrganizationData", "type": "object"}, "SuccessDetailResponse_GetOrganizationData_": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/GetOrganizationData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessDetailResponse[GetOrganizationData]", "type": "object"}, "UpdateOrganizationRequest": {"description": "Update organization request data.\n\nname: The name of the organization to update.\n\ndefault_project_connect_config_key: The default connect config key used for new projects.", "properties": {"name": {"anyOf": [{"maxLength": 255, "minLength": 3, "type": "string"}, {"type": "null"}], "title": "Name"}, "default_project_connect_config_key": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "title": "Default Project Connect Config Key"}}, "title": "UpdateOrganizationRequest", "type": "object"}, "CreateProjectData": {"description": "Create project response data.\n\nid: The ID of the project that was created.\n\nname: The name of the project that was created.\n\norganization_id: The ID of the organization that the project was created in.\n\ncreated_at: When the project record was created.\n\nproject_type: The type of the project.", "properties": {"id": {"format": "uuid", "title": "Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "organization_id": {"format": "uuid", "title": "Organization Id", "type": "string"}, "created_at": {"format": "date-time", "title": "Created At", "type": "string"}, "project_type": {"enum": ["test", "active"], "title": "Project Type", "type": "string"}, "default_report_variant_key": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Report Variant Key"}}, "required": ["id", "name", "organization_id", "created_at", "project_type"], "title": "CreateProjectData", "type": "object"}, "SuccessCreateResponse_CreateProjectData_": {"properties": {"status_code": {"const": 201, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/CreateProjectData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessCreateResponse[CreateProjectData]", "type": "object"}, "CreateProjectRequest": {"description": "Create project request data.\n\nname: The name of the project to create.\n\nwebhook_url: The webhook URL for the project.\n\nwebhook_secret: The webhook secret for the project.\n\norganization_id: The organization ID to create the project in.\n\nconnect_config_key: Optional connect config key to use instead of the organization's default. Requires identity.override_connect_config.\n\nproject_type: The type of project being created.", "properties": {"name": {"maxLength": 255, "minLength": 3, "title": "Name", "type": "string"}, "webhook_url": {"maxLength": 1024, "minLength": 3, "title": "Webhook Url", "type": "string"}, "webhook_secret": {"maxLength": 1024, "minLength": 3, "title": "Webhook Secret", "type": "string"}, "organization_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Organization Id"}, "project_type": {"enum": ["test", "active"], "title": "Project Type", "type": "string"}}, "required": ["name", "webhook_url", "webhook_secret", "project_type"], "title": "CreateProjectRequest", "type": "object"}, "ProjectFilter": {"properties": {"id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Id"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "organization_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Organization Id"}}, "title": "ProjectFilter", "type": "object"}, "GetProjectData": {"description": "Get project response data.\n\nid: The ID of the project.\n\nname: The name of the project.\n\norganization_id: The ID of the organization that the project is in.\n\nwebhook_url: The webhook URL for the project.\n\ncreated_at: When the project record was created.\n\nproject_type: The type of the project.", "properties": {"id": {"format": "uuid", "title": "Id", "type": "string"}, "name": {"title": "Name", "type": "string"}, "organization_id": {"format": "uuid", "title": "Organization Id", "type": "string"}, "webhook_url": {"title": "Webhook Url", "type": "string"}, "created_at": {"format": "date-time", "title": "Created At", "type": "string"}, "project_type": {"enum": ["test", "active"], "title": "Project Type", "type": "string"}, "default_report_variant_key": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Report Variant Key"}}, "required": ["id", "name", "organization_id", "webhook_url", "created_at", "project_type"], "title": "GetProjectData", "type": "object"}, "PagedGetProjectData": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"title": "Ok", "type": "boolean"}, "data": {"items": {"$ref": "#/components/schemas/GetProjectData"}, "title": "Data", "type": "array"}, "total": {"title": "Total", "type": "integer"}, "per_page": {"title": "Per Page", "type": "integer"}}, "required": ["status_code", "ok", "data", "total", "per_page"], "title": "PagedGetProjectData", "type": "object"}, "SuccessDetailResponse_GetProjectData_": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/GetProjectData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessDetailResponse[GetProjectData]", "type": "object"}, "UpdateProjectRequest": {"description": "Update project request data.", "properties": {"name": {"anyOf": [{"maxLength": 255, "minLength": 3, "type": "string"}, {"type": "null"}], "title": "Name"}, "webhook_url": {"anyOf": [{"maxLength": 1024, "minLength": 3, "type": "string"}, {"type": "null"}], "title": "Webhook Url"}, "webhook_secret": {"anyOf": [{"maxLength": 1024, "minLength": 3, "type": "string"}, {"type": "null"}], "title": "Webhook Secret"}, "default_report_variant_key": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Default Report Variant Key"}}, "title": "UpdateProjectRequest", "type": "object"}, "Gender": {"enum": ["male", "female", "unspecified"], "title": "Gender", "type": "string"}, "LevelOfEducation": {"enum": ["left_before_age_16", "left_at_age_16", "left_at_age_17_18", "undergraduate_or_equivalent", "masters_or_equivalent", "phd_or_equivalent"], "title": "LevelOfEducation", "type": "string"}, "SubjectData": {"description": "Subject response data.\n\nid: The ID of the subject.\n\nproject_id: The ID of the project that the subject is in.\n\nexternal_id: The external ID of the subject.\n\ndate_of birth: The date of birth of the subject. (YYYY-MM-DD)\n\ngender_at_birth: The gender of the subject at birth. (One of `male`, `female`, or `unspecified`)\n\nlevel_of_education: The level of education of the subject. See the `level_of_education` enum below for possible values.\n\nlocale: The locale of the subject.\n\ncreated_at: When the subject record was created.", "properties": {"id": {"format": "uuid", "title": "Id", "type": "string"}, "project_id": {"format": "uuid", "title": "Project Id", "type": "string"}, "external_id": {"title": "External Id", "type": "string"}, "date_of_birth": {"format": "date", "title": "Date Of Birth", "type": "string"}, "gender_at_birth": {"$ref": "#/components/schemas/Gender"}, "level_of_education": {"$ref": "#/components/schemas/LevelOfEducation"}, "locale": {"title": "Locale", "type": "string"}, "meta": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Meta"}, "created_at": {"format": "date-time", "title": "Created At", "type": "string"}}, "required": ["id", "project_id", "external_id", "date_of_birth", "gender_at_birth", "level_of_education", "locale", "created_at"], "title": "SubjectData", "type": "object"}, "SuccessCreateResponse_SubjectData_": {"properties": {"status_code": {"const": 201, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/SubjectData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessCreateResponse[SubjectData]", "type": "object"}, "CreateSubjectRequest": {"description": "Create subject request data.\n\nproject_id: The ID of the project to create the subject in.\n\nexternal_id: The external ID of the subject.\n\ndate_of_birth: The date of birth of the subject. (YYYY-MM-DD) Must imply an age\n    from 18 through 91 years inclusive on the current date for CANTAB norms.\n\ngender_at_birth: The gender of the subject at birth. (One of `male`, `female`, or `unspecified`)\n\nlevel_of_education: The level of education of the subject. See the `level_of_education` enum below for possible values.\n\nlocale: The locale of the subject.", "properties": {"project_id": {"format": "uuid", "title": "Project Id", "type": "string"}, "external_id": {"maxLength": 255, "minLength": 3, "title": "External Id", "type": "string"}, "date_of_birth": {"format": "date", "title": "Date Of Birth", "type": "string"}, "gender_at_birth": {"$ref": "#/components/schemas/Gender"}, "level_of_education": {"$ref": "#/components/schemas/LevelOfEducation"}, "locale": {"maxLength": 255, "minLength": 1, "title": "Locale", "type": "string"}, "meta": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Meta"}}, "required": ["project_id", "external_id", "date_of_birth", "gender_at_birth", "level_of_education", "locale"], "title": "CreateSubjectRequest", "type": "object"}, "SubjectFilter": {"properties": {"id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Id"}, "project_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Project Id"}, "external_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "External Id"}, "locale": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Locale"}, "meta": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Meta"}}, "title": "SubjectFilter", "type": "object"}, "PagedSubjectData": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"title": "Ok", "type": "boolean"}, "data": {"items": {"$ref": "#/components/schemas/SubjectData"}, "title": "Data", "type": "array"}, "total": {"title": "Total", "type": "integer"}, "per_page": {"title": "Per Page", "type": "integer"}}, "required": ["status_code", "ok", "data", "total", "per_page"], "title": "PagedSubjectData", "type": "object"}, "SuccessDetailResponse_SubjectData_": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/SubjectData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessDetailResponse[SubjectData]", "type": "object"}, "UpdateSubjectRequest": {"description": "Update subject request data.\n\nAny combination of the fields can be provided. At least one field is required.\n\ndate_of_birth: When set, must imply an age from 18 through 91 years inclusive\non the current date for CANTAB norms.", "properties": {"external_id": {"anyOf": [{"maxLength": 255, "minLength": 3, "type": "string"}, {"type": "null"}], "title": "External Id"}, "date_of_birth": {"anyOf": [{"format": "date", "type": "string"}, {"type": "null"}], "title": "Date Of Birth"}, "gender_at_birth": {"anyOf": [{"$ref": "#/components/schemas/Gender"}, {"type": "null"}]}, "level_of_education": {"anyOf": [{"$ref": "#/components/schemas/LevelOfEducation"}, {"type": "null"}]}, "locale": {"anyOf": [{"maxLength": 255, "minLength": 1, "type": "string"}, {"type": "null"}], "title": "Locale"}, "meta": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Meta"}}, "title": "UpdateSubjectRequest", "type": "object"}, "AssessmentStatus": {"description": "Assessments go through these states:\n- In Progress: The assessment is in progress.\n- Completed: The assessment has been completed.\n- Report Ready: The report has been generated for the completed assessment and can be downloaded.\n- Failed: The assessment has failed.", "enum": ["in_progress", "completed", "report_ready", "failed"], "title": "AssessmentStatus", "type": "string"}, "CantabOneVariantData": {"properties": {"instructions_mode": {"enum": ["required", "optional", "none"], "title": "Instructions Mode", "type": "string"}}, "required": ["instructions_mode"], "title": "CantabOneVariantData", "type": "object"}, "MeasureData": {"description": "Measure data.\n\ncode: The measure code. e.g. DSTTC\n\nvalue: The value of the measure, rounded to the correct number of significant digits.\n\nnorms: The norms of the measure.", "properties": {"code": {"title": "Code", "type": "string"}, "value": {"pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Value", "type": "string"}, "norms": {"$ref": "#/components/schemas/NormsData"}}, "required": ["code", "value", "norms"], "title": "MeasureData", "type": "object"}, "NormsData": {"description": "Norms data.\n\npercentile: The percentile of the measure.\n\npercentile_min: The minimum percentile of the measure.\n\npercentile_max: The maximum percentile of the measure.\n\npercentile_median: The median percentile of the measure.\n\nz_score: The z-score of the measure.", "properties": {"percentile": {"title": "Percentile", "type": "integer"}, "percentile_min": {"title": "Percentile Min", "type": "integer"}, "percentile_max": {"title": "Percentile Max", "type": "integer"}, "percentile_median": {"title": "Percentile Median", "type": "integer"}, "z_score": {"pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "title": "Z Score", "type": "string"}}, "required": ["percentile", "percentile_min", "percentile_max", "percentile_median", "z_score"], "title": "NormsData", "type": "object"}, "SubjectAssessmentData": {"description": "Subject assessment data.\n\nid: The ID of the assessment.\n\nsubject_id: The ID of the subject that the assessment is for.\n\nexternal_id: The external ID of the assessment.\n\nassessment_type: The type of assessment. (e.g. \"cantab-one\")\n\nweb_assessment_url: The wrapped Pathway URL to the web-based subject assessment.\n\ncreated_at: The date and time the assessment was created.\n\nexpires_at: The latest time by which the subject should complete the assessment\n(set at creation from ``ASSESSMENT_EXPIRATION_DAYS``).", "properties": {"id": {"format": "uuid", "title": "Id", "type": "string"}, "subject_id": {"format": "uuid", "title": "Subject Id", "type": "string"}, "external_id": {"title": "External Id", "type": "string"}, "assessment_type": {"title": "Assessment Type", "type": "string"}, "web_assessment_url": {"title": "Web Assessment Url", "type": "string"}, "created_at": {"format": "date-time", "title": "Created At", "type": "string"}, "expires_at": {"format": "date-time", "title": "Expires At", "type": "string"}, "status": {"$ref": "#/components/schemas/AssessmentStatus"}, "started_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "title": "Started At"}, "completed_at": {"anyOf": [{"format": "date-time", "type": "string"}, {"type": "null"}], "title": "Completed At"}, "failure_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Failure Reason"}, "report_variant_key": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Report Variant Key"}, "measures": {"anyOf": [{"items": {"$ref": "#/components/schemas/MeasureData"}, "type": "array"}, {"type": "null"}], "title": "Measures"}, "meta": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Meta"}, "variant": {"anyOf": [{"$ref": "#/components/schemas/CantabOneVariantData"}, {"type": "null"}]}}, "required": ["id", "subject_id", "external_id", "assessment_type", "web_assessment_url", "created_at", "expires_at", "status"], "title": "SubjectAssessmentData", "type": "object"}, "SuccessCreateResponse_SubjectAssessmentData_": {"properties": {"status_code": {"const": 201, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/SubjectAssessmentData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessCreateResponse[SubjectAssessmentData]", "type": "object"}, "CantabOneVariantRequest": {"description": "CANTAB One instruction mode when opening the wrapped assessment URL.", "properties": {"instructions_mode": {"enum": ["required", "optional", "none"], "title": "Instructions Mode", "type": "string"}}, "required": ["instructions_mode"], "title": "CantabOneVariantRequest", "type": "object"}, "CreateSubjectAssessmentRequest": {"description": "Create subject assessment request data.\n\nsubject_id: The ID of the subject to create the assessment for.\n\nexternal_id: The external ID of the assessment.\n\nassessment_type: The type of assessment to create.", "properties": {"subject_id": {"format": "uuid", "title": "Subject Id", "type": "string"}, "external_id": {"maxLength": 255, "minLength": 3, "title": "External Id", "type": "string"}, "assessment_type": {"title": "Assessment Type", "type": "string"}, "report_variant_key": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Report Variant Key"}, "meta": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Meta"}, "variant": {"anyOf": [{"$ref": "#/components/schemas/CantabOneVariantRequest"}, {"type": "null"}]}}, "required": ["subject_id", "external_id", "assessment_type"], "title": "CreateSubjectAssessmentRequest", "type": "object"}, "SubjectAssessmentFilter": {"properties": {"id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Id"}, "subject_id": {"anyOf": [{"format": "uuid", "type": "string"}, {"type": "null"}], "title": "Subject Id"}, "external_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "External Id"}, "assessment_type": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Assessment Type"}, "status": {"anyOf": [{"$ref": "#/components/schemas/AssessmentStatus"}, {"type": "null"}]}, "failure_reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Failure Reason"}, "meta": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Meta"}}, "title": "SubjectAssessmentFilter", "type": "object"}, "PagedSubjectAssessmentData": {"properties": {"items": {"items": {"$ref": "#/components/schemas/SubjectAssessmentData"}, "title": "Items", "type": "array"}, "count": {"title": "Count", "type": "integer"}}, "required": ["items", "count"], "title": "PagedSubjectAssessmentData", "type": "object"}, "SuccessDetailResponse_SubjectAssessmentData_": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/SubjectAssessmentData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessDetailResponse[SubjectAssessmentData]", "type": "object"}, "RunAssessmentTrickRequest": {"description": "Action to perform on the assessment.", "properties": {"action": {"description": "Requested trick action", "enum": ["complete_assessment_high", "complete_assessment_low", "complete_assessment_mixed", "create_report", "expire_assessment", "fail_assessment"], "title": "Action", "type": "string"}}, "required": ["action"], "title": "RunAssessmentTrickRequest", "type": "object"}, "ReportVariantData": {"description": "Report variant response data.\n\nkey: The unique key for this report variant.\n\nlogo_filename: The original filename of the uploaded logo, or empty string if none.", "properties": {"key": {"title": "Key", "type": "string"}, "logo_filename": {"title": "Logo Filename", "type": "string"}}, "required": ["key", "logo_filename"], "title": "ReportVariantData", "type": "object"}, "SuccessCreateResponse_ReportVariantData_": {"properties": {"status_code": {"const": 201, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/ReportVariantData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessCreateResponse[ReportVariantData]", "type": "object"}, "CreateReportVariantRequest": {"description": "Create report variant request.\n\nkey: A unique key identifying this report variant within the project.", "properties": {"key": {"title": "Key", "type": "string"}}, "required": ["key"], "title": "CreateReportVariantRequest", "type": "object"}, "PagedReportVariantData": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"title": "Ok", "type": "boolean"}, "data": {"items": {"$ref": "#/components/schemas/ReportVariantData"}, "title": "Data", "type": "array"}, "total": {"title": "Total", "type": "integer"}, "per_page": {"title": "Per Page", "type": "integer"}}, "required": ["status_code", "ok", "data", "total", "per_page"], "title": "PagedReportVariantData", "type": "object"}, "DeleteSuccessResponse": {"properties": {"status_code": {"default": 200, "title": "Status Code", "type": "integer"}, "ok": {"default": true, "title": "Ok", "type": "boolean"}}, "title": "DeleteSuccessResponse", "type": "object"}, "SuccessDetailResponse_ReportVariantData_": {"properties": {"status_code": {"const": 200, "title": "Status Code", "type": "integer"}, "ok": {"const": true, "title": "Ok", "type": "boolean"}, "data": {"$ref": "#/components/schemas/ReportVariantData"}}, "required": ["status_code", "ok", "data"], "title": "SuccessDetailResponse[ReportVariantData]", "type": "object"}}, "securitySchemes": {"BasicAuth": {"type": "http", "scheme": "basic"}, "BearerAuth": {"type": "http", "scheme": "bearer"}}}, "servers": []}