Skip to main content

Create Task

This request creates a batch task.

post /batch/tasks

Sample

A sample POST request to create a batch task:

curl -X POST \
'https://api.carrierx.com/core/v2/batch/tasks' \
-H 'Content-Type: application/json' \
--data-binary '{"method": "PATCH", "type": "phonenumber", "field":"phonenumber", "entries":["18053355112", "18053355280"], "data":{"trunk_group_sid": "b30a3dbb-3708-41f0-a9ca-5cf365dcc4d4"}}'\
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response

200 status code with a serialized copy of the 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"
}

Required Scopes

To create a Task object, the partner must have one of the following scopes enabled:

  • batch.manage
  • batch.create

Body Arguments

JSON representation of the fields and values of the Task object to be created.

Required fields to create a batch task depend on the method field value of the Task object:

"method" Field ValueRequired Fields
"DELETE"entries, field, method, type
"PATCH"data, entries, field, method, type
"POST"data, method, type

Refer to this table to view all fields that appear in the Task object.