Discard a task
Discarding a task takes a document out of processing, like Discard in the app.
POST https://api.send.ai/v2/{team_id}/project/{project_id}/task/{task_id}/discard
Scope: Tasks › Edit.
Request
The request has no body.
curl -X POST "https://api.send.ai/v2/tK3vQ9xLm2Rf8WbN0aZp/project/p3irz/task/task_Zp4Rk2Wn8Qx1Lc7Vb3M/discard" \
-H "Authorization: Bearer $SENDAI_API_KEY"
What discarding does
The document gets the status DISCARDED and runs no actions. The upload goes on without it: once every other document is done, the upload moves to Processed, even when all its documents were discarded. When the File filter had let the file through and a person was asked to look at it, discarding it also teaches the filter that such files need no processing.
Discarding sends the TASK_DISCARDED notification. To report a problem without discarding, see Report a task.
Response
The answer holds the task, in the same shape as Get a task.
Errors
The answer is an error when the task does not exist. See Errors.