openapi: 3.0.3 info: title: Exception Management API version: 1.0.0 description: | The WES-tier owner of the **Problem Solve** lifecycle in the warehouse-systems platform (ADR 0001, ADR 0002). Every case starts from a fact another context published (a missed CPT, a breached backlog threshold, an at-risk acknowledgement, a count discrepancy, an unexpected return); this API is where operators triage, assign and resolve those cases, and where the handling policy per source type is declared. There is deliberately **no case creation over REST** (`POST /exceptions` is always a keyed `405`): a case is always a consumed fact, and a repeated fact touches the open case (occurrence count, `lastSeenAt`) instead of opening another. `status` runs `OPEN -> TRIAGED -> ASSIGNED -> RESOLVED`; `RESOLVED` requires a resolution code and is terminal; `escalated` is a flag set by the SLA sweeper, never a state and never a blocker. Events are published as CloudEvents on `warehouse.exception-management.events` through a transactional outbox (see `apis/asyncapi.yaml`, ADR 0004). Every `POST` is idempotent: send an `Idempotency-Key`; a replay carries `Idempotency-Replayed: true`. A refusal is replayed only when it is final for the request (ADR 0015): a retryable one (404 `case-not-found`, 409 `concurrent-modification`) releases the key, so a retry executes again. Lists are keyset-paged (`limit`, `cursor`) and answer `{items, nextCursor}`. Errors are RFC 7807 problem documents with `type = https://errors.exception-management.warehouse-systems.dev/`. There is no authentication layer (fleet decision 2026-09-11). contact: name: exception-management maintainers url: https://github.com/IQVO/exception-management license: name: UNLICENSED servers: - url: http://localhost:8080 description: Local development - url: http://localhost:8000/api/exception-management description: Local kind cluster through Kong tags: - name: Exceptions description: "The Problem Solve casework: triage, assign, resolve." - name: Exception policies description: "The per-source-type handling policy: severity, queue, SLA, auto-resolve." - name: Health description: Liveness, readiness and metrics probes. paths: /exceptions: get: operationId: listExceptions summary: List exception cases description: | Lists cases, newest opened first, one page at a time (`limit`, `cursor`; keyset on opened-at then case id). An empty result is `200` with `{"items": []}`, never a 404. `status`, `queue`, `site` and `sourceType` narrow the list and are repeated on every page request; `sourceType` is the full CloudEvents type of the source fact. Without a `status` filter the list returns every open AND resolved case matching the other filters (resolve activity is part of the record). tags: [Exceptions] parameters: - $ref: "#/components/parameters/Limit" - $ref: "#/components/parameters/Cursor" - name: status in: query description: Only cases in this status. schema: $ref: "#/components/schemas/CaseStatus" - name: queue in: query description: Only cases in this problem-solve queue. schema: type: string - name: site in: query description: Only cases of this site. schema: type: string - name: sourceType in: query description: The full CloudEvents type of the source fact. schema: type: string responses: "200": description: One page of the matching cases (an empty page, never a 404). content: application/json: schema: $ref: "#/components/schemas/ExceptionCasePage" example: items: - caseId: case-1d2e3f4a-5b6c-4789-9abc-def012345678 dedupKey: sourceType: com.warehouse.wes.fulfillment-execution.task.TaskCPTMissed sourceSubject: task-8a1f siteId: null status: OPEN severity: HIGH queue: cps-front occurrenceCount: 3 escalated: false openedAt: "2026-10-21T09:00:05Z" lastSeenAt: "2026-10-21T09:20:05Z" slaDueAt: "2026-10-21T09:30:05Z" sourceEventId: "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b" sourcePayload: task_id: task-8a1f order_ref: wu-8a1f task_type: PICK cpt: "2026-09-30T14:55:00Z" auditTrail: - action: OPENED actor: system at: "2026-10-21T09:00:05Z" - action: TOUCHED actor: system at: "2026-10-21T09:10:05Z" - action: TOUCHED actor: system at: "2026-10-21T09:20:05Z" version: 1 nextCursor: eyJzIjoiMjAyNi0xMC0yMVQwOTowMDowNVoiLCJpIjoiY2FzZS0xZDJlM2Y0YS01YjZjLTQ3ODktOWFiYy1kZWYwMTIzNDU2NzgifQ "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalError" post: operationId: rejectCreateException summary: Cases are never created over REST (always 405) description: | There is deliberately **no `POST /exceptions`**: every case opens from a consumed fact (ADR 0001), and a repeated fact touches the open case (occurrence count, `lastSeenAt`) instead of opening another. Like every `POST` of the fleet it sits behind the idempotency middleware: the `Idempotency-Key` is demanded first (400 `idempotency-key-required` when absent), then the router answers `405 method-not-allowed` naming `GET` as the allowed method. The 405 is a deterministic answer and is stored: the same key and request replays it with `Idempotency-Replayed: true`, the same key with a different request is 409 `idempotency-key-reused`. tags: [Exceptions] parameters: - $ref: "#/components/parameters/IdempotencyKey" responses: "400": $ref: "#/components/responses/BadRequest" "409": $ref: "#/components/responses/Conflict" "405": description: Case creation does not exist; every case comes from a consumed fact. headers: Allow: description: The methods the resource accepts; always `GET`. schema: type: string enum: [GET] Idempotency-Replayed: $ref: "#/components/headers/IdempotencyReplayed" content: application/problem+json: schema: $ref: "#/components/schemas/Problem" example: type: https://errors.exception-management.warehouse-systems.dev/method-not-allowed title: Method not allowed status: 405 detail: "there is deliberately no POST /exceptions: every case opens from a consumed fact (ADR 0001)" instance: /exceptions /exceptions/{caseId}: parameters: - $ref: "#/components/parameters/CaseId" get: operationId: getException summary: Get an exception case description: | Returns the case with its frozen source payload, its SLA clock, its occurrence count, its assignee and resolution once they exist, and the audit trail (one entry per transition, each with its actor). tags: [Exceptions] responses: "200": description: The case. content: application/json: schema: $ref: "#/components/schemas/ExceptionCase" "400": $ref: "#/components/responses/BadRequest" "404": $ref: "#/components/responses/NotFound" "500": $ref: "#/components/responses/InternalError" /exceptions/{caseId}/triage-decisions: parameters: - $ref: "#/components/parameters/CaseId" post: operationId: triageException summary: Triage a case description: | Sets or changes the severity and queue of a case that is not yet resolved, and moves an `OPEN` case to `TRIAGED`. Requires an `Idempotency-Key`; replaying the same key and request returns the stored response with `Idempotency-Replayed: true` — except a retryable refusal (ADR 0015): a 404 `case-not-found` (the opening fact may not be consumed yet) or a 409 `concurrent-modification` is not stored, the key is released and a retry executes again. Publishes `ExceptionTriaged`. tags: [Exceptions] parameters: - $ref: "#/components/parameters/IdempotencyKey" - $ref: "#/components/parameters/ActorHeader" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/TriageRequest" example: severity: CRITICAL queue: cps-inbound responses: "200": description: The case is now triaged. headers: Idempotency-Replayed: $ref: "#/components/headers/IdempotencyReplayed" content: application/json: schema: $ref: "#/components/schemas/ExceptionCase" "400": $ref: "#/components/responses/BadRequest" "404": $ref: "#/components/responses/NotFound" "409": $ref: "#/components/responses/Conflict" "500": $ref: "#/components/responses/InternalError" /exceptions/{caseId}/assignments: parameters: - $ref: "#/components/parameters/CaseId" post: operationId: assignException summary: Assign a case description: | Gives the case an owner (an operator id) and moves it to `ASSIGNED`. Reassigning is allowed while the case is not resolved. Requires an `Idempotency-Key`. Publishes `ExceptionAssigned`. tags: [Exceptions] parameters: - $ref: "#/components/parameters/IdempotencyKey" - $ref: "#/components/parameters/ActorHeader" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AssignRequest" example: assignee: op-marc responses: "200": description: The case is now assigned. headers: Idempotency-Replayed: $ref: "#/components/headers/IdempotencyReplayed" content: application/json: schema: $ref: "#/components/schemas/ExceptionCase" "400": $ref: "#/components/responses/BadRequest" "404": $ref: "#/components/responses/NotFound" "409": $ref: "#/components/responses/Conflict" "500": $ref: "#/components/responses/InternalError" /exceptions/{caseId}/resolutions: parameters: - $ref: "#/components/parameters/CaseId" post: operationId: resolveException summary: Resolve a case description: | Records the resolution code and the root cause and moves the case to `RESOLVED`, its terminal state. `note` is optional. Resolving an already-resolved case is a 409 `case-already-resolved`; any later command on it is too. Requires an `Idempotency-Key`. Publishes `ExceptionResolved`. tags: [Exceptions] parameters: - $ref: "#/components/parameters/IdempotencyKey" - $ref: "#/components/parameters/ActorHeader" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ResolveRequest" example: resolutionCode: WORK_COMPLETED rootCause: OPERATOR_UNAVAILABLE responses: "200": description: The case is resolved (terminal). headers: Idempotency-Replayed: $ref: "#/components/headers/IdempotencyReplayed" content: application/json: schema: $ref: "#/components/schemas/ExceptionCase" "400": $ref: "#/components/responses/BadRequest" "404": $ref: "#/components/responses/NotFound" "409": $ref: "#/components/responses/Conflict" "500": $ref: "#/components/responses/InternalError" /exception-policies: get: operationId: listExceptionPolicies summary: List the handling policies description: | Lists the current policy version of every declared source type, ordered by source type, one page at a time (`limit`, `cursor`; keyset on source type). An empty result is `200` with `{"items": []}`. tags: [Exception policies] parameters: - $ref: "#/components/parameters/Limit" - $ref: "#/components/parameters/Cursor" responses: "200": description: One page of the declared policies. content: application/json: schema: $ref: "#/components/schemas/ExceptionPolicyPage" example: items: - sourceType: com.warehouse.wes.fulfillment-execution.task.TaskCPTMissed version: 1 severity: HIGH queue: cps-front slaMinutes: 30 autoResolve: onType: com.warehouse.wes.order-management.order.OrderRepromised withinMinutes: 60 declaredAt: "2026-10-21T08:00:00Z" nextCursor: eyJzIjoiY29tLndhcmVob3VzZS53ZXMuZnVsZmlsbG1lbnQtZXhlY3V0aW9uLnRhc2suVGFza0NQVE1pc3NlZCIsImkiOiJjb20ud2FyZWhvdXNlLndlcy5mdWxmaWxsbWVudC1leGVjdXRpb24udGFzay5UYXNrQ1BUTWlzc2VkIn0 "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalError" /exception-policies/{sourceType}: parameters: - $ref: "#/components/parameters/SourceType" put: operationId: declareExceptionPolicy summary: Declare a new version of a handling policy description: | Declares the handling policy of a source type at the next version (versions are append-only: the first declaration is version 1, every accepted declaration after that is +1). `sourceType` is the full CloudEvents type of the governed source fact; the service checks its shape only (`com.warehouse.wms|wes...`), not that a consumer for it exists. The new version governs cases opened after the declaration; open cases keep the severity, queue and SLA they were opened with. `autoResolve` is omitted or null when the source type has no auto-resolve rule. Requires an `Idempotency-Key`. Publishes `ExceptionPolicyDeclared`. tags: [Exception policies] parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DeclarePolicyRequest" example: severity: HIGH queue: cps-front slaMinutes: 30 autoResolve: onType: com.warehouse.wes.order-management.order.OrderRepromised withinMinutes: 60 responses: "201": description: The policy version is declared. headers: Idempotency-Replayed: $ref: "#/components/headers/IdempotencyReplayed" content: application/json: schema: $ref: "#/components/schemas/ExceptionPolicy" "400": $ref: "#/components/responses/BadRequest" "409": $ref: "#/components/responses/Conflict" "500": $ref: "#/components/responses/InternalError" /healthz: get: operationId: healthz summary: Liveness probe description: 200 while the process is running. tags: [Health] responses: "200": description: Alive. content: application/json: schema: $ref: "#/components/schemas/Status" /readyz: get: operationId: readyz summary: Readiness probe description: | 200 when the service can serve traffic. 503 while draining for shutdown (`{"status":"not_ready"}`) or while Postgres or the Kafka broker is unreachable (problem `dependency-unavailable`). Kafka readiness is reachability only (a broker answers a metadata request with an empty topic list); a missing topic never makes the service unready. tags: [Health] responses: "200": description: Ready. content: application/json: schema: $ref: "#/components/schemas/Status" "503": description: Not ready. content: application/json: schema: $ref: "#/components/schemas/Status" application/problem+json: schema: $ref: "#/components/schemas/Problem" example: type: https://errors.exception-management.warehouse-systems.dev/dependency-unavailable title: A runtime dependency is unavailable status: 503 detail: "not ready: kafka" instance: /readyz /metrics: get: operationId: metrics summary: Prometheus metrics description: The Prometheus scrape endpoint (text exposition format). tags: [Health] responses: "200": description: The metrics of the process. content: text/plain; version=0.0.4; charset=utf-8: schema: type: string components: parameters: CaseId: name: caseId in: path required: true description: The case id (`case-` followed by a unique suffix, at most 64 characters). schema: type: string minLength: 6 maxLength: 64 pattern: "^case-[^\\s/]+$" example: case-1d2e3f4a-5b6c-4789-9abc-def012345678 SourceType: name: sourceType in: path required: true description: | The full CloudEvents type of the governed source fact, URL-encoded (its dots and colons are significant), e.g. `com.warehouse.wes.fulfillment-execution.task.TaskCPTMissed`. schema: type: string minLength: 5 maxLength: 200 pattern: "^com\\.warehouse\\.(wms|wes)\\.[a-z][a-z-]*\\.[a-z][a-z-]*\\.[A-Za-z0-9.]+$" example: com.warehouse.wes.fulfillment-execution.task.TaskCPTMissed IdempotencyKey: name: Idempotency-Key in: header required: true description: | Caller-generated unique key (a UUID per logical submit; a retry reuses it) that makes a retried request safe. Required on every POST (a PUT accepts it too); answered with 400 `idempotency-key-required` when absent and 400 `idempotency-key-invalid` when it is longer than 128 characters or not printable ASCII. A replay with the same key and the same request (method, path and body) returns the stored response with the header `Idempotency-Replayed: true`; the same key with a different request is a 409 `idempotency-key-reused`. A refusal is stored and replayed only when it is final for the request (`invalid-*` validation, `case-already-resolved`, this key's own 400/409 problems; ADR 0015): a retryable refusal — 404 `case-not-found` (the case opens from a consumed fact that may not have arrived yet) or 409 `concurrent-modification` (retry after re-fetching the latest version) — is not stored; the key is released, a retry under it executes again and a different request under it is a new request. schema: type: string minLength: 1 maxLength: 128 ActorHeader: name: X-Actor in: header required: false description: | The operator identity the case's audit trail records for this command (an operator id, e.g. `op-jane`). A label, not authentication: the service has no auth layer (fleet decision 2026-09-11). Omitted (or blank) records `system`, the pre-header behavior; a value with a NUL byte is 400 `invalid-actor`. schema: type: string minLength: 1 maxLength: 64 example: op-jane Limit: name: limit in: query required: false description: Page size, 1 to 500 (default 100); anything else is 400 `invalid-limit`. A query parameter the collection does not declare (`after`, `offset`, `nextToken`, ...) is 400 `unknown-query-parameter`. schema: type: integer minimum: 1 maximum: 500 default: 100 Cursor: name: cursor in: query required: false description: | Opaque page token, copied from the previous page's `nextCursor`; absent for the first page. A value that does not decode is 400 `invalid-cursor`. Repeat the filters on every page request. schema: type: string headers: IdempotencyReplayed: description: >- `true` when this response is the stored answer of an earlier request with the same `Idempotency-Key` and the same method, path and body (the handler did not run again). Absent on the first execution. schema: type: string enum: ["true"] responses: BadRequest: description: Malformed JSON body, an unknown field, an invalid path, query or header parameter, or a NUL byte in a body. content: application/problem+json: schema: $ref: "#/components/schemas/Problem" examples: malformedBody: summary: Malformed JSON body or NUL byte value: type: https://errors.exception-management.warehouse-systems.dev/malformed-request-body title: Malformed request body status: 400 detail: request body is not valid JSON for this operation instance: /exceptions/case-1/resolutions invalidSeverity: summary: Unknown severity value: type: https://errors.exception-management.warehouse-systems.dev/invalid-severity title: Severity is invalid status: 400 detail: "severity must be one of LOW, MEDIUM, HIGH, CRITICAL" instance: /exceptions/case-1/triage-decisions invalidQueue: summary: Blank queue value: type: https://errors.exception-management.warehouse-systems.dev/invalid-queue title: Queue is invalid status: 400 detail: queue must not be blank instance: /exceptions/case-1/triage-decisions invalidActor: summary: Malformed X-Actor header value: type: https://errors.exception-management.warehouse-systems.dev/invalid-actor title: Actor is invalid status: 400 detail: the X-Actor header must name the operator performing the command, non-blank with no NUL byte instance: /exceptions/case-1/triage-decisions invalidAssignee: summary: Blank assignee value: type: https://errors.exception-management.warehouse-systems.dev/invalid-assignee title: Assignee is invalid status: 400 detail: assignee must not be blank instance: /exceptions/case-1/assignments invalidResolution: summary: Missing resolution code or root cause value: type: https://errors.exception-management.warehouse-systems.dev/invalid-resolution title: Resolution is invalid status: 400 detail: resolutionCode and rootCause must not be blank instance: /exceptions/case-1/resolutions invalidPolicy: summary: Policy values out of range value: type: https://errors.exception-management.warehouse-systems.dev/invalid-policy title: Policy is invalid status: 400 detail: slaMinutes must be at least 1 and autoResolve.onType, when present, must be a full CloudEvents type instance: /exception-policies/com.warehouse.wes.fulfillment-execution.task.TaskCPTMissed invalidSourceType: summary: Malformed source type value: type: https://errors.exception-management.warehouse-systems.dev/invalid-source-type title: Source type is invalid status: 400 detail: sourceType must be a full CloudEvents type this service consumes instance: /exception-policies/nope invalidCaseId: summary: Invalid case id value: type: https://errors.exception-management.warehouse-systems.dev/invalid-case-id title: Case id is invalid status: 400 detail: "case id must start with case- and have no whitespace, control characters or '/'" instance: /exceptions/nope invalidStatus: summary: Unknown status filter value: type: https://errors.exception-management.warehouse-systems.dev/invalid-status title: Status is invalid status: 400 detail: "status must be one of OPEN, TRIAGED, ASSIGNED, RESOLVED" instance: /exceptions idempotencyKeyRequired: summary: Missing Idempotency-Key value: type: https://errors.exception-management.warehouse-systems.dev/idempotency-key-required title: Idempotency-Key header is required status: 400 detail: send an Idempotency-Key header with a unique value per logical request instance: /exceptions/case-1/resolutions idempotencyKeyInvalid: summary: Idempotency-Key longer than 128 characters or not printable ASCII value: type: https://errors.exception-management.warehouse-systems.dev/idempotency-key-invalid title: Idempotency-Key header is invalid status: 400 detail: the Idempotency-Key header must be 1 to 128 printable ASCII characters instance: /exceptions/case-1/resolutions invalidLimit: summary: limit outside 1 to 500 value: type: https://errors.exception-management.warehouse-systems.dev/invalid-limit title: Limit is invalid status: 400 detail: limit must be an integer between 1 and 500 instance: /exceptions invalidCursor: summary: cursor is not a page token value: type: https://errors.exception-management.warehouse-systems.dev/invalid-cursor title: Cursor is invalid status: 400 detail: cursor is not a valid page token instance: /exceptions unknownQueryParameter: summary: A query parameter the collection does not declare (for example a retired paging parameter) value: type: https://errors.exception-management.warehouse-systems.dev/unknown-query-parameter title: Query parameter is not supported status: 400 detail: "query parameter is not supported: after" instance: /exceptions NotFound: description: No case has this id, or the path holds a NUL byte. content: application/problem+json: schema: $ref: "#/components/schemas/Problem" examples: caseNotFound: summary: No case has this id value: type: https://errors.exception-management.warehouse-systems.dev/case-not-found title: Exception case not found status: 404 detail: exception case not found instance: /exceptions/case-unknown notFound: summary: Malformed path (including a NUL byte) value: type: https://errors.exception-management.warehouse-systems.dev/not-found title: Not found status: 404 detail: no such path instance: /nope Conflict: description: The case is in the wrong state for the command, another request changed it first, or the Idempotency-Key was already used with a different request (`idempotency-key-reused`). content: application/problem+json: schema: $ref: "#/components/schemas/Problem" examples: caseAlreadyResolved: summary: RESOLVED is terminal value: type: https://errors.exception-management.warehouse-systems.dev/case-already-resolved title: The case is already resolved status: 409 detail: a resolved case accepts no further command instance: /exceptions/case-1/resolutions idempotencyKeyReused: summary: The Idempotency-Key was used with a different request value: type: https://errors.exception-management.warehouse-systems.dev/idempotency-key-reused title: Idempotency-Key was already used with a different request status: 409 detail: the Idempotency-Key was used with a different request (method, path or body) instance: /exceptions/case-1/resolutions concurrentModification: summary: Another request changed the case between read and write value: type: https://errors.exception-management.warehouse-systems.dev/concurrent-modification title: The case was modified by another request; re-fetch the latest version and retry status: 409 detail: re-fetch the case and retry the command instance: /exceptions/case-1/triage-decisions InternalError: description: Unexpected server error. content: application/problem+json: schema: $ref: "#/components/schemas/Problem" example: type: https://errors.exception-management.warehouse-systems.dev/internal-error title: Internal server error status: 500 detail: an unexpected error occurred instance: /exceptions schemas: CaseStatus: type: string description: | The fixed status machine: `OPEN -> TRIAGED -> ASSIGNED -> RESOLVED`. `RESOLVED` is terminal. `ESCALATED` is a flag, not a status. enum: [OPEN, TRIAGED, ASSIGNED, RESOLVED] Severity: type: string description: The triage outcome, from the policy or an operator. enum: [LOW, MEDIUM, HIGH, CRITICAL] DedupKey: type: object required: [sourceType, sourceSubject, siteId] properties: sourceType: { type: string, description: The full CloudEvents type of the source fact. } sourceSubject: { type: string, description: The subject of the source fact (its aggregate id). } siteId: { type: string, nullable: true, description: The site carried by the source fact; null when it has none. } AuditEntry: type: object required: [action, actor, at] properties: action: { type: string, description: "One of OPENED, TOUCHED, TRIAGED, ASSIGNED, ESCALATED, RESOLVED, AUTO_RESOLVED." } actor: { type: string, description: "The operator id, the policy id or `system`." } at: { type: string, format: date-time } TriageRequest: type: object additionalProperties: false required: [severity, queue] properties: severity: { $ref: "#/components/schemas/Severity" } queue: type: string minLength: 1 maxLength: 64 pattern: '\S' description: The problem-solve queue the case is routed to. AssignRequest: type: object additionalProperties: false required: [assignee] properties: assignee: type: string minLength: 1 maxLength: 64 pattern: '\S' description: The operator id taking the case. ResolveRequest: type: object additionalProperties: false required: [resolutionCode, rootCause] properties: resolutionCode: type: string minLength: 1 maxLength: 64 pattern: '^[A-Z0-9_]+$' description: What was done about the case (a code, not prose). rootCause: type: string minLength: 1 maxLength: 64 pattern: '^[A-Z0-9_]+$' description: Why it happened (a code, not prose). note: type: string nullable: true maxLength: 2000 description: Free-form remark; omitted or null when none. AutoResolveRule: type: object additionalProperties: false required: [onType, withinMinutes] properties: onType: type: string maxLength: 200 pattern: "^com\\.warehouse\\.(wms|wes)\\.[a-z][a-z-]*\\.[a-z][a-z-]*\\.[A-Za-z0-9.]+$" description: "The full CloudEvents type of the correlated fact that closes the case (e.g. OrderRepromised)." withinMinutes: type: integer format: int64 minimum: 1 description: The correlated fact counts only within this many minutes of the case's last occurrence. DeclarePolicyRequest: type: object additionalProperties: false required: [severity, queue, slaMinutes] properties: severity: { $ref: "#/components/schemas/Severity" } queue: type: string minLength: 1 maxLength: 64 pattern: '\S' description: The queue cases of this source type are routed to. slaMinutes: type: integer format: int64 minimum: 1 description: The SLA budget of cases opened under this policy. autoResolve: type: object nullable: true allOf: - $ref: "#/components/schemas/AutoResolveRule" ExceptionPolicy: type: object required: [sourceType, version, severity, queue, slaMinutes, declaredAt] properties: sourceType: { type: string, description: The full CloudEvents type of the governed source fact. } version: { type: integer, format: int64, minimum: 1, description: "Append-only: 1 for the first declaration, +1 per accepted change." } severity: { $ref: "#/components/schemas/Severity" } queue: { type: string } slaMinutes: { type: integer, format: int64, minimum: 1 } autoResolve: type: object nullable: true description: Null when the source type has no auto-resolve rule. allOf: - $ref: "#/components/schemas/AutoResolveRule" declaredAt: { type: string, format: date-time } ExceptionCase: type: object required: [caseId, dedupKey, status, severity, queue, occurrenceCount, escalated, openedAt, lastSeenAt, slaDueAt, sourceEventId, sourcePayload, auditTrail, version] properties: caseId: { type: string, example: case-1d2e3f4a-5b6c-4789-9abc-def012345678 } dedupKey: { $ref: "#/components/schemas/DedupKey" } status: { $ref: "#/components/schemas/CaseStatus" } severity: { $ref: "#/components/schemas/Severity" } queue: { type: string } occurrenceCount: { type: integer, format: int64, minimum: 1, description: How many times the source fact arrived; 1 at open and +1 per repeat. } escalated: { type: boolean, description: Set by the SLA sweeper at breach; never blocks a transition. } assignee: { type: string, description: The owning operator id; absent before the first assignment. } resolutionCode: { type: string, description: Absent until RESOLVED. } rootCause: { type: string, description: Absent until RESOLVED. } note: { type: string, nullable: true, description: Absent until RESOLVED; null when resolved without a note. } resolvedAt: { type: string, format: date-time, description: Absent until the case is resolved or auto-resolved. } autoResolveRuleId: { type: string, description: "The rule that fired, present only on an auto-resolved case." } openedAt: { type: string, format: date-time } lastSeenAt: { type: string, format: date-time, description: The arrival time of the most recent occurrence. } slaDueAt: { type: string, format: date-time, description: "openedAt + the policy's slaMinutes at open." } sourceEventId: { type: string, description: The CloudEvents id of the source fact that opened the case. } sourcePayload: type: object description: The frozen copy of the source fact's data; never changes after open. auditTrail: type: array description: One entry per transition, in order; every entry records its actor. items: { $ref: "#/components/schemas/AuditEntry" } version: { type: integer, format: int64, minimum: 1, description: "Starts at 1, +1 per accepted transition." } ExceptionCasePage: type: object required: [items] properties: items: type: array items: { $ref: "#/components/schemas/ExceptionCase" } nextCursor: type: string description: Opaque token for the next page; absent on the last page. ExceptionPolicyPage: type: object required: [items] properties: items: type: array items: { $ref: "#/components/schemas/ExceptionPolicy" } nextCursor: type: string description: Opaque token for the next page; absent on the last page. Problem: type: object description: RFC 7807 problem document used for every non-2xx response. required: [type, title, status, detail, instance] properties: type: { type: string, format: uri } title: { type: string } status: { type: integer, format: int32 } detail: { type: string } instance: { type: string } Status: type: object required: [status] properties: status: { type: string, example: ok }