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

# Delete Order

> Cancels or soft-deletes a verification order

# Delete Background Check Order

Cancels or soft-deletes a verification order and all associated searches.

## Request

<ParamField path="id" type="string" required>
  Unique identifier of the verification order to delete (UUID format)
</ParamField>

## Response

Cancellation is **best-effort**: the order and its searches are moved to a cancelled state and outstanding outbound work is cancelled.

<ResponseField name="success" type="boolean">
  `true` when cancellation succeeded.
</ResponseField>

<ResponseField name="orderId" type="string">
  Identifier of the cancelled verification order (UUID).
</ResponseField>

<ResponseField name="status" type="string">
  Resulting status. `CANCELLED` on success.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable confirmation message.
</ResponseField>

<Note>
  If the order does not exist, the response is `{ "error": "Order not found", "orderId": "<id>" }`. If cancellation fails, the response is `{ "error": "<reason>", "orderId": "<id>" }`.
</Note>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -sS -X DELETE "https://sandbox.theary.ai/background-check/v1/orders/550e8400-e29b-41d4-a716-446655440000" \
    -H "Authorization: Bearer YOUR_JWT_TOKEN" \
    -H "Accept: application/json"
  ```

  ```javascript JavaScript theme={null}
  const orderId = '550e8400-e29b-41d4-a716-446655440000'
  const response = await fetch(`/background-check/v1/orders/${orderId}`, {
    method: 'DELETE',
    headers: {
      Authorization: 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json',
    },
  })

  const result = await response.json()
  ```

  ```python Python theme={null}
  import requests

  order_id = "550e8400-e29b-41d4-a716-446655440000"
  headers = {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
  }

  response = requests.delete(
      f'https://sandbox.theary.ai/background-check/v1/orders/{order_id}',
      headers=headers
  )

  result = response.json()
  ```
</CodeGroup>

## Example Response

```json theme={null}
{
  "success": true,
  "orderId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "CANCELLED",
  "message": "Order and associated searches cancelled successfully"
}
```

### Order not found

```json theme={null}
{
  "error": "Order not found",
  "orderId": "550e8400-e29b-41d4-a716-446655440000"
}
```


## OpenAPI

````yaml DELETE /background-check/v1/orders/{id}
openapi: 3.0.0
info:
  title: SNH AI Background Check API
  description: >-
    AI-powered agentic background verification service for employment and
    education checks.
  version: '1.0'
  contact: {}
servers:
  - url: https://sandbox.theary.ai
    description: Sandbox
  - url: https://api.theary.ai
    description: Production
  - url: http://localhost:3000
    description: Local development
security:
  - bearerAuth: []
tags: []
paths:
  /background-check/v1/orders/{id}:
    delete:
      tags:
        - Background Check Orders
      summary: Cancel/delete verification order
      description: Cancels a verification order and its associated searches (best-effort)
      operationId: delete-order
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Order cancelled successfully
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Missing or invalid Bearer JWT
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
          description: HTTP status code
          example: 400
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          description: Error message or array of validation error messages
          example: Validation failed
        error:
          type: string
          description: HTTP status text
          example: Bad Request
      required:
        - statusCode
        - message
      title: Error Response
  securitySchemes:
    bearerAuth:
      scheme: bearer
      bearerFormat: JWT
      type: http

````