Skip to navigation

Start a batch

View as Markdown

Starts a batch with scheduling configuration. Updates contact statuses based on selected_statuses. Customer ID is automatically determined from the API key.

Calling hours. Contacts are called only between 09:05 and 20:55 in each contact’s local time. A schedule that reaches outside that window is still accepted; the response’s messages says so, and contacts outside the window wait until it opens.

Authentication

X-API-Keystring

API key for authentication. Example: raya_ABCD1234567890abcdef

Path parameters

idintegerRequired
The batch ID

Request

Request body for starting a batch. The schedule field is optional - if not provided, the existing schedule from the batch will be used.

Schedule Field Details:

  • timezone: IANA timezone identifier (e.g., “Asia/Kolkata”, “America/New_York”, “UTC”)
  • start_time: Start time in “HH:mm” format using 24-hour clock (e.g., “09:00” = 9 AM, “18:30” = 6:30 PM)
  • end_time: End time in “HH:mm” format using 24-hour clock (must be after start_time)
  • days: Array of day numbers where 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday, 7=Sunday

Other Fields:

  • max_retries: Maximum number of retry attempts (0 = no retries, 3 = 3 retries)
  • retry_after_hrs: Hours to wait before retrying (e.g., 3 = wait 3 hours)
  • max_concurrent_calls: Maximum number of simultaneous calls (1 = sequential, 5 = up to 5 at once)
  • selected_statuses: Array of contact statuses to reset to “Pending”. Use [“Pending”] for normal batch start/resume. Including “Unanswered” or “Failed” will immediately re-call those contacts (bypasses retry wait time).
max_retriesintegerRequired>=0

Maximum number of retry attempts for failed calls.

This determines how many times the system will attempt to call a contact if the initial call fails or is not completed.

  • 0 = No retries (only one attempt per contact)
  • 1 = One retry attempt (total of 2 attempts)
  • 3 = Three retry attempts (total of 4 attempts)
  • etc.

A call is considered for retry if it fails, is unanswered, or has an unsuccessful outcome. The system will wait for the duration specified in retry_after_hrs before making the next attempt.

retry_after_hrsdoubleRequired>=0

Hours to wait before retrying a failed call.

This is the time delay between retry attempts. The system will wait this many hours after a failed call before attempting to call the contact again.

Examples:

  • 0 = Retry immediately (not recommended for most use cases)
  • 3 = Wait 3 hours before retrying
  • 24 = Wait 24 hours (1 day) before retrying
  • 48 = Wait 48 hours (2 days) before retrying

The retry will only occur if:

  1. The number of attempts is less than max_retries
  2. The batch is still active
  3. The current time is within the schedule window
max_concurrent_callsintegerRequired>=1

Maximum number of concurrent calls the batch can make simultaneously.

This controls how many calls can be in progress at the same time for this batch. Higher values allow more parallel calls but require more system resources.

Examples:

  • 1 = One call at a time (sequential calling)
  • 5 = Up to 5 calls simultaneously
  • 10 = Up to 10 calls simultaneously

Important: The actual number of concurrent calls may be limited by:

  • Your account’s concurrency limit
  • Available system resources
  • The batch’s schedule (calls only happen during scheduled hours)

Setting this too high may cause rate limiting or resource exhaustion.

selected_statuseslist of stringsRequired

Array of contact statuses to reset to “Pending” when starting the batch. Contacts with these statuses will become eligible for calling immediately.

Important Behavior:

  • Contacts with the specified statuses will be reset to “Pending” status
  • Only contacts with “Pending” status will be called by the batch
  • If you include “Unanswered” or “Failed” statuses, those contacts will be re-called immediately without waiting for the retry duration (retry_after_hrs). This bypasses the normal retry wait time.

Common Status Values:

  • “Pending” - Contact has not been called yet (new contacts)
  • “Unanswered” - Previous call was not answered (will be re-called immediately if included)
  • “Invalid” - Dialing to this number isn’t allowed from the given DID.
  • “Completed” - Contact was successfully reached (rarely included for retries)

Usage Guidelines:

For Resuming/Starting a Batch (Recommended):

  • Use only [“Pending”] to call only new contacts that haven’t been called yet
  • This is the standard approach when starting or resuming a batch

For Immediate Retry (Use with Caution):

  • Include “Unanswered” or “Failed” only if you want to immediately re-call contacts that were previously unsuccessful
  • Warning: This will bypass the retry_after_hrs wait time and call them right away
  • Example: [“Pending”, “Unanswered”] will call both new contacts AND immediately retry unanswered contacts

Best Practice: For normal batch operations, use [“Pending”] only. Only include “Unanswered” or “Failed” if you specifically need to bypass the retry wait time.

scheduleobjectOptional

Schedule configuration object (optional). If not provided, the existing schedule from the batch will be used. If no schedule exists, an error will be returned.

The schedule defines when the batch should be active and making calls. All times are interpreted in the specified timezone.

Required fields:

  • timezone: IANA timezone identifier (e.g., “Asia/Kolkata”, “America/New_York”, “Europe/London”, “UTC”)
  • start_time: Start time in “HH:mm” format using 24-hour clock (e.g., “09:00” for 9 AM, “18:30” for 6:30 PM)
  • end_time: End time in “HH:mm” format using 24-hour clock (must be after start_time)
  • days: Array of day numbers representing which days of the week the batch should run

Day Numbers:

  • 1 = Monday
  • 2 = Tuesday
  • 3 = Wednesday
  • 4 = Thursday
  • 5 = Friday
  • 6 = Saturday
  • 7 = Sunday

Example: {“timezone”: “Asia/Kolkata”, “start_time”: “09:00”, “end_time”: “18:00”, “days”: [1,2,3,4,5]} This means the batch will run Monday through Friday from 9:00 AM to 6:00 PM India Standard Time (IST).

Response

Batch started successfully
idintegerOptional
namestring or nullOptional
statusstring or nullOptional
agent_idstringOptionalformat: "uuid"
created_atdatetime or nullOptional
scheduleobject or nullOptional
max_retriesintegerOptional
concurrencyintegerOptional
retry_after_hrsdoubleOptional
total_contactsintegerOptional
completed_contactsintegerOptional
unanswered_contactsintegerOptional

Errors

404
Not Found Error