AI Tests

Create a scheduled test job

Changed on

Creates a scheduled test job that runs the selected scenarios on a cron expression.

post/ai/tests/schedules/v1/cron-jobs

Request

  • Base URL: https://api.telnyx.com/v2
  • URL: https://api.telnyx.com/v2/ai/tests/schedules/v1/cron-jobs
  • Auth: HTTP bearer

Request body

crontab_expressionstring required

Cron expression controlling when the job runs.

namestring
scenariosinteger[]
tagsstring[]
agentinteger
timezonestring
personalitiesinteger[]
execution_modestring

Execution mode for the test runs, such as voice, text, or sip.

frequencyinteger
run_as_textboolean
notify_on'never' | 'success' | 'failure' | 'both'
is_activeboolean

Example request

{
  "crontab_expression": "0 3 * * *",
  "name": "Nightly regression",
  "agent": 1259,
  "scenarios": [
    9512
  ],
  "timezone": "America/Chicago",
  "execution_mode": "voice",
  "notify_on": "failure"
}

Response

Scheduled test job created.

idinteger required
namestring required
agentinteger required

ID of the test agent the job belongs to.

crontab_expressionstring required

Cron expression controlling when the job runs, in the job's timezone.

timezonestring
scenario_idsinteger[]

Scenario IDs the job executes.

personalityinteger nullable
personalitiesinteger[]
tagsstring[]
frequencyinteger
run_as_textboolean

Whether the job runs scenarios as text chat rather than voice calls.

execution_modestring

Execution mode for the test runs, such as voice, text, or sip.

notify_on'never' | 'success' | 'failure' | 'both'

When the job sends a notification.

is_activeboolean required
created_atstring date-time required
updated_atstring date-time required

Example response

{
  "id": 1188,
  "name": "Nightly regression",
  "agent": 1259,
  "crontab_expression": "0 3 * * *",
  "timezone": "America/Chicago",
  "scenario_ids": [
    9512
  ],
  "scenarios_data": [
    {
      "id": 9512,
      "agent": 1259,
      "name": "Refund escalation flow",
      "personality": 4643,
      "personality_name": "Interruptive (High)"
    }
  ],
  "personality": null,
  "personalities": [
    4643
  ],
  "tags": [
    "regression"
  ],
  "frequency": 1,
  "run_as_text": false,
  "execution_mode": "voice",
  "notify_on": "failure",
  "is_active": true,
  "created_at": "2026-10-13T18:04:05.123456Z",
  "updated_at": "2026-10-13T18:04:05.123456Z"
}

Changes