Skip to content

Get task

Endpoint

GET /organizations/{org_id}/tasks/{task_id}

This endpoint retrieves the full details for a single task (either a one-off task or a task within a process run) identified by its unique ID.

Request

Replace {org_id} with your Organization ID and {task_id} with the specific ID of the task you want to retrieve.

Headers

  • Authorization: Bearer {your_access_token}
  • Accept: application/json
  • X-Tallyfy-Client: APIClient

Query Parameters (Optional)

  • with (string): Include related data. For tasks, common options might include run, step, threads, assets, form_fields, tags, summary. Example: with=run,step,form_fields.

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const taskId = 'TASK_ID_TO_GET'; // ID of the task
const queryParams = '?with=run,step,form_fields'; // Example: get related info
const apiUrl = `https://api.tallyfy.com/organizations/${orgId}/tasks/${taskId}${queryParams}`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, {
method: 'GET',
headers: headers
})
.then(response => {
if (!response.ok) {
// Error handling...
return response.json().then(errData => { throw new Error(/*...*/); }).catch(() => { throw new Error(/*...*/); });
}
return response.json();
})
.then(data => {
console.log(`Successfully retrieved task ${taskId}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error getting task ${taskId}:`, error);
});

Response

A successful request returns a 200 OK status code and a JSON object containing a data field. The value of data is an object representing the requested task with its full details.

{
"data": {
"id": "TASK_ID_TO_GET",
"increment_id": 1205,
"title": "Review Proposal",
"summary": "Review the proposal document attached.",
"run_id": "run_id_xyz",
"step_id": "step_id_123",
"status": "active",
"task_type": "member", // or "guest"
"owners": { ... },
"deadline": "2024-05-25T17:00:00Z",
"created_at": "2024-05-20T10:00:00Z",
"last_updated": "2024-05-21T11:00:00Z",
"position": 1,
// ... other task properties ...
// Included if requested with 'with=form_fields':
"form_fields": [
{
"id": "capture_id_abc",
"label": "Approval Status",
"field_type": "dropdown",
"value": { "id": 1, "text": "Approved", "value": null }, // Value depends on field type
"required": true
// ... other form field details ...
}
],
// Included if requested with 'with=run':
"run": { ... process run details ... },
// Included if requested with 'with=step':
"step": { ... template step details ... }
}
}

If the task ID is not found or you don’t have permission, you will likely receive a 404 Not Found or 403 Forbidden error.