Disapprove Task
Disapprove a task to remove it from AI model learning. When you disapprove a task, its data is removed from the training dataset to prevent the model from learning incorrect patterns.
Request
POST /v2/{team_id}/project/{project_id}/task/{task_id}/disapprove
Path Parameters
| Parameter | Type | Description |
|---|---|---|
team_id | string | Your team identifier |
project_id | string | Project identifier |
task_id | string | Task identifier |
Request Body
This endpoint does not require a request body.
Response
Returns the full public task object with approved: false.
{
"payload": {
"id": "task_abcdef123456",
"name": "Document Analysis Task",
"created_at": "2024-01-15T10:30:00Z",
"meta": [{ "name": "category", "value": "invoice" }],
"status": "COMPLETED",
"step_type": "EXTRACT",
"upload_id": "upl_123456789",
"project_id": "proj_123456",
"approved": false,
"exported_at": null,
"export_failed_at": null,
"last_opened_at": null,
"pages": [
{
"id": "page_1",
"width": 2480,
"height": 3508,
"annotations": [
{
"id": "ann_1",
"entity_id": "total_amount",
"confidence": 0.98,
"content": "$1,234.56",
"top": 120.5,
"left_of_line": 340.0
}
],
"checkboxes": [
{
"id": "cb_1",
"confidence": 0.92,
"checked": true,
"coordinates": [
[100, 100],
[120, 100],
[120, 120],
[100, 120]
]
}
],
"segments": [
{
"id": "seg_1",
"confidence": 0.87,
"coordinates": [
[50, 50],
[400, 50],
[400, 200],
[50, 200]
]
}
],
"signatures": [
{
"id": "sig_1",
"confidence": 0.83,
"coordinates": [
[800, 600],
[1100, 600],
[1100, 750],
[800, 750]
]
}
]
}
]
}
}
Example Request
- cURL
- TypeScript
- Python
curl -X POST \
'https://api.send.ai/v2/team_123456/project/proj_123456/task/task_abcdef123456/disapprove' \
-H 'Authorization: Bearer YOUR_API_KEY'
const disapproveTask = async (
teamId: string,
projectId: string,
taskId: string
): Promise<any> => {
const response = await fetch(
`https://api.send.ai/v2/${teamId}/project/${projectId}/task/${taskId}/disapprove`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
if (!response.ok) {
throw new Error(`Failed to disapprove task: ${response.status} ${response.statusText}`);
}
return response.json();
};
// Example usage
disapproveTask('team_123456', 'proj_123456', 'task_abcdef123456')
.then(result => console.log(result))
.catch(error => console.error(error));
import requests
def disapprove_task(team_id, project_id, task_id):
url = f'https://api.send.ai/v2/{team_id}/project/{project_id}/task/{task_id}/disapprove'
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(url, headers=headers)
response.raise_for_status()
return response.json()
# Example usage
result = disapprove_task('team_123456', 'proj_123456', 'task_abcdef123456')
print(result)
Business Logic
Validation Rules
- Processing State: Tasks cannot be disapproved while in
PROCESSINGstate - Already Disapproved: Cannot disapprove a task that is already disapproved
- All Other States: Tasks can be disapproved in any state except
PROCESSING
What Happens When You Disapprove
- Task Update: The task's
approvedfield is set tofalse - AI Unlearning: The task data is removed from the training dataset
- Audit Trail: Approval timestamp and approver are cleared
- Lifecycle Event: A
task_de_approvedevent is published for tracking
Use Cases
- Poor Quality: Remove low-quality extractions from model training
- Incorrect Data: Flag incorrectly processed tasks to prevent model degradation
- Edge Cases: Remove unusual examples that might confuse the model
- Data Correction: After identifying errors, disapprove to prevent the model from learning mistakes
Error Handling
| Status Code | Error | Description |
|---|---|---|
400 | Bad Request | Task is already disapproved |
400 | Bad Request | Task cannot be disapproved while being processed |
404 | Not Found | Task not found |
401 | Unauthorized | Invalid or missing API key |
Related Operations
- Approve Task - Mark task for model learning
- Get Task - Check current approval status
- Complete Task - Complete task processing