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

# Cancel Prior Authorization

> Cancel a prior authorization request.

The request must not already be in a terminal state (`completed`, `failed`,
or `cancelled`). Requires a `cancellation_reason` payload which is stored
for analytics.

## Overview

Cancel an in-progress prior authorization request.

This endpoint returns an error response if the prior authorization is already in a terminal state (e.g. completed, cancelled).


## OpenAPI

````yaml post /prior-authorization/{id}/cancel
openapi: 3.1.0
info:
  title: Develop Health Public API
  description: Develop Health Public API
  version: '1.0'
servers:
  - url: https://api.develophealth.ai
security: []
paths:
  /prior-authorization/{id}/cancel:
    post:
      tags:
        - public-api
        - public-api
      summary: Cancel Prior Auth Submission By Id
      description: >-
        Cancel a prior authorization request.


        The request must not already be in a terminal state (`completed`,
        `failed`,

        or `cancelled`). Requires a `cancellation_reason` payload which is
        stored

        for analytics.
      operationId: cancel_prior_auth_submission_by_id_prior_authorization__id__cancel_post
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: Request Data
              allOf:
                - $ref: '#/components/schemas/CancelPriorAuthRequest'
      responses:
        '200':
          description: Successfully cancelled a prior authorization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelPriorAuthResponse'
              example:
                status: success
        '400':
          content:
            application/json:
              example:
                detail: >-
                  Cannot cancel a prior authorization request with status:
                  COMPLETED
          description: >-
            Cannot cancel a prior authorization in completed, failed, or
            cancelled state
        '404':
          content:
            application/json:
              example:
                detail: Prior Authorization Request does not exist.
          description: Prior Authorization Request does not exist
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - FronteggJWTAuthentication: []
components:
  schemas:
    CancelPriorAuthRequest:
      properties:
        cancellation_reason:
          type: string
          minLength: 1
          title: Cancellation Reason
          description: Reason for cancellation. This is used for analytics purposes.
      type: object
      required:
        - cancellation_reason
      title: CancelPriorAuthRequest
      description: Request to cancel a prior authorization.
    CancelPriorAuthResponse:
      properties:
        status:
          anyOf:
            - type: string
              enum:
                - success
            - type: string
              enum:
                - error
          title: Status
          default: success
        error:
          $ref: '#/components/schemas/ApiError'
        data:
          type: 'null'
          title: Data
      type: object
      title: CancelPriorAuthResponse
      description: >-
        Represents the response structure for a POST
        /prior-authorization/:id/cancellation request.


        This response is returned when a prior authorization is successfully
        cancelled.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ApiError:
      properties:
        title:
          type: string
          title: Title
        description:
          type: string
          title: Description
        code:
          type: string
          title: Code
      type: object
      required:
        - title
        - description
        - code
      title: ApiError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    FronteggJWTAuthentication:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````