---
title: "Cancel Instruction"
url: "https://developer.pexa.co.uk/apis/instruction-v1-v1/versions/861f183b-600d-4bbf-9762-abebcbf9b5ac/operations/cancelInstruction"
---

> Full API specification: https://developer.pexa.co.uk/apis/instruction-v1-v1/versions/861f183b-600d-4bbf-9762-abebcbf9b5ac.md

# Cancel Instruction

`DELETE` `/partner/api/platformconnect/v1/instructions/{instruction_id}`

Operation ID: `cancelInstruction`

This endpoint enables a lender to cancel an existing case instruction with either the panel management firm or the allocated law firm.

## Path parameters

- `instruction_id` (string, required) - The unique identifier for the instruction to be cancelled

## Header parameters

- `X-Request-Correlation-Id` (string, optional) - The unique identifier for the request

## Request body (required)

Content types: `application/json`

## Responses

- `204` - No Content
- `400` - BAD REQUEST
- `401` - UNAUTHORISED
- `403` - FORBIDDEN
- `404` - NOT FOUND
- `500` - INTERNAL SERVER ERROR
- `503` - SERVICE UNAVAILABLE

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Lender Instruction
  version: v1
servers:
  - url: https://api.pexa.co.uk
    description: API Gateway URL
paths:
  /partner/api/platformconnect/v1/instructions/{instruction_id}:
    delete:
      tags:
        - InstructionV1
      summary: Cancel Instruction
      description: This endpoint enables a lender to cancel an existing case
        instruction with either the panel management firm or the allocated law
        firm.
      operationId: cancelInstruction
      security:
        - oauth2:
            - x-api:cancel:instructions
      parameters:
        - name: X-Request-Correlation-Id
          in: header
          description: The unique identifier for the request
          required: false
          schema:
            type: string
        - name: instruction_id
          in: path
          description: The unique identifier for the instruction to be cancelled
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - cancellationReason
              properties:
                cancellationReason:
                  type: string
                  pattern: ^(OTHER)$
                  example: OTHER
                  description: |
                    Reason for cancelling the instruction.

                    Allowed values:
                      [`OTHER`]
                cancellationNotesForOther:
                  maxLength: 100
                  minLength: 1
                  type: string
                  example: Incorrect details provided
                  description: Mandatory when cancellationReason "OTHER" is provided
            examples:
              cancelInstructionRequest:
                summary: Cancel instruction with reason
                value:
                  cancellationReason: OTHER
                  cancellationNotesForOther: Incorrect details provided
        required: true
      responses:
        "204":
          description: No Content
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
        "400":
          description: BAD REQUEST
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field
                        message:
                          type: string
                          description: Error message
              example:
                errors:
                  - field: instruction_id
                    message: incorrect data type
        "401":
          description: UNAUTHORISED
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field
                        message:
                          type: string
                          description: Error message
              example:
                errors:
                  - message: Unauthorised
        "403":
          description: FORBIDDEN
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field
                        message:
                          type: string
                          description: Error message
              example:
                errors:
                  - message: forbidden
        "404":
          description: NOT FOUND
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field
                        message:
                          type: string
                          description: Error message
              example:
                errors:
                  - message: Not found
        "500":
          description: INTERNAL SERVER ERROR
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field
                        message:
                          type: string
                          description: Error message
              example:
                errors:
                  - message: Internal Server Error
        "503":
          description: SERVICE UNAVAILABLE
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field
                        message:
                          type: string
                          description: Error message
              example:
                errors:
                  - message: Service under maintenance
security:
  - oauth2:
      - x-api:cancel:instructions
components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://login.pexauk.co.uk/oauth/token
          scopes:
            x-api:create:instructions: Create instructions
            x-api:edit:instructions: Update instructions
            x-api:cancel:instructions: Cancel instructions
```
