> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polymorfa.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel operation

> Requests cancellation after transactionally rechecking that the operation is cancellable. Only operations whose capabilities.cancellable is true accept cancellation: running or action-required campaign and production-enrollment operations. The operation moves to cancelling and later settles as cancelled or another terminal status. Other operations return 409 operation_conflict with the current operation. Retrying with the same Idempotency-Key replays the original receipt.

Requires `operations:cancel`. Project tokens only access resources in their own project.



## OpenAPI

````yaml api-reference/features/connect.json POST /platform/operations/{operationId}/cancel
openapi: 3.0.3
info:
  title: Connect API methods
  version: 1.0.0
  description: Task-focused connect methods across supported Polymorfa connection types.
servers: []
security: []
paths:
  /platform/operations/{operationId}/cancel:
    post:
      tags:
        - Operations
      summary: Cancel operation
      description: >-
        Requests cancellation after transactionally rechecking that the
        operation is cancellable. Only operations whose capabilities.cancellable
        is true accept cancellation: running or action-required campaign and
        production-enrollment operations. The operation moves to cancelling and
        later settles as cancelled or another terminal status. Other operations
        return 409 operation_conflict with the current operation. Retrying with
        the same Idempotency-Key replays the original receipt.


        Requires `operations:cancel`. Project tokens only access resources in
        their own project.
      operationId: managementCancelPlatformOperation
      parameters:
        - name: operationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: |-
            Identifier used to retrieve the asynchronous operation.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 255
          description: |-
            Specifies idempotency key for this header parameter.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | String length | `1` through `255` characters |
      responses:
        '200':
          description: Success
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Stable request correlation identifier.
            Polymorfa-Version:
              schema:
                type: string
              description: API version applied to this response.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  data:
                    allOf:
                      - $ref: >-
                          #/components/schemas/management__OperationCancellationReceipt
                    description: Structured data carried by this object.
                required:
                  - data
        '400':
          $ref: '#/components/responses/management__BadRequest'
        '401':
          $ref: '#/components/responses/management__Unauthorized'
        '403':
          $ref: '#/components/responses/management__Forbidden'
        '404':
          $ref: '#/components/responses/management__NotFound'
        '409':
          $ref: '#/components/responses/management__OperationCancellationConflict'
      security:
        - management__ApiKeyAuth: []
      servers:
        - url: https://api.polymorfa.com
components:
  schemas:
    management__OperationCancellationReceipt:
      type: object
      additionalProperties: false
      properties:
        operation:
          allOf:
            - $ref: '#/components/schemas/management__Operation'
          description: >-
            Specifies operation for this management operation cancellation
            receipt.
        operationId:
          type: string
          format: uuid
          description: |-
            Identifier used to retrieve the asynchronous operation.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        idempotency:
          allOf:
            - $ref: '#/components/schemas/management__IdempotencyReceipt'
          description: >-
            Specifies idempotency for this management operation cancellation
            receipt.
      required:
        - operation
        - operationId
        - idempotency
    management__Operation:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          format: uuid
          description: |-
            Identifier for this resource.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        organizationId:
          type: string
          format: uuid
          description: |-
            Identifier for the organization.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        projectId:
          type: string
          format: uuid
          nullable: true
          description: |-
            Owning project. `null` for a team-owned operation.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string`; Format: `uuid` |
            | Alternative 2 | `null` |

            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        kind:
          type: string
          enum:
            - auth_projection_repair
            - session_lifecycle
            - auth_session_purge
            - label_projection_purge
            - billing_reconciliation
            - auto_top_up
            - campaign
            - production_enrollment
            - retention_sweep
            - webhook_redrive
          description: |-
            Kind discriminator for this object.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `auth_projection_repair` | Auth projection repair. |
            | `session_lifecycle` | Session lifecycle. |
            | `auth_session_purge` | Auth session purge. |
            | `label_projection_purge` | Label projection purge. |
            | `billing_reconciliation` | Billing reconciliation. |
            | `auto_top_up` | Auto top up. |
            | `campaign` | Campaign. |
            | `production_enrollment` | Production enrollment. |
            | `retention_sweep` | Retention sweep. |
            | `webhook_redrive` | Webhook redrive. |
        resource:
          type: object
          additionalProperties: false
          properties:
            type:
              type: string
              description: Type discriminator for this object.
            id:
              type: string
              description: Identifier for this resource.
          required:
            - type
            - id
          description: Structured resource values for this management operation.
        status:
          type: string
          enum:
            - pending
            - running
            - action_required
            - cancelling
            - succeeded
            - failed
            - cancelled
          description: |-
            Current status of this resource or operation.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `pending` | Pending. |
            | `running` | Running. |
            | `action_required` | Action required. |
            | `cancelling` | Cancelling. |
            | `succeeded` | Succeeded. |
            | `failed` | Failed. |
            | `cancelled` | Cancelled. |
        sequence:
          type: integer
          format: int64
          minimum: 1
          description: |-
            Specifies sequence for this management operation.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Numeric value | `1` or greater |
            | Format | `int64` |
        capabilities:
          allOf:
            - $ref: '#/components/schemas/management__OperationCapabilities'
          description: Specifies capabilities for this management operation.
        progress:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/management__OperationProgress'
          description: >-
            Specifies progress for this management operation.


            <!-- polymorfa-input-table -->

            **Accepted alternatives**

            | Alternative | Accepted input |

            | --- | --- |

            | Alternative 1 | Type: `object`; Required fields: `code`,
            `current`, `total` |

            | Alternative 2 | `null` |
        result:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/management__JsonValue'
          description: |-
            Specifies result for this management operation.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Any JSON value matching this alternative |
            | Alternative 2 | `null` |

            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | Alternative 2 | Type: `string` |
            | Alternative 3 | Type: `number` |
            | Alternative 4 | Type: `boolean` |
            | Alternative 5 | Type: `array` |
            | Alternative 6 | Type: `object` |
            | Alternative 7 | `null` |
        error:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/management__OperationError'
          description: >-
            Error details returned when the operation fails.


            <!-- polymorfa-input-table -->

            **Accepted alternatives**

            | Alternative | Accepted input |

            | --- | --- |

            | Alternative 1 | Type: `object`; Required fields: `code`,
            `retryable`, `details` |

            | Alternative 2 | `null` |
        actionRequired:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/management__OperationActionRequired'
          description: >-
            Specifies action required for this management operation.


            <!-- polymorfa-input-table -->

            **Accepted alternatives**

            | Alternative | Accepted input |

            | --- | --- |

            | Alternative 1 | Type: `object`; Required fields: `code`, `details`
            |

            | Alternative 2 | `null` |
        createdAt:
          type: string
          format: date-time
          description: |-
            ISO 8601 timestamp when this resource was created.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `date-time` |
        updatedAt:
          type: string
          format: date-time
          description: |-
            ISO 8601 timestamp when this resource was last updated.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `date-time` |
        completedAt:
          type: string
          format: date-time
          nullable: true
          description: |-
            ISO 8601 timestamp when this operation completed.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string`; Format: `date-time` |
            | Alternative 2 | `null` |

            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `date-time` |
      required:
        - id
        - organizationId
        - projectId
        - kind
        - resource
        - status
        - sequence
        - capabilities
        - progress
        - result
        - error
        - actionRequired
        - createdAt
        - updatedAt
        - completedAt
    management__IdempotencyReceipt:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          format: uuid
          description: |-
            Identifier for this resource.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        key:
          type: string
          minLength: 1
          maxLength: 255
          description: |-
            Specifies key for this management idempotency receipt.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | String length | `1` through `255` characters |
        replayed:
          type: boolean
          description: Whether replayed.
        createdAt:
          type: string
          format: date-time
          description: |-
            ISO 8601 timestamp when this resource was created.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `date-time` |
        expiresAt:
          type: string
          format: date-time
          description: |-
            ISO 8601 timestamp when this resource expires.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `date-time` |
      required:
        - id
        - key
        - replayed
        - createdAt
        - expiresAt
    management__ErrorEnvelope:
      type: object
      required:
        - error
        - data
        - docs
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - param
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - conflict_error
                - rate_limit_error
                - api_error
                - upstream_error
              description: |-
                Type discriminator for this object.

                <!-- polymorfa-input-table -->
                **Allowed values**
                | Value | Meaning |
                | --- | --- |
                | `invalid_request_error` | Invalid request error. |
                | `authentication_error` | Authentication error. |
                | `permission_error` | Permission error. |
                | `conflict_error` | Conflict error. |
                | `rate_limit_error` | Rate limit error. |
                | `api_error` | Api error. |
                | `upstream_error` | Upstream error. |
            code:
              type: string
              description: Stable failure code. Use this value for programmatic handling.
            message:
              type: string
              description: Safe explanation of the failure.
            param:
              type: string
              nullable: true
              description: |-
                Invalid request field, or null when no field applies.

                <!-- polymorfa-input-table -->
                **Accepted alternatives**
                | Alternative | Accepted input |
                | --- | --- |
                | Alternative 1 | Type: `string` |
                | Alternative 2 | `null` |
            request_id:
              type: string
              description: >-
                Matches the X-Request-Id response header. Include it when you
                contact support.
            request_log_url:
              type: string
              format: uri
              description: >-
                Console page that shows this request. Returned only to
                organization and project credentials whose request was logged.


                <!-- polymorfa-input-table -->

                **Value constraints**

                | Constraint | Accepted input |

                | --- | --- |

                | Format | `uri` |
          description: Error details returned when the operation fails.
        data:
          type: string
          nullable: true
          enum:
            - null
          description: |-
            Always null for a failed request.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `null` | Null. |

            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | Alternative 2 | `null` |
        docs:
          type: string
          format: uri
          description: |-
            Documentation link to this failure code.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uri` |
    management__OperationCancellationConflictEnvelope:
      oneOf:
        - $ref: '#/components/schemas/management__OperationConflictEnvelope'
        - $ref: '#/components/schemas/management__IdempotencyConflictEnvelope'
    management__OperationCapabilities:
      type: object
      additionalProperties: false
      properties:
        cancellable:
          type: boolean
          description: Whether cancellable.
        watchable:
          type: boolean
          description: Whether watchable.
      required:
        - cancellable
        - watchable
    management__OperationProgress:
      type: object
      additionalProperties: false
      properties:
        code:
          type: string
          description: Stable machine-readable code for this result.
        current:
          type: integer
          nullable: true
          description: |-
            Specifies current for this management operation progress.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `integer` |
            | Alternative 2 | `null` |
        total:
          type: integer
          nullable: true
          description: |-
            Final total for this order or price summary.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `integer` |
            | Alternative 2 | `null` |
      required:
        - code
        - current
        - total
    management__JsonValue:
      nullable: true
      oneOf:
        - type: string
          nullable: true
          enum:
            - null
        - type: string
        - type: number
        - type: boolean
        - type: array
          items:
            $ref: '#/components/schemas/management__JsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/management__JsonValue'
    management__OperationError:
      type: object
      additionalProperties: false
      properties:
        code:
          type: string
          description: Stable machine-readable code for this result.
        retryable:
          type: boolean
          description: Whether retryable.
        details:
          type: object
          nullable: true
          additionalProperties:
            $ref: '#/components/schemas/management__JsonValue'
          description: |-
            Structured details values for this management operation error.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `object` |
            | Alternative 2 | `null` |
      required:
        - code
        - retryable
        - details
    management__OperationActionRequired:
      type: object
      additionalProperties: false
      properties:
        code:
          type: string
          description: Stable machine-readable code for this result.
        details:
          type: object
          nullable: true
          additionalProperties:
            $ref: '#/components/schemas/management__JsonValue'
          description: >-
            Structured details values for this management operation action
            required.


            <!-- polymorfa-input-table -->

            **Accepted alternatives**

            | Alternative | Accepted input |

            | --- | --- |

            | Alternative 1 | Type: `object` |

            | Alternative 2 | `null` |
      required:
        - code
        - details
    management__OperationConflictEnvelope:
      type: object
      additionalProperties: false
      properties:
        error:
          type: string
          enum:
            - operation_conflict
          description: |-
            Error details returned when the operation fails.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `operation_conflict` | Operation conflict. |
        code:
          type: string
          enum:
            - operation_conflict
          description: |-
            Stable machine-readable code for this result.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `operation_conflict` | Operation conflict. |
        operation:
          allOf:
            - $ref: '#/components/schemas/management__Operation'
          description: Specifies operation for this management operation conflict envelope.
      required:
        - error
        - code
        - operation
    management__IdempotencyConflictEnvelope:
      type: object
      additionalProperties: false
      properties:
        error:
          type: string
          enum:
            - idempotency_conflict
          description: |-
            Error details returned when the operation fails.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `idempotency_conflict` | Idempotency conflict. |
        code:
          type: string
          enum:
            - idempotency_conflict
          description: |-
            Stable machine-readable code for this result.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `idempotency_conflict` | Idempotency conflict. |
      required:
        - error
        - code
  responses:
    management__BadRequest:
      description: A path, query, or request-body value did not pass validation.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Unauthorized:
      description: Missing/invalid credential for this audience.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__Forbidden:
      description: Authenticated but lacks the required scope/role/audience.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__NotFound:
      description: >-
        The requested resource was not found inside the authenticated team or
        project scope.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/management__ErrorEnvelope'
    management__OperationCancellationConflict:
      description: >-
        The operation cannot accept cancellation, or the idempotency key was
        reused for a different request.
      headers:
        X-Request-Id:
          schema:
            type: string
          description: Stable request correlation identifier.
        Polymorfa-Version:
          schema:
            type: string
          description: API version applied to this response.
      content:
        application/json:
          schema:
            $ref: >-
              #/components/schemas/management__OperationCancellationConflictEnvelope
  securitySchemes:
    management__ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Send your team API key or project token as `Authorization: Bearer
        <token>`. The credential must have the required permissions. Project
        tokens can access only their own project.

````