Skip to main content
POST
/
ai
/
assistants
/
{assistant_id}
/
scheduled_events
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const scheduledEventResponse = await client.ai.assistants.scheduledEvents.create('assistant_id', {
  scheduled_at_fixed_datetime: '2025-04-15T13:07:28.764Z',
  telnyx_agent_target: 'telnyx_agent_target',
  telnyx_conversation_channel: 'phone_call',
  telnyx_end_user_target: 'telnyx_end_user_target',
});

console.log(scheduledEventResponse);
{
  "telnyx_conversation_channel": "phone_call",
  "telnyx_end_user_target": "<string>",
  "telnyx_agent_target": "<string>",
  "scheduled_at_fixed_datetime": "2023-11-07T05:31:56Z",
  "assistant_id": "<string>",
  "retry_count": 0,
  "retry_attempts": 123,
  "scheduled_event_id": "<string>",
  "conversation_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "status": "pending",
  "conversation_metadata": {},
  "errors": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

assistant_id
string
required

Body

application/json
telnyx_conversation_channel
enum<string>
required
Available options:
phone_call,
sms_chat
telnyx_end_user_target
string
required

The phone number, SIP URI, to schedule the call or text to.

telnyx_agent_target
string
required

The phone number, SIP URI, to schedule the call or text from.

scheduled_at_fixed_datetime
string<date-time>
required

The datetime at which the event should be scheduled. Formatted as ISO 8601.

Example:

"2025-04-15T13:07:28.764Z"

text
string

Required for sms scheduled events. The text to be sent to the end user.

conversation_metadata
Conversation Metadata · object

Metadata associated with the conversation. Telnyx provides several pieces of metadata, but customers can also add their own.

Response

Successful Response

Union type for different scheduled event response types

telnyx_conversation_channel
enum<string>
required
Available options:
phone_call,
sms_chat
telnyx_end_user_target
string
required
telnyx_agent_target
string
required
scheduled_at_fixed_datetime
string<date-time>
required
assistant_id
string
required
retry_count
integer
default:0
retry_attempts
integer
scheduled_event_id
string
conversation_id
string
created_at
string<date-time>
status
enum<string>
default:pending
Available options:
pending,
in_progress,
completed,
failed
conversation_metadata
Conversation Metadata · object
errors
string[]