Skip to main content

Task Object

The Task Object represents a single batch operation request. Each task defines what operation will be executed (POST, PATCH, or DELETE), which objects are affected, and how they should be updated.

Task execution and results are tracked through the task status attribute and operation counters (processed, success, failure, and total).

Task Object Attributes

These fields and values make up the JSON object that gets returned with successful requests.

AttributeData TypeDescription
dataarray of objects

The payload containing data for bulk creation or modification. Must be empty for DELETE operations.

date_created
read only
string

The date and time when the batch task was created.

date_modified
read only
string

The date and time when the batch task was modified.

entriesarray

List of existing record identifiers to be modified or deleted. This is based on field. Must be empty for POST requests.

failure
read only
integer

Number of failed operations within the batch.

fieldstring

The field used to locate the existing entries during PATCH and DELETE operations. Must be empty for POST.

methodstring

The HTTP method applied to the batch request, either POST, PATCH, or DELETE.

partner_sid
read only
string

The secure ID of the partner associated with the batch task.

processed
read only
integer

Number of operations already processed in the batch task.

reviewboolean

Indicates whether this task requires manual reviewing before execution.

statusstring

Current execution status of the batch task. Refer to the table below for a comprehensive list of statuses.

success
read only
integer

Number of successfully executed operations.

task_sid
read only
string

The task secure ID.

total
read only
integer

Total number of operations queued in the batch.

typestring

The type of task, either phonenumber, prefix or file.

status

ValueDescription
approvedThe task has been approved and will execute.
cancelledThe task has been cancelled and will not execute.
completedThe task is completed.
createdThe batch of objects has been created.
pending_reviewThe task is pending review and has not been executed.
queuedThe task is in queue.
runningThe task is currently running.

Sample Task object

{
"data": {
"trunk_group_sid": "b30a3dbb-3708-41f0-a9ca-5cf365dcc4d4"
},
"date_created": "2024-10-30T20:47:32.517Z",
"date_modified": "2024-10-30T20:47:32.517Z",
"entries": [
"18053355112",
"18053355280"
],
"error_details": [],
"failure": null,
"field": "phonenumber",
"method": "PATCH",
"partner_sid": "923840ce-0b63-44a9-b4ce-09dc4181fb9d",
"processed": null,
"review": true,
"status": "created",
"success": null,
"task_sid": "2d9e546e-634b-4f6b-97ca-c2158163540c",
"total": null,
"type": "phonenumber"
}