> ## 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.

# Retract ban safe incident

> Withdraws a customer report and returns its incident record. Repeating the request returns the closed record. An incident observed from WhatsApp cannot be withdrawn and returns `409 bansafe_incident_not_a_report`. An unknown incident returns 404.

Requires a team API key with `sessions:manage`. Project tokens are not accepted.



## OpenAPI

````yaml api-reference/features/operate.json POST /platform/bansafe/incidents/{incidentId}/retract
openapi: 3.0.3
info:
  title: Operate API methods
  version: 1.0.0
  description: Task-focused operate methods across supported Polymorfa connection types.
servers: []
security: []
paths:
  /platform/bansafe/incidents/{incidentId}/retract:
    post:
      tags:
        - Bansafe
      summary: Retract ban safe incident
      description: >-
        Withdraws a customer report and returns its incident record. Repeating
        the request returns the closed record. An incident observed from
        WhatsApp cannot be withdrawn and returns `409
        bansafe_incident_not_a_report`. An unknown incident returns 404.


        Requires a team API key with `sessions:manage`. Project tokens are not
        accepted.
      operationId: managementRetractBanSafeIncident
      parameters:
        - name: incidentId
          in: path
          required: true
          schema:
            type: string
          description: Identifier for the incident.
      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__BanSafeIncident'
                    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__Conflict'
      security:
        - management__ApiKeyAuth: []
      servers:
        - url: https://api.polymorfa.com
        - url: http://localhost:8080
          description: local dev
components:
  schemas:
    management__BanSafeIncident:
      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` |
        sessionId:
          type: string
          format: uuid
          description: |-
            Identifier of the connected Polymorfa session.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        session:
          type: string
          description: Identifier of the connected Polymorfa session.
        phoneNumber:
          type: string
          description: Phone number in international format.
        projectId:
          type: string
          format: uuid
          description: |-
            Identifier of the Polymorfa project that owns this resource.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        kind:
          type: string
          enum:
            - cap_warning
            - cap_reached
            - timelock
            - temporary_ban
            - permanent_ban
            - connect_blocked
            - customer_report
          description: |-
            Kind discriminator for this object.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `cap_warning` | Cap warning. |
            | `cap_reached` | Cap reached. |
            | `timelock` | Timelock. |
            | `temporary_ban` | Temporary ban. |
            | `permanent_ban` | Permanent ban. |
            | `connect_blocked` | Connect blocked. |
            | `customer_report` | Customer report. |
        source:
          type: string
          enum:
            - runtime
            - customer
          description: |-
            Specifies source for this management ban safe incident.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `runtime` | Runtime. |
            | `customer` | Customer. |
        resolution:
          type: string
          description: Specifies resolution for this management ban safe incident.
        ambiguous:
          type: boolean
          description: Whether ambiguous.
        startedAt:
          type: string
          format: date-time
          description: |-
            Timestamp for started at.

            <!-- polymorfa-input-table -->
            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `date-time` |
        endsAt:
          type: string
          format: date-time
          nullable: true
          description: |-
            Timestamp for ends at.

            <!-- 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` |
        closedAt:
          type: string
          format: date-time
          nullable: true
          description: |-
            Timestamp for closed at.

            <!-- 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` |
        closedBy:
          type: string
          nullable: true
          description: |-
            Specifies closed by for this management ban safe incident.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | Alternative 2 | `null` |
        claimId:
          type: string
          format: uuid
          nullable: true
          description: |-
            Identifier for the claim.

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

            **Value constraints**
            | Constraint | Accepted input |
            | --- | --- |
            | Format | `uuid` |
        note:
          type: string
          nullable: true
          maxLength: 500
          description: >-
            Specifies note for this management ban safe incident.


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

            **Accepted alternatives**

            | Alternative | Accepted input |

            | --- | --- |

            | Alternative 1 | Type: `string`; String length: At most `500`
            characters |

            | Alternative 2 | `null` |


            **Value constraints**

            | Constraint | Accepted input |

            | --- | --- |

            | String length | At most `500` characters |
        reportedBy:
          type: string
          nullable: true
          description: |-
            Specifies reported by for this management ban safe incident.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Type: `string` |
            | 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` |
      required:
        - id
        - sessionId
        - session
        - phoneNumber
        - projectId
        - kind
        - source
        - resolution
        - ambiguous
        - startedAt
        - endsAt
        - note
        - reportedBy
        - createdAt
        - closedAt
        - closedBy
        - claimId
    management__ErrorEnvelope:
      type: object
      required:
        - error
        - data
        - docs
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - param
          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` |
          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` |
  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
        organization 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__Conflict:
      description: The request conflicts with the resource's current state.
      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'
  securitySchemes:
    management__ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Polymorfa server credential: a scoped pmfa_ organization key, or a
        pmfa_pt_ project token on project- and session-bound operations inside
        its exact authenticated project. Keys may be personal or service-account
        owned. Both enforce selected action scopes; organization keys can
        address team resources and every project in the organization. Listener
        and browser client credentials are rejected.

````