Skip to main content
POST
/
customers
/
batch
cURL
curl --request POST \
  --url https://www.oration.ai/api/v2/customers/batch \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-workspace-slug: <api-key>' \
  --data '
{
  "customers": [
    {
      "identifier": "<string>",
      "name": "<string>",
      "phoneNumber": "<string>",
      "email": "[email protected]",
      "metadata": {
        "customerName": "<string>",
        "amount": 123
      },
      "priority": 5
    }
  ],
  "strategy": "insert",
  "partial": false
}
'
{
  "jobId": "<string>"
}

Creating Customers

This endpoint allows you to create customers.

Request Body

The request body should contain a customers array with the customer information you want to create. Each customer object in the array should include the following fields:
FieldTypeRequiredDescription
namestringNoThe customer’s full name
phoneNumberstringNoThe customer’s phone number in E.164 format (e.g., +12345678901)
emailstringNoThe customer’s email address
identifierstringYesA unique identifier for the customer in your system
metadataobject/string/number/boolean/nullNoAdditional data about the customer that you want to store
priorityintegerNoCalling priority for the customer. Default: 5. Ascending order.
You can use priority to control how the customers are picked during campaign runs. It is calculated in ascending order. Lower the value, higher the priority. 0 is the highest priority. In addition to the customers array, the request body can include the following top-level parameters:
ParameterTypeRequiredDescription
strategystringNoThe strategy to use when creating customers. Can be upsert or insert. Defaults to insert
partialbooleanNoWhen set to true, allows partial batch processing. Only valid when strategy is set to insert. This ensures customers without errors are still inserted even if others in the batch fail.

Response Structure

The response includes the job ID. You can use this job ID to check the status of the job.
FieldTypeDescription
jobIdstringThe unique identifier of the job

Authorizations

x-api-key
string
header
required
x-workspace-slug
string
header
required

Body

application/json
customers
object[]
required
strategy
enum<string>
default:insert
Available options:
upsert,
insert
partial
boolean
default:false

Response

Successful response

jobId
string