{"openapi":"3.1.0","jsonSchemaDialect":"https://spec.openapis.org/oas/3.1/dialect/base","info":{"title":"Quick Policy API","version":"0.2.0","summary":"Read your policies, incidents and organisation from your own systems.","description":"A small, read-only API for the organisation an API key belongs to. Webhooks tell you when something changes.\n\nPaths are not versioned. Changes are additive: new fields can appear in any response, so ignore fields you do not recognise. Anything that would break a caller is announced in the changelog first.\n\nEach key may make 120 requests a minute. Past that, requests get HTTP 429 with the code RATE_LIMITED and a Retry-After header saying how many seconds to wait. The headers come only on the 429.\n\nHuman-readable docs: /developers on the Quick Policy website.","contact":{"name":"Quick Policy support","url":"https://quickpolicy.co.uk/support"}},"servers":[{"url":"https://www.quickpolicy.co.uk","description":"Quick Policy"}],"tags":[{"name":"Organisation","description":"The organisation the key belongs to."},{"name":"Policies","description":"Policies in your organisation."},{"name":"Incidents","description":"Incidents, on plans that include incident management."},{"name":"Webhooks","description":"Events we send to your endpoints."}],"security":[{"apiKey":[]}],"paths":{"/api/organizations/current":{"get":{"operationId":"getCurrentOrganization","summary":"Get your organisation","description":"Returns the organisation the key belongs to: its id, its name and the name of its plan. Any active key can call it, whatever its scopes, so it is the quickest way to check a new key works.\n\nAny active key can call this, whatever its scopes.","tags":["Organisation"],"security":[{"apiKey":[]}],"x-required-scope":null,"parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"plan":{"type":"object","properties":{"name":{"type":"string","description":"The name of your plan, for example Professional."}},"required":["name"],"additionalProperties":false}},"required":["id","name","plan"],"additionalProperties":false}},"required":["success","organization"],"additionalProperties":false},"example":{"success":true,"organization":{"id":"cm3org0001","name":"Acme Health Ltd","plan":{"name":"Professional"}}}}}},"401":{"description":"The key is missing, wrong, deleted, switched off or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"UNAUTHORIZED","message":"The API key is missing, wrong, deleted or past its expiry date."}}}}},"403":{"description":"Your organisation's plan no longer includes API access. Checked on every request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"API_ACCESS_NOT_IN_PLAN","message":"Your organisation's plan no longer includes API access, so its API keys have stopped working."}}}}},"404":{"description":"The organisation no longer exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"NOT_FOUND","message":"Organization not found"}}}}},"429":{"description":"The key has made more than 120 requests in a minute. Wait for the seconds in Retry-After.","headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Requests allowed per key in each window (120).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"When the current window ends, as a Unix time in seconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"RATE_LIMITED","message":"This key has made more than 120 requests in a minute. Wait 42 seconds and try again."}}}}},"500":{"description":"Something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Unable to fetch organization"}}}}}}}},"/api/policies":{"get":{"operationId":"listPolicies","summary":"List policies","description":"Returns your organisation's policies, newest first, up to 200. There is no paging on this endpoint: use the status and category filters to narrow the list.\n\nNeeds a key with the read:policies scope (or admin).","tags":["Policies"],"security":[{"apiKey":["read:policies"]}],"x-required-scope":"read:policies","parameters":[{"name":"status","in":"query","required":false,"description":"Only policies in this state. Asking for ARCHIVED also includes archived policies.","schema":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]}},{"name":"category","in":"query","required":false,"description":"Only policies in this category, by category code (for example DATA_PROTECTION).","schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"policies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":["string","null"]},"category":{"type":"string","description":"The policy category code, for example DATA_PROTECTION."},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"version":{"type":"integer","description":"Goes up by one on every saved change."},"reviewFrequencyDays":{"type":"integer"},"lastReviewedAt":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]},"nextReviewAt":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"updatedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"author":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]}},"required":["name"],"additionalProperties":false},{"type":"null"}],"description":"Who wrote it, by name only."},"acknowledgementCount":{"type":"integer","description":"Acknowledgements of the current version."},"draftPublishState":{"description":"For drafts, the status of the latest publish request (for example PENDING); otherwise null.","type":["string","null"]}},"required":["id","title","summary","category","status","version","reviewFrequencyDays","lastReviewedAt","nextReviewAt","createdAt","updatedAt","author","acknowledgementCount","draftPublishState"],"description":"A policy. Exactly these fields, nothing more.","additionalProperties":false},"description":"Newest first, at most 200. No policy text; fetch one policy for that."},"visibility":{"type":"object","properties":{"canReadDraftPolicies":{"type":"boolean"},"canViewArchivedPolicies":{"type":"boolean"},"defaultStatuses":{"type":"array","items":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]}},"allowedStatuses":{"type":"array","items":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]}}},"required":["canReadDraftPolicies","canViewArchivedPolicies","defaultStatuses","allowedStatuses"],"additionalProperties":false}},"required":["policies","visibility"],"additionalProperties":false},"example":{"policies":[{"id":"cm3pol0001","title":"Data Protection Policy","summary":null,"category":"DATA_PROTECTION","status":"PUBLISHED","version":3,"reviewFrequencyDays":365,"lastReviewedAt":"2026-10-12T15:20:00.000Z","nextReviewAt":"2027-10-12T15:20:00.000Z","createdAt":"2026-09-01T10:00:00.000Z","updatedAt":"2026-10-12T15:20:00.000Z","author":{"name":"Sam Patel"},"acknowledgementCount":11,"draftPublishState":null}],"visibility":{"canReadDraftPolicies":false,"canViewArchivedPolicies":false,"defaultStatuses":["PUBLISHED"],"allowedStatuses":["PUBLISHED"]}}}}},"400":{"description":"The status or category is not one we recognise.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"INVALID_FILTER","message":"Invalid status filter. Allowed values: DRAFT, PUBLISHED, ARCHIVED"}}}}},"401":{"description":"The key is missing, wrong, deleted, switched off or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"UNAUTHORIZED","message":"The API key is missing, wrong, deleted or past its expiry date."}}}}},"403":{"description":"Your organisation's plan no longer includes API access. Checked on every request. Or: The key does not have read:policies or admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"API_ACCESS_NOT_IN_PLAN","message":"Your organisation's plan no longer includes API access, so its API keys have stopped working."}}}}},"429":{"description":"The key has made more than 120 requests in a minute. Wait for the seconds in Retry-After.","headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Requests allowed per key in each window (120).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"When the current window ends, as a Unix time in seconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"RATE_LIMITED","message":"This key has made more than 120 requests in a minute. Wait 42 seconds and try again."}}}}},"500":{"description":"Something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Failed to fetch policies"}}}}}}}},"/api/policies/{id}":{"get":{"operationId":"getPolicy","summary":"Get a policy","description":"Returns one policy, including its full text and the name of its author.\n\nNeeds a key with the read:policies scope (or admin).","tags":["Policies"],"security":[{"apiKey":["read:policies"]}],"x-required-scope":"read:policies","parameters":[{"name":"id","in":"path","required":true,"description":"The policy id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"policy":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":["string","null"]},"category":{"type":"string","description":"The policy category code, for example DATA_PROTECTION."},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"version":{"type":"integer","description":"Goes up by one on every saved change."},"reviewFrequencyDays":{"type":"integer"},"lastReviewedAt":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]},"nextReviewAt":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]},"createdAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"updatedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"author":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]}},"required":["name"],"additionalProperties":false},{"type":"null"}],"description":"Who wrote it, by name only."},"content":{"type":"string","description":"The policy text, as stored (Markdown or HTML)."}},"required":["id","title","summary","category","status","version","reviewFrequencyDays","lastReviewedAt","nextReviewAt","createdAt","updatedAt","author","content"],"description":"A policy. Exactly these fields, nothing more.","additionalProperties":false}},"required":["success","policy"],"additionalProperties":false},"example":{"success":true,"policy":{"id":"cm3pol0001","title":"Data Protection Policy","summary":null,"category":"DATA_PROTECTION","status":"PUBLISHED","version":3,"reviewFrequencyDays":365,"lastReviewedAt":"2026-10-12T15:20:00.000Z","nextReviewAt":"2027-10-12T15:20:00.000Z","createdAt":"2026-09-01T10:00:00.000Z","updatedAt":"2026-10-12T15:20:00.000Z","author":{"name":"Sam Patel"},"content":"## Purpose\n\nThis policy sets out how we look after personal data…"}}}}},"401":{"description":"The key is missing, wrong, deleted, switched off or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"UNAUTHORIZED","message":"The API key is missing, wrong, deleted or past its expiry date."}}}}},"403":{"description":"Your organisation's plan no longer includes API access. Checked on every request. Or: The key does not have read:policies or admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"API_ACCESS_NOT_IN_PLAN","message":"Your organisation's plan no longer includes API access, so its API keys have stopped working."}}}}},"404":{"description":"There is no such policy in your organisation, or the key may not see it (a draft or archived policy, without the admin scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"NOT_FOUND","message":"Not found"}}}}},"429":{"description":"The key has made more than 120 requests in a minute. Wait for the seconds in Retry-After.","headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Requests allowed per key in each window (120).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"When the current window ends, as a Unix time in seconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"RATE_LIMITED","message":"This key has made more than 120 requests in a minute. Wait 42 seconds and try again."}}}}},"500":{"description":"Something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Failed to fetch policy"}}}}}}}},"/api/incidents":{"get":{"operationId":"listIncidents","summary":"List incidents","description":"Returns your organisation's incidents, most recently reported first, with counts by stage. Paged with limit and offset: 100 by default, at most 200.\n\nNeeds a key with the read:incidents scope (or admin).\n\nYour plan must also include incident management.","tags":["Incidents"],"security":[{"apiKey":["read:incidents"]}],"x-required-scope":"read:incidents","parameters":[{"name":"severity","in":"query","required":false,"description":"Only incidents of this severity, in lower case.","schema":{"type":"string","enum":["low","medium","high","critical"]}},{"name":"lifecycleStage","in":"query","required":false,"description":"Only incidents at this stage, in upper case.","schema":{"type":"string","enum":["REPORTED","TRIAGE","INVESTIGATING","REMEDIATING","READY_TO_CLOSE","CLOSED"]}},{"name":"limit","in":"query","required":false,"description":"How many to return, 1 to 200. Defaults to 100.","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"offset","in":"query","required":false,"description":"How many to skip. Defaults to 0.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"view":{"type":"string"},"stats":{"type":"object","properties":{"total":{"type":"integer"},"critical":{"type":"integer"},"reported":{"type":"integer"},"triage":{"type":"integer"},"investigating":{"type":"integer"},"remediating":{"type":"integer"},"readyToClose":{"type":"integer"},"closed":{"type":"integer"}},"required":["total","critical","reported","triage","investigating","remediating","readyToClose","closed"],"description":"Counts across the whole organisation, whatever filters you pass.","additionalProperties":false},"incidents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["low","medium","high","critical"]},"category":{"type":"string","description":"The incident type."},"status":{"type":"string"},"lifecycleStage":{"type":"string","enum":["REPORTED","TRIAGE","INVESTIGATING","REMEDIATING","READY_TO_CLOSE","CLOSED"]},"priority":{"type":"string"},"createdAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"updatedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"reportedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"occurredAt":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]},"detectedAt":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]},"businessImpactSummary":{"type":["string","null"]},"impactAreas":{"type":"array","items":{"type":"string"}},"affectedSystems":{"type":"array","items":{"type":"string"}},"dataExposureStatus":{"type":"string"},"recordsAffectedEstimate":{"anyOf":[{"type":"integer"},{"type":"null"}]},"peopleAffectedEstimate":{"anyOf":[{"type":"integer"},{"type":"null"}]},"externalNotificationRequired":{"type":["boolean","null"]},"incidentOwnerId":{"type":["string","null"]},"relatedPolicyId":{"type":["string","null"]},"_count":{"type":"object","properties":{"attachments":{"type":"integer"},"actions":{"type":"integer"},"investigations":{"type":"integer"},"notifications":{"type":"integer"},"suggestions":{"type":"integer","description":"Improvement suggestions still waiting for a decision."}},"required":["attachments","actions","investigations","notifications","suggestions"],"additionalProperties":false}},"required":["id","title","description","severity","category","status","lifecycleStage","priority","createdAt","updatedAt","reportedAt","occurredAt","detectedAt","businessImpactSummary","impactAreas","affectedSystems","dataExposureStatus","recordsAffectedEstimate","peopleAffectedEstimate","externalNotificationRequired","incidentOwnerId","relatedPolicyId","_count"],"additionalProperties":true}},"pagination":{"type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"total":{"type":"integer","description":"How many incidents match your filters."},"hasMore":{"type":"boolean","description":"True when there are more matching incidents after this page."}},"required":["limit","offset","total","hasMore"],"additionalProperties":false}},"required":["success","view","stats","incidents","pagination"],"additionalProperties":false},"example":{"success":true,"view":"list","stats":{"total":4,"critical":1,"reported":1,"triage":1,"investigating":1,"remediating":0,"readyToClose":0,"closed":1},"incidents":[{"id":"cm3inc0001","title":"Laptop left on a train","description":"A company laptop was left on the 08:12 to London Bridge.","severity":"high","category":"DATA_BREACH","status":"OPEN","lifecycleStage":"TRIAGE","priority":"HIGH","reportedAt":"2026-11-01T09:30:00.000Z","_count":{"attachments":0,"actions":2,"investigations":0,"notifications":1,"suggestions":0}}],"pagination":{"limit":100,"offset":0,"total":4,"hasMore":false}}}}},"400":{"description":"A severity, lifecycleStage, limit or offset value is not one we accept.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"INVALID_FILTER","message":"Invalid lifecycleStage filter. Allowed values: REPORTED, TRIAGE, INVESTIGATING, REMEDIATING, READY_TO_CLOSE, CLOSED"}}}}},"401":{"description":"The key is missing, wrong, deleted, switched off or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"UNAUTHORIZED","message":"The API key is missing, wrong, deleted or past its expiry date."}}}}},"403":{"description":"Your organisation's plan no longer includes API access. Checked on every request. Or: The key does not have read:incidents or admin. Or: Your plan does not include incident management.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"API_ACCESS_NOT_IN_PLAN","message":"Your organisation's plan no longer includes API access, so its API keys have stopped working."}}}}},"429":{"description":"The key has made more than 120 requests in a minute. Wait for the seconds in Retry-After.","headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Requests allowed per key in each window (120).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"When the current window ends, as a Unix time in seconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"RATE_LIMITED","message":"This key has made more than 120 requests in a minute. Wait 42 seconds and try again."}}}}},"500":{"description":"Something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Failed to process incident request."}}}}}}}},"/api/incidents/{id}":{"get":{"operationId":"getIncident","summary":"Get an incident","description":"Returns one incident: the record, a summary of its response playbook, its actions and its timeline. People appear only as user ids; no names or email addresses are returned.\n\nNeeds a key with the read:incidents scope (or admin).\n\nYour plan must also include incident management.","tags":["Incidents"],"security":[{"apiKey":["read:incidents"]}],"x-required-scope":"read:incidents","parameters":[{"name":"id","in":"path","required":true,"description":"The incident id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"incident":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["low","medium","high","critical"]},"category":{"type":"string","description":"The incident type."},"status":{"type":"string"},"lifecycleStage":{"type":"string","enum":["REPORTED","TRIAGE","INVESTIGATING","REMEDIATING","READY_TO_CLOSE","CLOSED"]},"priority":{"type":"string"},"createdAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"updatedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"reportedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"occurredAt":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]},"detectedAt":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]},"businessImpactSummary":{"type":["string","null"]},"impactAreas":{"type":"array","items":{"type":"string"}},"affectedSystems":{"type":"array","items":{"type":"string"}},"dataExposureStatus":{"type":"string"},"recordsAffectedEstimate":{"anyOf":[{"type":"integer"},{"type":"null"}]},"peopleAffectedEstimate":{"anyOf":[{"type":"integer"},{"type":"null"}]},"externalNotificationRequired":{"type":["boolean","null"]},"incidentOwnerId":{"type":["string","null"]},"relatedPolicyId":{"type":["string","null"]},"_count":{"type":"object","properties":{"attachments":{"type":"integer"},"actions":{"type":"integer"},"investigations":{"type":"integer"},"notifications":{"type":"integer"},"suggestions":{"type":"integer","description":"Improvement suggestions still waiting for a decision."}},"required":["attachments","actions","investigations","notifications","suggestions"],"additionalProperties":false}},"required":["id","title","description","severity","category","status","lifecycleStage","priority","createdAt","updatedAt","reportedAt","occurredAt","detectedAt","businessImpactSummary","impactAreas","affectedSystems","dataExposureStatus","recordsAffectedEstimate","peopleAffectedEstimate","externalNotificationRequired","incidentOwnerId","relatedPolicyId","_count"],"additionalProperties":true},"playbook":{"anyOf":[{"type":"object","properties":{"status":{"type":"string"},"version":{"type":"integer"},"executiveSummary":{"type":"string"},"generatedByAi":{"type":"boolean"},"reviewedAt":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]}},"required":["status","version","executiveSummary","generatedByAi","reviewedAt"],"additionalProperties":false},{"type":"null"}],"description":"The latest response playbook, summarised."},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"actionType":{"type":"string"},"description":{"type":"string"},"priority":{"type":"string"},"status":{"type":"string"},"dueDate":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]},"completedAt":{"description":"ISO 8601 date and time, UTC.","type":["string","null"]},"assignedTo":{"description":"A user id, never a name or email address.","type":["string","null"]}},"required":["id","actionType","description","priority","status","dueDate","completedAt","assignedTo"],"additionalProperties":false}},"timeline":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"title":{"type":"string"},"createdAt":{"type":"string","description":"ISO 8601 date and time, UTC."}},"required":["id","eventType","title","createdAt"],"additionalProperties":false},"description":"Oldest first."}},"required":["success","incident","playbook","actions","timeline"],"additionalProperties":false},"example":{"success":true,"incident":{"id":"cm3inc0001","title":"Laptop left on a train","severity":"high","lifecycleStage":"TRIAGE","incidentOwnerId":"cm3usr0001"},"playbook":{"status":"READY","version":1,"executiveSummary":"A device holding personal data was lost and needs containment.","generatedByAi":true,"reviewedAt":null},"actions":[{"id":"cm3act0001","actionType":"CONTAINMENT","description":"Wipe the laptop remotely.","priority":"HIGH","status":"OPEN","dueDate":"2026-11-01T17:00:00.000Z","completedAt":null,"assignedTo":"cm3usr0002"}],"timeline":[{"id":"cm3evt0001","eventType":"REPORTED","title":"Incident reported","createdAt":"2026-11-01T09:30:00.000Z"}]}}}},"401":{"description":"The key is missing, wrong, deleted, switched off or past its expiry date.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"UNAUTHORIZED","message":"The API key is missing, wrong, deleted or past its expiry date."}}}}},"403":{"description":"Your organisation's plan no longer includes API access. Checked on every request. Or: The key does not have read:incidents or admin. Or: Your plan does not include incident management.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"API_ACCESS_NOT_IN_PLAN","message":"Your organisation's plan no longer includes API access, so its API keys have stopped working."}}}}},"404":{"description":"There is no incident with this id in your organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"NOT_FOUND","message":"Incident not found."}}}}},"429":{"description":"The key has made more than 120 requests in a minute. Wait for the seconds in Retry-After.","headers":{"Retry-After":{"description":"Seconds to wait before trying again.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Requests allowed per key in each window (120).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"When the current window ends, as a Unix time in seconds.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"RATE_LIMITED","message":"This key has made more than 120 requests in a minute. Wait 42 seconds and try again."}}}}},"500":{"description":"Something went wrong on our side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"INTERNAL_ERROR","message":"Failed to process incident."}}}}}}}}},"webhooks":{"incident.opened":{"post":{"operationId":"webhook_incident_opened","summary":"incident.opened","description":"A new incident is reported. Sent to every active webhook subscribed to incident.opened. The body is the JSON object below, with no envelope; the event name is also in the X-QP-Event header.","tags":["Webhooks"],"parameters":[{"name":"X-QP-Event","in":"header","required":true,"description":"The event name, for example policy.published.","schema":{"type":"string"}},{"name":"X-QP-Delivery","in":"header","required":true,"description":"The delivery id. Retries of the same delivery reuse it, so use it to ignore duplicates.","schema":{"type":"string"}},{"name":"X-QP-Timestamp","in":"header","required":true,"description":"When this attempt was signed, as an ISO 8601 time.","schema":{"type":"string"}},{"name":"X-QP-Signature","in":"header","required":true,"description":"sha256= followed by the hex HMAC-SHA256 of the timestamp, a full stop, and the raw body, keyed with your signing secret.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"incident.opened"},"incidentId":{"type":"string"},"title":{"type":"string"},"severity":{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"],"description":"Upper case here, unlike the incident endpoints."},"status":{"type":"string"},"reportedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"url":{"type":"string","description":"A path in the Quick Policy app, relative to the app address."}},"required":["kind","incidentId","title","severity","status","reportedAt","url"],"additionalProperties":false},"example":{"kind":"incident.opened","incidentId":"cm3inc0001","title":"Laptop left on a train","severity":"HIGH","status":"OPEN","reportedAt":"2026-11-01T09:30:00.000Z","url":"/dashboard/incidents/cm3inc0001"}}}},"responses":{"2XX":{"description":"Delivered. Any 2xx status counts; anything else, or no answer within 30 seconds, is retried."}}}},"incident.severity_escalated":{"post":{"operationId":"webhook_incident_severity_escalated","summary":"incident.severity_escalated","description":"Severity is raised on an existing incident. Sent to every active webhook subscribed to incident.severity_escalated. The body is the JSON object below, with no envelope; the event name is also in the X-QP-Event header.","tags":["Webhooks"],"parameters":[{"name":"X-QP-Event","in":"header","required":true,"description":"The event name, for example policy.published.","schema":{"type":"string"}},{"name":"X-QP-Delivery","in":"header","required":true,"description":"The delivery id. Retries of the same delivery reuse it, so use it to ignore duplicates.","schema":{"type":"string"}},{"name":"X-QP-Timestamp","in":"header","required":true,"description":"When this attempt was signed, as an ISO 8601 time.","schema":{"type":"string"}},{"name":"X-QP-Signature","in":"header","required":true,"description":"sha256= followed by the hex HMAC-SHA256 of the timestamp, a full stop, and the raw body, keyed with your signing secret.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"incident.severity_escalated"},"incidentId":{"type":"string"},"title":{"type":"string"},"previousSeverity":{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"]},"newSeverity":{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"]},"escalatedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"actorUserId":{"type":"string"},"url":{"type":"string","description":"A path in the Quick Policy app, relative to the app address."}},"required":["kind","incidentId","title","previousSeverity","newSeverity","escalatedAt","actorUserId","url"],"additionalProperties":false},"example":{"kind":"incident.severity_escalated","incidentId":"cm3inc0001","title":"Laptop left on a train","previousSeverity":"HIGH","newSeverity":"CRITICAL","escalatedAt":"2026-11-01T10:05:00.000Z","actorUserId":"cm3usr0001","url":"/dashboard/incidents/cm3inc0001"}}}},"responses":{"2XX":{"description":"Delivered. Any 2xx status counts; anything else, or no answer within 30 seconds, is retried."}}}},"policy.published":{"post":{"operationId":"webhook_policy_published","summary":"policy.published","description":"A policy passes approval and is published. Sent to every active webhook subscribed to policy.published. The body is the JSON object below, with no envelope; the event name is also in the X-QP-Event header.","tags":["Webhooks"],"parameters":[{"name":"X-QP-Event","in":"header","required":true,"description":"The event name, for example policy.published.","schema":{"type":"string"}},{"name":"X-QP-Delivery","in":"header","required":true,"description":"The delivery id. Retries of the same delivery reuse it, so use it to ignore duplicates.","schema":{"type":"string"}},{"name":"X-QP-Timestamp","in":"header","required":true,"description":"When this attempt was signed, as an ISO 8601 time.","schema":{"type":"string"}},{"name":"X-QP-Signature","in":"header","required":true,"description":"sha256= followed by the hex HMAC-SHA256 of the timestamp, a full stop, and the raw body, keyed with your signing secret.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"policy.published"},"policyId":{"type":"string"},"title":{"type":"string"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}]},"publishedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"url":{"type":"string","description":"A path in the Quick Policy app, relative to the app address."}},"required":["kind","policyId","title","version","publishedAt","url"],"additionalProperties":false},"example":{"kind":"policy.published","policyId":"cm3pol0001","title":"Data Protection Policy","version":3,"publishedAt":"2026-11-01T09:30:00.000Z","url":"/dashboard/policies/cm3pol0001"}}}},"responses":{"2XX":{"description":"Delivered. Any 2xx status counts; anything else, or no answer within 30 seconds, is retried."}}}},"policy.review_overdue":{"post":{"operationId":"webhook_policy_review_overdue","summary":"policy.review_overdue","description":"A scheduled policy review is missed. Sent to every active webhook subscribed to policy.review_overdue. The body is the JSON object below, with no envelope; the event name is also in the X-QP-Event header.","tags":["Webhooks"],"parameters":[{"name":"X-QP-Event","in":"header","required":true,"description":"The event name, for example policy.published.","schema":{"type":"string"}},{"name":"X-QP-Delivery","in":"header","required":true,"description":"The delivery id. Retries of the same delivery reuse it, so use it to ignore duplicates.","schema":{"type":"string"}},{"name":"X-QP-Timestamp","in":"header","required":true,"description":"When this attempt was signed, as an ISO 8601 time.","schema":{"type":"string"}},{"name":"X-QP-Signature","in":"header","required":true,"description":"sha256= followed by the hex HMAC-SHA256 of the timestamp, a full stop, and the raw body, keyed with your signing secret.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"policy.review_overdue"},"policyId":{"type":"string"},"reviewDueAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"firedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"url":{"type":"string","description":"A path in the Quick Policy app, relative to the app address."}},"required":["kind","policyId","reviewDueAt","firedAt","url"],"additionalProperties":false},"example":{"kind":"policy.review_overdue","policyId":"cm3pol0001","reviewDueAt":"2026-10-31T00:00:00.000Z","firedAt":"2026-11-01T06:00:00.000Z","url":"/dashboard/policies/cm3pol0001"}}}},"responses":{"2XX":{"description":"Delivered. Any 2xx status counts; anything else, or no answer within 30 seconds, is retried."}}}},"training.overdue":{"post":{"operationId":"webhook_training_overdue","summary":"training.overdue","description":"A required training assignment passes its due date. Sent to every active webhook subscribed to training.overdue. The body is the JSON object below, with no envelope; the event name is also in the X-QP-Event header.","tags":["Webhooks"],"parameters":[{"name":"X-QP-Event","in":"header","required":true,"description":"The event name, for example policy.published.","schema":{"type":"string"}},{"name":"X-QP-Delivery","in":"header","required":true,"description":"The delivery id. Retries of the same delivery reuse it, so use it to ignore duplicates.","schema":{"type":"string"}},{"name":"X-QP-Timestamp","in":"header","required":true,"description":"When this attempt was signed, as an ISO 8601 time.","schema":{"type":"string"}},{"name":"X-QP-Signature","in":"header","required":true,"description":"sha256= followed by the hex HMAC-SHA256 of the timestamp, a full stop, and the raw body, keyed with your signing secret.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"training.overdue"},"assignmentId":{"type":"string"},"userId":{"type":"string"},"dueAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"expiredAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"url":{"type":"string","description":"A path in the Quick Policy app, relative to the app address."}},"required":["kind","assignmentId","userId","dueAt","expiredAt","url"],"additionalProperties":false},"example":{"kind":"training.overdue","assignmentId":"cm3trn0001","userId":"cm3usr0002","dueAt":"2026-10-31T00:00:00.000Z","expiredAt":"2026-11-01T06:00:00.000Z","url":"/dashboard/training"}}}},"responses":{"2XX":{"description":"Delivered. Any 2xx status counts; anything else, or no answer within 30 seconds, is retried."}}}},"vendor.risk_tier_changed":{"post":{"operationId":"webhook_vendor_risk_tier_changed","summary":"vendor.risk_tier_changed","description":"A vendor's risk tier is raised or lowered. Sent to every active webhook subscribed to vendor.risk_tier_changed. The body is the JSON object below, with no envelope; the event name is also in the X-QP-Event header.","tags":["Webhooks"],"parameters":[{"name":"X-QP-Event","in":"header","required":true,"description":"The event name, for example policy.published.","schema":{"type":"string"}},{"name":"X-QP-Delivery","in":"header","required":true,"description":"The delivery id. Retries of the same delivery reuse it, so use it to ignore duplicates.","schema":{"type":"string"}},{"name":"X-QP-Timestamp","in":"header","required":true,"description":"When this attempt was signed, as an ISO 8601 time.","schema":{"type":"string"}},{"name":"X-QP-Signature","in":"header","required":true,"description":"sha256= followed by the hex HMAC-SHA256 of the timestamp, a full stop, and the raw body, keyed with your signing secret.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"vendor.risk_tier_changed"},"vendorId":{"type":"string"},"vendorName":{"type":"string"},"previousRiskTier":{"anyOf":[{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"]},{"type":"null"}]},"newRiskTier":{"anyOf":[{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"]},{"type":"null"}]},"changedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"actorUserId":{"type":"string"},"url":{"type":"string","description":"A path in the Quick Policy app, relative to the app address."}},"required":["kind","vendorId","vendorName","previousRiskTier","newRiskTier","changedAt","actorUserId","url"],"additionalProperties":false},"example":{"kind":"vendor.risk_tier_changed","vendorId":"cm3ven0001","vendorName":"Acme Payroll Ltd","previousRiskTier":"MEDIUM","newRiskTier":"HIGH","changedAt":"2026-11-01T09:30:00.000Z","actorUserId":"cm3usr0001","url":"/dashboard/vendors/cm3ven0001"}}}},"responses":{"2XX":{"description":"Delivered. Any 2xx status counts; anything else, or no answer within 30 seconds, is retried."}}}},"risk.severity_escalated":{"post":{"operationId":"webhook_risk_severity_escalated","summary":"risk.severity_escalated","description":"Residual exposure on a risk increases. Sent to every active webhook subscribed to risk.severity_escalated. The body is the JSON object below, with no envelope; the event name is also in the X-QP-Event header.","tags":["Webhooks"],"parameters":[{"name":"X-QP-Event","in":"header","required":true,"description":"The event name, for example policy.published.","schema":{"type":"string"}},{"name":"X-QP-Delivery","in":"header","required":true,"description":"The delivery id. Retries of the same delivery reuse it, so use it to ignore duplicates.","schema":{"type":"string"}},{"name":"X-QP-Timestamp","in":"header","required":true,"description":"When this attempt was signed, as an ISO 8601 time.","schema":{"type":"string"}},{"name":"X-QP-Signature","in":"header","required":true,"description":"sha256= followed by the hex HMAC-SHA256 of the timestamp, a full stop, and the raw body, keyed with your signing secret.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"risk.severity_escalated"},"riskId":{"type":"string"},"title":{"type":"string"},"code":{"type":["string","null"]},"previousSeverity":{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"]},"newSeverity":{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"]},"residualLikelihood":{"type":"integer"},"residualImpact":{"type":"integer"},"escalatedAt":{"type":"string","description":"ISO 8601 date and time, UTC."},"actorUserId":{"type":"string"},"url":{"type":"string","description":"A path in the Quick Policy app, relative to the app address."}},"required":["kind","riskId","title","code","previousSeverity","newSeverity","residualLikelihood","residualImpact","escalatedAt","actorUserId","url"],"additionalProperties":false},"example":{"kind":"risk.severity_escalated","riskId":"cm3rsk0001","title":"Single supplier for payroll","code":"R-014","previousSeverity":"MEDIUM","newSeverity":"HIGH","residualLikelihood":3,"residualImpact":4,"escalatedAt":"2026-11-01T09:30:00.000Z","actorUserId":"cm3usr0001","url":"/dashboard/risks/cm3rsk0001"}}}},"responses":{"2XX":{"description":"Delivered. Any 2xx status counts; anything else, or no answer within 30 seconds, is retried."}}}},"audit_packet.ready":{"post":{"operationId":"webhook_audit_packet_ready","summary":"audit_packet.ready","description":"An audit packet finishes generating. Sent to every active webhook subscribed to audit_packet.ready. The body is the JSON object below, with no envelope; the event name is also in the X-QP-Event header.","tags":["Webhooks"],"parameters":[{"name":"X-QP-Event","in":"header","required":true,"description":"The event name, for example policy.published.","schema":{"type":"string"}},{"name":"X-QP-Delivery","in":"header","required":true,"description":"The delivery id. Retries of the same delivery reuse it, so use it to ignore duplicates.","schema":{"type":"string"}},{"name":"X-QP-Timestamp","in":"header","required":true,"description":"When this attempt was signed, as an ISO 8601 time.","schema":{"type":"string"}},{"name":"X-QP-Signature","in":"header","required":true,"description":"sha256= followed by the hex HMAC-SHA256 of the timestamp, a full stop, and the raw body, keyed with your signing secret.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"audit_packet.ready"},"packetId":{"type":"string"},"name":{"type":"string"},"packetType":{"type":"string"},"downloadUrl":{"type":"string","description":"A path in the app. Downloading needs a signed-in person; an API key cannot fetch it."},"url":{"type":"string","description":"A path in the Quick Policy app, relative to the app address."},"completedAt":{"type":"string","description":"ISO 8601 date and time, UTC."}},"required":["kind","packetId","name","packetType","downloadUrl","url","completedAt"],"additionalProperties":false},"example":{"kind":"audit_packet.ready","packetId":"cm3pkt0001","name":"ISO 27001 surveillance audit","packetType":"ISO_27001","downloadUrl":"/api/audit-packets/cm3pkt0001/download","url":"/dashboard/audit-packets/cm3pkt0001","completedAt":"2026-11-01T09:30:00.000Z"}}}},"responses":{"2XX":{"description":"Delivered. Any 2xx status counts; anything else, or no answer within 30 seconds, is retried."}}}},"webhook.test":{"post":{"operationId":"webhook_webhook_test","summary":"webhook.test","description":"A test delivery sent from the webhook settings page. Sent to every active webhook subscribed to webhook.test. The body is the JSON object below, with no envelope; the event name is also in the X-QP-Event header.","tags":["Webhooks"],"parameters":[{"name":"X-QP-Event","in":"header","required":true,"description":"The event name, for example policy.published.","schema":{"type":"string"}},{"name":"X-QP-Delivery","in":"header","required":true,"description":"The delivery id. Retries of the same delivery reuse it, so use it to ignore duplicates.","schema":{"type":"string"}},{"name":"X-QP-Timestamp","in":"header","required":true,"description":"When this attempt was signed, as an ISO 8601 time.","schema":{"type":"string"}},{"name":"X-QP-Signature","in":"header","required":true,"description":"sha256= followed by the hex HMAC-SHA256 of the timestamp, a full stop, and the raw body, keyed with your signing secret.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","const":"webhook.test"},"message":{"type":"string"},"timestamp":{"type":"string","description":"ISO 8601 date and time, UTC."}},"required":["kind","message","timestamp"],"additionalProperties":false},"example":{"kind":"webhook.test","message":"This is a test delivery from Quick Policy.","timestamp":"2026-11-01T09:30:00.000Z"}}}},"responses":{"2XX":{"description":"Delivered. Any 2xx status counts; anything else, or no answer within 30 seconds, is retried."}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"qk_ followed by 64 hex characters","description":"Send the key as `Authorization: Bearer qk_…`. An organisation admin creates keys on the Integrations page and sees each key once, when it is created.\nScopes (shown as role names on each operation):\n- read:policies: List policies and read a single policy.\n- read:incidents: List incidents and read one incident in full. Needs a plan that includes incident management.\n- admin: Everything the other scopes allow, and the scope that lets a key read draft and archived policies: a read:policies key sees published policies only.\n- write:policies (retired): No longer offered when creating a key. Older keys may still carry it, but it unlocks nothing: policies cannot be changed with an API key.\n- read:compliance (retired): No longer offered when creating a key. Older keys may still carry it, but it unlocks nothing."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["UNAUTHORIZED","API_ACCESS_NOT_IN_PLAN","INSUFFICIENT_SCOPE","FEATURE_NOT_IN_PLAN","INVALID_FILTER","RATE_LIMITED","NOT_FOUND","INTERNAL_ERROR"],"description":"A stable code. Branch on this."},"message":{"type":"string","description":"A readable message. Show it to a person; do not branch on its wording."}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"description":"The body of every error response to an API key.","additionalProperties":false}}},"x-rate-limit":{"enforced":true,"limit":120,"windowSeconds":60,"scope":"per key","headers":[{"name":"Retry-After","description":"Seconds to wait before trying again."},{"name":"X-RateLimit-Limit","description":"Requests allowed per key in each window (120)."},{"name":"X-RateLimit-Reset","description":"When the current window ends, as a Unix time in seconds."}],"guidance":"Each key may make 120 requests a minute. Past that, requests get HTTP 429 with the code RATE_LIMITED and a Retry-After header saying how many seconds to wait. The headers come only on the 429."},"x-changelog":[{"version":"0.2.0","date":"2026-11-02","changes":["Keys now stop working as soon as your organisation's plan no longer includes API access. Requests get 403 with the code API_ACCESS_NOT_IN_PLAN.","Every error to an API key now uses the body { \"error\": { \"code\", \"message\" } }, with a stable code to branch on. Signed-in use of the app is unchanged.","An unrecognised filter on the incident list (lifecycleStage, severity, limit or offset) now returns 400 INVALID_FILTER instead of 500.","Another organisation's incident now returns 404, not 403.","On the incident list, pagination.total and pagination.hasMore now count only the incidents that match your filters.","The write:policies and read:compliance scopes are no longer offered when creating a key. They never unlocked anything; keys that carry them are unaffected.","Breaking: responses to API keys now carry an explicit list of fields. The organisation is id, name and plan name only; policies no longer include internal fields, and the policy list no longer includes policy text or the entitlements object; an incident no longer includes the member list, email addresses, the raw record, investigations, notifications or suggestions.","Each key may now make 120 requests a minute. Past that, requests get 429 RATE_LIMITED with Retry-After, X-RateLimit-Limit and X-RateLimit-Reset headers.","Breaking: a key with read:policies now sees published policies only. Draft and archived policies need the admin scope; asking for them by status returns nothing, and fetching one by id returns 404."]},{"version":"0.1.0","date":"2026-11-01","changes":["First public reference for the API. It documents the five read endpoints an API key can already call, the webhook events and how deliveries are signed.","Corrected the incident filter values: lifecycleStage takes the upper-case stage names (for example TRIAGE), not lower-case ones.","Published a machine-readable OpenAPI 3.1 file at /developers/openapi.json."]}]}