POST
/
v1
/
api
/
conversations
/
message
/
generate
curl --request POST \
  --url https://api.trillet.ai/v1/api/conversations/message/generate \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-workspace-id: <x-workspace-id>' \
  --data '{
  "flowId": "<string>",
  "to": "<string>",
  "metadata": {
    "customerDetails": {
      "name": "<string>"
    }
  },
  "autopilot": true,
  "dynamic": {}
}'
{  
  "status": "success",  
  "conversation_id": "63e63b2a-8b6d-4ea4-ae84-abc123",  
  "message_id": "56f3459b-c23d-46a4-8a2d-bcd456",  
  "message": "Your appointment is confirmed for tomorrow at 3 PM."  
}  

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

flowId
string
required

Unique identifier for the message flow sending the message. Ensure the Message Flow ID belongs to an active flow.

to
string
required

Recipient’s contact information. Use E.164 format for SMS (e.g., +1234567890) and a valid email address format for Email (e.g., user@example.com).

Ensure the contact format matches the messageChannel type: SMS for phone numbers and Email for email addresses. Using an incorrect format or type will result in an error.

metadata
object
autopilot
boolean
required

Enable automatically sending the generated message to the intended recipient. If your flow has a delay enabled, the message will be sent after that delay. Defaults to false.

dynamic
object

Dynamic inputs for AI-generated messages.

Response Fields

status
string

Indicates (success) if the request was successful.

conversation_id
string

Unique identifier for the newly created or fetched existing conversation.

message_id
string

Unique identifier for the newly created message within the conversation.

message
string

Content of the message sent. This will always be the corresponding message flow’s initiationMessage.

{  
  "status": "success",  
  "conversation_id": "63e63b2a-8b6d-4ea4-ae84-abc123",  
  "message_id": "56f3459b-c23d-46a4-8a2d-bcd456",  
  "message": "Your appointment is confirmed for tomorrow at 3 PM."  
}