Get Task
Retrieve details for a specific task.
Endpoint
GET /v2/{team_id}/project/{project_id}/task/{task_id}
Authentication
This endpoint requires an API key with the task.read 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 get |
Example Request
- cURL
- TypeScript
- Python
curl -X GET \
'https://api.send.ai/v2/team_123456/project/proj_123456/task/task_abcdef123456' \
-H 'Authorization: Bearer YOUR_API_KEY'
const getTask = async (
teamId: string,
projectId: string,
taskId: string
): Promise<any> => {
const response = await fetch(
`https://api.send.ai/v2/${teamId}/project/${projectId}/task/${taskId}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
if (!response.ok) {
throw new Error(`Failed to get task: ${response.status} ${response.statusText}`);
}
return response.json();
};
// Example usage
getTask('team_123456', 'proj_123456', 'task_abcdef123456')
.then(result => console.log(result))
.catch(error => console.error(error));
import requests
def get_task(team_id, project_id, task_id):
url = f'https://api.send.ai/v2/{team_id}/project/{project_id}/task/{task_id}'
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
response.raise_for_status() # Raise exception for 4XX/5XX responses
return response.json()
# Example usage
result = get_task('team_123456', 'proj_123456', 'task_abcdef123456')
print(result)
Response
The response includes the full public task object.
{
"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-15T11: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]
]
}
]
}
]
}
}
Response Fields
Top-level fields:
| Field | Type | Description |
|---|---|---|
id | String | Unique task identifier |
name | String | Task name |
created_at | String (ISO 8601) | Task creation timestamp |
meta | Array | Metadata key-value pairs |
status | String | Task processing status |
step_type | String | Type of processing step |
upload_id | String | Associated upload ID |
project_id | String | Associated project ID |
approved | Boolean | Whether task has been approved |
exported_at | String/null | Export timestamp (if exported) |
export_failed_at | String/null | Export failure timestamp (if failed) |
last_opened_at | String/null | Last time task was opened |
pages | Array<Page> | Per-page data and extracted items |
Page object
| Field | Type | Description |
|---|---|---|
id | String | Page identifier |
width | Number/null | Page width in pixels (if known) |
height | Number/null | Page height in pixels (if known) |
annotations | Array<Annotation> | Extracted field-level annotations |
checkboxes | Array<Checkbox> | Detected checkboxes |
segments | Array<Segment> | Detected page segments |
signatures | Array<Signature> | Detected signatures |
Annotation
| Field | Type | Description |
|---|---|---|
id | String | Annotation identifier |
entity_id | String | Associated entity/field identifier |
confidence | Number | Confidence score |
content | String | Extracted text content |
top | Number/null | Vertical offset from top of page (if available) |
left_of_line | Number/null | Horizontal offset relative to text line (if any) |
Checkbox
| Field | Type | Description |
|---|---|---|
id | String | Checkbox identifier |
confidence | Number | Detection confidence |
checked | Boolean | Whether the checkbox is checked |
coordinates | Coordinates | Bounding polygon: [[x1,y1],[x2,y2],[x3,y3],[x4,y4]] |
Segment
| Field | Type | Description |
|---|---|---|
id | String | Segment identifier |
confidence | Number | Detection confidence |
coordinates | Coordinates | Bounding polygon: [[x1,y1],[x2,y2],[x3,y3],[x4,y4]] |
Signature
| Field | Type | Description |
|---|---|---|
id | String | Signature identifier |
confidence | Number | Detection confidence |
coordinates | Coordinates | Bounding polygon: [[x1,y1],[x2,y2],[x3,y3],[x4,y4]] |
Coordinates are returned as an array of four points defining a rectangle, in clockwise order starting from the top-left.
Status Values
PROCESSING- Task is being processedREVIEWING- Task is ready for reviewCOMPLETED- Task has been completedFAILED- Task processing failedDISCARDED- Task has been discardedFILTERED- Task was filtered out
Step Types
EXTRACT- Data extraction stepCLASSIFY- Classification stepSEGMENT- Segmentation stepGROUP- Grouping step