Skip to main content

Approve Task

Approve a task to flag it for AI model learning. When you approve a task, its data becomes part of the training dataset to improve future predictions.

Request​

POST /v2/{team_id}/project/{project_id}/task/{task_id}/approve

Path Parameters​

ParameterTypeDescription
team_idstringYour team identifier
project_idstringProject identifier
task_idstringTask identifier

Request Body​

This endpoint does not require a request body.

Response​

Returns the full public task object with approved: true.

{
"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": true,
"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 -X POST \
'https://api.send.ai/v2/team_123456/project/proj_123456/task/task_abcdef123456/approve' \
-H 'Authorization: Bearer YOUR_API_KEY'

Business Logic​

Validation Rules​

  • Processing State: Tasks cannot be approved while in PROCESSING state
  • Already Approved: Cannot approve a task that is already approved
  • All Other States: Tasks can be approved in any state except PROCESSING

What Happens When You Approve​

  1. Task Update: The task's approved field is set to true
  2. AI Learning: The task data is added to the training dataset for model improvement
  3. Audit Trail: Approval timestamp and API key are recorded
  4. Lifecycle Event: A task_approved event is published for tracking

Use Cases​

  • Quality Validation: Mark high-quality extractions for model training
  • Edge Cases: Flag unusual but correct examples to improve model coverage
  • Corrections: After manually correcting a task, approve it to teach the model
  • Post-Processing: Approve tasks even after export to continue improving the model

Error Handling​

Status CodeErrorDescription
400Bad RequestTask is already approved
400Bad RequestTask cannot be approved while being processed
404Not FoundTask not found
401UnauthorizedInvalid or missing API key