POST
/
v1
/
api
/
call
curl --request POST \
  --url https://api.trillet.ai/v1/api/call \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-workspace-id: <x-workspace-id>' \
  --data '{
  "to": "<string>",
  "call_agent_id": "<string>",
  "callback_url": "<string>",
  "dynamic_variables": {
    "firstName": "<string>",
    "lastName": "<string>",
    "Zipcode": "<string>",
    "address": "<string>",
    "email": "<string>",
    "phoneNumber": "<string>"
  },
  "metadata": {}
}'
{
  "status": "success",
  "call_id": "123456789",
  "message": "Call initiated successfully"
}

Headers

x-api-key
string
required

API key used for authenticating requests to the API.

x-workspace-id
string
required

Workspace identifier for the API.

Request Body

to
string
required

The phone number to which the call will be made.

call_agent_id
string
required

The ID of the agent assigned to make the call.

callback_url
string

A URL to receive webhook events about the call. If provided, this URL will be used for notifications.

dynamic_variables
object

Dynamic variables that can be used to customize call scripts. Each key represents a variable that can be inserted into the call script dynamically. For example:

metadata
object

Any fields passed here will be sent to the call agent and directly passed to the webhook triggered by the agent under its ‘metadata’ header, but they will not be included in the call agent’s context.

Response Fields

status
string

The status of the request, indicating the success or failure of the call initiation.

call_id
string

A unique identifier assigned to the initiated call. This ID can be used to track the call’s progress or retrieve its details later.

message
string

A message providing feedback about the call initiation process, typically confirming successful initiation or describing an error.

{
  "status": "success",
  "call_id": "123456789",
  "message": "Call initiated successfully"
}