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

# Delete Batch

> Permanently remove a batch after exporting its data.

## Overview

Once you have exported or archived call outcomes, delete the batch to keep your workspace tidy and prevent accidental reactivation. Deleting is irreversible and removes the batch record from analytics views.

## Prerequisites

* Bearer token for an administrator.
* Confirm no audits or dispute processes require the batch history.

## Request

<ParamField path="batchId" type="string" required>
  Identifier of the batch to delete.
</ParamField>

<ParamField header="Authorization" type="string" required>
  Bearer token authorised for Calling Management.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request DELETE '{{baseUrl}}/api/call/delete-batch/6880bac05860c9b91c53c790' \
    --header 'Authorization: Bearer {{authToken}}'
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "message": "Batch deleted"
  }
  ```
</ResponseExample>

<ResponseField name="message" type="string">
  Confirms the deletion. Use it to log audit trails.
</ResponseField>

## Error Handling

* **400 Bad Request** – Invalid `batchId` supplied.
* **401 Unauthorized** – Bearer token missing or expired.
* **404 Not Found** – Batch already deleted or does not belong to the workspace.
* **500 Internal Server Error** – Deletion failed; retry, then escalate with the batch id.

<Warning>
  This operation cannot be undone. Export call data with `GET /api/call/export/csv` before removing the batch.
</Warning>


## OpenAPI

````yaml DELETE /api/call/delete-batch/{batchId}
openapi: 3.1.0
info:
  title: Weya AI Public API
  description: >-
    Public API documentation for Weya AI platform - Call Management and DNC (Do
    Not Call) APIs
  version: 1.0.0
servers:
  - url: >-
      https://nexusdev-wjs-api-dev.mangoforest-291de162.swedencentral.azurecontainerapps.io
    description: Development server
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /api/call/delete-batch/{batchId}:
    delete:
      tags:
        - Call Management
      summary: Delete batch
      description: Permanently remove a batch after exporting its data
      parameters:
        - in: path
          name: batchId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Batch deleted
        '400':
          description: Invalid batchId
        '401':
          description: Unauthorized
        '404':
          description: Batch not found
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication for workspace access
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key used for programmatic calling integrations. Find it under
        Settings → API access in your workspace.

````