{"openapi":"3.1.0","info":{"title":"Adversarial API","description":"","license":{"name":""},"version":"0.1.0"},"servers":[{"url":"https://api.adversarial.com/api","description":"Production"},{"url":"https://api.adversarial.dev/api","description":"Staging"},{"url":"http://localhost:8080/api","description":"Local"}],"paths":{"/.well-known/oauth-authorization-server":{"get":{"tags":["OAuth"],"summary":"GET /.well-known/oauth-authorization-server","operationId":"authorization_server_metadata","responses":{"200":{"description":"Authorization server metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationServerMetadata"}}}}}}},"/.well-known/oauth-protected-resource":{"get":{"tags":["OAuth"],"summary":"GET /.well-known/oauth-protected-resource","operationId":"protected_resource_metadata","responses":{"200":{"description":"Protected resource metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtectedResourceMetadata"}}}}}}},"/oauth/register":{"post":{"tags":["OAuth"],"summary":"POST /oauth/register  (RFC 7591)","operationId":"register","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"Client registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"400":{"description":"Invalid registration"},"403":{"description":"Dynamic client registration is disabled"}}}},"/oauth/revoke":{"post":{"tags":["OAuth"],"summary":"POST /oauth/revoke","operationId":"revoke","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/RevokeRequest"}}},"required":true},"responses":{"200":{"description":"Revocation processed (always 200 per RFC 7009)"}}}},"/v1/auth/callback":{"get":{"tags":["Authorization"],"summary":"Complete OAuth2 login","operationId":"callback","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"state","in":"query","required":true,"schema":{"type":"string"}},{"name":"error","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"303":{"description":"Redirect to the next URL"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}}}},"/v1/auth/login":{"get":{"tags":["Authorization"],"summary":"Initiate OAuth2 login","operationId":"login","parameters":[{"name":"next_url","in":"query","required":true,"schema":{"type":"string"}},{"name":"provider","in":"query","required":true,"schema":{"type":"string"}},{"name":"invite_code","in":"query","required":false,"schema":{"type":["string","null"],"format":"uuid"}}],"responses":{"303":{"description":"Redirect to OAuth provider's login page"},"400":{"description":"Invalid auth provider"},"500":{"description":"Internal server error"}}}},"/v1/auth/logout":{"post":{"tags":["Authorization"],"summary":"Log out the current user","operationId":"logout","responses":{"200":{"description":"OK"},"500":{"description":"Internal server error"}}}},"/v1/auth/organizations/{id}":{"post":{"tags":["Authorization"],"summary":"Switch organization","operationId":"switch_orgs","parameters":[{"name":"id","in":"path","description":"Organization ID","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"responses":{"200":{"description":"OK"},"500":{"description":"Internal server error"}}}},"/v1/comments/{uuid}":{"put":{"tags":["Comments"],"summary":"Update a comment by ID","operationId":"update_comment","parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCommentRequest"}}},"required":true},"responses":{"200":{"description":"Update a comment by ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}}}},"delete":{"tags":["Comments"],"summary":"Delete a comment by ID","operationId":"delete_comment","parameters":[{"name":"uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Delete a comment by ID","content":{"application/json":{"schema":{}}}}}}},"/v1/context":{"get":{"tags":["Context"],"summary":"Retrieve information about the current user and their organization","operationId":"whoami","responses":{"200":{"description":"Retrieve information about the current user and their organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhoamiResponse"}}}}}}},"/v1/documents":{"get":{"tags":["Documents"],"summary":"List documents","operationId":"list_documents","responses":{"200":{"description":"List all documents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentList"}}}}}}},"/v1/documents/board-deck/pptx":{"get":{"tags":["Documents"],"summary":"Download the Board Deck powerpoint","operationId":"download_board_deck","responses":{"200":{"description":"The Board Deck","content":{"application/octet-stream":{"schema":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}}}}}},"/v1/documents/cybergov/pptx":{"get":{"tags":["Documents"],"summary":"Download the cybergov powerpoint","operationId":"download_cybergov","parameters":[{"name":"period","in":"query","description":"Give the period a name","required":true,"schema":{"type":"string"}},{"name":"start","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"end","in":"query","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"The CyberGov PowerPoint","content":{"application/octet-stream":{"schema":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}}}}}},"/v1/documents/{id}":{"patch":{"tags":["Documents"],"summary":"Make changes to documents","operationId":"patch_document","parameters":[{"name":"id","in":"path","description":"The document slug","required":true,"schema":{"type":"string"},"example":"cybergov-charter"}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentInput"}}}},"required":true},"responses":{"200":{"description":"Documents updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProposalAction"}}}}}}},"/v1/documents/{id}/proposal":{"patch":{"tags":["Documents"],"summary":"Approve or deny an open proposal","operationId":"patch_document_proposal","parameters":[{"name":"id","in":"path","description":"Document ID","required":true,"schema":{"type":"string"},"example":"ramp"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionAction"}}},"required":true},"responses":{"200":{"description":"Proposal decided on","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProposal"}}}},"400":{"description":"No open proposal exists"}}}},"/v1/documents/{slug}":{"get":{"tags":["Documents"],"summary":"Get editor data for a document","operationId":"get_document_editor","parameters":[{"name":"slug","in":"path","description":"The document slug","required":true,"schema":{"type":"string"},"example":"cybergov-charter"}],"responses":{"200":{"description":"Document editor data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArmDocument"}}}},"404":{"description":"Document not found"}}}},"/v1/documents/{slug}/docx":{"get":{"tags":["Documents"],"summary":"Get a document","operationId":"download_docx","parameters":[{"name":"slug","in":"path","description":"The document slug","required":true,"schema":{"type":"string"},"example":"cybergov-charter"}],"responses":{"200":{"description":"Get a document","content":{"application/octet-stream":{"schema":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}}}}}},"/v1/filter_views":{"get":{"tags":["Filter Views"],"summary":"List filter views for the current user","operationId":"list_filter_views","parameters":[{"name":"table","in":"query","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/FilterViewTable"}]}}],"responses":{"200":{"description":"List filter views","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFilterViewsResponse"}}}}}},"post":{"tags":["Filter Views"],"summary":"Create a new filter view","operationId":"create_filter_view","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFilterViewRequest"}}},"required":true},"responses":{"201":{"description":"Filter view created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterView"}}}},"400":{"description":"Invalid request"}}}},"/v1/filter_views/{id}":{"get":{"tags":["Filter Views"],"summary":"Get a filter view by ID.","operationId":"get_filter_view","parameters":[{"name":"id","in":"path","description":"The filter view ID","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"responses":{"200":{"description":"Get the filter view","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterView"}}}},"404":{"description":"Filter view not found"}}},"put":{"tags":["Filter Views"],"summary":"Update a filter view","operationId":"update_filter_view","parameters":[{"name":"id","in":"path","description":"The filter view ID","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFilterViewRequest"}}},"required":true},"responses":{"200":{"description":"Filter view updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterView"}}}},"404":{"description":"Filter view not found"}}},"delete":{"tags":["Filter Views"],"summary":"Delete a filter view","operationId":"delete_filter_view","parameters":[{"name":"id","in":"path","description":"The filter view ID","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"responses":{"204":{"description":"Filter view deleted"},"404":{"description":"Filter view not found"}}}},"/v1/filter_views/{id}/copy":{"post":{"tags":["Filter Views"],"summary":"Copy a filter view into the caller's own collection (\"Copy to my views\").","operationId":"copy_filter_view","parameters":[{"name":"id","in":"path","description":"The filter view ID to copy","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"responses":{"201":{"description":"Filter view copied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterView"}}}},"404":{"description":"Filter view not found"}}}},"/v1/incidents":{"get":{"tags":["Incidents"],"summary":"List incidents with associated components for the incident register","operationId":"list_paginated_incidents","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":["array","null"],"items":{"type":"string"}}},{"name":"title_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"description_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"free_text","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"id_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"severity","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Severity"}}},{"name":"status","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/IncidentStatus"}}},{"name":"source","in":"query","required":false,"schema":{"type":["array","null"],"items":{"type":"string"}}},{"name":"assigned_to","in":"query","description":"Accepts UUIDs, the literal `null` (unassigned), and the sentinel\n`me` (the calling user, resolved server-side). Multiple values\nunion.","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_AssignedTo"}}},{"name":"threat_objectives","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_ThreatName"}}},{"name":"created_after","in":"query","description":"Inclusive lower bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"created_before","in":"query","description":"Inclusive upper bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"updated_after","in":"query","description":"Inclusive lower bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"updated_before","in":"query","description":"Inclusive upper bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"detected_after","in":"query","description":"Inclusive lower bound on `detected_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"detected_before","in":"query","description":"Inclusive upper bound on `detected_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"occurred_after","in":"query","description":"Inclusive lower bound on `occurred_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"occurred_before","in":"query","description":"Inclusive upper bound on `occurred_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"occurred_is_null","in":"query","description":"Match only incidents whose `occurred_date` is unset. Mutually\nexclusive with `occurred_after`/`occurred_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"responded_after","in":"query","description":"Inclusive lower bound on `responded_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"responded_before","in":"query","description":"Inclusive upper bound on `responded_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"responded_is_null","in":"query","description":"Match only incidents whose `responded_date` is unset. Mutually\nexclusive with `responded_after`/`responded_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"contained_after","in":"query","description":"Inclusive lower bound on `contained_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"contained_before","in":"query","description":"Inclusive upper bound on `contained_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"contained_is_null","in":"query","description":"Match only incidents whose `contained_date` is unset. Mutually\nexclusive with `contained_after`/`contained_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"opened_by","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"updated_by","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"tags","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"include_children","in":"query","description":"When true, the list includes incidents that are linked under another\nincident (i.e. rows with a non-null `parent_id`). Defaults to false so\nregisters and rollups stay collapsed.","required":false,"schema":{"type":["boolean","null"]}},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1 (explicit `null` reads as the\ndefault); zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 50 (explicit `null` reads as the default);\nzero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":50,"maximum":500,"minimum":1}},{"name":"order_by","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"List incidents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_IncidentRegisterEntry"}}}}}},"post":{"tags":["Incidents"],"summary":"Create a new incident","operationId":"create_incident","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/CreateIncidentRequest"}]}}}},"responses":{"201":{"description":"Incident created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Incident"}}}},"400":{"description":"Validation failed (e.g. unknown source, inactive assignee)"}}},"delete":{"tags":["Incidents"],"summary":"Delete many incidents by incident IDs","description":"Note that all incidents are soft-deleted","operationId":"delete_many_incidents","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteManyIncidentsRequest"}}},"required":true},"responses":{"200":{"description":"Incidents deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteManyIncidentsResponse"}}}}}},"patch":{"tags":["Incidents"],"summary":"Update many incident's editable fields, given a list of incident IDs","operationId":"patch_many_incidents","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMultipleIncidentsRequest"}}},"required":true},"responses":{"200":{"description":"Incidents updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateManyIncidentsResponse"}}}},"400":{"description":"Validation failed (e.g. empty payload, unknown source, inactive assignee)"},"404":{"description":"not found"},"422":{"description":"Invalid parent link (self-link, cycle, multi-layer nesting, or deleted parent)"}}}},"/v1/incidents/export":{"post":{"tags":["Incidents"],"summary":"Export incidents as CSV","operationId":"export_incidents_csv","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ExportIncidentsRequest"}]}}}},"responses":{"200":{"description":"Export all incidents with current state as CSV","content":{"application/octet-stream":{"schema":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}}}}}},"/v1/incidents/import":{"post":{"tags":["Incidents"],"summary":"Import incidents from one or more CSV files provided via multipart form data","operationId":"import_incidents_csv","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ImportIncidentsMultipart"}}},"required":true},"responses":{"201":{"description":"Incidents imported from CSV","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportIncidentsResponse"}}}},"400":{"description":"Invalid CSV row, source, or shape"}}}},"/v1/incidents/scores":{"post":{"tags":["Incidents"],"summary":"Suggest scores for many incidents based on the provided parameters","operationId":"create_many_incident_scores","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestIncidentScoreRequest"}}},"required":true},"responses":{"200":{"description":"Incident Score Suggestion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiIncidentScoringResponse"}}}}}}},"/v1/incidents/sources":{"get":{"tags":["Incidents"],"summary":"List all incident sources available for use in the organization","operationId":"list_incident_sources","responses":{"200":{"description":"List of incident sources","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSourcesResponse"}}}}}},"post":{"tags":["Incidents"],"summary":"Add a new incident source to be available for use in the organization","operationId":"add_incident_source","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSourceRequest"}}},"required":true},"responses":{"201":{"description":"Incident source created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceResponse"}}}},"400":{"description":"Incident source already exists"}}},"delete":{"tags":["Incidents"],"summary":"Delete an incident source from the organization","operationId":"delete_incident_source","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSourceRequest"}}},"required":true},"responses":{"200":{"description":"Incident source deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSourceResponse"}}}}}}},"/v1/incidents/sources/reset":{"post":{"tags":["Incidents"],"summary":"Set incident sources back to the defaults","operationId":"reset_incident_sources","responses":{"200":{"description":"Incident sources reset to defaults","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetSourcesResponse"}}}}}}},"/v1/incidents/{id}":{"get":{"tags":["Incidents"],"summary":"Get an incident by ID","operationId":"get_incident","parameters":[{"name":"id","in":"path","description":"The ID of the incident to retrieve","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"}],"responses":{"200":{"description":"Get the incident","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentRegisterEntry"}}}},"404":{"description":"Incident not found"}}},"patch":{"tags":["Incidents"],"summary":"Update some of an incident's editable fields, by ID","operationId":"patch_incident","parameters":[{"name":"id","in":"path","description":"The ID of the incident to update","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateIncidentRequest"}}},"required":true},"responses":{"200":{"description":"Incident updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentRegisterEntry"}}}},"400":{"description":"Validation failed (e.g. empty payload, unknown source, inactive assignee)"},"404":{"description":"Incident not found"},"422":{"description":"Invalid parent link (self-link, cycle, multi-layer nesting, or deleted parent)"}}}},"/v1/incidents/{id}/children":{"get":{"tags":["Incidents"],"summary":"List incidents linked under a given parent incident. The default\n`/v1/incidents` register hides children — this endpoint is the only way to\nenumerate them.","operationId":"list_children_of_incident","parameters":[{"name":"id","in":"path","description":"Parent INC numeric ID (e.g. 1 for INC-00001)","required":true,"schema":{"type":"integer","format":"int64"},"example":1},{"name":"id","in":"query","required":false,"schema":{"type":["array","null"],"items":{"type":"string"}}},{"name":"title_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"description_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"free_text","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"id_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"severity","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Severity"}}},{"name":"status","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/IncidentStatus"}}},{"name":"source","in":"query","required":false,"schema":{"type":["array","null"],"items":{"type":"string"}}},{"name":"assigned_to","in":"query","description":"Accepts UUIDs, the literal `null` (unassigned), and the sentinel\n`me` (the calling user, resolved server-side). Multiple values\nunion.","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_AssignedTo"}}},{"name":"threat_objectives","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_ThreatName"}}},{"name":"created_after","in":"query","description":"Inclusive lower bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"created_before","in":"query","description":"Inclusive upper bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"updated_after","in":"query","description":"Inclusive lower bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"updated_before","in":"query","description":"Inclusive upper bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"detected_after","in":"query","description":"Inclusive lower bound on `detected_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"detected_before","in":"query","description":"Inclusive upper bound on `detected_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"occurred_after","in":"query","description":"Inclusive lower bound on `occurred_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"occurred_before","in":"query","description":"Inclusive upper bound on `occurred_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"occurred_is_null","in":"query","description":"Match only incidents whose `occurred_date` is unset. Mutually\nexclusive with `occurred_after`/`occurred_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"responded_after","in":"query","description":"Inclusive lower bound on `responded_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"responded_before","in":"query","description":"Inclusive upper bound on `responded_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"responded_is_null","in":"query","description":"Match only incidents whose `responded_date` is unset. Mutually\nexclusive with `responded_after`/`responded_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"contained_after","in":"query","description":"Inclusive lower bound on `contained_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"contained_before","in":"query","description":"Inclusive upper bound on `contained_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"contained_is_null","in":"query","description":"Match only incidents whose `contained_date` is unset. Mutually\nexclusive with `contained_after`/`contained_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"opened_by","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"updated_by","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"tags","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"include_children","in":"query","description":"When true, the list includes incidents that are linked under another\nincident (i.e. rows with a non-null `parent_id`). Defaults to false so\nregisters and rollups stay collapsed.","required":false,"schema":{"type":["boolean","null"]}},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1 (explicit `null` reads as the\ndefault); zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 50 (explicit `null` reads as the default);\nzero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":50,"maximum":500,"minimum":1}},{"name":"order_by","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Incidents linked under this parent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_IncidentRegisterEntry"}}}},"404":{"description":"Parent incident not found"}}}},"/v1/incidents/{id}/comments":{"get":{"tags":["Incidents"],"summary":"Get comments for an incident","operationId":"list_incident_comments","parameters":[{"name":"id","in":"path","description":"The ID of the incident to retrieve comments for","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"}],"responses":{"200":{"description":"Get the comments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCommentsResponse"}}}},"404":{"description":"Incident not found"}}},"post":{"tags":["Incidents"],"summary":"Create a new comment for an incident","operationId":"create_incident_comment","parameters":[{"name":"id","in":"path","description":"The ID of the incident to create a comment for","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewCommentRequest"}}},"required":true},"responses":{"201":{"description":"Comment created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}},"404":{"description":"Incident not found"}}}},"/v1/incidents/{id}/history":{"get":{"tags":["Incidents"],"summary":"Get the history of changes for an incident","operationId":"list_incident_history","parameters":[{"name":"id","in":"path","description":"The ID of the incident to retrieve history for","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 100, max 500; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":100,"maximum":500,"minimum":1}}],"responses":{"200":{"description":"List the incident history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_HistoryEntry"}}}},"404":{"description":"Incident not found"}}}},"/v1/incidents/{id}/risks":{"post":{"tags":["Incidents"],"summary":"Create a new risk from an incident","operationId":"create_risk_from_incident","parameters":[{"name":"id","in":"path","description":"The ID of the incident to create a risk for","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"}],"responses":{"201":{"description":"Risk created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskRegisterEntry"}}}},"404":{"description":"Incident not found"}}}},"/v1/incidents/{id}/risks/{risk_id}":{"post":{"tags":["Incidents"],"summary":"Associate a risk with an incident","operationId":"create_risk_association","parameters":[{"name":"id","in":"path","description":"The ID of the incident to associate the risk with","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"},{"name":"risk_id","in":"path","description":"The ID of the risk to associate with the incident","required":true,"schema":{"type":"string"},"example":"AKR-1"}],"responses":{"201":{"description":"Risk associated","content":{"application/json":{"schema":{}}}},"404":{"description":"Incident not found"}}},"delete":{"tags":["Incidents"],"summary":"Remove a risk association from an incident","operationId":"delete_risk_association","parameters":[{"name":"id","in":"path","description":"The ID of the incident to remove the risk association from","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"},{"name":"risk_id","in":"path","description":"The ID of the risk to remove the association from the incident","required":true,"schema":{"type":"string"},"example":"AKR-1"}],"responses":{"200":{"description":"Association removed","content":{"application/json":{"schema":{}}}},"404":{"description":"Incident not found"}}}},"/v1/incidents/{id}/score":{"get":{"tags":["Incidents"],"summary":"Suggest an incident score based on the provided parameters","operationId":"get_incident_score","parameters":[{"name":"id","in":"path","description":"The ID of the incident to score","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"}],"responses":{"200":{"description":"Incident Score Suggestion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiIncidentScore"}}}}}}},"/v1/incidents/{id}/tags":{"delete":{"tags":["Incidents"],"summary":"Remove a tag from an incident","operationId":"delete_incident_tag","parameters":[{"name":"id","in":"path","description":"The ID of the incident","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveIncidentTagRequest"}}},"required":true},"responses":{"200":{"description":"Tag removed from incident"},"404":{"description":"Incident, tag, or association not found"}}}},"/v1/incidents/{id}/threats":{"get":{"tags":["Incidents"],"summary":"Get threats associated with an incident","operationId":"list_associated_threats","parameters":[{"name":"id","in":"path","description":"The ID of the incident to retrieve threats for","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"}],"responses":{"200":{"description":"Get the threats","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"}}}}},"404":{"description":"Incident not found"}}}},"/v1/incidents/{incident_id}/tags":{"post":{"tags":["Incidents"],"summary":"Add a tag to an incident","operationId":"create_incident_tag","parameters":[{"name":"incident_id","in":"path","description":"The ID of the incident","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddIncidentTagRequest"}}},"required":true},"responses":{"201":{"description":"Tag added to incident","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentTagResponse"}}}},"404":{"description":"Incident or tag not found"},"409":{"description":"Tag already associated with incident"}}}},"/v1/integrations":{"get":{"tags":["Integrations"],"summary":"List configured integrations","operationId":"get_configured_integrations","responses":{"200":{"description":"List of integrations","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationConfigResponse"}}}}}}}},"/v1/integrations/jira/incidents/import":{"get":{"tags":["Integrations"],"summary":"Preview Jira issues as incidents before import","operationId":"preview_import_jira_incidents","parameters":[{"name":"jql","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Preview Jira issues matching a JQL query as Incidents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportIncidentsPreviewResponse"}}}}}},"post":{"tags":["Integrations"],"summary":"Import incidents from Jira","operationId":"import_jira_incidents","parameters":[{"name":"jql","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Import Jira issues matching a JQL query as Incidents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportIncidentsResponse"}}}}}}},"/v1/integrations/jira/incidents/{incident_id}":{"get":{"tags":["Integrations"],"summary":"List Jira issues linked to an incident","operationId":"get_linked_jira_issues_for_incident","parameters":[{"name":"incident_id","in":"path","description":"Incident id, i.e. INC-1 or 42","required":true,"schema":{"type":"string"},"example":"INC-1"}],"responses":{"200":{"description":"Linked Jira issues","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLinkedTicketsResponse"}}}},"404":{"description":"Incident not found"}}},"post":{"tags":["Integrations"],"summary":"Create a Jira issue for an incident","operationId":"create_jira_ticket_for_incident","parameters":[{"name":"incident_id","in":"path","description":"Incident id, i.e. INC-1 or 42","required":true,"schema":{"type":"string"},"example":"INC-1"},{"name":"project","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Ticket created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketPreview"}}}},"400":{"description":"Project override is empty"},"404":{"description":"Incident not found"}}}},"/v1/integrations/jira/incidents/{incident_id}/issues/{issue_key}":{"post":{"tags":["Integrations"],"summary":"Link an incident to a Jira issue","operationId":"link_incident_to_jira_issue","parameters":[{"name":"incident_id","in":"path","description":"Incident id, i.e. INC-1 or 42","required":true,"schema":{"type":"string"},"example":"INC-1"},{"name":"issue_key","in":"path","description":"The Jira issue key","required":true,"schema":{"type":"string"},"example":"EXAMPLE-123"}],"responses":{"200":{"description":"Incident linked to Jira issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}}}},"delete":{"tags":["Integrations"],"summary":"Unlink an incident from a Jira issue","operationId":"unlink_incident_from_jira_issue","parameters":[{"name":"incident_id","in":"path","description":"Incident id, i.e. INC-1 or 42","required":true,"schema":{"type":"string"},"example":"INC-1"},{"name":"issue_key","in":"path","description":"The Jira issue key","required":true,"schema":{"type":"string"},"example":"EXAMPLE-123"}],"responses":{"200":{"description":"Incident unlinked from Jira issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}}}}},"/v1/integrations/jira/preview":{"get":{"tags":["Integrations"],"summary":"Search Jira issues (autocomplete)","operationId":"preview_jira_tickets","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Jira issues matching query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewTicketsResponse"}}}}}}},"/v1/integrations/jira/risks/import":{"get":{"tags":["Integrations"],"summary":"Preview Jira issues as risks before import","operationId":"preview_jira_import_risks","parameters":[{"name":"jql","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Preview Jira issues matching a JQL query as Risks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRisksPreviewResponse"}}}},"400":{"description":"Invalid request"},"404":{"description":"No issues match the query"}}},"post":{"tags":["Integrations"],"summary":"Import risks from Jira","operationId":"import_jira_risks","parameters":[{"name":"jql","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Import Jira issues matching a JQL query as Risks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRisksResponse"}}}}}}},"/v1/integrations/jira/risks/{risk_id}":{"get":{"tags":["Integrations"],"summary":"List Jira issues linked to a risk","operationId":"get_linked_jira_issues_for_risk","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId","required":true,"schema":{"type":"string"},"example":"RSK-1"}],"responses":{"200":{"description":"Linked Jira issues","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLinkedTicketsResponse"}}}},"404":{"description":"Risk not found"}}},"post":{"tags":["Integrations"],"summary":"Create a Jira issue for a risk","operationId":"jira_create_ticket_for_risk","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId, i.e. AKR-1, RSK-1","required":true,"schema":{"type":"string"},"example":"RSK-1"},{"name":"project","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Ticket created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketPreview"}}}},"400":{"description":"Project override is empty"},"404":{"description":"Risk not found"}}}},"/v1/integrations/jira/risks/{risk_id}/issues/{issue_key}":{"post":{"tags":["Integrations"],"summary":"Link a risk to a Jira issue","operationId":"link_risk_to_jira_issue","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId","required":true,"schema":{"type":"string"},"example":"RSK-1"},{"name":"issue_key","in":"path","description":"The Jira issue key","required":true,"schema":{"type":"string"},"example":"EXAMPLE-123"}],"responses":{"200":{"description":"Risk linked to Jira issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}}}},"delete":{"tags":["Integrations"],"summary":"Unlink a risk from a Jira issue","operationId":"unlink_risk_from_jira_issue","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId","required":true,"schema":{"type":"string"},"example":"RSK-1"},{"name":"issue_key","in":"path","description":"The Jira issue key","required":true,"schema":{"type":"string"},"example":"EXAMPLE-123"}],"responses":{"200":{"description":"Risk unlinked from Jira issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}}}}},"/v1/integrations/linear/incidents/{incident_id}":{"get":{"tags":["Integrations"],"summary":"List Linear issues linked to an incident","operationId":"get_linked_linear_issues_for_incident","parameters":[{"name":"incident_id","in":"path","description":"String-formatted IncidentId","required":true,"schema":{"type":"string"},"example":"INC-1"}],"responses":{"200":{"description":"Linked Linear issues","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLinkedTicketsResponse"}}}},"404":{"description":"Incident not found"}}},"post":{"tags":["Integrations"],"summary":"Create a Linear issue for an incident","operationId":"linear_create_ticket_for_incident","parameters":[{"name":"incident_id","in":"path","description":"String-formatted IncidentId","required":true,"schema":{"type":"string"},"example":"INC-1"}],"responses":{"200":{"description":"Issue created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketPreview"}}}},"404":{"description":"Incident not found"}}}},"/v1/integrations/linear/incidents/{incident_id}/issues/{issue_key}":{"post":{"tags":["Integrations"],"summary":"Link an incident to a Linear issue","operationId":"link_incident_to_linear_issue","parameters":[{"name":"incident_id","in":"path","description":"String-formatted IncidentId","required":true,"schema":{"type":"string"},"example":"INC-1"},{"name":"issue_key","in":"path","description":"The stable Linear issue id (UUID), not the human identifier — a team-key rename can reuse the identifier","required":true,"schema":{"type":"string"},"example":"550e8400-e29b-41d4-a716-446655440000"}],"responses":{"200":{"description":"Incident linked to Linear issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}}}},"delete":{"tags":["Integrations"],"summary":"Unlink an incident from a Linear issue","operationId":"unlink_incident_from_linear_issue","parameters":[{"name":"incident_id","in":"path","description":"String-formatted IncidentId","required":true,"schema":{"type":"string"},"example":"INC-1"},{"name":"issue_key","in":"path","description":"The stable Linear issue id (UUID), not the human identifier — a team-key rename can reuse the identifier","required":true,"schema":{"type":"string"},"example":"550e8400-e29b-41d4-a716-446655440000"}],"responses":{"200":{"description":"Incident unlinked from Linear issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}}}}},"/v1/integrations/linear/preview":{"get":{"tags":["Integrations"],"summary":"Search for Linear issues (autocomplete)","operationId":"preview_linear_issues","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Linear issues matching query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewTicketsResponse"}}}}}}},"/v1/integrations/linear/risks/{risk_id}":{"get":{"tags":["Integrations"],"summary":"List Linear issues linked to a risk","operationId":"get_linked_linear_issues_for_risk","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId","required":true,"schema":{"type":"string"},"example":"RSK-1"}],"responses":{"200":{"description":"Linked Linear issues","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLinkedTicketsResponse"}}}},"404":{"description":"Risk not found"}}},"post":{"tags":["Integrations"],"summary":"Create a Linear issue for a risk","operationId":"linear_create_ticket_for_risk","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId, i.e. AKR-1, RSK-1","required":true,"schema":{"type":"string"},"example":"RSK-1"}],"responses":{"200":{"description":"Issue created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketPreview"}}}},"404":{"description":"Risk not found"}}}},"/v1/integrations/linear/risks/{risk_id}/issues/{issue_key}":{"post":{"tags":["Integrations"],"summary":"Link a risk to a Linear issue","operationId":"link_risk_to_linear_issue","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId","required":true,"schema":{"type":"string"},"example":"RSK-1"},{"name":"issue_key","in":"path","description":"The stable Linear issue id (UUID), not the human identifier — a team-key rename can reuse the identifier","required":true,"schema":{"type":"string"},"example":"550e8400-e29b-41d4-a716-446655440000"}],"responses":{"200":{"description":"Risk linked to Linear issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}}}},"delete":{"tags":["Integrations"],"summary":"Unlink a risk from a Linear issue","operationId":"unlink_risk_from_linear_issue","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId","required":true,"schema":{"type":"string"},"example":"RSK-1"},{"name":"issue_key","in":"path","description":"The stable Linear issue id (UUID), not the human identifier — a team-key rename can reuse the identifier","required":true,"schema":{"type":"string"},"example":"550e8400-e29b-41d4-a716-446655440000"}],"responses":{"200":{"description":"Risk unlinked from Linear issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}}}}},"/v1/integrations/servicenow/incidents/{incident_id}":{"get":{"tags":["Integrations"],"summary":"List ServiceNow records linked to an incident","operationId":"get_linked_servicenow_records_for_incident","parameters":[{"name":"incident_id","in":"path","description":"Incident id, i.e. INC-1 or 42","required":true,"schema":{"type":"string"},"example":"INC-1"}],"responses":{"200":{"description":"Linked ServiceNow records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLinkedTicketsResponse"}}}},"404":{"description":"Incident not found"}}},"post":{"tags":["Integrations"],"summary":"Create a ServiceNow ticket for an incident","operationId":"create_servicenow_ticket_for_incident","parameters":[{"name":"incident_id","in":"path","description":"Incident id, i.e. INC-1 or 42","required":true,"schema":{"type":"string"},"example":"INC-1"},{"name":"table","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Ticket created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketPreview"}}}},"400":{"description":"Table is missing (multiple configured) or not one of the configured ServiceNow tables"},"404":{"description":"Incident not found"}}}},"/v1/integrations/servicenow/incidents/{incident_id}/records/{record_key}":{"post":{"tags":["Integrations"],"summary":"Link an incident to a ServiceNow record","operationId":"link_incident_to_servicenow_record","parameters":[{"name":"incident_id","in":"path","description":"Incident id, i.e. INC-1 or 42","required":true,"schema":{"type":"string"},"example":"INC-1"},{"name":"record_key","in":"path","description":"The ServiceNow record number","required":true,"schema":{"type":"string"},"example":"INC0012345"},{"name":"table","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Incident linked to ServiceNow record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}},"400":{"description":"Table is not one of the configured ServiceNow tables"}}},"delete":{"tags":["Integrations"],"summary":"Unlink an incident from a ServiceNow record","operationId":"unlink_incident_from_servicenow_record","parameters":[{"name":"incident_id","in":"path","description":"Incident id, i.e. INC-1 or 42","required":true,"schema":{"type":"string"},"example":"INC-1"},{"name":"record_key","in":"path","description":"The ServiceNow record number","required":true,"schema":{"type":"string"},"example":"INC0012345"},{"name":"table","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Incident unlinked from ServiceNow record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}},"400":{"description":"Table is not one of the configured ServiceNow tables"}}}},"/v1/integrations/servicenow/preview":{"get":{"tags":["Integrations"],"summary":"Search for ServiceNow records (autocomplete)","operationId":"preview_servicenow_records","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"ServiceNow records matching query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewTicketsResponse"}}}}}}},"/v1/integrations/servicenow/risks/{risk_id}":{"get":{"tags":["Integrations"],"summary":"List ServiceNow records linked to a risk","operationId":"get_linked_servicenow_records_for_risk","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId","required":true,"schema":{"type":"string"},"example":"RSK-1"}],"responses":{"200":{"description":"Linked ServiceNow records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLinkedTicketsResponse"}}}},"404":{"description":"Risk not found"}}},"post":{"tags":["Integrations"],"summary":"Create a ServiceNow ticket for a risk","operationId":"servicenow_create_ticket_for_risk","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId, i.e. AKR-1, RSK-1","required":true,"schema":{"type":"string"},"example":"RSK-1"},{"name":"table","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Ticket created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketPreview"}}}},"400":{"description":"Table is missing (multiple configured) or not one of the configured ServiceNow tables"},"404":{"description":"Risk not found"}}}},"/v1/integrations/servicenow/risks/{risk_id}/records/{record_key}":{"post":{"tags":["Integrations"],"summary":"Link a risk to a ServiceNow record","operationId":"link_risk_to_servicenow_record","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId","required":true,"schema":{"type":"string"},"example":"RSK-1"},{"name":"record_key","in":"path","description":"The ServiceNow record number","required":true,"schema":{"type":"string"},"example":"INC0012345"},{"name":"table","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Risk linked to ServiceNow record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}},"400":{"description":"Table is not one of the configured ServiceNow tables"}}},"delete":{"tags":["Integrations"],"summary":"Unlink a risk from a ServiceNow record","operationId":"unlink_risk_from_servicenow_record","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId","required":true,"schema":{"type":"string"},"example":"RSK-1"},{"name":"record_key","in":"path","description":"The ServiceNow record number","required":true,"schema":{"type":"string"},"example":"INC0012345"},{"name":"table","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Risk unlinked from ServiceNow record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketLinkOperationResponse"}}}},"400":{"description":"Table is not one of the configured ServiceNow tables"}}}},"/v1/integrations/slack":{"get":{"tags":["Integrations"],"operationId":"get_slack_config","responses":{"200":{"description":"Configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackConfigResponse"}}}},"404":{"description":"Not configured"}}},"post":{"tags":["Integrations"],"operationId":"upsert_slack_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertSlackConfigRequest"}}},"required":true},"responses":{"200":{"description":"Configuration updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackConfigResponse"}}}},"201":{"description":"Configuration created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackConfigResponse"}}}},"400":{"description":"Invalid configuration"}}},"delete":{"tags":["Integrations"],"operationId":"delete_slack_config","responses":{"200":{"description":"Configuration deleted"},"404":{"description":"Not configured"}}}},"/v1/integrations/slack/channels":{"get":{"tags":["Integrations"],"operationId":"list_slack_channels","responses":{"200":{"description":"List of channels","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelInfo"}}}}},"500":{"description":"Internal server error"}}}},"/v1/integrations/slack/subscriptions":{"post":{"tags":["Integrations"],"operationId":"add_slack_subscription","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPayload"}}},"required":true},"responses":{"200":{"description":"Subscription added successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelInfo"}}}}},"404":{"description":"Configuration not found"},"500":{"description":"Failed to add subscription"}}},"delete":{"tags":["Integrations"],"operationId":"remove_slack_subscription","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPayload"}}},"required":true},"responses":{"200":{"description":"Subscription removed successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelInfo"}}}}},"404":{"description":"Configuration not found"},"500":{"description":"Failed to remove subscription"}}}},"/v1/integrations/slack/test":{"post":{"tags":["Integrations"],"operationId":"test_slack_connection","responses":{"200":{"description":"Test message sent successfully"},"404":{"description":"Configuration not found"},"500":{"description":"Failed to send test message"}}}},"/v1/integrations/teams":{"get":{"tags":["Integrations"],"operationId":"get_teams_config","responses":{"200":{"description":"Configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamsConfigResponse"}}}},"404":{"description":"Not configured"}}},"post":{"tags":["Integrations"],"operationId":"upsert_teams_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertTeamsConfigRequest"}}},"required":true},"responses":{"200":{"description":"Configuration updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamsConfigResponse"}}}},"201":{"description":"Configuration created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamsConfigResponse"}}}},"400":{"description":"Invalid configuration"}}},"delete":{"tags":["Integrations"],"operationId":"delete_teams_config","responses":{"200":{"description":"Configuration deleted"},"404":{"description":"Not configured"}}}},"/v1/integrations/teams/channels":{"get":{"tags":["Integrations"],"operationId":"list_teams_channels","responses":{"200":{"description":"List of channels","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelInfo"}}}}},"500":{"description":"Internal server error"}}}},"/v1/integrations/teams/subscriptions":{"post":{"tags":["Integrations"],"operationId":"add_teams_subscription","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPayload"}}},"required":true},"responses":{"200":{"description":"Subscription added successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelInfo"}}}}},"404":{"description":"Configuration not found"},"500":{"description":"Failed to add subscription"}}},"delete":{"tags":["Integrations"],"operationId":"remove_teams_subscription","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPayload"}}},"required":true},"responses":{"200":{"description":"Subscription removed successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelInfo"}}}}},"404":{"description":"Configuration not found"},"500":{"description":"Failed to remove subscription"}}}},"/v1/integrations/teams/test":{"post":{"tags":["Integrations"],"operationId":"test_teams_connection","responses":{"200":{"description":"Test message sent successfully"},"404":{"description":"Configuration not found"},"500":{"description":"Failed to send test message"}}}},"/v1/integrations/{integration_type}/job-summary":{"get":{"tags":["Jobs"],"summary":"Per-integration job aggregates: last run, in-flight status, last error.","description":"`integration_type` must be the official `IntegrationName` spelling\n(e.g. `CrowdStrike`, `watchTowr`), matching `task_data->>'integration_type'`\nin the queue. An unrecognized value isn't rejected — it simply matches no\nrows and returns an empty summary (`is_running: false`, all timestamps null),\nthe same shape as an integration that has never run.","operationId":"integration_job_summary","parameters":[{"name":"integration_type","in":"path","description":"Official IntegrationName spelling (e.g. `CrowdStrike`, `watchTowr`); an unknown value yields an empty summary","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Aggregated job stats for the integration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationJobSummary"}}}}}}},"/v1/integrations/{name}":{"get":{"tags":["Integrations"],"summary":"Get integration configuration","operationId":"get_integration_config","parameters":[{"name":"name","in":"path","description":"Integration vendor short name (e.g. 'jira', 'wiz', 'bugcrowd')","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get config","content":{"application/json":{"schema":{}}}},"404":{"description":"Get config not found"}}},"post":{"tags":["Integrations"],"summary":"Create or update integration configuration","operationId":"upsert_integration_config","parameters":[{"name":"name","in":"path","description":"Integration vendor short name (e.g. 'jira', 'wiz', 'bugcrowd')","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Configuration created. Returns the new configuration.","content":{"application/json":{"schema":{}}}},"201":{"description":"Configuration updated. Returns the updated configuration.","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid request body"}}},"delete":{"tags":["Integrations"],"summary":"Delete integration configuration","operationId":"delete_integration_config","parameters":[{"name":"name","in":"path","description":"Integration vendor short name (e.g. 'jira', 'wiz', 'bugcrowd')","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Configuration deleted","content":{"application/json":{"schema":{}}}}}}},"/v1/integrations/{name}/incidents/import":{"get":{"tags":["Integrations"],"summary":"Preview integration resources as incidents","operationId":"preview_integration_incidents","parameters":[{"name":"name","in":"path","description":"Integration vendor short name (e.g. 'jira', 'wiz', 'bugcrowd')","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Preview incident integration resources before importing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_Incident_ExternalPageMeta"}}}}}},"post":{"tags":["Integrations"],"summary":"Import incidents from an integration","operationId":"sync_integration_incidents","parameters":[{"name":"name","in":"path","description":"Integration vendor short name (e.g. 'jira', 'wiz', 'bugcrowd')","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Incident import dispatched to background worker","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResponse"}}}}}}},"/v1/integrations/{name}/risks/import":{"get":{"tags":["Integrations"],"summary":"Preview integration resources as risks","operationId":"preview_integration_risks","parameters":[{"name":"name","in":"path","description":"Integration vendor short name (e.g. 'jira', 'wiz', 'bugcrowd')","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Preview Integration resources as Risks before importing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_Risk_ExternalPageMeta"}}}}}},"post":{"tags":["Integrations"],"summary":"Import risks from an integration","operationId":"sync_integration_risks","parameters":[{"name":"name","in":"path","description":"Integration vendor short name (e.g. 'jira', 'wiz', 'bugcrowd')","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Risk import dispatched to background worker","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResponse"}}}}}}},"/v1/jobs":{"get":{"tags":["Jobs"],"summary":"List recent jobs for the current org.","operationId":"list_jobs","parameters":[{"name":"name","in":"query","description":"Filter by worker class name. Unknown values yield 422.","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/JobName"}}},{"name":"status","in":"query","description":"Filter by lifecycle status. Repeatable.","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/JobStatus"}}},{"name":"integration_type","in":"query","description":"Filter by `task_data.integration_type` (e.g. `Bugcrowd`).","required":false,"schema":{"type":["string","null"]}},{"name":"age_days","in":"query","description":"Only return jobs created within the last N days. Defaults to 7, max 30.","required":false,"schema":{"type":"integer","format":"int64","default":7,"maximum":30,"minimum":1}},{"name":"order_by","in":"query","description":"Sort key; always newest-first (`id` tiebreak). Defaults to `updated_at`\nso re-runs and fresh completions surface at the top.","required":false,"schema":{"$ref":"#/components/schemas/JobOrderBy"}},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 50, max 100; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":50,"maximum":100,"minimum":1}}],"responses":{"200":{"description":"Paginated list of jobs for the current org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_Job"}}}}}}},"/v1/jobs/{id}":{"get":{"tags":["Jobs"],"summary":"Retrieve a single job by ID.","operationId":"get_job","parameters":[{"name":"id","in":"path","description":"ULID assigned by the queue at enqueue time","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Job details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"404":{"description":"Job not found"}}}},"/v1/notifications":{"get":{"tags":["Notifications"],"summary":"list notifications for user","operationId":"list_notifications","parameters":[{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 20; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":20,"maximum":100,"minimum":1}},{"name":"include_read","in":"query","description":"Whether to include read notifications. Defaults to true.","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"Successfully retrieved list of notifications","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationResponse"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Could not retrieve notifications"}}},"patch":{"tags":["Notifications"],"summary":"Mark all notifications as read for the current user","operationId":"mark_all_notifications_as_read","responses":{"200":{"description":"All notifications marked as read"},"401":{"description":"Unauthorized"}}}},"/v1/notifications/preferences":{"get":{"tags":["Notification Preferences"],"summary":"List notification preferences","operationId":"get_preferences","responses":{"200":{"description":"Preferences retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesResponse"}}}},"401":{"description":"Unauthorized"}}},"post":{"tags":["Notification Preferences"],"summary":"Add a channel preference for a notification type","operationId":"add_notification_preference","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferenceView"}}},"required":true},"responses":{"200":{"description":"Preference added successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesResponse"}}}},"400":{"description":"Invalid request"}}},"delete":{"tags":["Notification Preferences"],"summary":"Remove a specific channel preference","operationId":"remove_notification_preference","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferenceView"}}},"required":true},"responses":{"200":{"description":"Preference removed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesResponse"}}}},"400":{"description":"Invalid request"}}}},"/v1/notifications/subscriptions":{"get":{"tags":["Subscriptions"],"summary":"List individual item subscriptions for user","description":"Returns subscriptions to specific items (risks, incidents, etc.) that the user\nis explicitly following. This does NOT include general notification subscriptions\nwhich are managed through the preferences endpoints.","operationId":"list_subscriptions_for_user","responses":{"200":{"description":"Successfully retrieved list of subscriptions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IndividualSubscriptionPayload"}}}}},"404":{"description":"Could not retrieve subscriptions"}}},"post":{"tags":["Subscriptions"],"summary":"Subscribe to notifications for a specific item","operationId":"create_subscription_for_user","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IndividualSubscriptionPayload"}}}},"required":true},"responses":{"200":{"description":"Successfully added subscription"},"400":{"description":"Invalid request - notification types that are not for specific risks or incidents must use preferences endpoints"},"404":{"description":"Could not add subscription"}}},"delete":{"tags":["Subscriptions"],"summary":"Unsubscribe from notifications for a specific item","operationId":"delete_subscription_for_user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndividualSubscriptionPayload"}}},"required":true},"responses":{"200":{"description":"Successfully removed subscription"},"400":{"description":"Invalid request - general types must use preferences endpoints"},"404":{"description":"Could not remove subscription"}}}},"/v1/notifications/{id}":{"patch":{"tags":["Notifications"],"summary":"mark notification as read","operationId":"mark_notification_as_read","parameters":[{"name":"id","in":"path","description":"The ID of the notification to mark as read","required":true,"schema":{"type":"integer","format":"int64"},"example":"123"}],"responses":{"200":{"description":"Notification marked as read"},"404":{"description":"Notification not found"}}}},"/v1/oauth/authorize":{"get":{"tags":["OAuth"],"summary":"GET /v1/oauth/authorize","description":"Entry point for the authorization_code grant. Validates params and either\nredirects to consent (if the user already has a session) or to login first.","operationId":"authorize","parameters":[{"name":"client_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string"}},{"name":"response_type","in":"query","required":true,"schema":{"type":"string"}},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string"}},{"name":"code_challenge_method","in":"query","required":true,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"state","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"resource","in":"query","description":"RFC 8707 resource indicator. MCP clients pass their MCP URL here.","required":false,"schema":{"type":["string","null"]}},{"name":"nonce","in":"query","description":"OIDC nonce — preserved end-to-end so clients can verify.","required":false,"schema":{"type":["string","null"]}}],"responses":{"303":{"description":"Redirect to consent or login"},"400":{"description":"Invalid request"}}}},"/v1/oauth/authorize/resume":{"get":{"tags":["OAuth"],"summary":"GET /v1/oauth/authorize/resume","description":"Re-entry after the user completes OIDC login. The pending request is read\nfrom the session and the user is sent to the consent page.","operationId":"authorize_resume","responses":{"303":{"description":"Redirect to consent"},"400":{"description":"No pending authorize request in session"},"401":{"description":"Not logged in"}}}},"/v1/oauth/clients":{"get":{"tags":["OAuth"],"operationId":"list_oauth_clients","parameters":[{"name":"user_id","in":"query","required":false,"schema":{"type":["string","null"],"format":"uuid"}},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 25, max 100; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":25,"maximum":100,"minimum":1}}],"responses":{"200":{"description":"Paginated list of OAuth clients","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_OAuthClientResponse"}}}},"401":{"description":"Unauthorized"}},"security":[{"session":[]},{"bearer":[]}]},"post":{"tags":["OAuth"],"summary":"POST /v1/oauth/clients","operationId":"create_oauth_client","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOAuthClientRequest"}}},"required":true},"responses":{"201":{"description":"OAuth client created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientResponse"}}}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}},"security":[{"session":[]},{"bearer":[]}]}},"/v1/oauth/clients/authorized":{"get":{"tags":["OAuth Clients"],"summary":"GET /v1/oauth/clients/authorized","operationId":"list_authorized_oauth_clients","parameters":[{"name":"user_id","in":"query","description":"Restrict to authorizations for the given user ids. Only meaningful for\ncallers holding `ORGANIZATION_MANAGE`; non-admins may pass only their\nown id (or omit entirely). Cross-org ids return `403`.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"search","in":"query","description":"Case-insensitive substring search. Matches the client name for any\ncaller; for admins also matches the authorizing user's email, first\nname, or last name.","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","description":"Restrict to authorizations whose live refresh-token rows include at\nleast one of the requested atomic scopes. Repeat the param to OR them:\n`?scope=risks:read&scope=incidents:read`. Compound aliases (`mcp`,\n`mcp:full`) are rejected — pass the expanded atomic scopes instead.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 25, max 100; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":25,"maximum":100,"minimum":1}},{"name":"order_by","in":"query","description":"Sort column + direction in the shape \"column, asc\" or \"column, desc\".\nValid columns: `client_name`, `last_used`, `authorized_on`,\n`authorized_by` (admin-only). Defaults to `last_used, desc`.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Paged list of authorized DCR applications","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_AuthorizedAppResponse"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}},"security":[{"session":[]},{"bearer":[]}]}},"/v1/oauth/clients/{client_id}/authorization":{"delete":{"tags":["OAuth Clients"],"summary":"DELETE /v1/oauth/clients/{client_id}/authorization","operationId":"revoke_oauth_client_authorization","parameters":[{"name":"client_id","in":"path","description":"Public DCR client id (arm_dyn_*)","required":true,"schema":{"type":"string"}},{"name":"user_id","in":"query","description":"Target user whose authorization is being revoked. Defaults to the\ncaller. When different from the caller, requires `ORGANIZATION_MANAGE`.","required":false,"schema":{"type":["string","null"],"format":"uuid"}}],"responses":{"204":{"description":"Authorization revoked"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Client not found or no active authorization for target user"}},"security":[{"session":[]},{"bearer":[]}]}},"/v1/oauth/clients/{id}":{"get":{"tags":["OAuth"],"summary":"GET /v1/oauth/clients/{id}","operationId":"get_oauth_client","parameters":[{"name":"id","in":"path","description":"OAuth client ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OAuth client details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"security":[{"session":[]},{"bearer":[]}]},"post":{"tags":["OAuth"],"summary":"Issue a fresh client secret for a service account. The public\n`client_id` is preserved so existing audit and log references remain\nvalid; only the secret half of the credential pair changes.","description":"The new secret is returned in the response exactly once — store it\nimmediately. Existing access tokens stay valid until they expire, but\nrefresh-token grants under the old secret will fail. To stop all\nbearer use immediately, revoke the service account\n(`PATCH /v1/oauth/clients/{id}` with `revoked: true`) first.\n\nResetting a revoked service account returns 409 — un-revoke it first.","operationId":"resetOAuthClientCredentials","parameters":[{"name":"id","in":"path","description":"OAuth client ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Credentials reset; new secret returned once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientResponse"}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"409":{"description":"Service account is revoked"}},"security":[{"session":[]},{"bearer":[]}]},"delete":{"tags":["OAuth"],"summary":"DELETE /v1/oauth/clients/{id}","operationId":"delete_oauth_client","parameters":[{"name":"id","in":"path","description":"OAuth client ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"OAuth client deleted"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"security":[{"session":[]},{"bearer":[]}]},"patch":{"tags":["OAuth"],"summary":"PATCH /v1/oauth/clients/{id}","operationId":"update_oauth_client","parameters":[{"name":"id","in":"path","description":"OAuth client ID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOAuthClientRequest"}}},"required":true},"responses":{"200":{"description":"OAuth client updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientResponse"}}}},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}},"security":[{"session":[]},{"bearer":[]}]}},"/v1/oauth/consent":{"post":{"tags":["OAuth"],"operationId":"consent","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRequest"}}},"required":true},"responses":{"200":{"description":"Consent recorded; redirect URL returned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentResponse"}}}},"400":{"description":"No pending request or invalid scope"},"401":{"description":"Not authenticated"}},"security":[{"session":[]}]}},"/v1/oauth/consent-info":{"get":{"tags":["OAuth"],"summary":"GET /v1/oauth/consent-info","operationId":"consent_info","responses":{"200":{"description":"Consent screen metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentInfo"}}}},"400":{"description":"No pending authorize request"},"401":{"description":"Not authenticated"},"404":{"description":"Referenced client no longer exists"}},"security":[{"session":[]}]}},"/v1/oauth/token":{"post":{"tags":["OAuth"],"summary":"POST /v1/oauth/token","description":"OAuth 2.1 token endpoint. Dispatches on `grant_type`:\n\n- `client_credentials`: confidential client exchanges its `client_id` +\n  `client_secret` for an access + refresh JWT pair. Existing API keys use\n  this path.\n- `authorization_code`: exchange a consent-approved code + PKCE verifier\n  for an access JWT + an opaque refresh token. Public DCR clients use this.\n- `refresh_token`: exchange a refresh for a new pair. Accepts both opaque\n  (public clients; rotating with family revoke-on-reuse) and JWT\n  (confidential clients; stateless).\n\nError responses follow RFC 6749 §5.2 — `{\"error\": \"...\",\n\"error_description\": \"...\"}` with appropriate HTTP status — so MCP clients\nlike Claude Code can parse them with standard OAuth validators. Form\nrejections (malformed body, wrong content-type, …) flow through\n`OAuthForm` so they emit the same envelope rather than axum's default\n422 + free-form text body.","operationId":"token","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}},"required":true},"responses":{"200":{"description":"Token pair generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenPair"}}}},"400":{"description":"Invalid request"},"401":{"description":"Invalid credentials"}}}},"/v1/organizations":{"get":{"tags":["Organizations"],"summary":"Retrieve the organizations the user is a member of","operationId":"list_organizations","responses":{"200":{"description":"List organizations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOrganizationsResponse"}}}},"404":{"description":"Organizations not found"}}}},"/v1/organizations/domains":{"get":{"tags":["Organizations"],"summary":"List the domains associated with the users organization","operationId":"list_domains","responses":{"200":{"description":"List all domains for the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDomainsResponse"}}}},"404":{"description":"Organization not found"}}},"post":{"tags":["Organizations"],"summary":"Add a domain to the users organization","operationId":"create_domain","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddDomainRequest"}}},"required":true},"responses":{"201":{"description":"Domain added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainInfo"}}}},"404":{"description":"Organization not found"},"409":{"description":"Domain already exists"}}},"delete":{"tags":["Organizations"],"summary":"Delete a domain from the users organization","operationId":"delete_domain","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Domain removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteDomainResponse"}}}},"404":{"description":"Organization not found"}}}},"/v1/organizations/invites":{"get":{"tags":["Organizations"],"summary":"list the outstanding invitations for the current organization","operationId":"list_invites","responses":{"200":{"description":"Organization member invites","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOrganizationInvitesResponse"}}}}}},"post":{"tags":["Organizations"],"summary":"Create an invitation to join the organization","operationId":"create_invite","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgInviteRequest"}}},"required":true},"responses":{"200":{"description":"User successfully invited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgInvite"}}}}}}},"/v1/organizations/invites/{id}":{"delete":{"tags":["Organizations"],"summary":"Delete an invitation to join the organization","operationId":"delete_invite","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"User invite successfully deleted","content":{"application/json":{"schema":{}}}}}}},"/v1/organizations/members/{user_id}":{"delete":{"tags":["Organizations"],"summary":"Deactivate a user in the organization.","operationId":"deactivate_member","parameters":[{"name":"user_id","in":"path","description":"The UUID of the user to deactivate","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"User deactivated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationMember"}}}},"400":{"description":"Cannot deactivate self or last admin"},"403":{"description":"Forbidden - insufficient permissions"},"404":{"description":"User or organization not found"}}},"patch":{"tags":["Organizations"],"summary":"Update a member's role and/or activation status.","operationId":"update_member","parameters":[{"name":"user_id","in":"path","description":"The UUID of the member to update","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRequest"}}},"required":true},"responses":{"200":{"description":"Member updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationMember"}}}},"400":{"description":"Invalid request"},"403":{"description":"Forbidden - insufficient permissions"},"404":{"description":"User not found in organization"}}}},"/v1/organizations/portfolio":{"get":{"tags":["Organizations"],"summary":"Get an overview of the users organization portfolio","operationId":"get_portfolio_overview","responses":{"200":{"description":"Organization portfolio overview","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PortfolioOrganization"}}}}},"404":{"description":"Organization not found"}}}},"/v1/organizations/roles":{"get":{"tags":["Organizations"],"summary":"List available roles and their descriptions.","operationId":"list_roles","responses":{"200":{"description":"List of available roles","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRolesResponse"}}}}}}},"/v1/organizations/roles/members-summary":{"get":{"tags":["Organizations"],"summary":"Returns per-role member counts and a bounded sample of member avatars.","operationId":"list_role_members_summary","responses":{"200":{"description":"Per-role member counts and sample avatars","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRoleMembersSummaryResponse"}}}}}}},"/v1/organizations/{id}":{"get":{"tags":["Organizations"],"summary":"Retrieve the requested organization","operationId":"get_organization","parameters":[{"name":"id","in":"path","description":"The UUID of the organization to retrieve","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"responses":{"200":{"description":"Get the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"404":{"description":"Organization not found"}}},"delete":{"tags":["Organizations"],"summary":"Leave the provided organization","operationId":"leave_organization","parameters":[{"name":"id","in":"path","description":"The UUID of the organization to leave","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"responses":{"204":{"description":"Leave the organization"},"404":{"description":"Organization not found"}}},"patch":{"tags":["Organizations"],"summary":"Update attributes of the users organization","operationId":"patch_organization","parameters":[{"name":"id","in":"path","description":"The UUID of the organization to update","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationRequest"}}},"required":true},"responses":{"200":{"description":"Organization updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"404":{"description":"Organization not found"}}}},"/v1/organizations/{id}/compliance":{"get":{"tags":["Organizations"],"summary":"Get compliance metrics for an organization","operationId":"get_compliance_metrics","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Compliance metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceMetrics"}}}},"404":{"description":"Organization not found"}}}},"/v1/organizations/{id}/risk-performance":{"get":{"tags":["Organizations"],"summary":"Get risk performance metrics for an organization","operationId":"get_risk_performance_metrics","parameters":[{"name":"id","in":"path","description":"The UUID of the organization","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"},{"name":"period_days","in":"query","description":"Number of days to look back (default: 90)","required":false,"schema":{"type":"integer","format":"int32"},"example":"90"}],"responses":{"200":{"description":"Risk performance metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskPerformanceMetrics"}}}},"404":{"description":"Organization not found"}}}},"/v1/organizations/{id}/tags":{"post":{"tags":["Organizations"],"summary":"Add a portfolio tag to an organization.","description":"Portfolio tags (`org_id = NULL`) are user-owned labels for grouping\norganizations across the portfolio view. They are distinct from\nrisk-register tags (`org_id = <some org>`), which live inside a\nsingle organization and are used to categorize risks and incidents.\nOnly portfolio tags can be applied to organizations via this endpoint.","operationId":"create_organization_tag","parameters":[{"name":"id","in":"path","description":"The UUID of the organization","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddOrganizationTagRequest"}}},"required":true},"responses":{"201":{"description":"Tag added to organization"},"404":{"description":"Organization not found"},"409":{"description":"Tag already associated with organization"}}},"delete":{"tags":["Organizations"],"summary":"Remove a portfolio tag from an organization.","description":"See `create_organization_tag` for the distinction between portfolio\ntags and risk-register tags.","operationId":"delete_organization_tag","parameters":[{"name":"id","in":"path","description":"The UUID of the organization","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveOrganizationTagRequest"}}},"required":true},"responses":{"200":{"description":"Tag removed from organization"},"404":{"description":"Organization not found"}}}},"/v1/risks":{"get":{"tags":["Risks"],"summary":"List RSKs (the canonical risk register).","operationId":"list_paginated_risks","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer","format":"int64"}}},{"name":"title_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"description_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"opened_by","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"updated_by","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"impact","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Impact"}}},{"name":"likelihood","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Likelihood"}}},{"name":"initially_reported_urgency","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_InitiallyReportedUrgency"}}},{"name":"type","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/RiskType"}}},{"name":"status","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/RiskStatus"}}},{"name":"source","in":"query","required":false,"schema":{"type":["array","null"],"items":{"type":"string"}}},{"name":"threat_objectives","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_ThreatName"}}},{"name":"urgency","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Urgency"}}},{"name":"created_after","in":"query","description":"Inclusive lower bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"created_before","in":"query","description":"Inclusive upper bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"updated_after","in":"query","description":"Inclusive lower bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"updated_before","in":"query","description":"Inclusive upper bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"discovered_after","in":"query","description":"Inclusive lower bound on `discovered_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"discovered_before","in":"query","description":"Inclusive upper bound on `discovered_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"due_after","in":"query","description":"Inclusive lower bound on `due_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"due_before","in":"query","description":"Inclusive upper bound on `due_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"due_is_null","in":"query","description":"Match only risks whose `due_date` is unset. Mutually exclusive with\n`due_after`/`due_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"expected_after","in":"query","description":"Inclusive lower bound on `expected_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"expected_before","in":"query","description":"Inclusive upper bound on `expected_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"expected_is_null","in":"query","description":"Match only risks whose `expected_date` is unset. Mutually exclusive\nwith `expected_after`/`expected_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"closed_after","in":"query","description":"Inclusive lower bound on `closed_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"closed_before","in":"query","description":"Inclusive upper bound on `closed_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"closed_is_null","in":"query","description":"Match only risks whose `closed_date` is unset. Mutually exclusive with\n`closed_after`/`closed_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"assigned_to","in":"query","description":"Accepts UUIDs, the literal `null` (unassigned), and the sentinel\n`me` (the calling user, resolved server-side). Multiple values\nunion — e.g. `assigned_to=me&assigned_to=<uuid>` returns rows\nassigned to either.","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_AssignedTo"}}},{"name":"tags","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1 (explicit `null` reads as the\ndefault); zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 50 (explicit `null` reads as the default);\nzero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":50,"maximum":500,"minimum":1}},{"name":"order_by","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"free_text_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"id_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"overdue","in":"query","description":"Filter to overdue (`true`) or non-overdue (`false`) risks. Overdue\nmeans open and past `due_date`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"include_children","in":"query","description":"When true, the list includes risks that are linked under another risk\n(i.e. rows with a non-null `parent_id`). Defaults to false so registers\nand rollups stay collapsed.","required":false,"schema":{"type":["boolean","null"]}},{"name":"urgency_shift","in":"query","description":"Return only risks whose current urgency has shifted from the urgency\nthey were first reported at. `Upgrade` matches risks now at least one\nlevel more severe; `Downgrade` matches those now at least one level\nless severe. Omit to leave the filter off.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/UrgencyShift"}]}}],"responses":{"200":{"description":"List RSKs with register-context fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_RiskRegisterEntry"}}}}}},"post":{"tags":["Risks"],"summary":"Create a new RSK.","operationId":"create_risk","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/CreateRiskRequest"}]}}}},"responses":{"201":{"description":"Risk created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskRegisterEntry"}}}},"400":{"description":"Validation failed (e.g. unknown source, inactive assignee)"}}},"delete":{"tags":["Risks"],"summary":"Delete many RSK risks by risk IDs","description":"Note that only RSKs can be deleted (not AKRs), and all risks are soft-deleted","operationId":"delete_many_risks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteManyRisksRequest"}}},"required":true},"responses":{"200":{"description":"Risks deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteManyRisksResponse"}}}}}},"patch":{"tags":["Risks"],"summary":"Bulk-update RSKs.","operationId":"patch_many_risks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateManyRisksRequest"}}},"required":true},"responses":{"200":{"description":"RSKs updated successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RiskRegisterEntry"}}}}},"400":{"description":"Validation failed (e.g. empty ids, unknown source, inactive assignee)"},"404":{"description":"Risk not found"},"422":{"description":"Invalid parent link (self-link, cycle, multi-layer nesting, or deleted parent)"}}}},"/v1/risks/akr":{"get":{"tags":["Risks"],"summary":"List all AKRs (Adversarial Key Risks).","operationId":"list_paginated_akrs","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer","format":"int64"}}},{"name":"title_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"description_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"free_text_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"id_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"status","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/RiskStatus"}}},{"name":"likelihood","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Likelihood"}}},{"name":"impact","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Impact"}}},{"name":"urgency","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Urgency"}}},{"name":"source","in":"query","required":false,"schema":{"type":["array","null"],"items":{"type":"string"}}},{"name":"threat_objectives","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_ThreatName"}}},{"name":"created_after","in":"query","description":"Inclusive lower bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"created_before","in":"query","description":"Inclusive upper bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"updated_after","in":"query","description":"Inclusive lower bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"updated_before","in":"query","description":"Inclusive upper bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"discovered_after","in":"query","description":"Inclusive lower bound on `discovered_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"discovered_before","in":"query","description":"Inclusive upper bound on `discovered_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"due_after","in":"query","description":"Inclusive lower bound on `due_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"due_before","in":"query","description":"Inclusive upper bound on `due_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"due_is_null","in":"query","description":"Match only AKRs whose `due_date` is unset. Mutually exclusive with\n`due_after`/`due_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"expected_after","in":"query","description":"Inclusive lower bound on `expected_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"expected_before","in":"query","description":"Inclusive upper bound on `expected_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"expected_is_null","in":"query","description":"Match only AKRs whose `expected_date` is unset. Mutually exclusive\nwith `expected_after`/`expected_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"closed_after","in":"query","description":"Inclusive lower bound on `closed_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"closed_before","in":"query","description":"Inclusive upper bound on `closed_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"closed_is_null","in":"query","description":"Match only AKRs whose `closed_date` is unset. Mutually exclusive with\n`closed_after`/`closed_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"assigned_to","in":"query","description":"Accepts UUIDs, the literal `null` (unassigned), and the sentinel\n`me` (the calling user, resolved server-side). Multiple values\nunion.","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_AssignedTo"}}},{"name":"overdue","in":"query","description":"Filter to overdue (`true`) or non-overdue (`false`) AKRs. Overdue\nmeans open and past `due_date`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"order_by","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1 (explicit `null` reads as the\ndefault); zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 50 (explicit `null` reads as the default);\nzero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":50,"maximum":500,"minimum":1}}],"responses":{"200":{"description":"List AKRs with register-context fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_KeyRiskRegisterEntry"}}}}}},"patch":{"tags":["Risks"],"summary":"Bulk-update AKRs.","operationId":"patch_many_key_risks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateManyRisksRequest"}}},"required":true},"responses":{"200":{"description":"AKRs updated successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KeyRiskRegisterEntry"}}}}},"400":{"description":"Validation failed (e.g. empty ids, unknown source, inactive assignee, tags rejected)"},"422":{"description":"AKRs do not support linking (parent_id rejected)"}}}},"/v1/risks/akr/{akr_id}":{"get":{"tags":["Risks"],"summary":"Get an AKR by numeric ID.","operationId":"get_key_risk","parameters":[{"name":"akr_id","in":"path","description":"Numeric AKR ID (e.g. 1 for AKR-00001)","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"200":{"description":"Key Risk details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRiskRegisterEntry"}}}}}},"patch":{"tags":["Risks"],"summary":"Update parts of an AKR by numeric ID.","description":"AKRs can't accept `tags` (they have no tag relation). Tag fields in the payload are rejected.","operationId":"patch_key_risk","parameters":[{"name":"akr_id","in":"path","description":"Numeric AKR ID (e.g. 1 for AKR-00001)","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRiskRequest"}}},"required":true},"responses":{"200":{"description":"Key risk updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRiskRegisterEntry"}}}},"400":{"description":"Validation failed (e.g. empty payload, unknown source, inactive assignee, tags rejected)"}}}},"/v1/risks/export":{"post":{"tags":["Risks"],"summary":"Export risks as CSV","operationId":"export_risks_csv","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ExportRisksRequest"}]}}}},"responses":{"200":{"description":"Export all risks with current state as CSV","content":{"application/octet-stream":{"schema":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}}}}}},"/v1/risks/import":{"post":{"tags":["Risks"],"summary":"Import risks from one or more CSV files provided via multipart form data","operationId":"import_risks_csv","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ImportRisksMultipart"}}},"required":true},"responses":{"201":{"description":"Risks imported from CSV","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRisksResponse"}}}},"400":{"description":"Invalid CSV row, source, or shape"}}}},"/v1/risks/remediation":{"get":{"tags":["Risks"],"summary":"Get remediation agility for an organization","operationId":"get_remediation_agility","parameters":[{"name":"start_date","in":"query","description":"Inclusive lower bound on the window. RFC 3339 timestamp or bare\n`YYYY-MM-DD` (anchored at start-of-day UTC).","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"end_date","in":"query","description":"Inclusive upper bound on the window. RFC 3339 timestamp or bare\n`YYYY-MM-DD` (anchored at end-of-day UTC).","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"urgency","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Urgency"}}},{"name":"include_children","in":"query","description":"Reveal risks linked as children of another risk. Defaults to hiding them\n(parity with the register), so the chart plots bundle parents only.","required":false,"schema":{"type":["boolean","null"]}}],"responses":{"200":{"description":"Get remediation agility for an organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskEntries"}}}}}}},"/v1/risks/remediation/sparkline/{org_id}":{"get":{"tags":["Risks"],"summary":"Get remediation agility sparkline for an organization","operationId":"get_organization_sparkline","parameters":[{"name":"org_id","in":"path","description":"The UUID of the organization to retrieve","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"responses":{"200":{"description":"Remediation agility sparkline image","content":{"application/octet-stream":{"schema":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}}}}}},"/v1/risks/scores":{"post":{"tags":["Risks"],"summary":"Generate AI risk scores for multiple risks","operationId":"create_many_risk_scores","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestScoreRequest"}}},"required":true},"responses":{"200":{"description":"Score many risks at once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiRiskScoringResponse"}}}}}}},"/v1/risks/settings/slas":{"get":{"tags":["Risks"],"summary":"Get the SLAs for the current organization","operationId":"get_slas","responses":{"200":{"description":"Get the SLAs for the current organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskSLAResponse"}}}}}},"delete":{"tags":["Risks"],"summary":"Reset the SLAs for the current organization","operationId":"reset_slas","responses":{"200":{"description":"Reset the SLAs for the current organization","content":{"application/json":{"schema":{}}}}}},"patch":{"tags":["Risks"],"summary":"Update the SLAs for the current organization","operationId":"update_slas","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSLARequest"}}},"required":true},"responses":{"200":{"description":"Update the SLAs for the current organization","content":{"application/json":{"schema":{}}}}}}},"/v1/risks/sources":{"get":{"tags":["Risks"],"summary":"List all Risk sources available for use in the organization","operationId":"list_risk_sources","responses":{"200":{"description":"List all Risk sources available for use in the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSourcesResponse"}}}}}},"post":{"tags":["Risks"],"summary":"Add a new Risk source to be available for use in the organization","operationId":"add_risk_source","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSourceRequest"}}},"required":true},"responses":{"201":{"description":"Risk source created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceResponse"}}}}}},"delete":{"tags":["Risks"],"summary":"Delete a risk source from the organization","operationId":"delete_risk_source","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSourceRequest"}}},"required":true},"responses":{"200":{"description":"Risk source deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSourceResponse"}}}}}}},"/v1/risks/sources/reset":{"post":{"tags":["Risks"],"summary":"Reset the risk sources to the default values","operationId":"reset_risk_sources","responses":{"200":{"description":"Risk sources reset to defaults","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetSourcesResponse"}}}}}}},"/v1/risks/types":{"get":{"tags":["Risks"],"summary":"List all Risk types available for use in the organization","operationId":"list_types","responses":{"200":{"description":"List all Risk types available for use in the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTypesResponse"}}}}}}},"/v1/risks/{id}":{"get":{"tags":["Risks"],"summary":"Get an RSK by numeric ID.","description":"AKRs live under `/v1/risks/akr/{akr_id}` — this endpoint is RSK-only by design.","operationId":"get_risk","parameters":[{"name":"id","in":"path","description":"Numeric RSK ID (e.g. 1 for RSK-00001)","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"200":{"description":"Risk details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskRegisterEntry"}}}}}},"patch":{"tags":["Risks"],"summary":"Update parts of an RSK by numeric ID.","operationId":"patch_risk","parameters":[{"name":"id","in":"path","description":"Numeric RSK ID (e.g. 1 for RSK-00001)","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRiskRequest"}}},"required":true},"responses":{"200":{"description":"Risk updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskRegisterEntry"}}}},"400":{"description":"Validation failed (e.g. empty payload, unknown source, inactive assignee)"},"404":{"description":"Risk not found"},"422":{"description":"Invalid parent link (self-link, cycle, multi-layer nesting, or deleted parent)"}}}},"/v1/risks/{id}/children":{"get":{"tags":["Risks"],"summary":"List risks linked under a given parent risk. The default `/v1/risks`\nregister hides children — this endpoint is the only way to enumerate them.","operationId":"list_risk_children","parameters":[{"name":"id","in":"path","description":"Parent RSK numeric ID (e.g. 1 for RSK-00001)","required":true,"schema":{"type":"integer","format":"int64"},"example":1},{"name":"id","in":"query","required":false,"schema":{"type":"array","items":{"type":"integer","format":"int64"}}},{"name":"title_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"description_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"opened_by","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"updated_by","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"impact","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Impact"}}},{"name":"likelihood","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Likelihood"}}},{"name":"initially_reported_urgency","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_InitiallyReportedUrgency"}}},{"name":"type","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/RiskType"}}},{"name":"status","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/RiskStatus"}}},{"name":"source","in":"query","required":false,"schema":{"type":["array","null"],"items":{"type":"string"}}},{"name":"threat_objectives","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_ThreatName"}}},{"name":"urgency","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Urgency"}}},{"name":"created_after","in":"query","description":"Inclusive lower bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"created_before","in":"query","description":"Inclusive upper bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"updated_after","in":"query","description":"Inclusive lower bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"updated_before","in":"query","description":"Inclusive upper bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"discovered_after","in":"query","description":"Inclusive lower bound on `discovered_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"discovered_before","in":"query","description":"Inclusive upper bound on `discovered_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"due_after","in":"query","description":"Inclusive lower bound on `due_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"due_before","in":"query","description":"Inclusive upper bound on `due_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"due_is_null","in":"query","description":"Match only risks whose `due_date` is unset. Mutually exclusive with\n`due_after`/`due_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"expected_after","in":"query","description":"Inclusive lower bound on `expected_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"expected_before","in":"query","description":"Inclusive upper bound on `expected_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"expected_is_null","in":"query","description":"Match only risks whose `expected_date` is unset. Mutually exclusive\nwith `expected_after`/`expected_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"closed_after","in":"query","description":"Inclusive lower bound on `closed_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-01-01T00:00:00Z"},{"name":"closed_before","in":"query","description":"Inclusive upper bound on `closed_date`. RFC 3339 or bare `YYYY-MM-DD`.","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-12-31T23:59:59Z"},{"name":"closed_is_null","in":"query","description":"Match only risks whose `closed_date` is unset. Mutually exclusive with\n`closed_after`/`closed_before`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"assigned_to","in":"query","description":"Accepts UUIDs, the literal `null` (unassigned), and the sentinel\n`me` (the calling user, resolved server-side). Multiple values\nunion — e.g. `assigned_to=me&assigned_to=<uuid>` returns rows\nassigned to either.","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_AssignedTo"}}},{"name":"tags","in":"query","required":false,"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"}}},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1 (explicit `null` reads as the\ndefault); zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 50 (explicit `null` reads as the default);\nzero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":50,"maximum":500,"minimum":1}},{"name":"order_by","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"free_text_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"id_contains","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"overdue","in":"query","description":"Filter to overdue (`true`) or non-overdue (`false`) risks. Overdue\nmeans open and past `due_date`.","required":false,"schema":{"type":["boolean","null"]}},{"name":"include_children","in":"query","description":"When true, the list includes risks that are linked under another risk\n(i.e. rows with a non-null `parent_id`). Defaults to false so registers\nand rollups stay collapsed.","required":false,"schema":{"type":["boolean","null"]}},{"name":"urgency_shift","in":"query","description":"Return only risks whose current urgency has shifted from the urgency\nthey were first reported at. `Upgrade` matches risks now at least one\nlevel more severe; `Downgrade` matches those now at least one level\nless severe. Omit to leave the filter off.","required":false,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/UrgencyShift"}]}}],"responses":{"200":{"description":"Risks linked under this parent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_RiskRegisterEntry"}}}},"404":{"description":"Parent risk not found"}}}},"/v1/risks/{id}/history":{"get":{"tags":["Risks"],"summary":"Get the history of changes for a risk","operationId":"list_risk_history","parameters":[{"name":"id","in":"path","description":"String-formatted RiskId, i.e. RSK-1, RSK-00001","required":true,"schema":{"type":"string"},"example":"RSK-1"},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 100, max 500; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":100,"maximum":500,"minimum":1}}],"responses":{"200":{"description":"List the risk history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_HistoryEntry"}}}},"400":{"description":"AKRs do not support history"},"404":{"description":"Risk not found"}}}},"/v1/risks/{risk_id}/comments":{"get":{"tags":["Risks"],"summary":"List comments for a risk","operationId":"list_risk_comments","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId, i.e. AKR-1, AKR-00001, RSK-1, RSK-00001, OrgRisk-1, KeyRisk-1, kEY_rIsK-1","required":true,"schema":{"type":"string"},"example":"AKR-1"}],"responses":{"200":{"description":"List all comments for a risk","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCommentsResponse"}}}}}},"post":{"tags":["Risks"],"summary":"Create a new comment for a risk","operationId":"create_risk_comment","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId, i.e. AKR-1, AKR-00001, RSK-1, RSK-00001, OrgRisk-1, KeyRisk-1, kEY_rIsK-1","required":true,"schema":{"type":"string"},"example":"AKR-1"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewCommentRequest"}}},"required":true},"responses":{"201":{"description":"Comment created succesfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}}}}},"/v1/risks/{risk_id}/incidents/{id}":{"post":{"tags":["Risks"],"summary":"Associate an incident with a risk","operationId":"create_incident_association","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId, i.e. AKR-1, AKR-00001, RSK-1, RSK-00001, OrgRisk-1, KeyRisk-1, kEY_rIsK-1","required":true,"schema":{"type":"string"},"example":"AKR-1"},{"name":"id","in":"path","description":"IncidentId, i.e. 1","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"200":{"description":"Incident associated","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["Risks"],"summary":"Remove an incident association from a risk","operationId":"delete_incident_association","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId, i.e. AKR-1, AKR-00001, RSK-1, RSK-00001, OrgRisk-1, KeyRisk-1, kEY_rIsK-1","required":true,"schema":{"type":"string"},"example":"AKR-1"},{"name":"id","in":"path","description":"IncidentId, i.e. 1","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"200":{"description":"Association removed","content":{"application/json":{"schema":{}}}}}}},"/v1/risks/{risk_id}/score":{"get":{"tags":["Risks"],"summary":"Get AI risk score for a risk","operationId":"get_risk_score","parameters":[{"name":"risk_id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Risk Score Suggestion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiRiskScore"}}}}}}},"/v1/risks/{risk_id}/tags":{"get":{"tags":["Risks"],"summary":"Get all tags associated with a risk","operationId":"list_risk_tags","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId, i.e. RSK-1, RSK-00001","required":true,"schema":{"type":"string"},"example":"RSK-1"}],"responses":{"200":{"description":"List of tags associated with the risk"},"404":{"description":"Risk not found"}}},"post":{"tags":["Risks"],"summary":"Add a tag to a risk","operationId":"create_risk_tag","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId, i.e. RSK-1","required":true,"schema":{"type":"string"},"example":"RSK-1"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddRiskTagRequest"}}},"required":true},"responses":{"201":{"description":"Tag added to risk","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskTagResponse"}}}},"404":{"description":"Risk or tag not found"},"409":{"description":"Tag already associated with risk"}}},"delete":{"tags":["Risks"],"summary":"Remove a tag from a risk","operationId":"delete_risk_tag","parameters":[{"name":"risk_id","in":"path","description":"String-formatted RiskId, i.e. RSK-1","required":true,"schema":{"type":"string"},"example":"RSK-1"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveRiskTagRequest"}}},"required":true},"responses":{"200":{"description":"Tag removed from risk"},"404":{"description":"Risk, tag, or association not found"}}}},"/v1/service-accounts":{"get":{"tags":["Users"],"summary":"List service accounts (integration + API-key) in the organization.","operationId":"list_service_accounts","parameters":[{"name":"page_size","in":"query","description":"Rows per page. Defaults to 25, max 100; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":25,"maximum":100,"minimum":1}},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"query","in":"query","description":"Freetext ILIKE across `first_name`, `last_name`, and `email`.","required":false,"schema":{"type":["string","null"]}},{"name":"active","in":"query","description":"`true` returns only active service accounts (`deactivated_date IS\nNULL`); `false` only deactivated; absent returns both.","required":false,"schema":{"type":["boolean","null"]}},{"name":"kind","in":"query","description":"Restrict to integration SAs, credential SAs, or both (default).","required":false,"schema":{"type":["array","null"],"items":{"type":"string"}}},{"name":"roles","in":"query","description":"Role UUIDs — matches SAs holding any of the listed roles.","required":false,"schema":{"type":["array","null"],"items":{"type":"string"}}},{"name":"created_after","in":"query","description":"Inclusive lower bound on `users.created_date`.","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"created_before","in":"query","description":"Inclusive upper bound on `users.created_date`.","required":false,"schema":{"type":["string","null"],"format":"date-time"}}],"responses":{"200":{"description":"List service accounts in the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_ServiceAccount"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}}}},"/v1/tags":{"post":{"tags":["Tags"],"summary":"Create a new tag","operationId":"create_tag","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTagRequest"}}},"required":true},"responses":{"201":{"description":"Tag created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"400":{"description":"Invalid request"},"409":{"description":"Tag name already exists"}}}},"/v1/tags/items":{"get":{"tags":["Tags"],"summary":"List item tags for the organization","operationId":"list_org_item_tags","responses":{"200":{"description":"List item tags for the organization, applied to risks and incidents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTagsResponse"}}}}}}},"/v1/tags/portfolio":{"get":{"tags":["Tags"],"summary":"List tags created by the user","operationId":"list_user_portfolio_tags","responses":{"200":{"description":"List tags created by the user, applied to organizations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTagsResponse"}}}}}}},"/v1/tags/{id}":{"get":{"tags":["Tags"],"summary":"Get a tag by ID","operationId":"get_tag","parameters":[{"name":"id","in":"path","description":"The ID of the tag to retrieve","required":true,"schema":{"type":"string","format":"uuid"},"example":"123"}],"responses":{"200":{"description":"Get the tag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"404":{"description":"Tag not found"}}},"delete":{"tags":["Tags"],"summary":"Delete a tag","operationId":"delete_tag","parameters":[{"name":"id","in":"path","description":"The ID of the tag to delete","required":true,"schema":{"type":"string","format":"uuid"},"example":"123"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteTagRequest"}}},"required":true},"responses":{"200":{"description":"Tag deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteTagResponse"}}}},"400":{"description":"Invalid reassignment target"},"404":{"description":"Tag not found"},"409":{"description":"Tag is in use; provide reassign_to_id or force=true to delete"}}},"patch":{"tags":["Tags"],"summary":"Update a tag","operationId":"update_tag","parameters":[{"name":"id","in":"path","description":"The ID of the tag to update","required":true,"schema":{"type":"string","format":"uuid"},"example":"123"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTagRequest"}}},"required":true},"responses":{"200":{"description":"Tag updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"400":{"description":"Invalid request"},"404":{"description":"Tag not found"},"409":{"description":"Tag name already exists"}}}},"/v1/tags/{id}/stats":{"get":{"tags":["Tags"],"summary":"Get statistics for a specific tag","operationId":"get_tag_stats","parameters":[{"name":"id","in":"path","description":"The ID of the tag to retrieve statistics for","required":true,"schema":{"type":"string","format":"uuid"},"example":"123"}],"responses":{"200":{"description":"Get the tag statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagStatsResponse"}}}},"404":{"description":"Tag not found"}}}},"/v1/threats":{"get":{"tags":["Threats"],"summary":"List threat objectives","operationId":"list_threat_levels","responses":{"200":{"description":"List all threat levels","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListThreatLevelsResponse"}}}}}}},"/v1/threats/organizations/{org_id}":{"get":{"tags":["Threats"],"summary":"List threat objectives for an organization","operationId":"list_threat_levels_by_org","parameters":[{"name":"org_id","in":"path","description":"The UUID of the organization","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"responses":{"200":{"description":"List all threat levels for the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListThreatLevelsResponse"}}}},"404":{"description":"Organization not found"}}}},"/v1/threats/projections":{"post":{"tags":["Threats"],"summary":"Project the consequences (risk and policy changes) of a hypothetical set of threat positions.","description":"This endpoint is only guaranteed to work correctly IF every threat position is valid for the organization, and all of the threat positions are passed in the request body.","operationId":"create_threat_projection","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThreatPosition"}}}},"required":true},"responses":{"200":{"description":"Projected threat consequences","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreatConsequences"}}}}}}},"/v1/threats/proposals":{"get":{"tags":["Threats"],"summary":"List all proposals to change threats made for the organization","operationId":"list_proposals","parameters":[{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"page_size","in":"query","description":"Rows per page. Defaults to 5, max 100; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":5,"maximum":100,"minimum":1}}],"responses":{"200":{"description":"List all proposals","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_FullProposal"}}}}}},"post":{"tags":["Threats"],"summary":"Create a new proposal to change a threat profile","operationId":"create_proposal","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewThreatPositions"}}},"required":true},"responses":{"201":{"description":"Proposal created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FullProposal"}}}}}}},"/v1/threats/proposals/active":{"get":{"tags":["Threats"],"summary":"Get the currently active proposal","operationId":"get_active_proposal","responses":{"200":{"description":"The currently active proposal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FullProposal"}}}},"404":{"description":"No active proposal found"}}}},"/v1/threats/proposals/{id}":{"patch":{"tags":["Threats"],"summary":"Update a pending proposal's threat positions","operationId":"patch_proposal","parameters":[{"name":"id","in":"path","description":"The ID of the proposal to update","required":true,"schema":{"type":"integer","format":"int64"},"example":123}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchProposalRequest"}}},"required":true},"responses":{"200":{"description":"Proposal updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FullProposal"}}}},"404":{"description":"No proposal found"}}}},"/v1/threats/proposals/{id}/approve":{"post":{"tags":["Threats"],"summary":"Approve a pending proposal","operationId":"approve_proposal","parameters":[{"name":"id","in":"path","description":"The ID of the proposal to approve","required":true,"schema":{"type":"integer","format":"int64"},"example":123}],"responses":{"200":{"description":"Proposal approved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FullProposal"}}}},"404":{"description":"No proposal found"}}}},"/v1/threats/proposals/{id}/deny":{"post":{"tags":["Threats"],"summary":"Deny a pending proposal","operationId":"deny_proposal","parameters":[{"name":"id","in":"path","description":"The ID of the proposal to deny","required":true,"schema":{"type":"integer","format":"int64"},"example":123}],"responses":{"200":{"description":"Proposal denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FullProposal"}}}},"404":{"description":"No proposal found"}}}},"/v1/threats/{slug}":{"get":{"tags":["Threats"],"summary":"Get threat objective data by slug","operationId":"get_threat_level","parameters":[{"name":"slug","in":"path","description":"String-formatted ThreatLevel slug","required":true,"schema":{"$ref":"#/components/schemas/ThreatName"},"example":"sabotage, data-disclosure"}],"responses":{"200":{"description":"Get a threat level by slug","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreatLevel"}}}}}}},"/v1/users":{"get":{"tags":["Users"],"summary":"List all users in the user's organization","operationId":"list_paginated_users","parameters":[{"name":"page_size","in":"query","description":"Rows per page. Defaults to 25, max 100; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":25,"maximum":100,"minimum":1}},{"name":"page","in":"query","description":"1-indexed page number. Defaults to 1; zero is rejected.","required":false,"schema":{"type":"integer","format":"int64","default":1,"maximum":1000000,"minimum":1}},{"name":"last_login","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"joined_date","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"last_name","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"order_by","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"query","in":"query","description":"Freetext ILIKE across `first_name`, `last_name`, and `email`. Empty\nor missing → no filter.","required":false,"schema":{"type":["string","null"]}},{"name":"first_name","in":"query","description":"Partial (ILIKE) match on `first_name`.","required":false,"schema":{"type":["string","null"]}},{"name":"email","in":"query","description":"Partial (ILIKE) match on `email`.","required":false,"schema":{"type":["string","null"]}},{"name":"active","in":"query","description":"`true` returns only active members (`deactivated_date IS NULL`);\n`false` returns only deactivated; absent returns both.","required":false,"schema":{"type":["boolean","null"]}},{"name":"roles","in":"query","description":"Role UUIDs — matches members holding any of the listed roles.","required":false,"schema":{"type":["array","null"],"items":{"type":"string"}}},{"name":"created_after","in":"query","description":"Inclusive lower bound on `organization_user.joined_date`.","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"created_before","in":"query","description":"Inclusive upper bound on `organization_user.joined_date`.","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"permission","in":"query","description":"Restrict to active users holding this permission label (e.g.\n`risks:read`). Resolution is over active members only, so combining\nthis with `active=false` yields an empty response. Unknown labels: 400.","required":false,"schema":{"type":["string","null"]}},{"name":"ids","in":"query","description":"Restrict to these user IDs (`?ids=<uuid>&ids=<uuid>`). Collected into a\nset, so repeats collapse; max 500 distinct. Does NOT override `active`.","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"}}}],"responses":{"200":{"description":"List all users in the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pager_OrganizationMember"}}}},"400":{"description":"Unknown permission label, or `ids` exceeds 500"}}}},"/v1/users/me":{"get":{"tags":["Users"],"summary":"Retrieve information about the current user and their organization","operationId":"me","responses":{"200":{"description":"Retrieve information about the current user and their organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}}}},"patch":{"tags":["Users"],"summary":"Update the current user's profile details","operationId":"patch_user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequest"}}},"required":true},"responses":{"200":{"description":"Update the current user's profile details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserResponse"}}}}}}},"/v1/users/me/invites":{"get":{"tags":["Users"],"summary":"List pending organization invitations","operationId":"list_user_invites","responses":{"200":{"description":"List invites to join an organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInvitesResponse"}}}}}}},"/v1/users/me/invites/{id}":{"post":{"tags":["Users"],"summary":"Accept an organization invitation","operationId":"accept_invite","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successfully accepted invite"}}},"delete":{"tags":["Users"],"summary":"Decline an invitation to join another organization","operationId":"decline_invite","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"User invite successfully declined","content":{"application/json":{"schema":{}}}}}}},"/v1/users/me/permissions":{"get":{"tags":["Users"],"summary":"Get the current user's effective permissions","description":"Returns the user's roles and a list of all granular permissions they have.\nPermissions follow the format `module:action` (e.g., `risks:write`, `incidents:write`).","operationId":"get_my_permissions","responses":{"200":{"description":"User's effective permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPermissionsResponse"}}}}}}},"/v1/users/{id}/avatar":{"get":{"tags":["Users"],"summary":"Fetch a user's profile avatar.","operationId":"get_user_avatar","parameters":[{"name":"id","in":"path","description":"User ID","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"v","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Avatar image bytes","content":{"image/*":{}}},"404":{"description":"User has no avatar, does not exist, or `?v=` is stale"}}}},"/v1/users/{uuid}":{"get":{"tags":["Users"],"summary":"Get a user by ID in the user's organization","operationId":"get_user","parameters":[{"name":"uuid","in":"path","description":"User ID","required":true,"schema":{"type":"string","format":"uuid"},"example":"123e4567-e89b-12d3-a456-426614174000"}],"responses":{"200":{"description":"Get a user by ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}}}}}},"components":{"schemas":{"AddDomainRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},"AddIncidentTagRequest":{"type":"object","required":["tag_id"],"properties":{"tag_id":{"type":"string","format":"uuid"}}},"AddOrganizationTagRequest":{"type":"object","required":["tag_id"],"properties":{"tag_id":{"type":"string","format":"uuid"}}},"AddRiskTagRequest":{"type":"object","properties":{"tag_id":{"type":"string","format":"uuid","default":"00000000-0000-0000-0000-000000000000"}}},"AiIncidentScore":{"type":"object","required":["id","severity","severity_reasoning","threat_objectives","threat_objectives_reasoning"],"properties":{"id":{"type":"integer","format":"int64"},"severity":{"$ref":"#/components/schemas/Severity"},"severity_reasoning":{"type":"string"},"threat_objectives":{"type":"array","items":{"$ref":"#/components/schemas/AiThreatRelevance"}},"threat_objectives_reasoning":{"type":"string"}}},"AiIncidentScoringResponse":{"type":"object","required":["succeeded","failed"],"properties":{"failed":{"type":"array","items":{"type":"integer","format":"int64"}},"succeeded":{"type":"array","items":{"$ref":"#/components/schemas/AiIncidentScore"}}}},"AiRiskScore":{"type":"object","required":["id","likelihood","likelihood_reasoning","impact","impact_reasoning","threat_objectives","threat_objectives_reasoning"],"properties":{"id":{"type":"integer","format":"int64"},"impact":{"$ref":"#/components/schemas/Impact"},"impact_reasoning":{"type":"string"},"likelihood":{"$ref":"#/components/schemas/Likelihood"},"likelihood_reasoning":{"type":"string"},"threat_objectives":{"type":"array","items":{"$ref":"#/components/schemas/AiThreatRelevance"}},"threat_objectives_reasoning":{"type":"string"}}},"AiRiskScoringResponse":{"type":"object","description":"This is the user-facing response for multiple risk scores.","required":["succeeded","failed"],"properties":{"failed":{"type":"array","items":{"type":"integer","format":"int64"}},"succeeded":{"type":"array","items":{"$ref":"#/components/schemas/AiRiskScore"}}}},"AiThreatRelevance":{"type":"object","required":["threat_name","relevance","reasoning"],"properties":{"reasoning":{"type":"string"},"relevance":{"$ref":"#/components/schemas/Relevance"},"threat_name":{"$ref":"#/components/schemas/ThreatName"}}},"AkrChange":{"type":"object","description":"Defines the change between an akr in its original state, to an akr after its been modified.","required":["risk","original_position","new_position"],"properties":{"new_position":{"$ref":"#/components/schemas/RelatedScore","description":"Describes the new position and the responsible threat objective for a risk change\n\nshould be renamed to new_score"},"original_position":{"$ref":"#/components/schemas/RelatedScore","description":"should be renamed to original_score"},"risk":{"$ref":"#/components/schemas/SummarizedAkr","description":"Describes the short summary of a risk"}}},"ArmDocument":{"type":"object","description":"A structure that contains information about a document, including the document's meta information","required":["meta","root"],"properties":{"meta":{"$ref":"#/components/schemas/DocumentInfo","description":"The meta information of the document"},"root":{"$ref":"#/components/schemas/DocNode_TemplateNode","description":"The root node of the document"}}},"Association":{"type":"object","description":"Defines an association between a key risk and some node type","required":["key_risk_id","description","threshold"],"properties":{"description":{"type":"string"},"key_risk_id":{"type":"integer","format":"int64"},"threshold":{"type":"integer","format":"int32"}}},"AuthorizationServerMetadata":{"type":"object","required":["issuer","authorization_endpoint","token_endpoint","registration_endpoint","revocation_endpoint","scopes_supported","response_types_supported","grant_types_supported","token_endpoint_auth_methods_supported","code_challenge_methods_supported"],"properties":{"authorization_endpoint":{"type":"string"},"code_challenge_methods_supported":{"type":"array","items":{"type":"string"}},"grant_types_supported":{"type":"array","items":{"type":"string"}},"issuer":{"type":"string","description":"Issuer identifier — also the origin from which the well-known path is\nserved. MCP clients may use this as the OAuth `iss` claim expectation."},"registration_endpoint":{"type":"string"},"response_types_supported":{"type":"array","items":{"type":"string"}},"revocation_endpoint":{"type":"string"},"scopes_supported":{"type":"array","items":{"type":"string"}},"token_endpoint":{"type":"string"},"token_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}}}},"AuthorizedAppResponse":{"type":"object","description":"View of a single DCR authorization for the Authorized Applications list.\n\n`authorized_by` is populated only when the list is returned in org scope\n(admin view) — in self-scope responses it's always `None` and omitted\nfrom the wire format.","required":["client_id","client_name","authorized_on","scope","status"],"properties":{"authorized_by":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AuthorizedByRef"}]},"authorized_on":{"type":"string","format":"date-time"},"client_id":{"type":"string"},"client_name":{"type":"string"},"last_used":{"type":["string","null"],"format":"date-time"},"scope":{"type":"string","description":"Space-separated atomic scopes granted by the user's most recent live\nconsent for this client. Compound aliases are already expanded."},"software_id":{"type":["string","null"]},"software_version":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/AuthorizedAppStatus","description":"Current usability state for this authorization. `expired` means no\nusable refresh token remains; explicitly revoked authorizations are not\nreturned by the list endpoint."}}},"AuthorizedAppStatus":{"type":"string","description":"Usability state for an authorized dynamic OAuth application.","enum":["active","expired"]},"AuthorizedByRef":{"type":"object","description":"Minimal user reference attached to `AuthorizedAppResponse` in org-scope\nresponses so the admin UI can render who authorized a client.","required":["id","email","first_name","last_name"],"properties":{"email":{"type":"string"},"first_name":{"type":"string"},"icon":{"type":["string","null"]},"id":{"type":"string","format":"uuid"},"last_name":{"type":"string"}}},"BugcrowdConfigResponse":{"type":"object","required":["username","auto_score","sync_enabled"],"properties":{"auto_score":{"type":"boolean"},"sync_enabled":{"type":"boolean"},"username":{"type":"string"}}},"CategoryWithPreferences":{"type":"object","description":"Category containing notification types with their channel preferences","required":["category","notification_types"],"properties":{"category":{"$ref":"#/components/schemas/SubscriptionCategory","description":"The notification category"},"notification_types":{"type":"array","items":{"$ref":"#/components/schemas/NotificationTypeWithPreferences"},"description":"Notification types with their channel preferences"}}},"ChannelInfo":{"type":"object","required":["name","integration_user_id","subscriptions"],"properties":{"integration_user_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionPayload"}}}},"Comment":{"type":"object","required":["id","user","value","created_date"],"properties":{"created_date":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"updated_date":{"type":["string","null"],"format":"date-time"},"user":{"$ref":"#/components/schemas/User"},"value":{"type":"string"}}},"ComplianceMetrics":{"type":"object","required":["org_id","total_critical_high_akrs","closed_critical_high_akrs","compliance_percentage"],"properties":{"closed_critical_high_akrs":{"type":"integer","format":"int32"},"compliance_percentage":{"type":"integer","format":"int32"},"org_id":{"type":"string","format":"uuid"},"total_critical_high_akrs":{"type":"integer","format":"int32"}}},"ConsentInfo":{"type":"object","description":"Response shape for GET /consent-info. Everything the consent UI needs to\nrender a Grant/Deny dialog.","required":["client_id","client_name","is_dynamic","scopes","redirect_uri"],"properties":{"client_id":{"type":"string"},"client_name":{"type":"string"},"is_dynamic":{"type":"boolean"},"redirect_uri":{"type":"string"},"resource":{"type":["string","null"]},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/ScopeInfo"},"description":"Fully expanded atomic scope list. The UI renders these directly so the\nuser sees exactly what they're granting (not a compound alias)."}}},"ConsentRequest":{"type":"object","description":"POST /v1/oauth/consent","required":["authorize"],"properties":{"authorize":{"type":"boolean"},"granted_scopes":{"type":["array","null"],"items":{"type":"string"},"description":"Granted scopes — may be a subset of what was requested. If omitted, all\npending scopes are granted (the consent UI typically sends everything\nthat was rendered). Unknown scopes are ignored; scopes not present in\nthe pending request are rejected to prevent privilege escalation."}}},"ConsentResponse":{"type":"object","required":["redirect"],"properties":{"redirect":{"type":"string","description":"Absolute URL the browser should navigate to next. On approve this is\nthe client's redirect_uri with `?code=...&state=...`; on deny it is the\nredirect_uri with `?error=access_denied&state=...`."}}},"CreateFilterViewRequest":{"type":"object","required":["name","filtered_table","filter"],"properties":{"filter":{},"filtered_table":{"$ref":"#/components/schemas/FilterViewTable"},"name":{"type":"string"}}},"CreateIncidentRequest":{"type":"object","description":"The required properties of a request to POST /incidents","properties":{"assigned_to":{"type":["string","null"],"format":"uuid","default":null},"contained_date":{"type":["string","null"],"format":"date-time","default":null},"description":{"type":"string","default":""},"detected_date":{"type":["string","null"],"format":"date-time","default":null},"occurred_date":{"type":["string","null"],"format":"date-time","default":null},"responded_date":{"type":["string","null"],"format":"date-time","default":null},"severity":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Severity"}],"default":null},"severity_reasoning":{"type":["string","null"],"default":null},"source":{"type":["string","null"],"default":null},"status":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/IncidentStatus"}],"default":null},"title":{"type":"string","default":""}}},"CreateOAuthClientRequest":{"type":"object","required":["client_name","roles"],"properties":{"allowed_ips":{"type":["array","null"],"items":{"type":"string"},"description":"IP/CIDR allowlist; null or empty = unrestricted"},"client_name":{"type":"string","description":"User-friendly name for the service account"},"expires_at":{"type":["string","null"],"format":"date-time","description":"Optional expiration"},"roles":{"type":"array","items":{"type":"string"},"description":"Role names to assign to the service-account user. Case-insensitive;\nmust be non-empty."}}},"CreateOrgInviteRequest":{"type":"object","required":["email","roles"],"properties":{"email":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}}}},"CreateRiskRequest":{"type":"object","description":"The required properties of a request to POST /risks","properties":{"assigned_to_id":{"type":["string","null"],"format":"uuid","default":null},"closed_date":{"type":["string","null"],"format":"date-time","default":null},"control_statement":{"type":["string","null"],"default":null},"description":{"type":"string","default":""},"discovered_date":{"type":["string","null"],"format":"date-time","default":null},"due_date":{"type":["string","null"],"format":"date-time","default":null},"expected_date":{"type":["string","null"],"format":"date-time","default":null},"impact":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Impact"}],"default":null},"impact_reasoning":{"type":["string","null"],"default":null},"initially_reported_urgency":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/InitiallyReportedUrgency"}],"default":null},"likelihood":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Likelihood"}],"default":null},"likelihood_reasoning":{"type":["string","null"],"default":null},"remediation_task":{"type":["string","null"],"default":null},"source":{"type":["string","null"],"default":null},"status":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RiskStatus"}],"default":null},"threat_objectives":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"},"default":null},"title":{"type":"string","default":""},"type":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RiskType"}],"default":null}}},"CreateSourceRequest":{"type":"object","required":["name"],"properties":{"description":{"type":["string","null"]},"name":{"type":"string"}}},"CreateTagRequest":{"type":"object","required":["content"],"properties":{"content":{"type":"string"},"tag_type":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/TagType"}]}}},"CrowdstrikeConfigResponse":{"type":"object","required":["client_id","cloud","sync_enabled","auto_score"],"properties":{"auto_score":{"type":"boolean"},"client_id":{"type":"string"},"cloud":{"type":"string"},"sync_enabled":{"type":"boolean"}}},"Custom":{"oneOf":[{"type":"object","required":["value"],"properties":{"value":{"type":"string","enum":["cyber_gov"]}}},{"type":"object","required":["value"],"properties":{"value":{"type":"string","enum":["risk_s_l_a"]}}},{"type":"object","required":["value"],"properties":{"value":{"type":"string","enum":["heatmap"]}}}]},"Decision":{"oneOf":[{"type":"object","description":"A decision to approve a proposal and effect the consequences","required":["Approved"],"properties":{"Approved":{"$ref":"#/components/schemas/UserAction","description":"A decision to approve a proposal and effect the consequences"}}},{"type":"object","description":"A decision to deny a proposal","required":["Denied"],"properties":{"Denied":{"$ref":"#/components/schemas/UserAction","description":"A decision to deny a proposal"}}}],"description":"Updating a proposal requires that the requestor specify whether the proposal is approved or denied"},"DecisionAction":{"type":"string","description":"Defines in a modification or creation standpoint, what happens to a proposal\n\ntodo: fix this doc","enum":["approve","deny"]},"DeleteDomainResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}}},"DeleteManyIncidentsRequest":{"type":"object","description":"DELETE /incidents","properties":{"ids":{"type":"array","items":{"type":"integer","format":"int64"},"default":[]}}},"DeleteManyIncidentsResponse":{"type":"object","description":"Response for DELETE /incidents","properties":{"deleted_count":{"type":"integer","default":0,"minimum":0},"not_found":{"type":"array","items":{"type":"string"},"default":[]}}},"DeleteManyRisksRequest":{"type":"object","description":"DELETE /risks","properties":{"ids":{"type":"array","items":{"type":"integer","format":"int64"},"default":[]}}},"DeleteManyRisksResponse":{"type":"object","description":"Response for DELETE /risks","properties":{"deleted_count":{"type":"integer","default":0,"minimum":0},"not_found":{"type":"array","items":{"type":"string"},"default":[]}}},"DeleteSourceRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}},"DeleteSourceResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}}},"DeleteTagRequest":{"type":"object","properties":{"force":{"type":["boolean","null"],"description":"Delete the tag even when it is still applied to resources, cascading the\nremoval from every associated risk, incident, and organization. Ignored\nwhen `reassign_to_id` is set (reassignment always takes precedence)."},"reassign_to_id":{"type":["string","null"],"format":"uuid"}}},"DeleteTagResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}}},"DocNode_TemplateNode":{"allOf":[{"oneOf":[{"allOf":[{"type":"string"},{"type":"object","required":["node_type"],"properties":{"node_type":{"type":"string","enum":["image"]}}}]},{"allOf":[{"type":"string"},{"type":"object","required":["node_type"],"properties":{"node_type":{"type":"string","enum":["text"]}}}]},{"allOf":[{"$ref":"#/components/schemas/Group_TemplateNode"},{"type":"object","required":["node_type"],"properties":{"node_type":{"type":"string","enum":["group"]}}}]},{"allOf":[{"$ref":"#/components/schemas/Selector"},{"type":"object","required":["node_type"],"properties":{"node_type":{"type":"string","enum":["selector"]}}}]},{"allOf":[{"$ref":"#/components/schemas/Table_TemplateNode"},{"type":"object","required":["node_type"],"properties":{"node_type":{"type":"string","enum":["table"]}}}]},{"allOf":[{"$ref":"#/components/schemas/Custom"},{"type":"object","required":["node_type"],"properties":{"node_type":{"type":"string","enum":["custom"]}}}]}],"description":"A representation of a all possible node types in the document.\nThis is useful because it allows us to have a single enum that can be used in vectors"},{"type":"object","required":["toc"],"properties":{"id":{"type":["string","null"]},"toc":{"type":"boolean"}}}],"description":"A representation of a node in the document."},"DocumentChanges":{"type":"object","description":"Contains a list of changes for a single document that will occur if a proposal is approved.","required":["document_id","changes"],"properties":{"changes":{"$ref":"#/components/schemas/PolicyChanges"},"document_id":{"$ref":"#/components/schemas/DocumentId"}}},"DocumentDetails":{"type":"object","description":"Contains the details of a document.","required":["version","status"],"properties":{"last_approved_action":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/UserAction"}]},"last_modified_action":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/UserAction"}]},"status":{"$ref":"#/components/schemas/DocumentStatus"},"version":{"$ref":"#/components/schemas/Version"}}},"DocumentEditValue":{"oneOf":[{"type":"object","description":"Contains the id of the selected option","required":["value","node_type"],"properties":{"node_type":{"type":"string","enum":["selected_option"]},"value":{"type":"string","description":"Contains the id of the selected option"}}},{"type":"object","required":["value","node_type"],"properties":{"node_type":{"type":"string","enum":["text"]},"value":{"type":"string"}}}]},"DocumentId":{"type":"object","description":"\n# A slug and version pair that uniquely identifies a document.\n\nAs a string, the format should be `slug:version`, where `slug` is a string that is a valid slug and `version` is a string that is a valid version.\n\n## Example\n```rust\n# use std::str::FromStr;\n# use backend::views::document::{DocumentId, Version};\n# use backend::views::common::Slug;\n\nlet document_id_str = \"cybersecurity-policy:1.0.0\";\nlet document_id: DocumentId = DocumentId::from_str(document_id_str).unwrap();\nassert_eq!(document_id.slug.as_str(), \"cybersecurity-policy\");\nassert_eq!(document_id_str.to_string(), DocumentId::new(Slug::from_str(\"cybersecurity-policy\").unwrap(), Version::new(1, 0, 0)).to_string());","required":["slug","version"],"properties":{"slug":{"$ref":"#/components/schemas/Slug","description":"The slug of the document. i.e. `cybersecurity-policy`"},"version":{"$ref":"#/components/schemas/Version","description":"The version of the document. i.e. `1.0.0`"}}},"DocumentInfo":{"type":"object","description":"Provides basic information about a document.","required":["slug","title","description","state","latest_version"],"properties":{"description":{"type":"string"},"latest_version":{"$ref":"#/components/schemas/Version"},"slug":{"type":"string","example":"cybersecurity-policy"},"state":{"$ref":"#/components/schemas/DocumentState"},"title":{"type":"string"}}},"DocumentInput":{"allOf":[{"$ref":"#/components/schemas/DocumentEditValue","description":"the value that was selected/edited. Even though the type is a string, it will be interpreted as what the type\nof the document item is."},{"type":"object","required":["node_id"],"properties":{"node_id":{"type":"string","description":"the id of the document item that was changed. this is the PK of the doc_item_reference table."}}}],"description":"Defines some form of selection/edit that a user has made for a document item."},"DocumentList":{"type":"array","items":{"$ref":"#/components/schemas/DocumentInfo"},"description":"# Contains a list of [`DocumentInfo`]s.\nThis is the primary view model for the compliance module."},"DocumentProposal":{"type":"object","required":["id","document","created"],"properties":{"created":{"$ref":"#/components/schemas/UserAction"},"decision":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Decision"}]},"document":{"$ref":"#/components/schemas/DocumentId"},"id":{"type":"integer","format":"int32"}}},"DocumentProposalAction":{"type":"object","required":["id","proposal","created"],"properties":{"created":{"$ref":"#/components/schemas/UserAction"},"id":{"type":"integer","format":"int32"},"proposal":{"type":"integer","format":"int32"},"updated_date":{"type":["string","null"],"format":"date-time"}}},"DocumentState":{"oneOf":[{"type":"object","description":"The document has not been initialized yet. It is possible\nfor the document to have details, meaning that a proposal is \"open\" to initialize it.","required":["value"],"properties":{"value":{"type":"string","enum":["uninitialized"]}}},{"type":"object","description":"The initial proposal is being opened","required":["details","value"],"properties":{"details":{"$ref":"#/components/schemas/DocumentDetails","description":"The initial proposal is being opened"},"value":{"type":"string","enum":["pending_initialization"]}}},{"type":"object","description":"The document has been initialized and is ready for use","required":["details","value"],"properties":{"details":{"$ref":"#/components/schemas/DocumentDetails","description":"The document has been initialized and is ready for use"},"value":{"type":"string","enum":["initialized"]}}}],"description":"The state of a document from a user perspective."},"DocumentStatus":{"oneOf":[{"type":"object","description":"There are no open changes to the document","required":["changes"],"properties":{"changes":{"type":"string","enum":["no_changes"]}}},{"type":"object","description":"There are open changes to the document","required":["value","changes"],"properties":{"changes":{"type":"string","enum":["open_changes"]},"value":{"type":"integer","format":"int32","description":"There are open changes to the document","minimum":0}}}],"description":"The number of changes that have been made to a document."},"DomainInfo":{"type":"object","description":"Provides information about a domain","required":["name","verified"],"properties":{"name":{"type":"string"},"verified":{"type":"boolean"}}},"ExportIncidentsRequest":{"type":"object","required":["selected_incidents"],"properties":{"columns":{"type":["array","null"],"items":{"$ref":"#/components/schemas/IncidentExportColumn"},"description":"Optional list of column keys to include, in order. If None, exports all columns."},"filename":{"type":["string","null"],"description":"Optional custom filename (without .csv extension)"},"filter":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/IncidentParams","description":"Filter applied in \"All in filter\" mode. Used when `selected_incidents`\nis empty. Pagination on the filter is overridden by streaming defaults."}]},"selected_incidents":{"type":"array","items":{"type":"string"},"description":"IDs of selected rows. When non-empty, exports only these and ignores\n`filter`. When empty, falls back to \"All in filter\".","example":"INC-00001"}}},"ExportRisksRequest":{"type":"object","required":["meta_risk_type","selected_risks"],"properties":{"columns":{"type":["array","null"],"items":{"$ref":"#/components/schemas/RiskExportColumn"},"description":"Optional list of column keys to include, in order. If None, exports all columns."},"filename":{"type":["string","null"],"description":"Optional custom filename (without .csv extension)"},"filter":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RiskRSKParams","description":"RSK filter applied in \"All in filter\" mode. Honored only when\n`meta_risk_type == OrgRisk` and `selected_risks` is empty. AKR exports\nalways export every AKR (there is only ever one page of them in\npractice), so this field is ignored when `meta_risk_type == KeyRisk`.\nPagination on the filter is overridden by the streaming defaults."}]},"meta_risk_type":{"$ref":"#/components/schemas/MetaRiskType","description":"Which register the export targets (RSK or AKR). Mirrors the active tab\non the risks page."},"selected_risks":{"type":"array","items":{"type":"string"},"description":"IDs of selected rows. When non-empty, exports only these and ignores\n`filter`. When empty, falls back to \"All in filter\"."}}},"ExternalPageMeta":{"type":"object","description":"Pagination metadata for external-integration responses. The continuation is\na single opaque [`next_page_token`](Self::next_page_token) — a base64(JSON)\nblob the producer round-trips through [`crate::views::cursor`] — so the\npage/offset/cursor schemes of the underlying APIs are invisible to the\nSDK/frontend, which only read `total_items` for the \"X of Y\" display.","properties":{"next_page_token":{"type":["string","null"],"description":"Opaque continuation token. Absent means there are no further pages — the\nsole end-of-collection signal."},"total_items":{"type":["integer","null"],"format":"int64","description":"Total matching items, when the upstream API reports it. Informational\nonly — never used for loop control. Absent when the API reports no total\n(e.g. HackerOne, GitHub Dependabot).","minimum":0}}},"FilterView":{"type":"object","required":["id","user_id","name","filtered_table","filter","shared"],"properties":{"filter":{"type":"object"},"filtered_table":{"type":"string","example":"risks"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"shared":{"type":"boolean","description":"Whether the owner has shared this view with their organization."},"user_id":{"type":"string","format":"uuid"}}},"FilterViewTable":{"type":"string","description":"Used in queries to filter what kind of risks to return","enum":["risks","incidents","portfolio"]},"Filter_AssignedTo":{"oneOf":[{"type":"string","enum":["null"]},{"oneOf":[{"type":"string","enum":["me"]},{"type":"string","format":"uuid"}],"description":"A user reference for the `assigned_to` filter: a user's UUID, or the literal\n`me` (the calling user, resolved server-side). Wrapped in `Filter`,\n`assigned_to` accepts `null` (unassigned), `me`, or a UUID — e.g.\n`?assigned_to=me&assigned_to=null` returns rows assigned to you or to nobody."}],"description":"A filter value for a column: one of the column's values, or the literal\nstring `null` to match rows where the column is unset. Repeat the parameter\nto match any of several values — e.g. `?impact=Low&impact=High&impact=null`\nreturns rows that are Low, High, or unscored."},"Filter_Impact":{"oneOf":[{"type":"string","enum":["null"]},{"type":"string","enum":["Very Low","Low","Medium","High","Severe"]}],"description":"A filter value for a column: one of the column's values, or the literal\nstring `null` to match rows where the column is unset. Repeat the parameter\nto match any of several values — e.g. `?impact=Low&impact=High&impact=null`\nreturns rows that are Low, High, or unscored."},"Filter_InitiallyReportedUrgency":{"oneOf":[{"type":"string","enum":["null"]},{"type":"string","enum":["Critical","High","Medium","Low","Info"]}],"description":"A filter value for a column: one of the column's values, or the literal\nstring `null` to match rows where the column is unset. Repeat the parameter\nto match any of several values — e.g. `?impact=Low&impact=High&impact=null`\nreturns rows that are Low, High, or unscored."},"Filter_Likelihood":{"oneOf":[{"type":"string","enum":["null"]},{"type":"string","enum":["Remote","Unlikely","Possible","Probable","Imminent"]}],"description":"A filter value for a column: one of the column's values, or the literal\nstring `null` to match rows where the column is unset. Repeat the parameter\nto match any of several values — e.g. `?impact=Low&impact=High&impact=null`\nreturns rows that are Low, High, or unscored."},"Filter_Severity":{"oneOf":[{"type":"string","enum":["null"]},{"type":"string","enum":["SEV-5","SEV-4","SEV-3","SEV-2","SEV-1"]}],"description":"A filter value for a column: one of the column's values, or the literal\nstring `null` to match rows where the column is unset. Repeat the parameter\nto match any of several values — e.g. `?impact=Low&impact=High&impact=null`\nreturns rows that are Low, High, or unscored."},"Filter_String":{"oneOf":[{"type":"string","enum":["null"]},{"type":"string"}],"description":"A filter value for a column: one of the column's values, or the literal\nstring `null` to match rows where the column is unset. Repeat the parameter\nto match any of several values — e.g. `?impact=Low&impact=High&impact=null`\nreturns rows that are Low, High, or unscored."},"Filter_ThreatName":{"oneOf":[{"type":"string","enum":["null"]},{"type":"string","description":"Identifies a specific threat objective","enum":["Sabotage","Data Disclosure","Extortion","Customer Targeting","Resource Hijacking","Fraud"]}],"description":"A filter value for a column: one of the column's values, or the literal\nstring `null` to match rows where the column is unset. Repeat the parameter\nto match any of several values — e.g. `?impact=Low&impact=High&impact=null`\nreturns rows that are Low, High, or unscored."},"Filter_Urgency":{"oneOf":[{"type":"string","enum":["null"]},{"type":"string","description":"A score that determines how to treat certain values of a risk based on their likelihood and impact.","enum":["Info","Low","Medium","High","Critical"]}],"description":"A filter value for a column: one of the column's values, or the literal\nstring `null` to match rows where the column is unset. Repeat the parameter\nto match any of several values — e.g. `?impact=Low&impact=High&impact=null`\nreturns rows that are Low, High, or unscored."},"FullProposal":{"type":"object","description":"Contains detailed information about a proposal. This includes values of [`Proposal`] and a list of [`FullProposalAction`]s.","required":["proposal","actions"],"properties":{"actions":{"type":"array","items":{"$ref":"#/components/schemas/FullProposalAction"}},"proposal":{"$ref":"#/components/schemas/Proposal"}}},"FullProposalAction":{"type":"object","description":"Contains values of [`threat_proposal_action::Model`](crate::models::threat_proposal_action::Model) and a list of [`InherentScore`]s.","required":["action","scores"],"properties":{"action":{"$ref":"#/components/schemas/ProposalAction"},"scores":{"type":"array","items":{"$ref":"#/components/schemas/InherentScore"}}}},"GetLinkedTicketsResponse":{"type":"object","description":"Response for listing tickets linked to a risk or incident.","required":["tickets"],"properties":{"tickets":{"type":"array","items":{"$ref":"#/components/schemas/TicketPreview"}}}},"GitHubConfigResponse":{"type":"object","required":["organization","sync_enabled","auto_score"],"properties":{"auto_score":{"type":"boolean"},"organization":{"type":"string"},"sync_enabled":{"type":"boolean"}}},"GreyMatterConfigResponse":{"type":"object","description":"Configuration response for GreyMatter integration","required":["sync_enabled","auto_score"],"properties":{"auto_score":{"type":"boolean"},"sync_enabled":{"type":"boolean"}}},"GroupStructure":{"type":"string","description":"The structure of the group.","enum":["section","ordered_list","unordered_list","table"]},"GroupStyle":{"type":"object","description":"The style of the group.","required":["text_align","structure"],"properties":{"page_break":{"type":["string","null"]},"structure":{"type":"string"},"text_align":{"type":"string"}}},"Group_TemplateNode":{"type":"object","description":"A representation of a group of nodes in the document.","required":["style","children"],"properties":{"children":{"type":"array","items":{"$ref":"#/components/schemas/DocNode_TemplateNode"}},"style":{"$ref":"#/components/schemas/GroupStyle"}}},"HackerOneConfigResponse":{"type":"object","required":["username","program_handle","sync_enabled","auto_score"],"properties":{"auto_score":{"type":"boolean"},"program_handle":{"type":"string"},"sync_enabled":{"type":"boolean"},"username":{"type":"string"}}},"HistoryEntry":{"type":"object","description":"A single entry in the history list, representing a set of simultaneous changes to an item","required":["timestamp","user","changes","is_creation"],"properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/HistoryEntryChange"}},"is_creation":{"type":"boolean","description":"True only for the actual first (creation) history row. False for all subsequent rows,\nincluding dummy rows inserted by touch_history() when a comment is added."},"timestamp":{"type":"string","format":"date-time"},"user":{"$ref":"#/components/schemas/User"}}},"HistoryEntryChange":{"oneOf":[{"type":"object","description":"Generic text or enum-display field (status, severity, title, description, ...).","required":["field","kind"],"properties":{"field":{"type":"string"},"kind":{"type":"string","enum":["text"]},"new":{"type":["string","null"]},"old":{"type":["string","null"]}}},{"type":"object","description":"Date / timestamp field. Frontend formats via `<Timestamp />`.","required":["field","kind"],"properties":{"field":{"type":"string"},"kind":{"type":"string","enum":["date"]},"new":{"type":["string","null"],"format":"date-time"},"old":{"type":["string","null"],"format":"date-time"}}},{"type":"object","description":"User-assignment field. Frontend renders via `<UserChip />`.","required":["field","kind"],"properties":{"field":{"type":"string"},"kind":{"type":"string","enum":["user"]},"new":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]},"old":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]}}},{"type":"object","description":"Threat-objective set change, computed as a set diff over\n`HashSet<ThreatObjectiveRelation>`.","required":["field","added","removed","kind"],"properties":{"added":{"type":"array","items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"}},"field":{"type":"string"},"kind":{"type":"string","enum":["threat_objectives"]},"removed":{"type":"array","items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"}}}}],"description":"One field-level change rendered on the history tab.\n\nTagged on `kind` so the frontend can dispatch to the right cell renderer\n(text, date via `<Timestamp />`, user via `<UserChip />`, threat-objective\nadded/removed lists)."},"Impact":{"type":"string","enum":["Very Low","Low","Medium","High","Severe"]},"ImportIncidentsMultipart":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","contentMediaType":"application/octet-stream"}}},"ImportIncidentsPreviewResponse":{"type":"object","description":"Preview of the incidents an import would create (those not already imported).","required":["new","total_new"],"properties":{"new":{"type":"array","items":{"$ref":"#/components/schemas/Incident"},"description":"Incidents that would be newly created by the import."},"total_new":{"type":"integer","description":"Number of incidents that would be newly created.","minimum":0}}},"ImportIncidentsResponse":{"type":"object","required":["incidents_imported"],"properties":{"incidents_imported":{"type":"integer","format":"int64","minimum":0}}},"ImportResponse":{"type":"object","description":"Acknowledgement that an import has been accepted for background processing\n(HTTP 202).","required":["status"],"properties":{"status":{"type":"string","description":"Dispatch status; `\"queued\"` when the import has been accepted."}}},"ImportRisksMultipart":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","contentMediaType":"application/octet-stream"}}},"ImportRisksPreviewResponse":{"type":"object","description":"Preview of the risks an import would create (those not already imported).","required":["new","total_new"],"properties":{"new":{"type":"array","items":{"$ref":"#/components/schemas/Risk"},"description":"Risks that would be newly created by the import."},"total_new":{"type":"integer","description":"Number of risks that would be newly created.","minimum":0}}},"ImportRisksResponse":{"type":"object","required":["risks_imported"],"properties":{"risks_imported":{"type":"integer","format":"int64","minimum":0}}},"Incident":{"type":"object","description":"Relationship, core incident information","required":["id","created_date","updated_date","opened_by","updated_by","title","description","status","source","detected_date"],"properties":{"assigned_to":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]},"contained_date":{"type":["string","null"],"format":"date-time"},"created_date":{"type":"string","format":"date-time"},"description":{"type":"string"},"detected_date":{"type":"string","format":"date-time"},"id":{"type":"string","example":"INC-00001"},"occurred_date":{"type":["string","null"],"format":"date-time"},"opened_by":{"$ref":"#/components/schemas/User"},"parent_id":{"type":["string","null"],"description":"When set, this incident is linked under the named parent incident.","example":"INC-00001"},"responded_date":{"type":["string","null"],"format":"date-time"},"severity":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Severity"}]},"severity_reasoning":{"type":["string","null"]},"source":{"type":"string","description":"Where the incident was reported from (e.g. \"Employee Reported\"). Always\npresent."},"status":{"$ref":"#/components/schemas/IncidentStatus"},"title":{"type":"string"},"updated_by":{"$ref":"#/components/schemas/User"},"updated_date":{"type":"string","format":"date-time"}}},"IncidentExportColumn":{"type":"string","description":"Available columns for incident CSV export.","enum":["id","title","description","status","severity","source","created_date","updated_date","detected_date","occurred_date","responded_date","contained_date","assigned_to","opened_by","severity_reasoning","tags"]},"IncidentParams":{"type":"object","properties":{"assigned_to":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_AssignedTo"},"description":"Accepts UUIDs, the literal `null` (unassigned), and the sentinel\n`me` (the calling user, resolved server-side). Multiple values\nunion.","default":null,"uniqueItems":true},"contained_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `contained_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"contained_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `contained_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"contained_is_null":{"type":["boolean","null"],"description":"Match only incidents whose `contained_date` is unset. Mutually\nexclusive with `contained_after`/`contained_before`.","default":null},"created_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"created_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"description_contains":{"type":["string","null"],"default":null},"detected_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `detected_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"detected_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `detected_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"free_text":{"type":["string","null"],"default":null},"id":{"type":["array","null"],"items":{"type":"string"},"default":null},"id_contains":{"type":["string","null"],"default":null},"include_children":{"type":["boolean","null"],"description":"When true, the list includes incidents that are linked under another\nincident (i.e. rows with a non-null `parent_id`). Defaults to false so\nregisters and rollups stay collapsed.","default":null},"occurred_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `occurred_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"occurred_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `occurred_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"occurred_is_null":{"type":["boolean","null"],"description":"Match only incidents whose `occurred_date` is unset. Mutually\nexclusive with `occurred_after`/`occurred_before`.","default":null},"opened_by":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"},"default":null,"uniqueItems":true},"order_by":{"type":["string","null"],"default":null},"page":{"type":"integer","format":"int64","description":"1-indexed page number. Defaults to 1 (explicit `null` reads as the\ndefault); zero is rejected.","default":1,"maximum":1000000,"minimum":1},"page_size":{"type":"integer","format":"int64","description":"Rows per page. Defaults to 50 (explicit `null` reads as the default);\nzero is rejected.","default":50,"maximum":500,"minimum":1},"responded_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `responded_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"responded_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `responded_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"responded_is_null":{"type":["boolean","null"],"description":"Match only incidents whose `responded_date` is unset. Mutually\nexclusive with `responded_after`/`responded_before`.","default":null},"severity":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Severity"},"default":null,"uniqueItems":true},"source":{"type":["array","null"],"items":{"type":"string"},"default":null,"uniqueItems":true},"status":{"type":["array","null"],"items":{"$ref":"#/components/schemas/IncidentStatus"},"default":null,"uniqueItems":true},"tags":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"},"default":null,"uniqueItems":true},"threat_objectives":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_ThreatName"},"default":null,"uniqueItems":true},"title_contains":{"type":["string","null"],"default":null},"updated_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"updated_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"updated_by":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"},"default":null,"uniqueItems":true}}},"IncidentRegisterEntry":{"type":"object","description":"Register row for an Incident. An `Incident` plus the relational data shown on\nthe incident register: risk associations, threat objectives, tags, and comment count.","required":["incident","comment_count","risk_associations","threat_objectives","tags","linked_children_count"],"properties":{"comment_count":{"type":"integer","format":"int64","minimum":0},"incident":{"$ref":"#/components/schemas/Incident"},"linked_children_count":{"type":"integer","format":"int64","description":"Number of incidents linked under this incident (i.e. children pointing at it).\nAn incident is itself a linked child when `incident.parent_id` is set.","minimum":0},"risk_associations":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"threat_objectives":{"type":"array","items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"}}}},"IncidentStatus":{"type":"string","description":"The status of an incident","enum":["New","In Progress","Review","Closed"]},"IncidentTagResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"IndividualSubscriptionPayload":{"type":"object","description":"Payload for subscribing to individual items\nThis is separate from SubscriptionPayload to enforce that item_identifier is required","required":["notification_type","item_identifier"],"properties":{"item_identifier":{"type":"string","description":"The identifier of the specific item (e.g., \"RSK-123\", \"INC-456\")"},"notification_type":{"$ref":"#/components/schemas/NotificationType"}}},"InherentScore":{"type":"object","description":"Contains information about the current scoring of a threat objective.\n\nInherent scores don't exist without the context of an organization, and cannot exist\nwithout some relationship to a threat objective.\n\nThis struct should be refactored at some point to be more generic, because it doesn't necessarily\nhave to relate to a proposal, nor does this struct need to include the `threat_objective_name` if not\nrequested alone.","required":["threat_objective_name","id","likelihood","impact","created_date","proposal_id","proposal_action_id","is_draft"],"properties":{"created_date":{"type":"string","format":"date-time","description":"the date the score was created."},"id":{"type":"integer","format":"int64","description":"an auto-incrementing PK value that uniquely identifies the score given the threat objective name"},"impact":{"$ref":"#/components/schemas/Impact","description":"the y-axis"},"is_draft":{"type":"boolean","description":"Whether this inherent score is a draft (excluded from some threat-level\nresponses)."},"likelihood":{"$ref":"#/components/schemas/Likelihood","description":"the x-axis"},"proposal_action_id":{"type":"integer","format":"int64","description":"the proposal action PK that this score is associated with"},"proposal_id":{"type":"integer","format":"int64","description":"the proposal PK that this score is associated with"},"threat_objective_name":{"$ref":"#/components/schemas/ThreatName","description":"the threat objective PK"}}},"InitiallyReportedUrgency":{"type":"string","enum":["Critical","High","Medium","Low","Info"]},"IntegrationConfigResponse":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/JiraConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["jira"]}}}]},{"allOf":[{"$ref":"#/components/schemas/ServiceNowConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["service_now"]}}}]},{"allOf":[{"$ref":"#/components/schemas/LinearConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["linear"]}}}]},{"allOf":[{"$ref":"#/components/schemas/BugcrowdConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["bugcrowd"]}}}]},{"allOf":[{"$ref":"#/components/schemas/CrowdstrikeConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["crowdstrike"]}}}]},{"allOf":[{"$ref":"#/components/schemas/GitHubConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["github"]}}}]},{"allOf":[{"$ref":"#/components/schemas/GreyMatterConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["greymatter"]}}}]},{"allOf":[{"$ref":"#/components/schemas/HackerOneConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["hacker_one"]}}}]},{"allOf":[{"$ref":"#/components/schemas/WatchtowrConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["watchtowr"]}}}]},{"allOf":[{"$ref":"#/components/schemas/WizConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["wiz"]}}}]},{"allOf":[{"$ref":"#/components/schemas/SlackConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["slack"]}}}]},{"allOf":[{"$ref":"#/components/schemas/TeamsConfigResponse"},{"type":"object","required":["integration"],"properties":{"integration":{"type":"string","enum":["teams"]}}}]}],"description":"An integration's stored configuration, tagged by the `integration` field.\nSecrets (API keys, client secrets) are never included."},"IntegrationJobSummary":{"type":"object","description":"Per-integration job aggregates for the integration card.","required":["is_running"],"properties":{"is_running":{"type":"boolean"},"last_completed_at":{"type":["string","null"],"format":"date-time"},"last_error":{"type":["string","null"]},"last_error_at":{"type":["string","null"],"format":"date-time"},"last_ran":{"type":["string","null"],"format":"date-time"}}},"JiraConfigResponse":{"type":"object","required":["url","project_key","username"],"properties":{"default_epic":{"type":["string","null"]},"project_key":{"type":"string"},"url":{"type":"string"},"username":{"type":"string"}}},"Job":{"type":"object","description":"A single background-queue job, projected from its `pg_loco_queue` row.","required":["id","name","status","run_at","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"duration_seconds":{"type":["integer","null"],"format":"int64","description":"Wall-clock seconds from enqueue (`created_at`) to terminal state\n(`updated_at`); `None` for in-flight rows. Includes queue wait, since Loco\ndoesn't preserve a worker-start timestamp for one-shot jobs."},"error_message":{"type":["string","null"],"description":"Failure reason — Loco merges `{\"error\": msg}` into `task_data` when\na worker returns `Err`. `None` for non-failed jobs."},"id":{"type":"string","description":"ULID assigned by Loco at enqueue time."},"integration_type":{"type":["string","null"],"description":"Integration type from `task_data.integration_type`, when present."},"name":{"type":"string","description":"Worker class name (e.g. `RiskIntegrationImporter`)."},"run_at":{"type":"string","format":"date-time","description":"Loco's `run_at`: the enqueue time, **except** that Loco overwrites it to\nthe completion instant when a one-shot job completes (see\n`complete_job` in `loco_rs::bgworker::pg`). So it is not \"when the worker\nstarted\" — `duration_seconds` is derived from `created_at` instead."},"status":{"$ref":"#/components/schemas/JobStatus"},"updated_at":{"type":"string","format":"date-time"}}},"JobName":{"type":"string","description":"A background-worker class surfaced by the jobs API.","enum":["RiskIntegrationImporter","IncidentIntegrationImporter","RiskScoringWorker","IncidentScoringWorker"]},"JobOrderBy":{"type":"string","description":"Sort key for [`list`]. Always descending (newest first), with `id DESC` as\nthe tiebreaker so pagination is stable across rows sharing a timestamp.","enum":["created_at","updated_at"]},"JobStatus":{"type":"string","description":"Public job status — matches the five values Loco's queue ever writes.","enum":["queued","processing","completed","failed","cancelled"]},"KeyRisk":{"type":"object","description":"The core view of an Adversarial Key Risk (AKR).\n\nRelational data — threat objectives, comments, and incident associations — is\nexposed on `KeyRiskRegisterEntry`, not here.","required":["id","title","description","status","type","created_date","updated_date","discovered_date"],"properties":{"assigned_to":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]},"closed_date":{"type":["string","null"],"format":"date-time"},"control_statement":{"type":["string","null"]},"created_date":{"type":"string","format":"date-time"},"description":{"type":"string"},"discovered_date":{"type":"string","format":"date-time"},"due_date":{"type":["string","null"],"format":"date-time"},"expected_date":{"type":["string","null"],"format":"date-time"},"id":{"type":"string","example":"AKR-00001"},"impact":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Impact"}]},"likelihood":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Likelihood"}]},"remediation_task":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/RiskStatus"},"title":{"type":"string"},"type":{"$ref":"#/components/schemas/RiskType"},"updated_date":{"type":"string","format":"date-time"},"urgency":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Urgency","description":"Derived from `likelihood` and `impact`. Null when either is missing."}]}}},"KeyRiskRegisterEntry":{"type":"object","description":"Register row for Adversarial Key Risks (AKRs). A `KeyRisk` plus the relational\ndata shown on the AKR register: threat objectives, incident associations, and\ncomment count. AKRs cannot be tagged.","required":["key_risk","threat_objectives","comments","incident_associations"],"properties":{"comments":{"type":"integer","format":"int64","minimum":0},"incident_associations":{"type":"array","items":{"type":"string"},"example":"INC-00001"},"key_risk":{"$ref":"#/components/schemas/KeyRisk"},"threat_objectives":{"type":"array","items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"}}}},"Likelihood":{"type":"string","enum":["Remote","Unlikely","Possible","Probable","Imminent"]},"LinearConfigResponse":{"type":"object","required":["team_key","team_id"],"properties":{"team_id":{"type":"string","description":"Resolved UUID of the default team issues are created under."},"team_key":{"type":"string","description":"Human team key (e.g. `ENG`) the admin configured."}}},"ListCommentsResponse":{"type":"object","required":["comments"],"properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}}}},"ListDomainsResponse":{"type":"object","required":["domains"],"properties":{"domains":{"type":"array","items":{"$ref":"#/components/schemas/DomainInfo"}}}},"ListFilterViewsResponse":{"type":"object","required":["filter_views"],"properties":{"filter_views":{"type":"array","items":{"$ref":"#/components/schemas/FilterView"}}}},"ListOrganizationInvitesResponse":{"type":"object","required":["invites"],"properties":{"invites":{"type":"array","items":{"$ref":"#/components/schemas/OrgInvite"}}}},"ListOrganizationsResponse":{"type":"object","required":["orgs"],"properties":{"orgs":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}},"ListRoleMembersSummaryResponse":{"type":"object","required":["summaries","sample_limit"],"properties":{"sample_limit":{"type":"integer","format":"int32","description":"Maximum length of any `sample_members` list in this response.","minimum":0},"summaries":{"type":"array","items":{"$ref":"#/components/schemas/RoleMembersSummary"}}}},"ListRolesResponse":{"type":"object","required":["roles"],"properties":{"roles":{"type":"array","items":{"$ref":"#/components/schemas/RoleInfo"}}}},"ListSourcesResponse":{"type":"object","required":["sources"],"properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceResponse"}}}},"ListTagsResponse":{"type":"object","required":["tags"],"properties":{"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}}}},"ListThreatLevelsResponse":{"type":"object","required":["threat_levels"],"properties":{"threat_levels":{"type":"array","items":{"$ref":"#/components/schemas/ThreatLevel"}}}},"ListTypesResponse":{"type":"object","required":["types"],"properties":{"types":{"type":"array","items":{"$ref":"#/components/schemas/TypeResponse"}}}},"MemberKind":{"type":"string","description":"Kind of principal an `OrganizationMember` represents. Always `HUMAN` on the\n`/v1/users` endpoint today; included on the wire so consumers have a single\ndiscriminator regardless of which endpoint surfaced the row.\n\nWire format is SCREAMING_SNAKE_CASE so the values read as constants (`HUMAN`,\n`SERVICE_ACCOUNT`).","enum":["HUMAN","INTEGRATION","SERVICE_ACCOUNT"]},"MetaRiskType":{"type":"string","description":"Defines the the risk type, of which there are two: `OrgRisk` and `KeyRisk`. In turn, this leads to different functionalities based on implementors of structs that use this property.","enum":["org_risk","key_risk"]},"NewCommentRequest":{"type":"object","required":["value"],"properties":{"value":{"type":"string"}}},"NewThreatPositions":{"type":"object","required":["positions"],"properties":{"positions":{"type":"array","items":{"$ref":"#/components/schemas/ThreatPosition"},"description":"Defines the new positions of the threats for this proposal action"}}},"NotificationChannel":{"type":"string","description":"Enum representing notification delivery channels.\nUsed for storing user preferences for how they want to receive notifications.","enum":["Platform","Email","Slack","Teams"]},"NotificationResponse":{"allOf":[{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"type":"object","required":["notification_type","timestamp","contributor","item_identifier","id","notification_text","link"],"properties":{"contributor":{"$ref":"#/components/schemas/User"},"details":{"type":["string","null"]},"id":{"type":"integer","format":"int64"},"item_identifier":{"type":"string"},"item_title":{"type":["string","null"]},"link":{"type":"string"},"notification_text":{"type":"string"},"notification_type":{"$ref":"#/components/schemas/NotificationType"},"read_at":{"type":["string","null"],"format":"date-time"},"timestamp":{"type":"string","format":"date-time"}}},"description":"The items on this page."}}},{"type":"object","required":["total_unread"],"properties":{"total_unread":{"type":"integer","format":"int64"}}}],"description":"The standard `{ results, pagination }` envelope plus the bell-badge unread\ncount, which spans all pages and ignores the `include_read` filter."},"NotificationType":{"type":"string","enum":["AssignedRisk","RiskChanged","NewRiskComment","NewLowRisk","NewMediumRisk","NewHighRisk","NewCriticalRisk","IncChanged","NewSev1Inc","NewSev2Inc","NewSev3Inc","NewFraudInc","NewExtortionInc","NewSabotageInc","NewDataDisclosureInc","NewCustomerTargetingInc","NewResourceHijackingInc","NewIncComment","AssignedInc","DowngradedInc","InvitedToOrg","RisksCreated","IncidentsCreated"]},"NotificationTypeWithPreferences":{"type":"object","description":"Notification type with its channel preferences","required":["notification_type","display_name","enabled_channels","platform_mandatory","is_global"],"properties":{"display_name":{"type":"string","description":"The display name of the notification type"},"enabled_channels":{"type":"array","items":{"$ref":"#/components/schemas/NotificationChannel"},"description":"List of channels that are enabled for this notification type"},"is_global":{"type":"boolean","description":"If true, this notification type is subscribed at the type level (global)\nrather than for specific items"},"notification_type":{"$ref":"#/components/schemas/NotificationType","description":"The notification type"},"platform_mandatory":{"type":"boolean","description":"If true, the Platform channel preference is mandatory and cannot be disabled"}}},"NotificationView":{"type":"object","required":["notification_type","timestamp","contributor","item_identifier","id","notification_text","link"],"properties":{"contributor":{"$ref":"#/components/schemas/User"},"details":{"type":["string","null"]},"id":{"type":"integer","format":"int64"},"item_identifier":{"type":"string"},"item_title":{"type":["string","null"]},"link":{"type":"string"},"notification_text":{"type":"string"},"notification_type":{"$ref":"#/components/schemas/NotificationType"},"read_at":{"type":["string","null"],"format":"date-time"},"timestamp":{"type":"string","format":"date-time"}}},"OAuthClientResponse":{"type":"object","required":["id","org_id","user_id","client_name","client_id","created_date","roles","user"],"properties":{"allowed_ips":{"type":["array","null"],"items":{"type":"string"}},"client_id":{"type":"string"},"client_name":{"type":"string"},"client_secret":{"type":["string","null"]},"created_by":{"type":["string","null"],"format":"uuid"},"created_date":{"type":"string","format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"id":{"type":"string","format":"uuid"},"last_used":{"type":["string","null"],"format":"date-time"},"org_id":{"type":"string","format":"uuid"},"revoked_at":{"type":["string","null"],"format":"date-time"},"roles":{"type":"array","items":{"type":"string"}},"user":{"$ref":"#/components/schemas/User","description":"The service-account user this key authenticates as. 1:1 with the\nkey; used by the UI to render a user chip alongside each row."},"user_id":{"type":"string","format":"uuid"}}},"OrgInvite":{"type":"object","required":["id","email","expiration","invited_by","roles"],"properties":{"email":{"type":"string"},"expiration":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"invited_by":{"$ref":"#/components/schemas/User"},"roles":{"type":"array","items":{"type":"string"}}}},"Organization":{"type":"object","required":["id","name","display_name","description","verified"],"properties":{"description":{"type":"string"},"display_name":{"type":"string"},"icon":{"type":["string","null"]},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"verified":{"type":"boolean"}}},"OrganizationMember":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","required":["roles","joined_date","kind"],"properties":{"deactivated_date":{"type":["string","null"],"format":"date-time"},"joined_date":{"type":"string","format":"date-time"},"kind":{"$ref":"#/components/schemas/MemberKind"},"last_login":{"type":["string","null"],"format":"date-time"},"roles":{"type":"array","items":{"type":"string"}}}}]},"PageBreak":{"type":"string","description":"The vertical page break options of the group.","enum":["before","after","both"]},"PageMeta":{"type":"object","description":"Full pagination metadata — every field guaranteed. The meta for\nregister/list endpoints backed by a `sea_orm::Paginator`.","required":["page","page_size","total_pages","total_items"],"properties":{"page":{"type":"integer","format":"int64","description":"1-indexed page number of this result slice.","minimum":0},"page_size":{"type":"integer","format":"int64","description":"Number of items requested per page.","minimum":0},"total_items":{"type":"integer","format":"int64","description":"Total number of matching items across all pages.","minimum":0},"total_pages":{"type":"integer","format":"int64","description":"Total number of pages at this page size.","minimum":0}}},"Pager_AuthorizedAppResponse":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"type":"object","description":"View of a single DCR authorization for the Authorized Applications list.\n\n`authorized_by` is populated only when the list is returned in org scope\n(admin view) — in self-scope responses it's always `None` and omitted\nfrom the wire format.","required":["client_id","client_name","authorized_on","scope","status"],"properties":{"authorized_by":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/AuthorizedByRef"}]},"authorized_on":{"type":"string","format":"date-time"},"client_id":{"type":"string"},"client_name":{"type":"string"},"last_used":{"type":["string","null"],"format":"date-time"},"scope":{"type":"string","description":"Space-separated atomic scopes granted by the user's most recent live\nconsent for this client. Compound aliases are already expanded."},"software_id":{"type":["string","null"]},"software_version":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/AuthorizedAppStatus","description":"Current usability state for this authorization. `expired` means no\nusable refresh token remains; explicitly revoked authorizations are not\nreturned by the list endpoint."}}},"description":"The items on this page."}}},"Pager_FullProposal":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"type":"object","description":"Contains detailed information about a proposal. This includes values of [`Proposal`] and a list of [`FullProposalAction`]s.","required":["proposal","actions"],"properties":{"actions":{"type":"array","items":{"$ref":"#/components/schemas/FullProposalAction"}},"proposal":{"$ref":"#/components/schemas/Proposal"}}},"description":"The items on this page."}}},"Pager_HistoryEntry":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"type":"object","description":"A single entry in the history list, representing a set of simultaneous changes to an item","required":["timestamp","user","changes","is_creation"],"properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/HistoryEntryChange"}},"is_creation":{"type":"boolean","description":"True only for the actual first (creation) history row. False for all subsequent rows,\nincluding dummy rows inserted by touch_history() when a comment is added."},"timestamp":{"type":"string","format":"date-time"},"user":{"$ref":"#/components/schemas/User"}}},"description":"The items on this page."}}},"Pager_IncidentRegisterEntry":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"type":"object","description":"Register row for an Incident. An `Incident` plus the relational data shown on\nthe incident register: risk associations, threat objectives, tags, and comment count.","required":["incident","comment_count","risk_associations","threat_objectives","tags","linked_children_count"],"properties":{"comment_count":{"type":"integer","format":"int64","minimum":0},"incident":{"$ref":"#/components/schemas/Incident"},"linked_children_count":{"type":"integer","format":"int64","description":"Number of incidents linked under this incident (i.e. children pointing at it).\nAn incident is itself a linked child when `incident.parent_id` is set.","minimum":0},"risk_associations":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"threat_objectives":{"type":"array","items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"}}}},"description":"The items on this page."}}},"Pager_Incident_ExternalPageMeta":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"type":"object","description":"Pagination metadata for external-integration responses. The continuation is\na single opaque [`next_page_token`](Self::next_page_token) — a base64(JSON)\nblob the producer round-trips through [`crate::views::cursor`] — so the\npage/offset/cursor schemes of the underlying APIs are invisible to the\nSDK/frontend, which only read `total_items` for the \"X of Y\" display.","properties":{"next_page_token":{"type":["string","null"],"description":"Opaque continuation token. Absent means there are no further pages — the\nsole end-of-collection signal."},"total_items":{"type":["integer","null"],"format":"int64","description":"Total matching items, when the upstream API reports it. Informational\nonly — never used for loop control. Absent when the API reports no total\n(e.g. HackerOne, GitHub Dependabot).","minimum":0}}},"results":{"type":"array","items":{"type":"object","description":"Relationship, core incident information","required":["id","created_date","updated_date","opened_by","updated_by","title","description","status","source","detected_date"],"properties":{"assigned_to":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]},"contained_date":{"type":["string","null"],"format":"date-time"},"created_date":{"type":"string","format":"date-time"},"description":{"type":"string"},"detected_date":{"type":"string","format":"date-time"},"id":{"type":"string","example":"INC-00001"},"occurred_date":{"type":["string","null"],"format":"date-time"},"opened_by":{"$ref":"#/components/schemas/User"},"parent_id":{"type":["string","null"],"description":"When set, this incident is linked under the named parent incident.","example":"INC-00001"},"responded_date":{"type":["string","null"],"format":"date-time"},"severity":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Severity"}]},"severity_reasoning":{"type":["string","null"]},"source":{"type":"string","description":"Where the incident was reported from (e.g. \"Employee Reported\"). Always\npresent."},"status":{"$ref":"#/components/schemas/IncidentStatus"},"title":{"type":"string"},"updated_by":{"$ref":"#/components/schemas/User"},"updated_date":{"type":"string","format":"date-time"}}},"description":"The items on this page."}}},"Pager_Job":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"type":"object","description":"A single background-queue job, projected from its `pg_loco_queue` row.","required":["id","name","status","run_at","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time"},"duration_seconds":{"type":["integer","null"],"format":"int64","description":"Wall-clock seconds from enqueue (`created_at`) to terminal state\n(`updated_at`); `None` for in-flight rows. Includes queue wait, since Loco\ndoesn't preserve a worker-start timestamp for one-shot jobs."},"error_message":{"type":["string","null"],"description":"Failure reason — Loco merges `{\"error\": msg}` into `task_data` when\na worker returns `Err`. `None` for non-failed jobs."},"id":{"type":"string","description":"ULID assigned by Loco at enqueue time."},"integration_type":{"type":["string","null"],"description":"Integration type from `task_data.integration_type`, when present."},"name":{"type":"string","description":"Worker class name (e.g. `RiskIntegrationImporter`)."},"run_at":{"type":"string","format":"date-time","description":"Loco's `run_at`: the enqueue time, **except** that Loco overwrites it to\nthe completion instant when a one-shot job completes (see\n`complete_job` in `loco_rs::bgworker::pg`). So it is not \"when the worker\nstarted\" — `duration_seconds` is derived from `created_at` instead."},"status":{"$ref":"#/components/schemas/JobStatus"},"updated_at":{"type":"string","format":"date-time"}}},"description":"The items on this page."}}},"Pager_KeyRiskRegisterEntry":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"type":"object","description":"Register row for Adversarial Key Risks (AKRs). A `KeyRisk` plus the relational\ndata shown on the AKR register: threat objectives, incident associations, and\ncomment count. AKRs cannot be tagged.","required":["key_risk","threat_objectives","comments","incident_associations"],"properties":{"comments":{"type":"integer","format":"int64","minimum":0},"incident_associations":{"type":"array","items":{"type":"string"},"example":"INC-00001"},"key_risk":{"$ref":"#/components/schemas/KeyRisk"},"threat_objectives":{"type":"array","items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"}}}},"description":"The items on this page."}}},"Pager_OAuthClientResponse":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"type":"object","required":["id","org_id","user_id","client_name","client_id","created_date","roles","user"],"properties":{"allowed_ips":{"type":["array","null"],"items":{"type":"string"}},"client_id":{"type":"string"},"client_name":{"type":"string"},"client_secret":{"type":["string","null"]},"created_by":{"type":["string","null"],"format":"uuid"},"created_date":{"type":"string","format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"id":{"type":"string","format":"uuid"},"last_used":{"type":["string","null"],"format":"date-time"},"org_id":{"type":"string","format":"uuid"},"revoked_at":{"type":["string","null"],"format":"date-time"},"roles":{"type":"array","items":{"type":"string"}},"user":{"$ref":"#/components/schemas/User","description":"The service-account user this key authenticates as. 1:1 with the\nkey; used by the UI to render a user chip alongside each row."},"user_id":{"type":"string","format":"uuid"}}},"description":"The items on this page."}}},"Pager_OrganizationMember":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","required":["roles","joined_date","kind"],"properties":{"deactivated_date":{"type":["string","null"],"format":"date-time"},"joined_date":{"type":"string","format":"date-time"},"kind":{"$ref":"#/components/schemas/MemberKind"},"last_login":{"type":["string","null"],"format":"date-time"},"roles":{"type":"array","items":{"type":"string"}}}}]},"description":"The items on this page."}}},"Pager_RiskRegisterEntry":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"type":"object","description":"Register row for Organization Risks (RSKs). A `Risk` plus the relational data\nshown on the risk register: threat objectives, incident associations, tags, and\ncomment count.","required":["risk","threat_objectives","comments","incident_associations","tags","linked_children_count"],"properties":{"comments":{"type":"integer","format":"int64","description":"Count of comments on this risk (not the comments themselves).","minimum":0},"incident_associations":{"type":"array","items":{"type":"string"},"example":"INC-00001"},"linked_children_count":{"type":"integer","format":"int64","description":"Number of risks linked under this risk (i.e. children pointing at it).\nA risk is itself a linked child when `risk.parent_id` is set.","minimum":0},"risk":{"$ref":"#/components/schemas/Risk"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"threat_objectives":{"type":"array","items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"}}}},"description":"The items on this page."}}},"Pager_Risk_ExternalPageMeta":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"type":"object","description":"Pagination metadata for external-integration responses. The continuation is\na single opaque [`next_page_token`](Self::next_page_token) — a base64(JSON)\nblob the producer round-trips through [`crate::views::cursor`] — so the\npage/offset/cursor schemes of the underlying APIs are invisible to the\nSDK/frontend, which only read `total_items` for the \"X of Y\" display.","properties":{"next_page_token":{"type":["string","null"],"description":"Opaque continuation token. Absent means there are no further pages — the\nsole end-of-collection signal."},"total_items":{"type":["integer","null"],"format":"int64","description":"Total matching items, when the upstream API reports it. Informational\nonly — never used for loop control. Absent when the API reports no total\n(e.g. HackerOne, GitHub Dependabot).","minimum":0}}},"results":{"type":"array","items":{"type":"object","description":"The core view of an Organization Risk (RSK).\n\nRelational data — threat objectives, comments, incident associations, and tags —\nis exposed on `RiskRegisterEntry`, not here.","required":["id","title","description","status","type","created_date","updated_date","discovered_date","opened_by","updated_by"],"properties":{"assigned_to":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]},"closed_date":{"type":["string","null"],"format":"date-time"},"control_statement":{"type":["string","null"]},"created_date":{"type":"string","format":"date-time"},"deleted_date":{"type":["string","null"],"format":"date-time"},"description":{"type":"string"},"discovered_date":{"type":"string","format":"date-time"},"due_date":{"type":["string","null"],"format":"date-time"},"expected_date":{"type":["string","null"],"format":"date-time"},"id":{"type":"string","example":"RSK-00001"},"impact":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Impact"}]},"impact_reasoning":{"type":["string","null"]},"initially_reported_urgency":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/InitiallyReportedUrgency"}]},"likelihood":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Likelihood"}]},"likelihood_reasoning":{"type":["string","null"]},"opened_by":{"$ref":"#/components/schemas/User"},"parent_id":{"type":["string","null"],"description":"When set, this risk is linked under the named parent risk.","example":"RSK-00001"},"remediation_task":{"type":["string","null"]},"source":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/RiskStatus"},"title":{"type":"string"},"type":{"$ref":"#/components/schemas/RiskType"},"updated_by":{"$ref":"#/components/schemas/User"},"updated_date":{"type":"string","format":"date-time"},"urgency":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Urgency","description":"Derived from `likelihood` and `impact`. Null when either is missing."}]}}},"description":"The items on this page."}}},"Pager_ServiceAccount":{"type":"object","description":"Paginated list envelope: `{ \"results\": [...], \"pagination\": {...} }`.","required":["results","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/PageMeta","description":"Pagination metadata describing the slice."},"results":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","required":["kind","created_date","roles"],"properties":{"allowed_ips":{"type":["array","null"],"items":{"type":"string"},"description":"IP allowlist enforced on token exchange. Populated only for credential SAs."},"client_id":{"type":["string","null"],"description":"Public OAuth client ID (`arm_sa_…`). Populated only for credential SAs."},"created_by_user":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User","description":"The admin user who provisioned this credential SA, resolved from\n`oauth_client.created_by` and batch-loaded so the table can render a\nchip without an extra round-trip per row. Populated only for\ncredential SAs whose creator still exists in the org."}]},"created_date":{"type":"string","format":"date-time"},"deactivated_date":{"type":["string","null"],"format":"date-time","description":"Soft-deactivation timestamp from `organization_user.deactivated_date`.\n`None` means the SA is currently active. The unified Service Accounts\npage uses this to render disabled rows alongside active ones."},"expires_at":{"type":["string","null"],"format":"date-time","description":"Hard expiry on the credential. Populated only for credential SAs."},"kind":{"$ref":"#/components/schemas/ServiceAccountKind"},"last_used":{"type":["string","null"],"format":"date-time","description":"Most-recent successful token exchange. Populated only for credential SAs."},"oauth_client_id":{"type":["string","null"],"format":"uuid","description":"Internal `oauth_client.id`. Populated only for credential SAs. The UI\nuses this to address `PATCH/DELETE /v1/oauth/clients/{id}`. Distinct\nfrom `client_id` (the public `arm_sa_…` string used at token-exchange\ntime)."},"revoked_at":{"type":["string","null"],"format":"date-time","description":"When the credential was administratively revoked. Populated only for\ncredential SAs; mirrors `deactivated_date` once revoked."},"roles":{"type":"array","items":{"type":"string"},"description":"Roles held by this SA. Empty for integration SAs; populated from\n`role_user_org` for credential SAs."}}}],"description":"A service account belonging to the organization. Covers both integration\nservice accounts (jira / wiz / etc. — created automatically when an\nintegration is configured) and credential service accounts (created through\n`POST /v1/oauth/clients`).\nUnlike [`OrganizationMember`], service accounts have no `last_login`."},"description":"The items on this page."}}},"PatchProposalRequest":{"type":"object","required":["positions"],"properties":{"positions":{"type":"array","items":{"$ref":"#/components/schemas/ThreatPosition"},"description":"The updated threat positions"}}},"PolicyChanges":{"oneOf":[{"type":"object","required":["value","change_type"],"properties":{"change_type":{"type":"string","enum":["uninitialized"]},"value":{"type":"array","items":{"$ref":"#/components/schemas/PolicyInitialization"}}}},{"type":"object","required":["value","change_type"],"properties":{"change_type":{"type":"string","enum":["initialized"]},"value":{"type":"array","items":{"$ref":"#/components/schemas/PolicySuggestion"}}}}]},"PolicyInitialization":{"type":"object","description":"Contains a list of changes that will occur if a proposal is approved.\n\nDoes contain the `driver` field like [`PolicySuggestion`] because the value\nprovides this information.","required":["id","value"],"properties":{"id":{"type":"string","description":"The node id the selector"},"value":{"$ref":"#/components/schemas/SelectOption","description":"The value of the selector upon document initialization."}}},"PolicySuggestion":{"type":"object","description":"Contains a list of changes that will occur if a proposal is approved.","required":["id","options"],"properties":{"driver":{"type":["integer","null"],"format":"int64","description":"The id of the risk that is determining this new suggestion. None if there is no\nid determining the new suggestion"},"id":{"type":"string","description":"The node id the selector"},"new_suggestion":{"type":["string","null"],"description":"The proposed suggestion based on AKR association, if relevant."},"options":{"type":"array","items":{"$ref":"#/components/schemas/SelectOption"},"description":"The avilable options to choose from"},"original_suggestion":{"type":["string","null"],"description":"The current suggestion based on AKR, if relevant."},"selected_option":{"type":["string","null"],"description":"The currently selected option, usually by an organization"}}},"PortfolioOrganization":{"type":"object","required":["id","name","display_name","description","verified","risk_count","incident_count","tags"],"properties":{"description":{"type":"string"},"display_name":{"type":"string"},"icon":{"type":["string","null"]},"id":{"type":"string","format":"uuid"},"incident_count":{"type":"object","additionalProperties":{"type":"integer","minimum":0},"propertyNames":{"type":"string"}},"name":{"type":"string"},"risk_count":{"type":"integer","format":"int64","minimum":0},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"verified":{"type":"boolean"}}},"PreferenceView":{"type":"object","description":"A single channel preference entry","required":["channel","notification_type"],"properties":{"channel":{"$ref":"#/components/schemas/NotificationChannel","description":"The notification channel (Platform, Email, Slack, etc.)"},"notification_type":{"$ref":"#/components/schemas/NotificationType","description":"The type of notification"}}},"PreferencesResponse":{"type":"object","description":"Response containing all notification preferences","required":["available_channels","categories"],"properties":{"available_channels":{"type":"array","items":{"$ref":"#/components/schemas/NotificationChannel"},"description":"Available notification channels for the organization"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/CategoryWithPreferences"},"description":"Notification categories with their preferences"}}},"PreviewTicketsResponse":{"type":"object","description":"Response for ticket search / autocomplete endpoints.","required":["tickets"],"properties":{"tickets":{"type":"array","items":{"$ref":"#/components/schemas/TicketPreview"}}}},"Proposal":{"type":"object","required":["id","created_date"],"properties":{"approved_by":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]},"approved_date":{"type":["string","null"],"format":"date-time"},"created_by":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]},"created_date":{"type":"string","format":"date-time"},"denied_by":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]},"denied_date":{"type":["string","null"],"format":"date-time"},"id":{"type":"integer","format":"int64"}}},"ProposalAction":{"type":"object","required":["id","created_date"],"properties":{"comment":{"type":["string","null"]},"created_by":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]},"created_date":{"type":"string","format":"date-time"},"deleted_date":{"type":["string","null"],"format":"date-time"},"id":{"type":"integer","format":"int64"},"updated_date":{"type":["string","null"],"format":"date-time"}}},"ProtectedResourceMetadata":{"type":"object","required":["resource","authorization_servers","bearer_methods_supported","scopes_supported"],"properties":{"authorization_servers":{"type":"array","items":{"type":"string"},"description":"Authorization servers that issue tokens accepted at this resource."},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"resource":{"type":"string","description":"Canonical URI of the resource (in our case, the MCP endpoint)."},"scopes_supported":{"type":"array","items":{"type":"string"}}}},"RegisterRequest":{"type":"object","description":"RFC 7591 Client Registration Request (relevant subset for this server).","required":["client_name","redirect_uris"],"properties":{"client_name":{"type":"string"},"grant_types":{"type":["array","null"],"items":{"type":"string"},"description":"Must include `authorization_code` if present; defaults apply when absent."},"redirect_uris":{"type":"array","items":{"type":"string"}},"response_types":{"type":["array","null"],"items":{"type":"string"}},"scope":{"type":["string","null"],"description":"Required scope set. Compound scopes (`mcp`, `mcp:full`) are accepted\nand stored as-is; expansion happens at authorize time."},"software_id":{"type":["string","null"]},"software_version":{"type":["string","null"]},"token_endpoint_auth_method":{"type":["string","null"],"description":"Token endpoint authentication method for this client. Supported values\nare `none`, `client_secret_post`, and `client_secret_basic`."}}},"RegisterResponse":{"type":"object","description":"RFC 7591 Client Registration Response.","required":["client_id","client_id_issued_at","client_name","redirect_uris","grant_types","response_types","token_endpoint_auth_method"],"properties":{"client_id":{"type":"string"},"client_id_issued_at":{"type":"integer","format":"int64"},"client_name":{"type":"string"},"client_secret":{"type":["string","null"]},"grant_types":{"type":"array","items":{"type":"string"}},"redirect_uris":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}},"scope":{"type":["string","null"]},"software_id":{"type":["string","null"]},"software_version":{"type":["string","null"]},"token_endpoint_auth_method":{"type":"string"}}},"RelatedScore":{"type":"object","description":"Contains a scoring position alongside the threat objective who initiated this score. This struct\nis usually used in tandem with relevance to determine itself","required":["threat_objectives","position"],"properties":{"position":{"$ref":"#/components/schemas/Score"},"threat_objectives":{"type":"array","items":{"$ref":"#/components/schemas/ThreatName"},"description":"The threat objective that caused this change to occur\n\nTODO: use fnv once utoipa supports different hasher derivations","uniqueItems":true}}},"Relevance":{"type":"string","description":"Defines how relevant a threat objective is to a particular risk","enum":["Moderate","Substantial"]},"RemoveIncidentTagRequest":{"type":"object","required":["tag_id"],"properties":{"tag_id":{"type":"string","format":"uuid"}}},"RemoveOrganizationTagRequest":{"type":"object","required":["tag_id"],"properties":{"tag_id":{"type":"string","format":"uuid"}}},"RemoveRiskTagRequest":{"type":"object","properties":{"tag_id":{"type":"string","format":"uuid","default":"00000000-0000-0000-0000-000000000000"}}},"RequestMetaRiskType":{"type":"string","description":"Used in queries to filter what kind of risks to return","enum":["org_risk","key_risk","both","none"]},"ResetSourcesResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}}},"RevokeRequest":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"token_type_hint":{"type":["string","null"],"description":"Hint about the token kind (RFC 7009). We ignore it because all lookup\nis by hash — but accepting it keeps the endpoint spec-shaped."}}},"Risk":{"type":"object","description":"The core view of an Organization Risk (RSK).\n\nRelational data — threat objectives, comments, incident associations, and tags —\nis exposed on `RiskRegisterEntry`, not here.","required":["id","title","description","status","type","created_date","updated_date","discovered_date","opened_by","updated_by"],"properties":{"assigned_to":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User"}]},"closed_date":{"type":["string","null"],"format":"date-time"},"control_statement":{"type":["string","null"]},"created_date":{"type":"string","format":"date-time"},"deleted_date":{"type":["string","null"],"format":"date-time"},"description":{"type":"string"},"discovered_date":{"type":"string","format":"date-time"},"due_date":{"type":["string","null"],"format":"date-time"},"expected_date":{"type":["string","null"],"format":"date-time"},"id":{"type":"string","example":"RSK-00001"},"impact":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Impact"}]},"impact_reasoning":{"type":["string","null"]},"initially_reported_urgency":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/InitiallyReportedUrgency"}]},"likelihood":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Likelihood"}]},"likelihood_reasoning":{"type":["string","null"]},"opened_by":{"$ref":"#/components/schemas/User"},"parent_id":{"type":["string","null"],"description":"When set, this risk is linked under the named parent risk.","example":"RSK-00001"},"remediation_task":{"type":["string","null"]},"source":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/RiskStatus"},"title":{"type":"string"},"type":{"$ref":"#/components/schemas/RiskType"},"updated_by":{"$ref":"#/components/schemas/User"},"updated_date":{"type":"string","format":"date-time"},"urgency":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Urgency","description":"Derived from `likelihood` and `impact`. Null when either is missing."}]}}},"RiskEntries":{"type":"array","items":{"$ref":"#/components/schemas/RiskEntry"},"description":"Risk entries are the most compact way to ser/de data for the remagi.\n\nYou should use [`RiskEntryBuilder`] to create this type. if you do not get\nthis from deserializing."},"RiskEntry":{"type":"object","required":["id","discovered_date"],"properties":{"closed_date":{"type":["string","null"],"format":"date-time"},"discovered_date":{"type":"string","format":"date-time"},"due_date":{"type":["string","null"],"format":"date-time"},"id":{"type":"string"},"urgency":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Urgency"}]}}},"RiskExportColumn":{"type":"string","description":"Available columns for risk CSV export.","enum":["id","title","description","status","likelihood","impact","urgency","source","type","created_date","updated_date","discovered_date","due_date","expected_date","closed_date","assigned_to","opened_by","initially_reported_urgency","remediation_task","control_statement","likelihood_reasoning","impact_reasoning","threat_objectives","tags"]},"RiskPerformanceMetrics":{"type":"object","required":["org_id","period_days","average_performance_percentage","total_risks_evaluated"],"properties":{"average_performance_percentage":{"type":"integer","format":"int32"},"org_id":{"type":"string","format":"uuid"},"period_days":{"type":"integer","format":"int32"},"total_risks_evaluated":{"type":"integer","format":"int32"}}},"RiskRSKParams":{"type":"object","properties":{"assigned_to":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_AssignedTo"},"description":"Accepts UUIDs, the literal `null` (unassigned), and the sentinel\n`me` (the calling user, resolved server-side). Multiple values\nunion — e.g. `assigned_to=me&assigned_to=<uuid>` returns rows\nassigned to either.","default":null,"uniqueItems":true},"closed_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `closed_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"closed_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `closed_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"closed_is_null":{"type":["boolean","null"],"description":"Match only risks whose `closed_date` is unset. Mutually exclusive with\n`closed_after`/`closed_before`.","default":null},"created_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"created_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `created_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"description_contains":{"type":["string","null"],"default":null},"discovered_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `discovered_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"discovered_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `discovered_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"due_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `due_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"due_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `due_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"due_is_null":{"type":["boolean","null"],"description":"Match only risks whose `due_date` is unset. Mutually exclusive with\n`due_after`/`due_before`.","default":null},"expected_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `expected_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"expected_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `expected_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"expected_is_null":{"type":["boolean","null"],"description":"Match only risks whose `expected_date` is unset. Mutually exclusive\nwith `expected_after`/`expected_before`.","default":null},"free_text_contains":{"type":["string","null"],"default":null},"id":{"type":"array","items":{"type":"integer","format":"int64"},"default":[]},"id_contains":{"type":["string","null"],"default":null},"impact":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Impact"},"default":null,"uniqueItems":true},"include_children":{"type":["boolean","null"],"description":"When true, the list includes risks that are linked under another risk\n(i.e. rows with a non-null `parent_id`). Defaults to false so registers\nand rollups stay collapsed.","default":null},"initially_reported_urgency":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_InitiallyReportedUrgency"},"default":null,"uniqueItems":true},"likelihood":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Likelihood"},"default":null,"uniqueItems":true},"opened_by":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"},"default":null,"uniqueItems":true},"order_by":{"type":["string","null"],"default":null},"overdue":{"type":["boolean","null"],"description":"Filter to overdue (`true`) or non-overdue (`false`) risks. Overdue\nmeans open and past `due_date`.","default":null},"page":{"type":"integer","format":"int64","description":"1-indexed page number. Defaults to 1 (explicit `null` reads as the\ndefault); zero is rejected.","default":1,"maximum":1000000,"minimum":1},"page_size":{"type":"integer","format":"int64","description":"Rows per page. Defaults to 50 (explicit `null` reads as the default);\nzero is rejected.","default":50,"maximum":500,"minimum":1},"source":{"type":["array","null"],"items":{"type":"string"},"default":null,"uniqueItems":true},"status":{"type":["array","null"],"items":{"$ref":"#/components/schemas/RiskStatus"},"default":null,"uniqueItems":true},"tags":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"},"default":null,"uniqueItems":true},"threat_objectives":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_ThreatName"},"default":null,"uniqueItems":true},"title_contains":{"type":["string","null"],"default":null},"type":{"type":["array","null"],"items":{"$ref":"#/components/schemas/RiskType"},"default":null,"uniqueItems":true},"updated_after":{"type":["string","null"],"format":"date-time","description":"Inclusive lower bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"updated_before":{"type":["string","null"],"format":"date-time","description":"Inclusive upper bound on `updated_date`. RFC 3339 or bare `YYYY-MM-DD`.","default":null},"updated_by":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_String"},"default":null,"uniqueItems":true},"urgency":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Filter_Urgency"},"default":null,"uniqueItems":true},"urgency_shift":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/UrgencyShift","description":"Return only risks whose current urgency has shifted from the urgency\nthey were first reported at. `Upgrade` matches risks now at least one\nlevel more severe; `Downgrade` matches those now at least one level\nless severe. Omit to leave the filter off."}],"default":null}}},"RiskRegisterEntry":{"type":"object","description":"Register row for Organization Risks (RSKs). A `Risk` plus the relational data\nshown on the risk register: threat objectives, incident associations, tags, and\ncomment count.","required":["risk","threat_objectives","comments","incident_associations","tags","linked_children_count"],"properties":{"comments":{"type":"integer","format":"int64","description":"Count of comments on this risk (not the comments themselves).","minimum":0},"incident_associations":{"type":"array","items":{"type":"string"},"example":"INC-00001"},"linked_children_count":{"type":"integer","format":"int64","description":"Number of risks linked under this risk (i.e. children pointing at it).\nA risk is itself a linked child when `risk.parent_id` is set.","minimum":0},"risk":{"$ref":"#/components/schemas/Risk"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"threat_objectives":{"type":"array","items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"}}}},"RiskSLAResponse":{"type":"object","description":"API response representing the SLAs for each urgency level in Days","properties":{"critical":{"type":["integer","null"],"format":"int32"},"high":{"type":["integer","null"],"format":"int32"},"info":{"type":["integer","null"],"format":"int32"},"low":{"type":["integer","null"],"format":"int32"},"medium":{"type":["integer","null"],"format":"int32"}}},"RiskStatus":{"type":"string","description":"The status of a risk","enum":["New","Urgency Proposed","Remediation","Closure Proposed","Closed"]},"RiskTagResponse":{"type":"object","properties":{"message":{"type":"string","default":""}}},"RiskType":{"type":"string","enum":["Code","Configuration","Control Deficiency","Policy","Procedural","Vulnerability","Third-party"]},"RoleInfo":{"type":"object","required":["id","name","description","capabilities","permissions"],"properties":{"capabilities":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"},"description":"Granular permissions for this role (format: \"module:action\")"}}},"RoleMembersSummary":{"type":"object","required":["role_id","role_name","member_count","sample_members"],"properties":{"member_count":{"type":"integer","format":"int32","description":"Number of active members holding this role.","minimum":0},"role_id":{"type":"string","format":"uuid"},"role_name":{"type":"string"},"sample_members":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Sample of members for avatar tiles."}}},"ScopeInfo":{"type":"object","required":["scope","description"],"properties":{"description":{"type":"string","description":"Human-readable description the consent UI displays."},"scope":{"type":"string","description":"Machine-readable scope label, e.g. \"risks:read\"."}}},"Score":{"type":"object","description":"usually part of a larger struct, defines a combination of likelihood and impact\nSometimes these distinct values are necessary,\nsince they contain more \"information\" than [`Urgency`] alone.","required":["likelihood","impact"],"properties":{"impact":{"$ref":"#/components/schemas/Impact"},"likelihood":{"$ref":"#/components/schemas/Likelihood"}}},"SelectOption":{"type":"object","description":"This is a representation of a \"selector\", which gives an organization the capability of selecting what the value of a selector is","required":["name","weight"],"properties":{"association":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Association"}]},"name":{"type":"string"},"value":{"type":["object","null"]},"weight":{"type":"integer","format":"int32"}}},"Selector":{"type":"object","description":"A selector node: lets an organization choose how a group looks from a set of\noptions.","required":["options"],"properties":{"options":{"type":"array","items":{"$ref":"#/components/schemas/SelectOption"}},"selected_option":{"type":["string","null"],"description":"The currently selected option, if any."}}},"ServiceAccount":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","required":["kind","created_date","roles"],"properties":{"allowed_ips":{"type":["array","null"],"items":{"type":"string"},"description":"IP allowlist enforced on token exchange. Populated only for credential SAs."},"client_id":{"type":["string","null"],"description":"Public OAuth client ID (`arm_sa_…`). Populated only for credential SAs."},"created_by_user":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User","description":"The admin user who provisioned this credential SA, resolved from\n`oauth_client.created_by` and batch-loaded so the table can render a\nchip without an extra round-trip per row. Populated only for\ncredential SAs whose creator still exists in the org."}]},"created_date":{"type":"string","format":"date-time"},"deactivated_date":{"type":["string","null"],"format":"date-time","description":"Soft-deactivation timestamp from `organization_user.deactivated_date`.\n`None` means the SA is currently active. The unified Service Accounts\npage uses this to render disabled rows alongside active ones."},"expires_at":{"type":["string","null"],"format":"date-time","description":"Hard expiry on the credential. Populated only for credential SAs."},"kind":{"$ref":"#/components/schemas/ServiceAccountKind"},"last_used":{"type":["string","null"],"format":"date-time","description":"Most-recent successful token exchange. Populated only for credential SAs."},"oauth_client_id":{"type":["string","null"],"format":"uuid","description":"Internal `oauth_client.id`. Populated only for credential SAs. The UI\nuses this to address `PATCH/DELETE /v1/oauth/clients/{id}`. Distinct\nfrom `client_id` (the public `arm_sa_…` string used at token-exchange\ntime)."},"revoked_at":{"type":["string","null"],"format":"date-time","description":"When the credential was administratively revoked. Populated only for\ncredential SAs; mirrors `deactivated_date` once revoked."},"roles":{"type":"array","items":{"type":"string"},"description":"Roles held by this SA. Empty for integration SAs; populated from\n`role_user_org` for credential SAs."}}}],"description":"A service account belonging to the organization. Covers both integration\nservice accounts (jira / wiz / etc. — created automatically when an\nintegration is configured) and credential service accounts (created through\n`POST /v1/oauth/clients`).\nUnlike [`OrganizationMember`], service accounts have no `last_login`."},"ServiceAccountKind":{"type":"string","description":"Primary discriminator on a service account.\n\nWire format is SCREAMING_SNAKE_CASE (`INTEGRATION`, `CREDENTIAL`) so the\nvalues read as constants.","enum":["INTEGRATION","CREDENTIAL"]},"ServiceNowConfigResponse":{"type":"object","required":["instance_url","client_id","tables"],"properties":{"client_id":{"type":"string"},"instance_url":{"type":"string"},"tables":{"type":"array","items":{"type":"string"},"description":"Tables the integration creates, searches, links, and fetches across."}}},"Severity":{"type":"string","enum":["SEV-5","SEV-4","SEV-3","SEV-2","SEV-1"]},"SlackConfigResponse":{"type":"object","required":["channel_name"],"properties":{"channel_name":{"type":"string"}}},"Slug":{"type":"string","description":"\n# A slug that is used to identify a resource in kebab-case\n\n## Example\n```rust\n# use std::str::FromStr;\n# use backend::views::common::Slug;\nlet slug: Slug = Slug::from_str(\"cybersecurity-policy\").unwrap();\nassert_eq!(slug.as_str(), \"cybersecurity-policy\");"},"SourceResponse":{"type":"object","required":["name"],"properties":{"description":{"type":["string","null"]},"name":{"type":"string"}}},"SubscriptionCategory":{"type":"string","enum":["Threats","Risks","Incidents","Compliance","General","Default"]},"SubscriptionPayload":{"type":"object","required":["notification_type"],"properties":{"item_identifier":{"type":["string","null"]},"notification_type":{"$ref":"#/components/schemas/NotificationType"}}},"SuggestIncidentScoreRequest":{"type":"object","properties":{"incident_ids":{"type":"array","items":{"type":"integer","format":"int64"},"default":[]}}},"SuggestScoreRequest":{"type":"object","properties":{"risk_ids":{"type":"array","items":{"type":"integer","format":"int64"},"default":[]}}},"SummarizedAkr":{"type":"object","required":["id","title","description"],"properties":{"description":{"type":"string"},"id":{"type":"integer","format":"int64"},"title":{"type":"string"}}},"TableCellProperties":{"type":"object","required":["vertical_alignment"],"properties":{"vertical_alignment":{"type":"string"}}},"TableCell_TemplateNode":{"type":"object","required":["props","node"],"properties":{"node":{"$ref":"#/components/schemas/DocNode_TemplateNode"},"props":{"$ref":"#/components/schemas/TableCellProperties"}}},"TableRow_TemplateNode":{"type":"object","required":["cells"],"properties":{"cells":{"type":"array","items":{"$ref":"#/components/schemas/TableCell_TemplateNode"}}}},"Table_TemplateNode":{"type":"object","required":["rows"],"properties":{"rows":{"type":"array","items":{"$ref":"#/components/schemas/TableRow_TemplateNode"}}}},"Tag":{"type":"object","required":["id","content","creator_id"],"properties":{"content":{"type":"string"},"creator_id":{"type":"string","format":"uuid"},"id":{"type":"string","format":"uuid"},"org_id":{"type":["string","null"],"format":"uuid"}}},"TagOperation":{"type":"string","enum":["no-change","add","replace","find-remove","remove-all"]},"TagStatsResponse":{"type":"object","required":["organization_count","risk_count","incident_count","total_count"],"properties":{"incident_count":{"type":"integer","format":"int64"},"organization_count":{"type":"integer","format":"int64"},"risk_count":{"type":"integer","format":"int64"},"total_count":{"type":"integer","format":"int64"}}},"TagType":{"type":"string","enum":["Portfolio","Item"]},"TeamsConfigResponse":{"type":"object","required":["channel_name"],"properties":{"channel_name":{"type":"string"}}},"ThreatConsequences":{"type":"object","description":"Determines that the ramifications of a current threat proposal will be compared to the \"cannon\" version","required":["risk_changes","document_changes_list"],"properties":{"document_changes_list":{"type":"array","items":{"$ref":"#/components/schemas/DocumentChanges"},"description":"Contains a list of policy changes that will affect how adversarial notifies users about their policies"},"risk_changes":{"type":"array","items":{"$ref":"#/components/schemas/AkrChange"},"description":"Contains a list of changes that will occur for AKRs if the proposed state is approved"}}},"ThreatLevel":{"type":"object","description":"Information relating to a threat and its history.\n\nThreat Levels are typically generated for organizations. Threat Objectives\ndon't have any universal inherent or without the context of an organization.","required":["name","min_likelihood","inherent"],"properties":{"inherent":{"type":"array","items":{"$ref":"#/components/schemas/InherentScore"},"description":"The inherent scores relating to the threat objective"},"min_likelihood":{"$ref":"#/components/schemas/Likelihood","description":"Used to constrain the threat level from moving to a location that is deemed too risky"},"name":{"$ref":"#/components/schemas/ThreatName","description":"The PK of the threat objective"}}},"ThreatName":{"type":"string","description":"Identifies a specific threat objective","enum":["Sabotage","Data Disclosure","Extortion","Customer Targeting","Resource Hijacking","Fraud"]},"ThreatObjectiveRelation":{"type":"object","description":"A relational struct that has a threat objective type and its relevancy to a risk.\n\n`PartialEq`, `Eq`, and `Hash` are implemented manually to exclude `created_date`,\nwhich is metadata about when the relation was mutated — not part of the identity.","required":["threat_objective"],"properties":{"created_date":{"type":["string","null"],"format":"date-time","description":"The time that this relation was mutated"},"relevance":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Relevance","description":"the relevancy of the threat objective to the risk. Typically a value of 1, or 2. While the relevancy is null the the database,\nimplementations of retrieving this from postgres should ignore null values."}]},"threat_objective":{"$ref":"#/components/schemas/ThreatName","description":"the threat objective type"}}},"ThreatPosition":{"type":"object","description":"A position of a threat.\n\nThis is used to calculate the consequence of moving a threat objective to a certain likelihood and impact.\n\nIn most cases, it's better to use a [`ThreatProfile`](crate::models::threats::ThreatProfile) than to use a `Vec<ThreatPosition>`.","required":["name","likelihood","impact"],"properties":{"impact":{"$ref":"#/components/schemas/Impact","description":"Y-axis for the threat objective"},"likelihood":{"$ref":"#/components/schemas/Likelihood","description":"X-axis for the threat objective"},"name":{"$ref":"#/components/schemas/ThreatName","description":"PK of the threat objective in the database"}}},"TicketLinkOperationResponse":{"type":"object","description":"Acknowledgement returned by ticket link/unlink endpoints.","required":["status"],"properties":{"status":{"type":"string","description":"Human-readable confirmation message (e.g. \"RSK-00042 linked to ticket PROJ-123\")."}}},"TicketPreview":{"type":"object","description":"A generic preview of an external ticket for autocomplete and linked-ticket\ndisplay. Works across all ticket integrations (Jira, ServiceNow, etc.).","required":["id","key","summary","image","url","available"],"properties":{"available":{"type":"boolean","description":"`false` when the external system no longer returns this ticket (a\ndangling link kept visible only so the user can unlink it); `true` for\nlive tickets. Synthesized unresolved previews set this to `false`."},"id":{"type":"string","description":"Opaque external ticket ID."},"image":{"type":"string","description":"Icon URL for the ticket type."},"key":{"type":"string","description":"Human-readable ticket key (e.g. \"PROJ-123\", \"INC0012345\")."},"summary":{"type":"string","description":"Short summary/title."},"table":{"type":["string","null"],"description":"The source table the ticket lives in (e.g. \"incident\"); `null` when the\nintegration has no such concept."},"url":{"type":"string","description":"URL to view the ticket in the external system."}}},"TokenPair":{"type":"object","required":["access_token","refresh_token","token_type","expires_in"],"properties":{"access_token":{"type":"string"},"expires_in":{"type":"integer","format":"int64"},"refresh_token":{"type":"string"},"scope":{"type":["string","null"]},"token_type":{"type":"string"}}},"TokenRequest":{"type":"object","description":"Wire-level body for `/oauth/token`. `grant_type` is intentionally a free-\nform string — RFC 6749 §1.3 describes it as a URI extension point, so\nrejecting unknown values at deserialization would conflate \"malformed\nrequest\" (RFC `invalid_request`) with \"we don't support that grant type\"\n(RFC `unsupported_grant_type`). The handler dispatches manually and emits\nthe spec-correct error code for each case.","properties":{"client_id":{"type":["string","null"]},"client_secret":{"type":["string","null"]},"code":{"type":["string","null"],"description":"Authorization code (from the redirect after consent)."},"code_verifier":{"type":["string","null"],"description":"PKCE verifier — plaintext string whose S256 hash must match the\ncode_challenge stored at authorize time."},"grant_type":{"type":["string","null"],"description":"One of `client_credentials`, `authorization_code`, `refresh_token`.\nOther values are rejected with RFC 6749 §5.2 `unsupported_grant_type`."},"redirect_uri":{"type":["string","null"],"description":"Redirect URI presented at authorize time. Must match exactly per\nRFC 6749 §4.1.3."},"refresh_token":{"type":["string","null"]},"resource":{"type":["string","null"],"description":"RFC 8707 resource indicator. For `client_credentials`, lets a machine\nclient bind its token to a specific MCP resource (e.g. `<origin>/mcp`)\nso it satisfies that resource's audience check at use time. The\n`authorization_code` path takes the resource from the authorize request\nvia the stored code row instead, so this field is read only for\n`client_credentials`."}}},"TypeResponse":{"type":"object","required":["name","description"],"properties":{"description":{"type":"string"},"name":{"type":"string"}}},"UpdateCommentRequest":{"type":"object","required":["value"],"properties":{"value":{"type":"string"}}},"UpdateFilterViewRequest":{"type":"object","properties":{"filter":{},"name":{"type":["string","null"]},"shared":{"type":["boolean","null"],"description":"Toggle whether this view is shared with the owner's organization."}}},"UpdateIncidentRequest":{"type":"object","description":"PATCH /incidents/:id","properties":{"assigned_to":{"type":["string","null"],"format":"uuid","default":null},"contained_date":{"type":["string","null"],"format":"date-time","default":null},"description":{"type":["string","null"],"default":null},"detected_date":{"type":["string","null"],"format":"date-time","default":null},"occurred_date":{"type":["string","null"],"format":"date-time","default":null},"parent_id":{"type":["integer","null"],"format":"int64","description":"Mark this incident as linked under another incident. `Some(Some(id))`\nsets the parent; `Some(None)` clears it; `None` leaves it untouched.","default":null},"responded_date":{"type":["string","null"],"format":"date-time","default":null},"severity":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Severity"}],"default":null},"severity_reasoning":{"type":["string","null"],"default":null},"source":{"type":["string","null"],"default":null},"status":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/IncidentStatus"}],"default":null},"tags":{"type":["array","null"],"items":{"type":"string","format":"uuid"},"default":null},"threat_objectives":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"},"default":null},"title":{"type":["string","null"],"default":null}}},"UpdateManyIncidentsResponse":{"type":"object","required":["incidents"],"properties":{"incidents":{"type":"array","items":{"$ref":"#/components/schemas/IncidentRegisterEntry"}}}},"UpdateManyRisksRequest":{"allOf":[{"oneOf":[{"$ref":"#/components/schemas/UpdateRiskRequest"}],"default":{"title":null,"description":null,"status":null,"likelihood":null,"impact":null,"source":null,"type":null,"discovered_date":null,"expected_date":null,"closed_date":null,"assigned_to":null,"initially_reported_urgency":null,"remediation_task":null,"control_statement":null,"likelihood_reasoning":null,"impact_reasoning":null,"threat_objectives":null,"tags":null,"parent_id":null}},{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"default":[]},"tag_operation":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/TagOperation"}],"default":null}}}],"description":"PATCH /risks"},"UpdateMemberRequest":{"type":"object","properties":{"active":{"type":["boolean","null"],"description":"Set to `true` to reactivate a deactivated user.\nAbsent means \"don't change activation status\".\n`false` is rejected — use DELETE to deactivate."},"roles":{"type":["array","null"],"items":{"type":"string"},"description":"Names of the roles to assign (e.g. [\"admin\"], [\"editor\", \"viewer\"]).\nAbsent means \"don't change roles\"."}}},"UpdateMultipleIncidentsRequest":{"allOf":[{"oneOf":[{"$ref":"#/components/schemas/UpdateIncidentRequest"}],"default":{"title":null,"description":null,"severity":null,"severity_reasoning":null,"source":null,"status":null,"detected_date":null,"assigned_to":null,"occurred_date":null,"responded_date":null,"contained_date":null,"threat_objectives":null,"tags":null,"parent_id":null}},{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"example":"INC-00001","default":[]},"tag_operation":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/TagOperation"}],"default":null}}}]},"UpdateOAuthClientRequest":{"type":"object","properties":{"allowed_ips":{"type":["array","null"],"items":{"type":"string"}},"client_name":{"type":["string","null"]},"expires_at":{"type":["string","null"],"format":"date-time"},"revoked":{"type":["boolean","null"],"description":"Toggle the revoked state. `Some(true)` stamps `revoked_at = now()`;\n`Some(false)` clears it. `None` leaves the field unchanged."},"roles":{"type":["array","null"],"items":{"type":"string"},"description":"Replaces the SA user's role assignments by role name. Requires\n`ORGANIZATION_MANAGE` and roles bounded by the caller's permissions."}}},"UpdateOrganizationRequest":{"type":"object","properties":{"description":{"type":["string","null"]},"display_name":{"type":["string","null"]},"icon":{"type":["string","null"]},"name":{"type":["string","null"]}}},"UpdateRiskRequest":{"type":"object","description":"PATCH /risks/:id","properties":{"assigned_to":{"type":["string","null"],"format":"uuid","default":null},"closed_date":{"type":["string","null"],"format":"date-time","default":null},"control_statement":{"type":["string","null"],"default":null},"description":{"type":["string","null"],"default":null},"discovered_date":{"type":["string","null"],"format":"date-time","default":null},"expected_date":{"type":["string","null"],"format":"date-time","default":null},"impact":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Impact"}],"default":null},"impact_reasoning":{"type":["string","null"],"default":null},"initially_reported_urgency":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/InitiallyReportedUrgency"}],"default":null},"likelihood":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Likelihood"}],"default":null},"likelihood_reasoning":{"type":["string","null"],"default":null},"parent_id":{"type":["integer","null"],"format":"int64","description":"Mark this risk as linked under another risk. `Some(Some(id))` sets the\nparent; `Some(None)` clears it; `None` leaves the field untouched.","default":null},"remediation_task":{"type":["string","null"],"default":null},"source":{"type":["string","null"],"default":null},"status":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RiskStatus"}],"default":null},"tags":{"type":["array","null"],"items":{"type":"string","format":"uuid"},"default":null},"threat_objectives":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ThreatObjectiveRelation"},"default":null},"title":{"type":["string","null"],"default":null},"type":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RiskType"}],"default":null}}},"UpdateSLARequest":{"type":"object","properties":{"critical":{"type":["integer","null"],"format":"int32"},"high":{"type":["integer","null"],"format":"int32"},"info":{"type":["integer","null"],"format":"int32"},"low":{"type":["integer","null"],"format":"int32"},"medium":{"type":["integer","null"],"format":"int32"}}},"UpdateTagRequest":{"type":"object","properties":{"content":{"type":["string","null"]}}},"UpdateUserRequest":{"type":"object","properties":{"email":{"type":["string","null"]},"first_name":{"type":["string","null"]},"icon":{"type":["string","null"]},"last_name":{"type":["string","null"]}}},"UpdateUserResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}}},"UpsertSlackConfigRequest":{"type":"object","properties":{"channel_name":{"type":["string","null"]},"webhook_url":{"type":["string","null"]}}},"UpsertTeamsConfigRequest":{"type":"object","properties":{"channel_name":{"type":["string","null"]},"webhook_url":{"type":["string","null"]}}},"Urgency":{"type":"string","description":"A score that determines how to treat certain values of a risk based on their likelihood and impact.","enum":["Info","Low","Medium","High","Critical"]},"UrgencyShift":{"type":"string","description":"Direction of an urgency shift between a risk's initially-reported\nurgency and its current urgency.","enum":["Upgrade","Downgrade"]},"User":{"type":"object","description":"A User as returned by the API.\n\nProfile images are not embedded — clients fetch them from\n`GET /api/v1/{icon}` when `icon` is `Some`.","required":["id","first_name","last_name","email"],"properties":{"email":{"type":"string"},"first_name":{"type":"string"},"icon":{"type":["string","null"],"description":"Relative path to the user's avatar endpoint, e.g.\n`\"users/{id}/avatar?v={hash}\"`. `None` when the user has no avatar."},"id":{"type":"string","format":"uuid"},"last_name":{"type":"string"}}},"UserAction":{"type":"object","description":"A common attribute of several structs that identifies a person and time where information is utilized in some capacity","required":["date"],"properties":{"by":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/UserId"}]},"date":{"type":"string","format":"date-time"}}},"UserId":{"type":"string","format":"uuid"},"UserInvite":{"type":"object","required":["id","organization","expiration","invited_by","roles"],"properties":{"expiration":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"invited_by":{"$ref":"#/components/schemas/User"},"organization":{"$ref":"#/components/schemas/Organization"},"roles":{"type":"array","items":{"type":"string"}}}},"UserInvitesResponse":{"type":"object","required":["invites"],"properties":{"invites":{"type":"array","items":{"$ref":"#/components/schemas/UserInvite"}}}},"UserPermissionsResponse":{"type":"object","required":["roles","permissions","total_permissions"],"properties":{"permissions":{"type":"array","items":{"type":"string"},"description":"List of granular permissions (format: \"module:action\")"},"roles":{"type":"array","items":{"type":"string"},"description":"The role names the user holds in the organization"},"total_permissions":{"type":"integer","description":"Total number of permissions","minimum":0}}},"Version":{"type":"array","items":{"type":"integer","format":"int32","description":"\n# A version number that follows the semantic versioning scheme.\n\n## Example\n```rust\n# use std::str::FromStr;\n# use backend::views::document::Version;\nlet version_str = \"1.0.0\";\nlet version: Version = Version::from_str(version_str).unwrap();\nassert_eq!(version.to_string(), \"1.0.0\");","minimum":0},"description":"\n# A version number that follows the semantic versioning scheme.\n\n## Example\n```rust\n# use std::str::FromStr;\n# use backend::views::document::Version;\nlet version_str = \"1.0.0\";\nlet version: Version = Version::from_str(version_str).unwrap();\nassert_eq!(version.to_string(), \"1.0.0\");","maxItems":3,"minItems":3},"WatchtowrConfigResponse":{"type":"object","required":["url","sync_enabled","auto_score"],"properties":{"auto_score":{"type":"boolean"},"sync_enabled":{"type":"boolean"},"url":{"type":"string"}}},"WhoamiResponse":{"type":"object","required":["user","organization","roles"],"properties":{"organization":{"$ref":"#/components/schemas/Organization"},"roles":{"type":"array","items":{"type":"string"}},"user":{"$ref":"#/components/schemas/User"}}},"WizConfigResponse":{"type":"object","required":["url","client_id","sync_enabled","auto_score"],"properties":{"auto_score":{"type":"boolean"},"client_id":{"type":"string"},"sync_enabled":{"type":"boolean"},"url":{"type":"string"}}}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"},"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/api/v1/oauth/token","scopes":{}}}},"session":{"type":"apiKey","in":"cookie","name":"arm-session"}}}}