Update Task
This request updates a batch task, targeted by secure ID.
patch | /batch/tasks/{task_sid} |
put | /batch/tasks/{task_sid} |
Sample
A sample PATCH request to update the Task object, targeted by secure ID, with the values in the request body:
curl -X PATCH \
'https://api.carrierx.com/core/v2/batch/tasks/2d9e546e-634b-4f6b-97ca-c2158163540c' \
-H 'Content-Type: application/json' \
--data-binary '{"status":"approved"}'\
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'
Response
200
status code with a serialized copy of the updated Task object:
{
"data": {
"trunk_group_sid": "b30a3dbb-3708-41f0-a9ca-5cf365dcc4d4"
},
"date_created": "2024-10-30T20:47:32.000Z",
"date_modified": "2024-10-30T20:51:23.189Z",
"entries": [
"18053355112",
"18053355280"
],
"error_details": [],
"failure": 0,
"field": "phonenumber",
"method": "PATCH",
"partner_sid": "923840ce-0b63-44a9-b4ce-09dc4181fb9d",
"processed": 0,
"review": true,
"status": "approved",
"success": 0,
"task_sid": "2d9e546e-634b-4f6b-97ca-c2158163540c",
"total": 2,
"type": "phonenumber"
}
A Task object can be updated using either a PATCH
or PUT
request.
-
A
PATCH
request can be used to update one or more attribute values. When using aPATCH
request, only the attributes specified in the request payload will be updated, all other attributes and values will remain the same. The task secure ID is passed in the query URL, and the values to be modified are passed in the request body. -
A
PUT
request can be used to update an entire Task object. The task secure ID is passed in the query URL, and the entire Task object is passed in the request body.
Note, while all the fields must be present in a PUT
request, not all the attribute values may be modified after the initial creation, because when created, some of them become read-only.
Required Scopes
To update a Task object, the partner must have one of the following scopes enabled:
batch.manage
batch.update
Path Arguments
Parameter | Data Type | Description |
---|---|---|
task_sid required | string | The task secure ID. |
Body Arguments
JSON representation of the fields and values to be updated.
The only field that can be updated is status
if the current value is pending_review
. The status
can be changed to either approved
or cancelled
.
Refer to this table to view all fields that appear in the Task object.