4.2 Delete batch

DELETE /documentClassification/deleteBatch

This endpoint permanently deletes a specific batch from a document classification process.

You must provide both the classificationId and the batchId in the request body. This action is irreversible and will remove the selected batch along with all results and files associated with it.

Use this endpoint when you need to clean up or remove a specific batch without affecting the overall classification. Separate endpoints are available for deleting entire classifications or individual files.

Server URL

https://api.extracta.ai/api/v1

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Required
Description

classificationId

string

true

The classification id.

batchId

string

true

The batch id.

Body Example

{
    "classificationId": "classificationId",
    "batchId": "batchId"
}

Code Example

const axios = require('axios');

async function deleteBatch(token, classificationId, batchId) {
    const url = "https://api.extracta.ai/api/v1/documentClassification/deleteBatch";

    try {
        const response = await axios.delete(url, {
            headers: {
                'Content-Type': 'application/json',
                'Authorization': `Bearer ${token}`
            },
            data: {
                classificationId: classificationId,
                batchId: batchId
            }
        });

        return response.data;
    } catch (error) {
        throw error.response ? error.response.data : new Error('An unknown error occurred');
    }
}

async function main() {
    const token = 'apiKey';
    const classificationId = 'classificationId';
    const batchId = 'batchId';

    try {
        const response = await deleteBatch(token, classificationId, batchId);
        console.log("Batch Deleted:", response);
    } catch (error) {
        console.error("Failed to delete batch:", error);
    }
}

main();

Responses

{
    "status": "success",
    "message": "Batch deleted"
}

Last updated

Was this helpful?