---
title: "Cancel a case"
url: "https://developers.zinnia.com/apis/policy-transactions-1-0-2/versions/d0006570-ab9d-464e-814f-d120ba425e84/operations/cancelCase"
---

> Full API specification: https://developers.zinnia.com/apis/policy-transactions-1-0-2/versions/d0006570-ab9d-464e-814f-d120ba425e84.md

# Cancel a case

`PUT` `/policy/v1/cases/{caseId}/cancel`

Operation ID: `cancelCase`

Cancels an existing case based on eligibility rules. The API validates that the case exists and that the associated BPM process has not yet started. If eligible, the case is transitioned to a CANCELLED status, cancellation metadata is persisted, and a NES cancellation event is emitted. Only cases in NOT_STARTED BPM state can be cancelled.

## Path parameters

- `caseId` (string, required) - The unique identifier of the case to cancel

## Request body (required)

Content types: `application/json`

## Responses

- `202` - Cancellation accepted and BPM process triggered
- `400` - Bad Request - Missing or invalid required fields
- `401` - Authentication failed
- `403` - Access denied
- `404` - Case not found
- `409` - Cancellation not allowed - BPM process is not in an eligible state
- `500` - Internal server error

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Zinnia Policy Transactions API.
  version: 1.0.8
servers:
  - url: https://dev.api.zinnia.io
    description: DEV Environment
  - url: https://qa.api.zinnia.io
    description: QA Environment
paths:
  /policy/v1/cases/{caseId}/cancel:
    put:
      x-kong-plugin-pre-function:
        config:
          access:
            - |
              local path = kong.request.get_path()
              local new_path = path:gsub("^/policy/v1/cases", "/bpm/v1/cases")
              kong.service.request.set_path(new_path)
      tags:
        - Policy - Transactions
      summary: Cancel a case
      description: >
        Cancels an existing case based on eligibility rules. The API validates
        that the case exists and that the associated BPM process has not yet
        started. If eligible, the case is transitioned to a CANCELLED status,
        cancellation metadata is persisted, and a NES cancellation event is
        emitted. Only cases in NOT_STARTED BPM state can be cancelled.
      operationId: cancelCase
      parameters:
        - name: caseId
          in: path
          required: true
          description: The unique identifier of the case to cancel
          schema:
            type: string
            example: CA0000007516
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CaseCancellationRequest"
            example:
              correlationId: 218d8992-3783-42ac-b59a-66cbc36adaa2
              planCode: TL0101
              policyNumber: FIUL463340020
              reason: User requested cancellation
              requestedBy: CLIENT
              type: Reinstatement
              subType: Reinstatement
      responses:
        "202":
          description: Cancellation accepted and BPM process triggered
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CaseCancellationResponse"
              example:
                caseId: CA0000007516
                correlationId: 218d8992-3783-42ac-b59a-66cbc36adaa2
                caseStatus: CANCELLED
                message: Case cancellation initiated successfully
        "400":
          description: Bad Request - Missing or invalid required fields
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationResponse"
              example:
                statusCode: 400
                timestamp: 2026-02-18T10:30:00Z
                errorId: a4a57ed0-2c1b-4922-9959-3b85dd8a96d3
                message: Validation failed
                error:
                  - reason is required
                  - type is required
        "401":
          description: Authentication failed
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    message: Unauthorized
        "403":
          description: Access denied
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccessDeniedResponse"
        "404":
          description: Case not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationResponse"
              example:
                statusCode: 404
                timestamp: 2026-02-18T10:30:00Z
                errorId: b5b68ed1-3d2c-5933-0060-4c96ee9b97e4
                message: Case not found
                error:
                  - "No case found for caseId: CA0000007516"
        "409":
          description: Cancellation not allowed - BPM process is not in an eligible state
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationResponse"
              example:
                statusCode: 409
                timestamp: 2026-02-18T10:30:00Z
                errorId: c6c79fe2-4e3d-6044-1171-5da7fface85
                message: Cancellation not allowed
                error:
                  - Cancellation not allowed once transaction processing has
                    started.
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerErrorResponse"
      security:
        - Auth0: []
security:
  - Auth0: []
components:
  schemas:
    CaseCancellationRequest:
      type: object
      required:
        - correlationId
        - planCode
        - policyNumber
        - reason
        - type
      properties:
        correlationId:
          type: string
          description: Unique identifier to trace the request across systems
          example: 218d8992-3783-42ac-b59a-66cbc36adaa2
        planCode:
          type: string
          description: Product code provided by the Zinnia system
          example: TL0101
        policyNumber:
          type: string
          description: The policy number associated with the case
          example: FIUL463340020
        reason:
          type: string
          description: The reason for cancelling the case
          example: User requested cancellation
        requestedBy:
          type: string
          description: The entity requesting cancellation. Derived from the authenticated
            token.
          example: CLIENT
        type:
          type: string
          description: The transaction type associated with the case
          example: Reinstatement
        subType:
          type: string
          description: The transaction sub-type associated with the case
          example: Reinstatement
    CaseCancellationResponse:
      type: object
      properties:
        caseId:
          type: string
          description: The unique identifier of the cancelled case
          example: CA0000007516
        correlationId:
          type: string
          description: Unique identifier to trace the request across systems
          example: 218d8992-3783-42ac-b59a-66cbc36adaa2
        caseStatus:
          type: string
          description: The updated status of the case
          example: CANCELLED
        message:
          type: string
          description: Confirmation message
          example: Case cancellation initiated successfully
    ValidationResponse:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
          example: 400
        timestamp:
          type: string
          format: date-time
        errorId:
          type: string
          example: a4a57ed0-2c1b-4922-9959-3b85dd8a96d3
        message:
          type: string
          example: JSON Valdiation fails with error
        error:
          type: array
          items:
            type: string
            example: Mandatory attribute label missing
    AccessDeniedResponse:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
          example: 403
        timestamp:
          type: integer
          format: int64
          example: 1681395423438
        errorId:
          type: string
          example: 0286d47a-7ad9-499c-8ca0-8f6634d236a3
        message:
          type: string
          example: "User is not authorized for the carrier : CarrierName_1"
    ServerErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
          example: 500
        timestamp:
          type: integer
          format: int64
          example: 1681395423438
        errorId:
          type: string
          example: 0286d47a-7ad9-499c-8ca0-8f6634d236a3
        message:
          type: string
          example: Failed to process request
  securitySchemes:
    Auth0:
      type: openIdConnect
      openIdConnectUrl: https://login.uat.zinnia.com/.well-known/openid-configuration
      x-kong-security-openid-connect:
        config:
          run_on_preflight: true
          scopes_claim:
            - https://uat.api.zinnia.io/permissions
          audience_claim:
            - aud
          audience_required:
            - https://uat.api.zinnia.io
          client_id:
            - client_id
          auth_methods:
            - bearer
        enabled: true
        protocols:
          - grpc
          - grpcs
          - http
          - https
```
