4.1 Delete classification

DELETE /documentClassification/deleteClassification

This endpoint permanently deletes an entire document classification process, including all associated batches, results, and uploaded files.

You must provide only the classificationId in the request body. This action is irreversible and removes all data linked to the specified classification.

Use this endpoint when you intend to fully decommission a classification and all its related content. Separate endpoints are available for deleting individual batches or 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.

Body Example

{
    "classificationId": "classificationId"
}

Code Example

const axios = require('axios');

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

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

        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';

    try {
        const response = await deleteClassification(token, classificationId);
        console.log("Classification Deleted:", response);
    } catch (error) {
        console.error("Failed to delete classification:", error);
    }
}

main();

Responses

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

Last updated

Was this helpful?