Report Task
Report an issue with a task, flagging it for review or correction.
Endpoint
POST /v2/{team_id}/project/{project_id}/task/{task_id}/report
Authentication
This endpoint requires an API key with the task.edit scope.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
team_id | String | Yes | The ID of the team |
project_id | String | Yes | The ID of the project |
task_id | String | Yes | The ID of the task to report |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
issues | Issue[] | Yes | List of issue objects describing problems |
message | String | No | Optional free-text description |
Issue Object
| Field | Type | Required | Description |
|---|---|---|---|
| label | String | Yes | Human-readable issue label |
| value | String | Yes | Machine-readable issue code |
Example Request
- cURL
- TypeScript
- Python
curl -X POST \
'https://api.send.ai/v2/team_123456/project/proj_123456/task/task_abcdef123456/report' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"message": "The document is blurry and text cannot be read clearly.",
"issues": [{"label": "Poor Document Quality", "value": "poor_quality"}]
}'
type Issue = { label: string; value: string };
const reportTask = async (
teamId: string,
projectId: string,
taskId: string,
body: { message?: string; issues: Issue[] }
): Promise<any> => {
const response = await fetch(
`https://api.send.ai/v2/${teamId}/project/${projectId}/task/${taskId}/report`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
}
);
if (!response.ok && response.status !== 207) {
throw new Error(`Failed to report task: ${response.status} ${response.statusText}`);
}
return response.json();
};
// Example usage
reportTask('team_123456', 'proj_123456', 'task_abcdef123456', {
message: 'The document is blurry and text cannot be read clearly.',
issues: [{ label: 'Poor Document Quality', value: 'poor_quality' }]
})
.then(result => console.log(result))
.catch(error => console.error(error));
import requests
def report_task(team_id, project_id, task_id, issues, message=None):
url = f'https://api.send.ai/v2/{team_id}/project/{project_id}/task/{task_id}/report'
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
payload = {
'issues': issues,
'message': message
}
response = requests.post(url, headers=headers, json=payload)
# 207 indicates partial success when external export fails
if response.status_code not in [200, 201, 207]:
response.raise_for_status()
return response.json()
# Example usage
result = report_task(
'team_123456',
'proj_123456',
'task_abcdef123456',
issues=[
{
'label': 'Poor Document Quality',
'value': 'poor_quality'
}
],
message='The document is blurry and text cannot be read clearly.'
)
print(result)
Response
Returns the updated task (full public task object) and any error information:
{
"payload": {
"id": "task_abcdef123456",
"name": "Document Analysis Task",
"created_at": "2024-01-15T10:30:00Z",
"meta": [{ "name": "category", "value": "invoice" }],
"status": "REVIEWING",
"step_type": "EXTRACT",
"upload_id": "upl_123456789",
"project_id": "proj_123456",
"approved": false,
"exported_at": null,
"export_failed_at": null,
"last_opened_at": "2024-01-15T12:45:00Z",
"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]
]
}
]
}
]
},
"error": null
}
Common Issue Types
Here are some example issue types you might use:
| Label | Value | Description |
|---|---|---|
| "Poor Document Quality" | "poor_quality" | Document is blurry, skewed, or illegible |
| "Wrong Document Type" | "wrong_type" | Document doesn't match expected format |
| "Missing Information" | "missing_info" | Required fields are not present |
| "Processing Error" | "processing_error" | Technical issue during processing |
| "Data Validation Failed" | "validation_failed" | Extracted data doesn't pass validation |
Important Notes
- The issues array must contain at least one issue object
- The report will be logged and may trigger notifications or workflows
- Reporting a task doesn't change its processing status
- Reports can include both predefined issue types and custom messages
- The task remains available for further processing or correction
Error Responses
400 Bad Request- Invalid request body or missing required fields404 Not Found- Task not found or API key doesn't have access401 Unauthorized- Invalid or missing API key207 Multi-Status- Report was processed but external API call failed