Create batch
Creates a new batch with contacts. Each contact must have contact_name and contact_phone. Additional fields are stored in agent_args and can be used during calls. Customer ID is automatically determined from the API key. To add contacts to an existing batch, use POST /api/batch/{id}/contacts.
Authentication
X-API-Keystring
API key for authentication. Example: raya_ABCD1234567890abcdef
Request
This endpoint expects an object.
agent_id
The UUID of the agent to use for this batch
batch_name
Name for the batch
contacts
Array of contact objects. Each contact must have contact_name and contact_phone. Additional fields are allowed.
Response
Batch created successfully
status
Status of the batch creation
Allowed values:
message
Human-readable message about the result
totalRows
Total number of contacts in the request
validRows
Number of valid contacts that were processed
invalidRows
Number of invalid contacts that were rejected
batchId
ID of the created or updated batch
contactsInserted
Number of contacts successfully added to the batch
data
Array of valid contact data that was processed
errors
Array of validation errors (only present if status is error)
Errors
400
Bad Request Error
401
Unauthorized Error
404
Not Found Error

