{"openapi":"3.1.0","info":{"title":"Math API","version":"1.0.0","description":"Explore every supported Math operation, with input fields, response schemas, and examples. All data and mutation endpoints require an API key.\n\nNew here? Start with the [quickstart](/docs/quickstart), [authentication](/docs/authentication), or [roles and scopes](/docs/permissions). For safe writes and file transfers, see the [review workflow](/docs/guides/workflow) and [reports guide](/docs/guides/files).\n\nSelect **Authentication** and enter your key without the Bearer prefix. Credentials stay in page memory. **The request tester calls the live API; successful writes change real data.** Examples are synthetic. See [data coverage](/docs/data-coverage) for the current dashboard integration boundary.\n"},"servers":[{"url":"https://math-api.qmindlabs.ai","description":"Main Math API"}],"security":[{"ApiKey":[]}],"tags":[{"name":"Authentication","description":"Check your authenticated identity and scopes."},{"name":"Seeds & topics","description":"Find imported topics and their tasks."},{"name":"Tasks & review","description":"Read, assign and review tasks with version checks."},{"name":"Research & reports","description":"Read reports, verified evidence and storage locations."},{"name":"Attachments","description":"Upload and download supplementary task files."},{"name":"Monitoring","description":"Inspect imported data, activity and review analytics."},{"name":"Clients & members","description":"Organize clients and inspect permitted members."},{"name":"API keys","description":"Issue, inspect and revoke scoped keys."},{"name":"Bug reports","description":"Submit issues and optional screenshots."},{"name":"Dashboard compatibility","description":"Alternate routes retained for dashboard clients."}],"paths":{"/api/auth/session":{"get":{"tags":["Authentication"],"summary":"Inspect your API identity","operationId":"get__api_auth_session","description":"**Required scope:** `read`. **Roles:** Reviewer, Owner, Admin.\n\nReturns the effective member role and API-key scopes. Internal environment names retain dev; this is the main Math deployment.","x-required-scopes":["read"],"parameters":[],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"},"example":{"schema_version":"dashboard-auth-v2","admin_provisioned":true,"user":{"id":42,"username":"example_member","email":null,"email_verified":false,"display_name":"Example member","role":"REVIEWER","is_admin":false,"is_primary_admin":false,"enabled":true,"must_change_password":false,"last_login_at":null,"authenticated_role":"REVIEWER","active_role":"REVIEWER","can_switch_role":false,"viewing_user":null,"identity_id":"example-identity","api_key":{"id":"bbbbbbbbbbbbbbbbbbbbbbbb","name":"example","scopes":["read"]},"workspace":{"id":"ws_math","slug":"math","label":"Math","environment":"dev"}}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/seeds":{"get":{"tags":["Seeds & topics"],"summary":"List visible seeds","operationId":"get__api_math_seeds","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nGroups imported tasks by source question ID. Counts and search results are restricted to your visible tasks.","x-required-scopes":["read"],"parameters":[{"name":"page","in":"query","required":false,"description":"One-based page number.","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"page_size","in":"query","required":false,"description":"Maximum number of items returned.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"q","in":"query","required":false,"description":"Case-insensitive literal substring search; percent and underscore are treated literally.","schema":{"type":"string","maxLength":250}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Seeds"},"example":{"seeds":[{"question_id":"math-example-topic","title":"Elementary number theory","task_count":1,"run_count":1,"last_imported_at":"2026-09-22T12:00:00.000Z","unassigned":1,"assigned":0,"in_review":0,"reviewed":0,"archived":0,"source_status":"COMPLETED","tasks_url":"/w/math/api/math/seeds/math-example-topic/tasks"}],"total":1,"page":1,"page_size":25}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/seeds/{question_id}":{"get":{"tags":["Seeds & topics"],"summary":"Get a seed summary","operationId":"get__api_math_seeds_question_id_","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\n","x-required-scopes":["read"],"parameters":[{"name":"question_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","maxLength":250,"example":"math-example-topic"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedDetail"},"example":{"seed":{"question_id":"math-example-topic","title":"Elementary number theory","task_count":1,"run_count":1,"last_imported_at":"2026-09-22T12:00:00.000Z","unassigned":1,"assigned":0,"in_review":0,"reviewed":0,"archived":0,"source_status":"COMPLETED","tasks_url":"/w/math/api/math/seeds/math-example-topic/tasks"}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/seeds/{question_id}/tasks":{"get":{"tags":["Seeds & topics"],"summary":"List tasks for a seed","operationId":"get__api_math_seeds_question_id_tasks","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nThe path fixes the question ID. All other task filters apply. Includes archived tasks by default.","x-required-scopes":["read"],"parameters":[{"name":"question_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","maxLength":250,"example":"math-example-topic"}},{"name":"page","in":"query","required":false,"description":"One-based page number.","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"page_size","in":"query","required":false,"description":"Maximum number of items returned.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"q","in":"query","required":false,"description":"Case-insensitive literal substring search; percent and underscore are treated literally.","schema":{"type":"string","maxLength":250}},{"name":"surface","in":"query","required":false,"description":"all includes archived tasks; archive returns only archived tasks; release returns current accepted reports. Other surfaces exclude archived tasks.","schema":{"type":"string","enum":["all","evaluations","review","clients","release","archive"],"default":"all"}},{"name":"review_state","in":"query","required":false,"description":"Filter by review state. UNREVIEWED means any state except REVIEWED.","schema":{"type":"string","enum":["UNASSIGNED","ASSIGNED","IN_REVIEW","REVIEWED","UNREVIEWED"]}},{"name":"decision","in":"query","required":false,"description":"Filter by decision.","schema":{"type":"string","enum":["PENDING","READY_AS_IS","MINOR_REPAIR","MAJOR_REPAIR","REJECTED"]}},{"name":"reviewer_id","in":"query","required":false,"description":"Member ID, or unassigned.","schema":{"type":"string","pattern":"^(unassigned|[1-9][0-9]*)$"}},{"name":"client_id","in":"query","required":false,"description":"Client ID, or unassigned.","schema":{"type":"string","pattern":"^(unassigned|[1-9][0-9]*)$"}},{"name":"run_id","in":"query","required":false,"description":"Exact imported run identifier.","schema":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"}},{"name":"sort","in":"query","required":false,"description":"Most recently updated, oldest updated, or alphabetical topic order. Ties have stable ordering.","schema":{"type":"string","enum":["updated","oldest","topic"],"default":"updated"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"},"example":{"tasks":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"}],"total":1,"page":1,"page_size":25,"counts":{"all":1,"unassigned":1,"in_review":0,"reviewed":0,"archived":0},"reviewers":[{"id":42,"display_name":"Example reviewer"}],"clients":[{"id":42,"name":"Example client","enabled":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/tasks":{"get":{"tags":["Tasks & review"],"summary":"List tasks","operationId":"get__api_math_tasks","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nIncludes archived tasks by default. Counts describe the filtered result, not just the current page. Reviewers see only tasks currently assigned to them.","x-required-scopes":["read"],"parameters":[{"name":"page","in":"query","required":false,"description":"One-based page number.","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"page_size","in":"query","required":false,"description":"Maximum number of items returned.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"q","in":"query","required":false,"description":"Case-insensitive literal substring search; percent and underscore are treated literally.","schema":{"type":"string","maxLength":250}},{"name":"surface","in":"query","required":false,"description":"all includes archived tasks; archive returns only archived tasks; release returns current accepted reports. Other surfaces exclude archived tasks.","schema":{"type":"string","enum":["all","evaluations","review","clients","release","archive"],"default":"all"}},{"name":"review_state","in":"query","required":false,"description":"Filter by review state. UNREVIEWED means any state except REVIEWED.","schema":{"type":"string","enum":["UNASSIGNED","ASSIGNED","IN_REVIEW","REVIEWED","UNREVIEWED"]}},{"name":"decision","in":"query","required":false,"description":"Filter by decision.","schema":{"type":"string","enum":["PENDING","READY_AS_IS","MINOR_REPAIR","MAJOR_REPAIR","REJECTED"]}},{"name":"reviewer_id","in":"query","required":false,"description":"Member ID, or unassigned.","schema":{"type":"string","pattern":"^(unassigned|[1-9][0-9]*)$"}},{"name":"client_id","in":"query","required":false,"description":"Client ID, or unassigned.","schema":{"type":"string","pattern":"^(unassigned|[1-9][0-9]*)$"}},{"name":"question_id","in":"query","required":false,"description":"Exact source topic/seed identifier.","schema":{"type":"string","maxLength":250,"example":"math-example-topic"}},{"name":"run_id","in":"query","required":false,"description":"Exact imported run identifier.","schema":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"}},{"name":"sort","in":"query","required":false,"description":"Most recently updated, oldest updated, or alphabetical topic order. Ties have stable ordering.","schema":{"type":"string","enum":["updated","oldest","topic"],"default":"updated"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"},"example":{"tasks":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"}],"total":1,"page":1,"page_size":25,"counts":{"all":1,"unassigned":1,"in_review":0,"reviewed":0,"archived":0},"reviewers":[{"id":42,"display_name":"Example reviewer"}],"clients":[{"id":42,"name":"Example client","enabled":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/tasks/{task_id}":{"get":{"tags":["Tasks & review"],"summary":"Get task research details","operationId":"get__api_math_tasks_task_id_","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nReturns the imported problem, report mapping and a compact workflow summary. Use the /workflow endpoint for version, assignment and history.","x-required-scopes":["read"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchDetail"},"example":{"schema_version":"math-task-reports-v1","task":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","ordinal":1,"title":"A sample mathematical proposition","run_id":"11111111-2222-4333-8444-555555555555","question_id":"math-example-topic","parent_title":"Elementary number theory","status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"report_download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download","result_id":"example-result","pass_rate":null,"model":null,"workflow":{"task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","review_state":"UNASSIGNED","decision":"PENDING","archived":0},"problem":"Prove or disprove the stated proposition.","problem_sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}},"post":{"tags":["Tasks & review"],"summary":"Apply a workflow action","operationId":"post__api_math_tasks_task_id_","description":"**Required scope:** `write`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nRead the current version first. Each success increments it and returns the updated task/history. Reviewers may start, add feedback or submit a verdict on assigned tasks. Other actions require Owner/Admin. feedback, verdict and reopen require a nonblank comment. Assign/client accept null to clear the assignment. Restore an archived task before other changes. Reopen a completed review before reassignment or another verdict. Feedback moves ASSIGNED tasks to IN_REVIEW. A stale version returns 409; reread before retrying. Examples use synthetic IDs and versions.","x-required-scopes":["write"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDetail"},"example":{"task":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"},"history":[{"id":"task:1","action":"example","actor_name":null,"comment":"example","created_at":"2026-09-22T12:00:00.000Z","changes":[{"field":"example","before":null,"after":null}]}],"reviewers":[{"id":42,"display_name":"Example reviewer"}],"clients":[{"id":42,"name":"Example client","enabled":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowAction"},"examples":{"assign":{"summary":"Assign a reviewer (Owner/Admin)","value":{"action":"assign","version":1,"reviewer_id":42}},"start":{"summary":"Start an assigned review","value":{"action":"start","version":2}},"feedback":{"summary":"Add feedback","value":{"action":"feedback","version":3,"comment":"Clarify the final proof step."}},"verdict":{"summary":"Record a decision","value":{"action":"verdict","version":4,"decision":"MINOR_REPAIR","comment":"The final proof step needs clarification."}},"archive":{"summary":"Archive (Owner/Admin)","value":{"action":"archive","version":5}},"restore":{"summary":"Restore (Owner/Admin)","value":{"action":"restore","version":6}},"client":{"summary":"Assign a client (Owner/Admin)","value":{"action":"client","version":7,"client_id":42}},"reopen":{"summary":"Reopen a completed review (Owner/Admin)","value":{"action":"reopen","version":8,"comment":"New evidence requires another review."}}}}}}}},"/api/math/tasks/{task_id}/workflow":{"get":{"tags":["Tasks & review"],"summary":"Get task workflow and history","operationId":"get__api_math_tasks_task_id_workflow","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nReturns the current version, assignment, decision, allowed reviewer/client choices, and latest 200 events.","x-required-scopes":["read"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDetail"},"example":{"task":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"},"history":[{"id":"task:1","action":"example","actor_name":null,"comment":"example","created_at":"2026-09-22T12:00:00.000Z","changes":[{"field":"example","before":null,"after":null}]}],"reviewers":[{"id":42,"display_name":"Example reviewer"}],"clients":[{"id":42,"name":"Example client","enabled":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}},"post":{"tags":["Dashboard compatibility"],"summary":"Apply a workflow action through the detail route","operationId":"post__api_math_tasks_task_id_workflow","description":"**Required scope:** `write`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nAlias of POST /api/math/tasks/{task_id}. Read the current version first. Each success increments it and returns the updated task/history. Reviewers may start, add feedback or submit a verdict on assigned tasks. Other actions require Owner/Admin. feedback, verdict and reopen require a nonblank comment. Assign/client accept null to clear the assignment. Restore an archived task before other changes. Reopen a completed review before reassignment or another verdict. Feedback moves ASSIGNED tasks to IN_REVIEW. A stale version returns 409; reread before retrying. Examples use synthetic IDs and versions.","x-required-scopes":["write"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDetail"},"example":{"task":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"},"history":[{"id":"task:1","action":"example","actor_name":null,"comment":"example","created_at":"2026-09-22T12:00:00.000Z","changes":[{"field":"example","before":null,"after":null}]}],"reviewers":[{"id":42,"display_name":"Example reviewer"}],"clients":[{"id":42,"name":"Example client","enabled":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowAction"},"examples":{"assign":{"summary":"Assign a reviewer (Owner/Admin)","value":{"action":"assign","version":1,"reviewer_id":42}},"start":{"summary":"Start an assigned review","value":{"action":"start","version":2}},"feedback":{"summary":"Add feedback","value":{"action":"feedback","version":3,"comment":"Clarify the final proof step."}},"verdict":{"summary":"Record a decision","value":{"action":"verdict","version":4,"decision":"MINOR_REPAIR","comment":"The final proof step needs clarification."}},"archive":{"summary":"Archive (Owner/Admin)","value":{"action":"archive","version":5}},"restore":{"summary":"Restore (Owner/Admin)","value":{"action":"restore","version":6}},"client":{"summary":"Assign a client (Owner/Admin)","value":{"action":"client","version":7,"client_id":42}},"reopen":{"summary":"Reopen a completed review (Owner/Admin)","value":{"action":"reopen","version":8,"comment":"New evidence requires another review."}}}}}}}},"/api/math/tasks/{task_id}/notes":{"get":{"tags":["Tasks & review"],"summary":"List task notes","operationId":"get__api_math_tasks_task_id_notes","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nNonempty comments from workflow events, newest version first. No total is returned; a short page marks the end.","x-required-scopes":["read"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}},{"name":"page","in":"query","required":false,"description":"One-based page number.","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"page_size","in":"query","required":false,"description":"Maximum number of items returned.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notes"},"example":{"task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","page":42,"page_size":42,"notes":[{"id":42,"version":42,"action":"example","actor_id":null,"actor_name":null,"comment":"example","created_at":"2026-09-22T12:00:00.000Z"}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}},"post":{"tags":["Tasks & review"],"summary":"Add a task note","operationId":"post__api_math_tasks_task_id_notes","description":"**Required scope:** `write`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nUses the feedback workflow action and increments the version. Can move an ASSIGNED task to IN_REVIEW. Returns full workflow detail rather than a standalone note.","x-required-scopes":["write"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDetail"},"example":{"task":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"},"history":[{"id":"task:1","action":"example","actor_name":null,"comment":"example","created_at":"2026-09-22T12:00:00.000Z","changes":[{"field":"example","before":null,"after":null}]}],"reviewers":[{"id":42,"display_name":"Example reviewer"}],"clients":[{"id":42,"name":"Example client","enabled":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteCreate"},"example":{"version":1,"comment":"Please clarify the final proof step."}}}}}},"/api/math/workflow":{"get":{"tags":["Dashboard compatibility"],"summary":"List dashboard workflow tasks","operationId":"get__api_math_workflow","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nSame response and filters as /api/math/tasks, but defaults to the evaluations surface (archived tasks excluded).","x-required-scopes":["read"],"parameters":[{"name":"page","in":"query","required":false,"description":"One-based page number.","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"page_size","in":"query","required":false,"description":"Maximum number of items returned.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"q","in":"query","required":false,"description":"Case-insensitive literal substring search; percent and underscore are treated literally.","schema":{"type":"string","maxLength":250}},{"name":"surface","in":"query","required":false,"description":"all includes archived tasks; archive returns only archived tasks; release returns current accepted reports. Other surfaces exclude archived tasks.","schema":{"type":"string","enum":["all","evaluations","review","clients","release","archive"],"default":"evaluations"}},{"name":"review_state","in":"query","required":false,"description":"Filter by review state. UNREVIEWED means any state except REVIEWED.","schema":{"type":"string","enum":["UNASSIGNED","ASSIGNED","IN_REVIEW","REVIEWED","UNREVIEWED"]}},{"name":"decision","in":"query","required":false,"description":"Filter by decision.","schema":{"type":"string","enum":["PENDING","READY_AS_IS","MINOR_REPAIR","MAJOR_REPAIR","REJECTED"]}},{"name":"reviewer_id","in":"query","required":false,"description":"Member ID, or unassigned.","schema":{"type":"string","pattern":"^(unassigned|[1-9][0-9]*)$"}},{"name":"client_id","in":"query","required":false,"description":"Client ID, or unassigned.","schema":{"type":"string","pattern":"^(unassigned|[1-9][0-9]*)$"}},{"name":"question_id","in":"query","required":false,"description":"Exact source topic/seed identifier.","schema":{"type":"string","maxLength":250,"example":"math-example-topic"}},{"name":"run_id","in":"query","required":false,"description":"Exact imported run identifier.","schema":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"}},{"name":"sort","in":"query","required":false,"description":"Most recently updated, oldest updated, or alphabetical topic order. Ties have stable ordering.","schema":{"type":"string","enum":["updated","oldest","topic"],"default":"updated"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"},"example":{"tasks":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"}],"total":1,"page":1,"page_size":25,"counts":{"all":1,"unassigned":1,"in_review":0,"reviewed":0,"archived":0},"reviewers":[{"id":42,"display_name":"Example reviewer"}],"clients":[{"id":42,"name":"Example client","enabled":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/workflow/tasks/{task_id}":{"get":{"tags":["Dashboard compatibility"],"summary":"Get dashboard task workflow","operationId":"get__api_math_workflow_tasks_task_id_","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\n","x-required-scopes":["read"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDetail"},"example":{"task":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"},"history":[{"id":"task:1","action":"example","actor_name":null,"comment":"example","created_at":"2026-09-22T12:00:00.000Z","changes":[{"field":"example","before":null,"after":null}]}],"reviewers":[{"id":42,"display_name":"Example reviewer"}],"clients":[{"id":42,"name":"Example client","enabled":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}},"post":{"tags":["Dashboard compatibility"],"summary":"Apply a dashboard workflow action","operationId":"post__api_math_workflow_tasks_task_id_","description":"**Required scope:** `write`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nRead the current version first. Each success increments it and returns the updated task/history. Reviewers may start, add feedback or submit a verdict on assigned tasks. Other actions require Owner/Admin. feedback, verdict and reopen require a nonblank comment. Assign/client accept null to clear the assignment. Restore an archived task before other changes. Reopen a completed review before reassignment or another verdict. Feedback moves ASSIGNED tasks to IN_REVIEW. A stale version returns 409; reread before retrying. Examples use synthetic IDs and versions.","x-required-scopes":["write"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDetail"},"example":{"task":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"},"history":[{"id":"task:1","action":"example","actor_name":null,"comment":"example","created_at":"2026-09-22T12:00:00.000Z","changes":[{"field":"example","before":null,"after":null}]}],"reviewers":[{"id":42,"display_name":"Example reviewer"}],"clients":[{"id":42,"name":"Example client","enabled":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowAction"},"examples":{"assign":{"summary":"Assign a reviewer (Owner/Admin)","value":{"action":"assign","version":1,"reviewer_id":42}},"start":{"summary":"Start an assigned review","value":{"action":"start","version":2}},"feedback":{"summary":"Add feedback","value":{"action":"feedback","version":3,"comment":"Clarify the final proof step."}},"verdict":{"summary":"Record a decision","value":{"action":"verdict","version":4,"decision":"MINOR_REPAIR","comment":"The final proof step needs clarification."}},"archive":{"summary":"Archive (Owner/Admin)","value":{"action":"archive","version":5}},"restore":{"summary":"Restore (Owner/Admin)","value":{"action":"restore","version":6}},"client":{"summary":"Assign a client (Owner/Admin)","value":{"action":"client","version":7,"client_id":42}},"reopen":{"summary":"Reopen a completed review (Owner/Admin)","value":{"action":"reopen","version":8,"comment":"New evidence requires another review."}}}}}}}},"/api/math/topics":{"get":{"tags":["Seeds & topics"],"summary":"List latest imported run per topic","operationId":"get__api_math_topics","description":"**Required scope:** `read`. **Roles:** Owner, Admin.\n\nWhole-run research is restricted to operators. q searches topic titles, IDs, run IDs and problem text. Reviewers should use /api/math/seeds.","x-required-scopes":["read"],"parameters":[{"name":"page","in":"query","required":false,"description":"One-based page number.","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"page_size","in":"query","required":false,"description":"Maximum number of items returned.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"q","in":"query","required":false,"description":"Case-insensitive literal substring search; percent and underscore are treated literally.","schema":{"type":"string","maxLength":250}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Topics"},"example":{"schema_version":"math-research-v1","topics":[{"topic_id":"math:math-example-topic","question_id":"math-example-topic","title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","run_count":1,"task_count":1,"status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","reports":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}],"report_download_url":null,"research_bundle_url":null,"public_tasks_url":null,"pass_rate":null,"model":null,"review_summary":{"run_id":"11111111-2222-4333-8444-555555555555","total":1,"active":1,"reviewed":0,"accepted":0,"archived":0}}],"total":1,"page":1,"page_size":25,"total_tasks":1}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/runs":{"get":{"tags":["Research & reports"],"summary":"List imported runs","operationId":"get__api_math_runs","description":"**Required scope:** `read`. **Roles:** Owner, Admin.\n\nAll matching imported runs, newest first. These are completed import records, not live scheduler jobs.","x-required-scopes":["read"],"parameters":[{"name":"page","in":"query","required":false,"description":"One-based page number.","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"page_size","in":"query","required":false,"description":"Maximum number of items returned.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"q","in":"query","required":false,"description":"Case-insensitive literal substring search; percent and underscore are treated literally.","schema":{"type":"string","maxLength":250}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Runs"},"example":{"schema_version":"math-research-v1","runs":[{"topic_id":"math:math-example-topic","question_id":"math-example-topic","title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","run_count":1,"task_count":1,"status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","reports":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}],"report_download_url":null,"research_bundle_url":null,"public_tasks_url":null,"pass_rate":null,"model":null,"review_summary":{"run_id":"11111111-2222-4333-8444-555555555555","total":1,"active":1,"reviewed":0,"accepted":0,"archived":0}}],"total":1,"page":1,"page_size":25,"total_tasks":1}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/runs/{run_id}":{"get":{"tags":["Research & reports"],"summary":"Get an imported run","operationId":"get__api_math_runs_run_id_","description":"**Required scope:** `read`. **Roles:** Owner, Admin.\n\nRun details, associated tasks, reports and aggregate review status.","x-required-scopes":["read"],"parameters":[{"name":"run_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunDetail"},"example":{"schema_version":"math-research-v1","run":{"topic_id":"math:math-example-topic","question_id":"math-example-topic","title":"example","run_id":"11111111-2222-4333-8444-555555555555","run_count":0,"task_count":0,"status":"example","publication_verified":true,"human_review":"example","imported_at":"2026-09-22T12:00:00.000Z","reports":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}],"report_download_url":null,"research_bundle_url":null,"public_tasks_url":null,"pass_rate":null,"model":null,"review_summary":null,"proposition":"example","problem":"example","tasks":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","ordinal":1,"title":"A sample mathematical proposition","run_id":"11111111-2222-4333-8444-555555555555","question_id":"math-example-topic","parent_title":"Elementary number theory","status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"report_download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download","result_id":"example-result","pass_rate":null,"model":null,"workflow":{"task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","review_state":"UNASSIGNED","decision":"PENDING","archived":0},"problem":"Prove or disprove the stated proposition.","problem_sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}],"research_outcomes":[null],"source_commit":"example"}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/reports":{"get":{"tags":["Research & reports"],"summary":"List task report mappings","operationId":"get__api_math_reports","description":"**Required scope:** `read`. **Roles:** Owner, Admin.\n\nIncludes tasks with a null report mapping. mapped_reports counts mappings; it is not a count of unique file objects.","x-required-scopes":["read"],"parameters":[{"name":"page","in":"query","required":false,"description":"One-based page number.","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"page_size","in":"query","required":false,"description":"Maximum number of items returned.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"q","in":"query","required":false,"description":"Search indexed report text.","schema":{"type":"string","maxLength":250}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reports"},"example":{"schema_version":"math-task-reports-v1","reports":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","ordinal":1,"title":"A sample mathematical proposition","run_id":"11111111-2222-4333-8444-555555555555","question_id":"math-example-topic","parent_title":"Elementary number theory","status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"report_download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download","result_id":"example-result","pass_rate":null,"model":null,"workflow":{"task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","review_state":"UNASSIGNED","decision":"PENDING","archived":0}}],"total":1,"page":1,"page_size":25,"total_runs":1,"mapped_reports":1}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/workflow/tasks/{task_id}/evidence":{"get":{"tags":["Research & reports"],"summary":"Get verified task evidence","operationId":"get__api_math_workflow_tasks_task_id_evidence","description":"**Required scope:** `files:read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nReturns a JSON projection of the permitted task’s rubric, review and quality gate. Source-defined evidence fields vary by report and may be null. Private sibling-task data and raw provenance files are not exposed.","x-required-scopes":["files:read"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evidence"},"example":{"task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","source_sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","rubric":null,"independent_review":null,"public_review":null,"rubric_audit":null,"rubric_quality":null,"quality_gate":{"route":"ADVANCE"},"source_report_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","model_pass_rate":null}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/tasks/{task_id}/paths":{"get":{"tags":["Research & reports"],"summary":"Get task report storage locations","operationId":"get__api_math_tasks_task_id_paths","description":"**Required scope:** `paths:read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nPrivate source/imported identifiers for the task’s current primary report. Reviewers must be assigned to every task sharing the report. Use download_url for authenticated file retrieval.","x-required-scopes":["paths:read"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paths"},"example":{"paths":[{"artifact_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","kind":"example","filename":"example","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","bytes":0,"run_id":"11111111-2222-4333-8444-555555555555","question_id":"math-example-topic","aws_job_id":null,"source_batch_id":null,"source_uri":"s3://example-bucket/runs/example/report.md","imported_uri":"s3://example-artifacts/math-imports/example/report.md","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/runs/{run_id}/paths":{"get":{"tags":["Research & reports"],"summary":"Get run storage locations","operationId":"get__api_math_runs_run_id_paths","description":"**Required scope:** `paths:read`. **Roles:** Owner, Admin.\n\nExcludes PRIVATE and PROVENANCE artifacts. Returns 404 when no permitted paths exist.","x-required-scopes":["paths:read"],"parameters":[{"name":"run_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paths"},"example":{"paths":[{"artifact_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","kind":"example","filename":"example","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","bytes":0,"run_id":"11111111-2222-4333-8444-555555555555","question_id":"math-example-topic","aws_job_id":null,"source_batch_id":null,"source_uri":"s3://example-bucket/runs/example/report.md","imported_uri":"s3://example-artifacts/math-imports/example/report.md","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/artifacts/{artifact_id}/download":{"get":{"tags":["Research & reports"],"summary":"Download a verified report or artifact","operationId":"get__api_math_artifacts_artifact_id_download","description":"**Required scope:** `files:read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nThe service verifies size and SHA-256 before returning bytes. Reports are Markdown, checkpoints gzip, and public inputs/tasks JSON. Reviewers may download only their current mapped primary reports, including checks for all shared mappings. PRIVATE and PROVENANCE objects cannot be downloaded here.","x-required-scopes":["files:read"],"parameters":[{"name":"artifact_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Verified file bytes, not a JSON response envelope.","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}},"Content-Type":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Content-Disposition":{"schema":{"type":"string"},"description":"Filename and download disposition."}},"content":{"text/markdown":{"schema":{"type":"string","format":"binary"}},"application/gzip":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/tasks/{task_id}/attachments":{"get":{"tags":["Attachments"],"summary":"List task attachments","operationId":"get__api_math_tasks_task_id_attachments","description":"**Required scope:** `files:read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nUp to 200 active attachments, newest first. Removed attachments are excluded.","x-required-scopes":["files:read"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attachments"},"example":{"attachments":[{"id":"cccccccccccccccccccccccccccccccc","task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"proof.pdf","description":"example","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","bytes":42,"uploaded_by":42,"created_at":"2026-09-22T12:00:00.000Z","download_url":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/attachments/cccccccccccccccccccccccccccccccc/download"}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}},"post":{"tags":["Attachments"],"summary":"Upload a task attachment","operationId":"post__api_math_tasks_task_id_attachments","description":"**Required scope:** `files:write`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nSend raw file bytes with Content-Type application/octet-stream. Minimum 1 byte, maximum 16 MiB; 200 active files per task. Archived tasks are read-only. Uploads are supplementary files and do not replace imported reports.","x-required-scopes":["files:write"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}},{"name":"X-Filename","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":180,"example":"proof.pdf"},"description":"Filename; no slashes, backslashes or control characters."},{"name":"description","in":"query","required":false,"description":"Optional attachment description.","schema":{"type":"string","maxLength":2000}}],"responses":{"201":{"description":"Created successfully","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentDetail"},"example":{"attachment":{"id":"cccccccccccccccccccccccccccccccc","task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"proof.pdf","description":"example","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","bytes":42,"uploaded_by":42,"created_at":"2026-09-22T12:00:00.000Z","download_url":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/attachments/cccccccccccccccccccccccccccccccc/download"}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}},"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}}},"/api/math/tasks/{task_id}/attachments/{attachment_id}":{"get":{"tags":["Attachments"],"summary":"Get attachment metadata","operationId":"get__api_math_tasks_task_id_attachments_attachment_id_","description":"**Required scope:** `files:read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\n","x-required-scopes":["files:read"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}},{"name":"attachment_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","pattern":"^[0-9a-f]{32}$","example":"cccccccccccccccccccccccccccccccc"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentDetail"},"example":{"attachment":{"id":"cccccccccccccccccccccccccccccccc","task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"proof.pdf","description":"example","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","bytes":42,"uploaded_by":42,"created_at":"2026-09-22T12:00:00.000Z","download_url":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/attachments/cccccccccccccccccccccccccccccccc/download"}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}},"delete":{"tags":["Attachments"],"summary":"Remove an attachment","operationId":"delete__api_math_tasks_task_id_attachments_attachment_id_","description":"**Required scope:** `files:write`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nReviewers can remove only their own uploads while still assigned. Owner/Admin can remove any permitted attachment. Archived tasks must be restored first. Removal hides the file and retains its bytes for audit/recovery.","x-required-scopes":["files:write"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}},{"name":"attachment_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","pattern":"^[0-9a-f]{32}$","example":"cccccccccccccccccccccccccccccccc"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentDeleted"},"example":{"deleted":true,"id":"cccccccccccccccccccccccccccccccc"}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/tasks/{task_id}/attachments/{attachment_id}/download":{"get":{"tags":["Attachments"],"summary":"Download an attachment","operationId":"get__api_math_tasks_task_id_attachments_attachment_id_download","description":"**Required scope:** `files:read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nReturns the file only after verifying its receipt and rechecking task access.","x-required-scopes":["files:read"],"parameters":[{"name":"task_id","in":"path","required":true,"description":"64-character task ID returned by the task list.","schema":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}},{"name":"attachment_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","pattern":"^[0-9a-f]{32}$","example":"cccccccccccccccccccccccccccccccc"}}],"responses":{"200":{"description":"Verified file bytes, not a JSON response envelope.","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}},"Content-Type":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Content-Disposition":{"schema":{"type":"string"},"description":"Filename and download disposition."}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/monitor":{"get":{"tags":["Monitoring"],"summary":"Get import and review status","operationId":"get__api_math_monitor","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nAssignment-scoped counts and freshness timestamps for imported dashboard data. Does not include unimported seeds, active AWS/Vast scheduler jobs, or job start/stop control.","x-required-scopes":["read"],"parameters":[],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Monitor"},"example":{"scope":"workspace","source":"imported_dashboard_data","live_pipeline_jobs_available":false,"tasks":0,"runs":0,"topics":0,"last_imported_at":null,"last_workflow_change_at":null,"in_review":0,"reviewed":0,"archived":0}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/activity":{"get":{"tags":["Monitoring"],"summary":"List workflow activity","operationId":"get__api_math_activity","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nVisible task/client audit events, newest first. Counts and results are scoped by assignment for reviewers.","x-required-scopes":["read"],"parameters":[{"name":"page","in":"query","required":false,"description":"One-based page number.","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1}},{"name":"page_size","in":"query","required":false,"description":"Maximum number of items returned.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activity"},"example":{"events":[{"id":"task:1","action":"example","actor_name":null,"comment":"example","created_at":"2026-09-22T12:00:00.000Z","changes":[{"field":"example","before":null,"after":null}]}],"total":0,"page":1,"page_size":25}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/analytics":{"get":{"tags":["Monitoring"],"summary":"Get review analytics","operationId":"get__api_math_analytics","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nReview state, decisions, workload, trend and recent activity. Model pass rates are not available.","x-required-scopes":["read"],"parameters":[{"name":"days","in":"query","required":false,"description":"Decision trend window. Overall task totals are not limited by this window.","schema":{"type":"integer","enum":[7,30,90],"default":30}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Analytics"},"example":{"total_tasks":0,"total_runs":0,"verified_reports":0,"active_tasks":0,"assigned_clients":0,"archived":0,"review_states":[{"state":"UNASSIGNED","count":0}],"decisions":[{"decision":"PENDING","count":0}],"days":7,"since":"2026-09-22T12:00:00.000Z","reviewer_workload":[{"reviewer_id":null,"reviewer_name":"example","total":0,"pending":0,"in_review":0,"reviewed":0}],"decision_trend":[{"day":"2026-09-22","decisions":0,"accepted":0}],"model_measurements":0,"recent_activity":[{"id":"task:1","action":"example","actor_name":null,"comment":"example","created_at":"2026-09-22T12:00:00.000Z","changes":[{"field":"example","before":null,"after":null}]}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/math/clients":{"get":{"tags":["Clients & members"],"summary":"List clients and task counts","operationId":"get__api_math_clients","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nReviewers see only clients linked to their assigned tasks. Includes enabled/disabled status and updated_at for conflict-safe edits.","x-required-scopes":["read"],"parameters":[],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Clients"},"example":{"clients":[{"id":42,"name":"Example client","description":"example","enabled":true,"updated_at":"2026-09-22T12:00:00.000Z","task_count":0,"archived_count":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}},"post":{"tags":["Clients & members"],"summary":"Create a client","operationId":"post__api_math_clients","description":"**Required scope:** `write`. **Roles:** Owner, Admin.\n\nNames are trimmed, 2–100 characters and case-insensitively unique. Duplicate names return 409. Read the client list afterward to obtain updated_at for future edits.","x-required-scopes":["write"],"parameters":[],"responses":{"201":{"description":"Created successfully","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCreated"},"example":{"client":{"id":42,"name":"Example client","description":"example","enabled":true,"task_count":0}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCreate"},"example":{"name":"Example client"}}}}}},"/api/math/clients/{client_id}":{"post":{"tags":["Clients & members"],"summary":"Update a client","operationId":"post__api_math_clients_client_id_","description":"**Required scope:** `write`. **Roles:** Owner, Admin.\n\nAll four fields are required. Supply the exact current updated_at; stale values return 409. The new timestamp is returned.","x-required-scopes":["write"],"parameters":[{"name":"client_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientUpdated"},"example":{"client":{"id":42,"name":"Example client","description":"example","enabled":true,"updated_at":"2026-09-22T12:00:00.000Z"}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientUpdate"},"example":{"name":"Example client","description":"example","enabled":true,"updated_at":"2026-09-22T12:00:00.000Z"}}}}}},"/api/clients":{"get":{"tags":["Dashboard compatibility"],"summary":"List shared client summaries","operationId":"get__api_clients","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nDashboard-compatible client summary. Use /api/math/clients for descriptions and archived counts.","x-required-scopes":["read"],"parameters":[],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedClients"},"example":{"schema_version":"campaign-clients-v1","clients":[{"id":42,"name":"example","enabled":true,"created_at":"2026-09-22T12:00:00.000Z","updated_at":"2026-09-22T12:00:00.000Z","task_count":0}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/reviewers":{"get":{"tags":["Clients & members"],"summary":"List reviewer choices","operationId":"get__api_reviewers","description":"**Required scope:** `read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nReviewers see their own member record. Operators see member choices excluding the primary admin. Check enabled before assignment.","x-required-scopes":["read"],"parameters":[],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reviewers"},"example":{"schema_version":"review-assignees-v1","reviewers":[{"id":42,"username":"example_member","email":null,"email_verified":false,"display_name":"Example member","role":"REVIEWER","is_admin":false,"is_primary_admin":false,"enabled":true,"must_change_password":false,"last_login_at":null,"assignment_count":0,"active_assignment_count":0,"invite_pending":false,"invite_expires_at":null}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/users":{"get":{"tags":["Clients & members"],"summary":"List Math members","operationId":"get__api_users","description":"**Required scope:** `read`. **Roles:** Admin.\n\nRead-only local member projections. Account creation and membership changes belong to the central identity service.","x-required-scopes":["read"],"parameters":[],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Users"},"example":{"schema_version":"users-v3","users":[{"id":42,"username":"example_member","email":null,"email_verified":false,"display_name":"Example member","role":"REVIEWER","is_admin":false,"is_primary_admin":false,"enabled":true,"must_change_password":false,"last_login_at":null,"assignment_count":0,"active_assignment_count":0,"invite_pending":false,"invite_expires_at":null}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/auth/audit":{"get":{"tags":["Clients & members"],"summary":"Read identity audit events","operationId":"get__api_auth_audit","description":"**Required scope:** `read`. **Roles:** Admin.\n\nLatest 100 local identity audit records. detail is event-specific JSON.","x-required-scopes":["read"],"parameters":[],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthAudit"},"example":{"schema_version":"auth-audit-v1","events":[{"id":42,"action":"example","detail":null,"occurred_at":"2026-09-22T12:00:00.000Z","actor_name":null,"target_name":null,"assignment_id":null}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/auth/viewable-users":{"get":{"tags":["Dashboard compatibility"],"summary":"Inspect dashboard view capability","operationId":"get__api_auth_viewable_users","description":"**Required scope:** `read`. **Roles:** Admin.\n\nWith API-key authentication this returns an empty users list. Keys cannot switch roles or view another identity; issue a separately scoped key instead.","x-required-scopes":["read"],"parameters":[],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewableUsers"},"example":{"schema_version":"viewable-users-v1","role":"ADMIN","users":[]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/keys":{"get":{"tags":["API keys"],"summary":"List API keys","operationId":"get__api_keys","description":"**Required scope:** `keys:manage`. **Roles:** Reviewer, Owner, Admin.\n\nUp to 500 keys, newest first, including expired/revoked metadata. Non-admins see only their keys; Admin sees workspace keys. Secrets and hashes are never returned.","x-required-scopes":["keys:manage"],"parameters":[],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Keys"},"example":{"keys":[{"id":"bbbbbbbbbbbbbbbbbbbbbbbb","actor_id":42,"name":"example","role":"REVIEWER","scopes":["read"],"workspace_id":"ws_math","environment":"dev","created_by":42,"created_at":"2026-09-22T12:00:00.000Z","expires_at":"2026-09-22T12:00:00.000Z","revoked_at":null,"last_used_at":null}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}},"post":{"tags":["API keys"],"summary":"Create an API key","operationId":"post__api_keys","description":"**Required scope:** `keys:manage`. **Roles:** Reviewer, Owner, Admin.\n\nReturns the secret once. Save it privately. Non-admins issue only for themselves; Admin may specify an enabled Math member. Role and scopes cannot exceed the issuer or target member. Default expiry 90 days, maximum 365; 50 active keys per member. Defaults inherit issuer role/scopes.","x-required-scopes":["keys:manage"],"parameters":[],"responses":{"201":{"description":"Created successfully","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreated"},"example":{"key":{"id":"bbbbbbbbbbbbbbbbbbbbbbbb","actor_id":42,"name":"example","role":"REVIEWER","scopes":["read"],"workspace_id":"ws_math","environment":"dev","created_by":42,"created_at":"2026-09-22T12:00:00.000Z","expires_at":"2026-09-22T12:00:00.000Z","revoked_at":null,"last_used_at":null},"token":"YOUR_NEW_API_KEY","token_shown_once":true}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreate"},"examples":{"readonly":{"summary":"Read-only automation key","value":{"name":"Read-only reporting","scopes":["read","files:read","paths:read"],"expires_in_days":90}},"reviewer":{"summary":"Admin issues a reviewer key","value":{"name":"Reviewer automation","actor_id":42,"role":"REVIEWER","scopes":["read","write","files:read","files:write","paths:read"]}}}}}}}},"/api/keys/{key_id}":{"get":{"tags":["API keys"],"summary":"Get key metadata","operationId":"get__api_keys_key_id_","description":"**Required scope:** `keys:manage`. **Roles:** Reviewer, Owner, Admin.\n\nOwn key only unless Admin. The secret cannot be retrieved.","x-required-scopes":["keys:manage"],"parameters":[{"name":"key_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","pattern":"^[0-9a-f]{24}$","example":"bbbbbbbbbbbbbbbbbbbbbbbb"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyDetail"},"example":{"key":{"id":"bbbbbbbbbbbbbbbbbbbbbbbb","actor_id":42,"name":"example","role":"REVIEWER","scopes":["read"],"workspace_id":"ws_math","environment":"dev","created_by":42,"created_at":"2026-09-22T12:00:00.000Z","expires_at":"2026-09-22T12:00:00.000Z","revoked_at":null,"last_used_at":null}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}},"delete":{"tags":["API keys"],"summary":"Revoke an API key","operationId":"delete__api_keys_key_id_","description":"**Required scope:** `keys:manage`. **Roles:** Reviewer, Owner, Admin.\n\nOwn key only unless Admin. Revocation takes effect across both API processes. Repeated revocation preserves the original revoked_at. Revoking your current key prevents subsequent requests.","x-required-scopes":["keys:manage"],"parameters":[{"name":"key_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","pattern":"^[0-9a-f]{24}$","example":"bbbbbbbbbbbbbbbbbbbbbbbb"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyDetail"},"example":{"key":{"id":"bbbbbbbbbbbbbbbbbbbbbbbb","actor_id":42,"name":"example","role":"REVIEWER","scopes":["read"],"workspace_id":"ws_math","environment":"dev","created_by":42,"created_at":"2026-09-22T12:00:00.000Z","expires_at":"2026-09-22T12:00:00.000Z","revoked_at":null,"last_used_at":null}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/keys/{key_id}/events":{"get":{"tags":["API keys"],"summary":"List key audit events","operationId":"get__api_keys_key_id_events","description":"**Required scope:** `keys:manage`. **Roles:** Reviewer, Owner, Admin.\n\nLatest 100 creation, revocation and write-request events. Own key only unless Admin; an unavailable key produces an empty list. Read requests are reflected by last_used_at rather than individual events.","x-required-scopes":["keys:manage"],"parameters":[{"name":"key_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"string","pattern":"^[0-9a-f]{24}$","example":"bbbbbbbbbbbbbbbbbbbbbbbb"}}],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyEvents"},"example":{"events":[{"id":42,"key_id":"bbbbbbbbbbbbbbbbbbbbbbbb","actor_id":42,"action":"CREATED","request_id":null,"method":null,"route":null,"status":null,"created_at":"2026-09-22T12:00:00.000Z"}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}},"/api/bug-reports":{"get":{"tags":["Bug reports"],"summary":"List bug reports","operationId":"get__api_bug_reports","description":"**Required scope:** `read`. **Roles:** Reviewer, Owner, Admin.\n\nLatest 50 reports. Reviewer/Owner see their own submissions; Admin sees all.","x-required-scopes":["read"],"parameters":[],"responses":{"200":{"description":"Successful response","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BugReports"},"example":{"schema_version":"bug-reports-v1","reports":[{"id":42,"reporter":{"id":42,"display_name":"example","role":"REVIEWER"},"description":"example","page_path":null,"status":"example","screenshot_attached":true,"screenshot_url":null,"created_at":"2026-09-22T12:00:00.000Z","updated_at":"2026-09-22T12:00:00.000Z"}]}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}},"post":{"tags":["Bug reports"],"summary":"Submit a bug report","operationId":"post__api_bug_reports","description":"**Required scope:** `write + files:write`. **Roles:** Reviewer, Owner, Admin.\n\nMultipart form with a description and optional screenshot. Both scopes are required even without a screenshot. picture accepts PNG/JPEG/WebP up to 8 MiB. page_path should be a relative path beginning with /. The response is a creation receipt; list reports to obtain the screenshot URL.","x-required-scopes":["write","files:write"],"parameters":[],"responses":{"201":{"description":"Created successfully","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BugCreated"},"example":{"schema_version":"bug-report-v1","report":{"id":42,"status":"OPEN","screenshot_attached":true,"created_at":"2026-09-22T12:00:00.000Z"}}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/BugCreate"},"example":{"description":"The report download button is unavailable."}}}}}},"/api/bug-reports/{report_id}/screenshot":{"get":{"tags":["Bug reports"],"summary":"Download a bug screenshot","operationId":"get__api_bug_reports_report_id_screenshot","description":"**Required scope:** `files:read`. **Roles:** Reviewer (assigned tasks), Owner, Admin.\n\nOnly the report’s submitter or an Admin can retrieve the verified image.","x-required-scopes":["files:read"],"parameters":[{"name":"report_id","in":"path","required":true,"description":"Identifier returned by the corresponding list endpoint.","schema":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42}}],"responses":{"200":{"description":"Verified file bytes, not a JSON response envelope.","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}},"Content-Type":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Content-Disposition":{"schema":{"type":"string"},"description":"Filename and download disposition."}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid input","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_request","message":"Invalid input"}}}},"401":{"description":"Missing, invalid, expired or revoked API key","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"invalid_api_key","message":"Missing, invalid, expired or revoked API key"}}}},"403":{"description":"Role, scope, account or origin does not permit this operation","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_scope_required","message":"Role, scope, account or origin does not permit this operation"}}}},"404":{"description":"Resource unavailable or outside your permitted tasks","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"not_found","message":"Resource unavailable or outside your permitted tasks"}}}},"405":{"description":"HTTP method is not supported","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"method_not_allowed","message":"HTTP method is not supported"}}}},"409":{"description":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"math_workflow_conflict","message":"Stale version, invalid workflow transition or changed evidence; read the latest state before retrying"}}}},"413":{"description":"Request exceeds the permitted upload or JSON size","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"payload_too_large","message":"Request exceeds the permitted upload or JSON size"}}}},"415":{"description":"Unsupported request Content-Type","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"json_required","message":"Unsupported request Content-Type"}}}},"429":{"description":"600 authenticated requests per minute per key exceeded; retry next minute","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"api_key_rate_limited","message":"600 authenticated requests per minute per key exceeded; retry next minute"}}}},"503":{"description":"Service, storage or capacity temporarily unavailable","headers":{"x-request-id":{"description":"Server-generated identifier for tracing this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"service_unavailable","message":"Service, storage or capacity temporarily unavailable"}}}}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","bearerFormat":"Math API key","description":"Paste your issued key, without the Bearer prefix. No key is embedded in this documentation."}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"string","example":"api_key_scope_required"},"message":{"type":"string","example":"This operation requires the read scope."}},"required":["code","message"],"additionalProperties":false},"Session":{"type":"object","properties":{"schema_version":{"const":"dashboard-auth-v2","type":"string"},"admin_provisioned":{"type":"boolean"},"user":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"username":{"type":"string","example":"example_member"},"email":{"anyOf":[{"type":"string","example":"member@example.com"},{"type":"null"}]},"email_verified":{"type":"boolean","example":false},"display_name":{"type":"string","example":"Example member"},"role":{"type":"string","enum":["REVIEWER","OWNER","ADMIN"]},"is_admin":{"type":"boolean","example":false},"is_primary_admin":{"type":"boolean","example":false},"enabled":{"type":"boolean"},"must_change_password":{"type":"boolean","const":false},"last_login_at":{"anyOf":[{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},{"type":"null"}]},"authenticated_role":{"type":"string","enum":["REVIEWER","OWNER","ADMIN"]},"active_role":{"type":"string","enum":["REVIEWER","OWNER","ADMIN"]},"can_switch_role":{"type":"boolean","const":false},"viewing_user":{"type":"null"},"identity_id":{"type":"string","example":"example-identity"},"api_key":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","example":"bbbbbbbbbbbbbbbbbbbbbbbb"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["read","write","files:read","files:write","paths:read","keys:manage"]},"minItems":1,"maxItems":6,"uniqueItems":true}},"required":["id","name","scopes"],"additionalProperties":false},"workspace":{"type":"object","properties":{"id":{"const":"ws_math","type":"string"},"slug":{"const":"math","type":"string"},"label":{"const":"Math","type":"string"},"environment":{"const":"dev","type":"string","description":"Retained internal name of the main Math workspace."}},"required":["id","slug","label","environment"],"additionalProperties":false}},"required":["id","username","email","email_verified","display_name","role","is_admin","is_primary_admin","enabled","must_change_password","last_login_at","authenticated_role","active_role","can_switch_role","viewing_user","identity_id","api_key","workspace"],"additionalProperties":false}},"required":["schema_version","admin_provisioned","user"],"additionalProperties":false},"Member":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"username":{"type":"string","example":"example_member"},"email":{"anyOf":[{"type":"string","example":"member@example.com"},{"type":"null"}]},"email_verified":{"type":"boolean","example":false},"display_name":{"type":"string","example":"Example member"},"role":{"type":"string","enum":["REVIEWER","OWNER","ADMIN"]},"is_admin":{"type":"boolean","example":false},"is_primary_admin":{"type":"boolean","example":false},"enabled":{"type":"boolean"},"must_change_password":{"type":"boolean","const":false},"last_login_at":{"anyOf":[{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},{"type":"null"}]},"assignment_count":{"type":"integer","minimum":0},"active_assignment_count":{"type":"integer","minimum":0},"invite_pending":{"type":"boolean","const":false},"invite_expires_at":{"type":"null"}},"required":["id","username","email","email_verified","display_name","role","is_admin","is_primary_admin","enabled","must_change_password","last_login_at","assignment_count","active_assignment_count","invite_pending","invite_expires_at"],"additionalProperties":false},"Users":{"type":"object","properties":{"schema_version":{"type":"string","const":"users-v3"},"users":{"type":"array","items":{"$ref":"#/components/schemas/Member"}}},"required":["schema_version","users"],"additionalProperties":false},"Reviewers":{"type":"object","properties":{"schema_version":{"type":"string","const":"review-assignees-v1"},"reviewers":{"type":"array","items":{"$ref":"#/components/schemas/Member"}}},"required":["schema_version","reviewers"],"additionalProperties":false},"AuthAudit":{"type":"object","properties":{"schema_version":{"type":"string","const":"auth-audit-v1"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"action":{"type":"string"},"detail":{"description":"Imported JSON content. Shape varies with the source report; may be null.","example":null},"occurred_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"actor_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"target_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignment_id":{"anyOf":[{"type":["integer","string"]},{"type":"null"}]}},"required":["id","action","detail","occurred_at","actor_name","target_name","assignment_id"],"additionalProperties":false}}},"required":["schema_version","events"],"additionalProperties":false},"WorkflowTask":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"title":{"type":"string"},"problem":{"type":"string","example":"Prove or disprove the stated proposition."},"parent_title":{"type":"string"},"run_id":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"},"ordinal":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"report":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"download_url":{"type":"string","example":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}},"required":["id","sha256","download_url"],"additionalProperties":false},"imported_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1,"description":"Current task version returned by the workflow endpoint. A stale value returns 409."},"pass_rate":{"type":"null","description":"No model measurement is available in this API."},"model":{"type":"null","description":"No model measurement is available in this API."},"reviewer":{"anyOf":[{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"display_name":{"type":"string","example":"Example reviewer"}},"required":["id","display_name"],"additionalProperties":false},{"type":"null"}]},"review_state":{"type":"string","enum":["UNASSIGNED","ASSIGNED","IN_REVIEW","REVIEWED"]},"decision":{"type":"string","enum":["PENDING","READY_AS_IS","MINOR_REPAIR","MAJOR_REPAIR","REJECTED"]},"notes":{"type":"string"},"archived":{"type":"boolean"},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"updated_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"}},"required":["id","title","problem","parent_title","run_id","ordinal","report","imported_at","version","pass_rate","model","reviewer","review_state","decision","notes","archived","client","updated_at"],"additionalProperties":false,"example":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"}},"HistoryEvent":{"type":"object","properties":{"id":{"type":"string","example":"task:1"},"action":{"type":"string"},"actor_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"comment":{"type":"string"},"created_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"changes":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"before":{"type":["string","number","boolean","null"]},"after":{"type":["string","number","boolean","null"]}},"required":["field","before","after"],"additionalProperties":false}},"task_id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"task_title":{"type":"string"},"client_id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","action","actor_name","comment","created_at","changes"],"additionalProperties":false},"TaskList":{"type":"object","properties":{"tasks":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowTask"}},"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1},"page_size":{"type":"integer","minimum":1,"maximum":100,"example":25},"counts":{"type":"object","properties":{"all":{"type":"integer","minimum":0},"unassigned":{"type":"integer","minimum":0},"in_review":{"type":"integer","minimum":0},"reviewed":{"type":"integer","minimum":0},"archived":{"type":"integer","minimum":0}},"required":["all","unassigned","in_review","reviewed","archived"],"additionalProperties":false},"reviewers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"display_name":{"type":"string","example":"Example reviewer"}},"required":["id","display_name"],"additionalProperties":false}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"name":{"type":"string","example":"Example client"},"enabled":{"type":"integer","enum":[0,1]}},"required":["id","name","enabled"],"additionalProperties":false}}},"required":["tasks","total","page","page_size","counts","reviewers","clients"],"additionalProperties":false,"example":{"tasks":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","title":"A sample divisibility proposition","problem":"Prove or disprove the stated proposition.","parent_title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","ordinal":1,"report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"imported_at":"2026-09-22T12:00:00.000Z","version":1,"pass_rate":null,"model":null,"reviewer":null,"review_state":"UNASSIGNED","decision":"PENDING","notes":"","archived":false,"client":null,"updated_at":"2026-09-22T12:00:00.000Z"}],"total":1,"page":1,"page_size":25,"counts":{"all":1,"unassigned":1,"in_review":0,"reviewed":0,"archived":0},"reviewers":[{"id":42,"display_name":"Example reviewer"}],"clients":[{"id":42,"name":"Example client","enabled":0}]}},"WorkflowDetail":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/WorkflowTask"},"history":{"type":"array","items":{"$ref":"#/components/schemas/HistoryEvent"},"maxItems":200},"reviewers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"display_name":{"type":"string","example":"Example reviewer"}},"required":["id","display_name"],"additionalProperties":false}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"name":{"type":"string","example":"Example client"},"enabled":{"type":"integer","enum":[0,1]}},"required":["id","name","enabled"],"additionalProperties":false}}},"required":["task","history","reviewers","clients"],"additionalProperties":false},"WorkflowAction":{"oneOf":[{"title":"assign","type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1,"description":"Current task version returned by the workflow endpoint. A stale value returns 409."},"action":{"type":"string","const":"assign"},"comment":{"type":"string","maxLength":8000,"description":"Trimmed before use; NUL characters are rejected.","example":"Please clarify the final proof step."},"reviewer_id":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},{"type":"null"}]}},"required":["version","action","reviewer_id"],"additionalProperties":false},{"title":"start","type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1,"description":"Current task version returned by the workflow endpoint. A stale value returns 409."},"action":{"type":"string","const":"start"},"comment":{"type":"string","maxLength":8000,"description":"Trimmed before use; NUL characters are rejected.","example":"Please clarify the final proof step."}},"required":["version","action"],"additionalProperties":false},{"title":"feedback","type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1,"description":"Current task version returned by the workflow endpoint. A stale value returns 409."},"action":{"type":"string","const":"feedback"},"comment":{"type":"string","maxLength":8000,"description":"Trimmed before use; NUL characters are rejected.","example":"Please clarify the final proof step.","minLength":1}},"required":["version","action","comment"],"additionalProperties":false},{"title":"verdict","type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1,"description":"Current task version returned by the workflow endpoint. A stale value returns 409."},"action":{"type":"string","const":"verdict"},"comment":{"type":"string","maxLength":8000,"description":"Trimmed before use; NUL characters are rejected.","example":"Please clarify the final proof step.","minLength":1},"decision":{"type":"string","enum":["READY_AS_IS","MINOR_REPAIR","MAJOR_REPAIR","REJECTED"]}},"required":["version","action","decision","comment"],"additionalProperties":false},{"title":"archive","type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1,"description":"Current task version returned by the workflow endpoint. A stale value returns 409."},"action":{"type":"string","const":"archive"},"comment":{"type":"string","maxLength":8000,"description":"Trimmed before use; NUL characters are rejected.","example":"Please clarify the final proof step."}},"required":["version","action"],"additionalProperties":false},{"title":"restore","type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1,"description":"Current task version returned by the workflow endpoint. A stale value returns 409."},"action":{"type":"string","const":"restore"},"comment":{"type":"string","maxLength":8000,"description":"Trimmed before use; NUL characters are rejected.","example":"Please clarify the final proof step."}},"required":["version","action"],"additionalProperties":false},{"title":"client","type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1,"description":"Current task version returned by the workflow endpoint. A stale value returns 409."},"action":{"type":"string","const":"client"},"comment":{"type":"string","maxLength":8000,"description":"Trimmed before use; NUL characters are rejected.","example":"Please clarify the final proof step."},"client_id":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},{"type":"null"}]}},"required":["version","action","client_id"],"additionalProperties":false},{"title":"reopen","type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1,"description":"Current task version returned by the workflow endpoint. A stale value returns 409."},"action":{"type":"string","const":"reopen"},"comment":{"type":"string","maxLength":8000,"description":"Trimmed before use; NUL characters are rejected.","example":"Please clarify the final proof step.","minLength":1}},"required":["version","action","comment"],"additionalProperties":false}]},"NoteCreate":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1,"description":"Current task version returned by the workflow endpoint. A stale value returns 409."},"comment":{"type":"string","maxLength":8000,"description":"Trimmed before use; NUL characters are rejected.","example":"Please clarify the final proof step.","minLength":1}},"required":["version","comment"],"additionalProperties":false},"Notes":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"page":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"page_size":{"type":"integer","minimum":1,"maximum":100,"example":42},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"version":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"action":{"type":"string"},"actor_id":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},{"type":"null"}]},"actor_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"comment":{"type":"string"},"created_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"}},"required":["id","version","action","actor_id","actor_name","comment","created_at"],"additionalProperties":false}}},"required":["task_id","page","page_size","notes"],"additionalProperties":false},"Seed":{"type":"object","properties":{"question_id":{"type":"string","maxLength":250,"example":"math-example-topic"},"title":{"type":"string"},"task_count":{"type":"integer","minimum":0},"run_count":{"type":"integer","minimum":0},"last_imported_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"unassigned":{"type":"integer","minimum":0},"assigned":{"type":"integer","minimum":0},"in_review":{"type":"integer","minimum":0},"reviewed":{"type":"integer","minimum":0},"archived":{"type":"integer","minimum":0},"source_status":{"type":"string","const":"COMPLETED","description":"Imported completion status; not a live scheduler state."},"tasks_url":{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/workflow"}},"required":["question_id","title","task_count","run_count","last_imported_at","unassigned","assigned","in_review","reviewed","archived","source_status","tasks_url"],"additionalProperties":false,"example":{"question_id":"math-example-topic","title":"Elementary number theory","task_count":1,"run_count":1,"last_imported_at":"2026-09-22T12:00:00.000Z","unassigned":1,"assigned":0,"in_review":0,"reviewed":0,"archived":0,"source_status":"COMPLETED","tasks_url":"/w/math/api/math/seeds/math-example-topic/tasks"}},"Seeds":{"type":"object","properties":{"seeds":{"type":"array","items":{"$ref":"#/components/schemas/Seed"}},"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1},"page_size":{"type":"integer","minimum":1,"maximum":100,"example":25}},"required":["seeds","total","page","page_size"],"additionalProperties":false,"example":{"seeds":[{"question_id":"math-example-topic","title":"Elementary number theory","task_count":1,"run_count":1,"last_imported_at":"2026-09-22T12:00:00.000Z","unassigned":1,"assigned":0,"in_review":0,"reviewed":0,"archived":0,"source_status":"COMPLETED","tasks_url":"/w/math/api/math/seeds/math-example-topic/tasks"}],"total":1,"page":1,"page_size":25}},"SeedDetail":{"type":"object","properties":{"seed":{"$ref":"#/components/schemas/Seed"}},"required":["seed"],"additionalProperties":false},"Artifact":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"filename":{"type":"string","example":"research-report.md"},"label":{"type":"string"},"kind":{"type":"string","enum":["RESEARCH_REPORT","EXPLORER_REPORT","CHECKPOINT","PUBLIC_TASKS","INPUT"]},"bytes":{"type":"integer","minimum":0},"download_url":{"type":"string","example":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}},"required":["id","filename","label","kind","bytes","download_url"],"additionalProperties":false,"example":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}},"ResearchTask":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"ordinal":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"title":{"type":"string","example":"A sample mathematical proposition"},"run_id":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"},"question_id":{"type":"string","maxLength":250,"example":"math-example-topic"},"parent_title":{"type":"string"},"status":{"type":"string"},"publication_verified":{"type":"boolean"},"human_review":{"type":"string"},"imported_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"report":{"anyOf":[{"$ref":"#/components/schemas/Artifact"},{"type":"null"}]},"report_download_url":{"anyOf":[{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/workflow"},{"type":"null"}]},"result_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"pass_rate":{"type":"null","description":"No model measurement is available in this API."},"model":{"type":"null","description":"No model measurement is available in this API."},"workflow":{"anyOf":[{"type":"object","properties":{"task_id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"review_state":{"type":"string","enum":["UNASSIGNED","ASSIGNED","IN_REVIEW","REVIEWED"]},"decision":{"type":"string","enum":["PENDING","READY_AS_IS","MINOR_REPAIR","MAJOR_REPAIR","REJECTED"]},"archived":{"type":"integer","enum":[0,1]}},"required":["task_id","review_state","decision","archived"],"additionalProperties":false},{"type":"null"}]}},"required":["id","ordinal","title","run_id","question_id","parent_title","status","publication_verified","human_review","imported_at","report","report_download_url","result_id","pass_rate","model","workflow"],"additionalProperties":false,"example":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","ordinal":1,"title":"A sample mathematical proposition","run_id":"11111111-2222-4333-8444-555555555555","question_id":"math-example-topic","parent_title":"Elementary number theory","status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"report_download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download","result_id":"example-result","pass_rate":null,"model":null,"workflow":{"task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","review_state":"UNASSIGNED","decision":"PENDING","archived":0}}},"ResearchTaskDetail":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"ordinal":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"title":{"type":"string","example":"A sample mathematical proposition"},"run_id":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"},"question_id":{"type":"string","maxLength":250,"example":"math-example-topic"},"parent_title":{"type":"string"},"status":{"type":"string"},"publication_verified":{"type":"boolean"},"human_review":{"type":"string"},"imported_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"report":{"anyOf":[{"$ref":"#/components/schemas/Artifact"},{"type":"null"}]},"report_download_url":{"anyOf":[{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/workflow"},{"type":"null"}]},"result_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"pass_rate":{"type":"null","description":"No model measurement is available in this API."},"model":{"type":"null","description":"No model measurement is available in this API."},"workflow":{"anyOf":[{"type":"object","properties":{"task_id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"review_state":{"type":"string","enum":["UNASSIGNED","ASSIGNED","IN_REVIEW","REVIEWED"]},"decision":{"type":"string","enum":["PENDING","READY_AS_IS","MINOR_REPAIR","MAJOR_REPAIR","REJECTED"]},"archived":{"type":"integer","enum":[0,1]}},"required":["task_id","review_state","decision","archived"],"additionalProperties":false},{"type":"null"}]},"problem":{"type":"string"},"problem_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}},"required":["id","ordinal","title","run_id","question_id","parent_title","status","publication_verified","human_review","imported_at","report","report_download_url","result_id","pass_rate","model","workflow","problem","problem_sha256"],"additionalProperties":false,"example":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","ordinal":1,"title":"A sample mathematical proposition","run_id":"11111111-2222-4333-8444-555555555555","question_id":"math-example-topic","parent_title":"Elementary number theory","status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"report_download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download","result_id":"example-result","pass_rate":null,"model":null,"workflow":{"task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","review_state":"UNASSIGNED","decision":"PENDING","archived":0},"problem":"Prove or disprove the stated proposition.","problem_sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}},"ResearchDetail":{"type":"object","properties":{"schema_version":{"type":"string","const":"math-task-reports-v1"},"task":{"$ref":"#/components/schemas/ResearchTaskDetail"}},"required":["schema_version","task"],"additionalProperties":false},"Reports":{"type":"object","properties":{"schema_version":{"type":"string","const":"math-task-reports-v1"},"reports":{"type":"array","items":{"$ref":"#/components/schemas/ResearchTask"}},"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1},"page_size":{"type":"integer","minimum":1,"maximum":100,"example":25},"total_runs":{"type":"integer","minimum":0},"mapped_reports":{"type":"integer","minimum":0}},"required":["schema_version","reports","total","page","page_size","total_runs","mapped_reports"],"additionalProperties":false,"example":{"schema_version":"math-task-reports-v1","reports":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","ordinal":1,"title":"A sample mathematical proposition","run_id":"11111111-2222-4333-8444-555555555555","question_id":"math-example-topic","parent_title":"Elementary number theory","status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","report":{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"},"report_download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download","result_id":"example-result","pass_rate":null,"model":null,"workflow":{"task_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","review_state":"UNASSIGNED","decision":"PENDING","archived":0}}],"total":1,"page":1,"page_size":25,"total_runs":1,"mapped_reports":1}},"Run":{"type":"object","properties":{"topic_id":{"type":"string","example":"math:math-example-topic"},"question_id":{"type":"string","maxLength":250,"example":"math-example-topic"},"title":{"type":"string"},"run_id":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"},"run_count":{"type":"integer","minimum":0},"task_count":{"type":"integer","minimum":0},"status":{"type":"string"},"publication_verified":{"type":"boolean"},"human_review":{"type":"string"},"imported_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"reports":{"type":"array","items":{"$ref":"#/components/schemas/Artifact"}},"report_download_url":{"anyOf":[{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/workflow"},{"type":"null"}]},"research_bundle_url":{"anyOf":[{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/workflow"},{"type":"null"}]},"public_tasks_url":{"anyOf":[{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/workflow"},{"type":"null"}]},"pass_rate":{"type":"null","description":"No model measurement is available in this API."},"model":{"type":"null","description":"No model measurement is available in this API."},"review_summary":{"anyOf":[{"type":"object","properties":{"run_id":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"},"total":{"type":"integer","minimum":0},"active":{"type":"integer","minimum":0},"reviewed":{"type":"integer","minimum":0},"accepted":{"type":"integer","minimum":0},"archived":{"type":"integer","minimum":0}},"required":["run_id","total","active","reviewed","accepted","archived"],"additionalProperties":false},{"type":"null"}]}},"required":["topic_id","question_id","title","run_id","run_count","task_count","status","publication_verified","human_review","imported_at","reports","report_download_url","research_bundle_url","public_tasks_url","pass_rate","model","review_summary"],"additionalProperties":false,"example":{"topic_id":"math:math-example-topic","question_id":"math-example-topic","title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","run_count":1,"task_count":1,"status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","reports":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}],"report_download_url":null,"research_bundle_url":null,"public_tasks_url":null,"pass_rate":null,"model":null,"review_summary":{"run_id":"11111111-2222-4333-8444-555555555555","total":1,"active":1,"reviewed":0,"accepted":0,"archived":0}}},"Topics":{"type":"object","properties":{"schema_version":{"type":"string","const":"math-research-v1"},"topics":{"type":"array","items":{"$ref":"#/components/schemas/Run"}},"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1},"page_size":{"type":"integer","minimum":1,"maximum":100,"example":25},"total_tasks":{"type":"integer","minimum":0}},"required":["schema_version","topics","total","page","page_size","total_tasks"],"additionalProperties":false,"example":{"schema_version":"math-research-v1","topics":[{"topic_id":"math:math-example-topic","question_id":"math-example-topic","title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","run_count":1,"task_count":1,"status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","reports":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}],"report_download_url":null,"research_bundle_url":null,"public_tasks_url":null,"pass_rate":null,"model":null,"review_summary":{"run_id":"11111111-2222-4333-8444-555555555555","total":1,"active":1,"reviewed":0,"accepted":0,"archived":0}}],"total":1,"page":1,"page_size":25,"total_tasks":1}},"Runs":{"type":"object","properties":{"schema_version":{"type":"string","const":"math-research-v1"},"runs":{"type":"array","items":{"$ref":"#/components/schemas/Run"}},"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1},"page_size":{"type":"integer","minimum":1,"maximum":100,"example":25},"total_tasks":{"type":"integer","minimum":0}},"required":["schema_version","runs","total","page","page_size","total_tasks"],"additionalProperties":false,"example":{"schema_version":"math-research-v1","runs":[{"topic_id":"math:math-example-topic","question_id":"math-example-topic","title":"Elementary number theory","run_id":"11111111-2222-4333-8444-555555555555","run_count":1,"task_count":1,"status":"COMPLETED","publication_verified":true,"human_review":"PENDING","imported_at":"2026-09-22T12:00:00.000Z","reports":[{"id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","filename":"research-report.md","label":"Research report","kind":"RESEARCH_REPORT","bytes":2048,"download_url":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}],"report_download_url":null,"research_bundle_url":null,"public_tasks_url":null,"pass_rate":null,"model":null,"review_summary":{"run_id":"11111111-2222-4333-8444-555555555555","total":1,"active":1,"reviewed":0,"accepted":0,"archived":0}}],"total":1,"page":1,"page_size":25,"total_tasks":1}},"RunDetail":{"type":"object","properties":{"schema_version":{"type":"string","const":"math-research-v1"},"run":{"type":"object","properties":{"topic_id":{"type":"string","example":"math:math-example-topic"},"question_id":{"type":"string","maxLength":250,"example":"math-example-topic"},"title":{"type":"string"},"run_id":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"},"run_count":{"type":"integer","minimum":0},"task_count":{"type":"integer","minimum":0},"status":{"type":"string"},"publication_verified":{"type":"boolean"},"human_review":{"type":"string"},"imported_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"reports":{"type":"array","items":{"$ref":"#/components/schemas/Artifact"}},"report_download_url":{"anyOf":[{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/workflow"},{"type":"null"}]},"research_bundle_url":{"anyOf":[{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/workflow"},{"type":"null"}]},"public_tasks_url":{"anyOf":[{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/workflow"},{"type":"null"}]},"pass_rate":{"type":"null","description":"No model measurement is available in this API."},"model":{"type":"null","description":"No model measurement is available in this API."},"review_summary":{"anyOf":[{"type":"object","properties":{"run_id":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"},"total":{"type":"integer","minimum":0},"active":{"type":"integer","minimum":0},"reviewed":{"type":"integer","minimum":0},"accepted":{"type":"integer","minimum":0},"archived":{"type":"integer","minimum":0}},"required":["run_id","total","active","reviewed","accepted","archived"],"additionalProperties":false},{"type":"null"}]},"proposition":{"type":"string"},"problem":{"type":"string"},"tasks":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/ResearchTaskDetail"},{"type":"object","properties":{"ordinal":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"problem":{"type":"string"}},"required":["ordinal","problem"],"additionalProperties":false}]}},"research_outcomes":{"type":"array","items":{"description":"Imported JSON content. Shape varies with the source report; may be null.","example":null},"description":"Source-defined research outcome records."},"source_commit":{"type":"string"}},"required":["topic_id","question_id","title","run_id","run_count","task_count","status","publication_verified","human_review","imported_at","reports","report_download_url","research_bundle_url","public_tasks_url","pass_rate","model","review_summary","proposition","problem","tasks","research_outcomes","source_commit"],"additionalProperties":false}},"required":["schema_version","run"],"additionalProperties":false},"Paths":{"type":"object","properties":{"paths":{"type":"array","items":{"type":"object","properties":{"artifact_id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"kind":{"type":"string"},"filename":{"type":"string"},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"bytes":{"type":"integer","minimum":0},"run_id":{"type":"string","format":"uuid","example":"11111111-2222-4333-8444-555555555555"},"question_id":{"type":"string","maxLength":250,"example":"math-example-topic"},"aws_job_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"source_batch_id":{"type":["integer","string","null"]},"source_uri":{"type":"string","example":"s3://example-bucket/runs/example/report.md","description":"Private source identifier; not a public URL."},"imported_uri":{"type":"string","example":"s3://example-artifacts/math-imports/example/report.md","description":"Private imported identifier; use download_url to retrieve bytes."},"download_url":{"type":"string","example":"/w/math/api/math/artifacts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/download"}},"required":["artifact_id","kind","filename","sha256","bytes","run_id","question_id","aws_job_id","source_batch_id","source_uri","imported_uri","download_url"],"additionalProperties":false}}},"required":["paths"],"additionalProperties":false},"Evidence":{"type":"object","properties":{"task_id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"source_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"truth_value":{"description":"Imported JSON content. Shape varies with the source report; may be null.","example":null},"rubric":{"description":"Imported JSON content. Shape varies with the source report; may be null.","example":null},"independent_review":{"description":"Imported JSON content. Shape varies with the source report; may be null.","example":null},"public_review":{"description":"Imported JSON content. Shape varies with the source report; may be null.","example":null},"rubric_audit":{"description":"Imported JSON content. Shape varies with the source report; may be null.","example":null},"rubric_quality":{"description":"Imported JSON content. Shape varies with the source report; may be null.","example":null},"quality_gate":{"type":"object","properties":{"route":{"type":"string","const":"ADVANCE"},"reason":{"description":"Imported JSON content. Shape varies with the source report; may be null.","example":null},"quality_score":{"description":"Imported JSON content. Shape varies with the source report; may be null.","example":null}},"required":["route"],"additionalProperties":false},"source_report_id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"model_pass_rate":{"type":"null","description":"No model measurement is available in this API."}},"required":["task_id","source_sha256","rubric","independent_review","public_review","rubric_audit","rubric_quality","quality_gate","source_report_id","model_pass_rate"],"additionalProperties":false},"Monitor":{"type":"object","properties":{"scope":{"type":"string","enum":["workspace","assigned_tasks"]},"source":{"type":"string","const":"imported_dashboard_data"},"live_pipeline_jobs_available":{"type":"boolean","const":false},"tasks":{"type":"integer","minimum":0},"runs":{"type":"integer","minimum":0},"topics":{"type":"integer","minimum":0},"last_imported_at":{"anyOf":[{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},{"type":"null"}]},"last_workflow_change_at":{"anyOf":[{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},{"type":"null"}]},"in_review":{"type":"integer","minimum":0},"reviewed":{"type":"integer","minimum":0},"archived":{"type":"integer","minimum":0}},"required":["scope","source","live_pipeline_jobs_available","tasks","runs","topics","last_imported_at","last_workflow_change_at","in_review","reviewed","archived"],"additionalProperties":false},"Activity":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/HistoryEvent"}},"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":1},"page_size":{"type":"integer","minimum":1,"maximum":100,"example":25}},"required":["events","total","page","page_size"],"additionalProperties":false},"Analytics":{"type":"object","properties":{"total_tasks":{"type":"integer","minimum":0},"total_runs":{"type":"integer","minimum":0},"verified_reports":{"type":"integer","minimum":0},"active_tasks":{"type":"integer","minimum":0},"assigned_clients":{"type":"integer","minimum":0},"archived":{"type":"integer","minimum":0},"review_states":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["UNASSIGNED","ASSIGNED","IN_REVIEW","REVIEWED"]},"count":{"type":"integer","minimum":0}},"required":["state","count"],"additionalProperties":false}},"decisions":{"type":"array","items":{"type":"object","properties":{"decision":{"type":"string","enum":["PENDING","READY_AS_IS","MINOR_REPAIR","MAJOR_REPAIR","REJECTED"]},"count":{"type":"integer","minimum":0}},"required":["decision","count"],"additionalProperties":false}},"days":{"type":"integer","enum":[7,30,90]},"since":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"reviewer_workload":{"type":"array","items":{"type":"object","properties":{"reviewer_id":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},{"type":"null"}]},"reviewer_name":{"type":"string"},"total":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"in_review":{"type":"integer","minimum":0},"reviewed":{"type":"integer","minimum":0}},"required":["reviewer_id","reviewer_name","total","pending","in_review","reviewed"],"additionalProperties":false}},"decision_trend":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date","example":"2026-09-22"},"decisions":{"type":"integer","minimum":0},"accepted":{"type":"integer","minimum":0}},"required":["day","decisions","accepted"],"additionalProperties":false}},"model_measurements":{"type":"integer","const":0},"recent_activity":{"type":"array","items":{"$ref":"#/components/schemas/HistoryEvent"}}},"required":["total_tasks","total_runs","verified_reports","active_tasks","assigned_clients","archived","review_states","decisions","days","since","reviewer_workload","decision_trend","model_measurements","recent_activity"],"additionalProperties":false},"Clients":{"type":"object","properties":{"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"name":{"type":"string","example":"Example client"},"description":{"type":"string"},"enabled":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"task_count":{"type":"integer","minimum":0},"archived_count":{"type":"integer","minimum":0}},"required":["id","name","description","enabled","updated_at","task_count","archived_count"],"additionalProperties":false}}},"required":["clients"],"additionalProperties":false},"SharedClients":{"type":"object","properties":{"schema_version":{"type":"string","const":"campaign-clients-v1"},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"name":{"type":"string"},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"task_count":{"type":"integer","minimum":0}},"required":["id","name","enabled","created_at","updated_at","task_count"],"additionalProperties":false}}},"required":["schema_version","clients"],"additionalProperties":false},"ClientCreate":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":100,"example":"Example client"},"description":{"type":"string","maxLength":2000}},"required":["name"],"additionalProperties":false},"ClientUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":100,"example":"Example client"},"description":{"type":"string","maxLength":2000},"enabled":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z","description":"Exact updated_at from the client list. Stale values return 409."}},"required":["name","description","enabled","updated_at"],"additionalProperties":false},"ClientCreated":{"type":"object","properties":{"client":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"name":{"type":"string","example":"Example client"},"description":{"type":"string"},"enabled":{"type":"boolean"},"task_count":{"type":"integer","const":0}},"required":["id","name","description","enabled","task_count"],"additionalProperties":false}},"required":["client"],"additionalProperties":false},"ClientUpdated":{"type":"object","properties":{"client":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"name":{"type":"string","example":"Example client"},"description":{"type":"string"},"enabled":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"}},"required":["id","name","description","enabled","updated_at"],"additionalProperties":false}},"required":["client"],"additionalProperties":false},"Attachment":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{32}$","example":"cccccccccccccccccccccccccccccccc"},"task_id":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"filename":{"type":"string","example":"proof.pdf"},"description":{"type":"string"},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$","example":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},"bytes":{"type":"integer","minimum":1,"maximum":16777216,"example":42},"uploaded_by":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"created_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"download_url":{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/attachments/cccccccccccccccccccccccccccccccc/download"}},"required":["id","task_id","filename","description","sha256","bytes","uploaded_by","created_at","download_url"],"additionalProperties":false},"Attachments":{"type":"object","properties":{"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"},"maxItems":200}},"required":["attachments"],"additionalProperties":false},"AttachmentDetail":{"type":"object","properties":{"attachment":{"$ref":"#/components/schemas/Attachment"}},"required":["attachment"],"additionalProperties":false},"AttachmentDeleted":{"type":"object","properties":{"deleted":{"type":"boolean","const":true},"id":{"type":"string","pattern":"^[0-9a-f]{32}$","example":"cccccccccccccccccccccccccccccccc"}},"required":["deleted","id"],"additionalProperties":false},"Key":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-f]{24}$","example":"bbbbbbbbbbbbbbbbbbbbbbbb"},"actor_id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"name":{"type":"string"},"role":{"type":"string","enum":["REVIEWER","OWNER","ADMIN"]},"scopes":{"type":"array","items":{"type":"string","enum":["read","write","files:read","files:write","paths:read","keys:manage"]},"minItems":1,"maxItems":6,"uniqueItems":true},"workspace_id":{"type":"string","const":"ws_math"},"environment":{"type":"string","const":"dev"},"created_by":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"created_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"expires_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},{"type":"null"}]},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},{"type":"null"}]}},"required":["id","actor_id","name","role","scopes","workspace_id","environment","created_by","created_at","expires_at","revoked_at","last_used_at"],"additionalProperties":false},"Keys":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/Key"},"maxItems":500}},"required":["keys"],"additionalProperties":false},"KeyDetail":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/Key"}},"required":["key"],"additionalProperties":false},"KeyCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"example":"Read-only reporting"},"role":{"type":"string","enum":["REVIEWER","OWNER","ADMIN"],"description":"Defaults to the issuer’s effective role. Cannot exceed issuer or target member."},"actor_id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42,"description":"Defaults to yourself. Only Admin can issue keys for another enabled Math member."},"expires_in_days":{"type":"integer","minimum":1,"maximum":365,"default":90},"scopes":{"type":"array","items":{"type":"string","enum":["read","write","files:read","files:write","paths:read","keys:manage"]},"minItems":1,"maxItems":6,"uniqueItems":true,"description":"Defaults to issuer scopes. Cannot exceed issuer scopes.","example":["read","files:read"]}},"required":["name"],"additionalProperties":false},"KeyCreated":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/Key"},"token":{"type":"string","example":"YOUR_NEW_API_KEY","description":"Secret returned only on creation. Store privately; it cannot be retrieved again."},"token_shown_once":{"type":"boolean","const":true}},"required":["key","token","token_shown_once"],"additionalProperties":false},"KeyEvents":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"key_id":{"type":"string","pattern":"^[0-9a-f]{24}$","example":"bbbbbbbbbbbbbbbbbbbbbbbb"},"actor_id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"action":{"type":"string","enum":["CREATED","REVOKED","REQUEST"]},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"route":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"integer","minimum":100,"maximum":599},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"}},"required":["id","key_id","actor_id","action","request_id","method","route","status","created_at"],"additionalProperties":false},"maxItems":100}},"required":["events"],"additionalProperties":false},"BugReports":{"type":"object","properties":{"schema_version":{"type":"string","const":"bug-reports-v1"},"reports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"reporter":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"display_name":{"type":"string"},"role":{"type":"string","enum":["REVIEWER","OWNER","ADMIN"]}},"required":["id","display_name","role"],"additionalProperties":false},"description":{"type":"string"},"page_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"screenshot_attached":{"type":"boolean"},"screenshot_url":{"anyOf":[{"type":"string","example":"/w/math/api/math/tasks/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/workflow"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"}},"required":["id","reporter","description","page_path","status","screenshot_attached","screenshot_url","created_at","updated_at"],"additionalProperties":false},"maxItems":50}},"required":["schema_version","reports"],"additionalProperties":false},"BugCreate":{"type":"object","properties":{"description":{"type":"string","minLength":5,"maxLength":4000,"example":"The report download button is unavailable."},"page_path":{"type":"string","maxLength":500,"example":"/w/math/tasks"},"picture":{"type":"string","format":"binary","description":"Optional PNG, JPEG or WebP image, at most 8 MiB."}},"required":["description"],"additionalProperties":false},"BugCreated":{"type":"object","properties":{"schema_version":{"type":"string","const":"bug-report-v1"},"report":{"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":9007199254740991,"example":42},"status":{"type":"string","const":"OPEN"},"screenshot_attached":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","example":"2026-09-22T12:00:00.000Z"}},"required":["id","status","screenshot_attached","created_at"],"additionalProperties":false}},"required":["schema_version","report"],"additionalProperties":false},"ViewableUsers":{"type":"object","properties":{"schema_version":{"type":"string","const":"viewable-users-v1"},"role":{"type":"string","const":"ADMIN"},"users":{"type":"array","maxItems":0,"items":false}},"required":["schema_version","role","users"],"additionalProperties":false}}}}