Create Message Flow
curl --request POST \
--url https://api.trillet.ai/v1/api/message-flows \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"name": "<string>",
"direction": "<string>",
"description": "<string>",
"agent": "<string>",
"settings": {
"responseSettings": {
"delay": 123,
"enabled": true,
"start": "<string>",
"end": "<string>",
"timezone": "<string>",
"outOfHoursMessage": "<string>"
},
"security": {
"hipaaCompliance": true
},
"emailSettings": {
"subjectLine": "<string>",
"signature": "<string>"
}
},
"initiationMessage": "<string>",
"prompt": "<string>",
"isActive": true,
"autopilot": true,
"messageChannel": "<string>"
}
'import requests
url = "https://api.trillet.ai/v1/api/message-flows"
payload = {
"name": "<string>",
"direction": "<string>",
"description": "<string>",
"agent": "<string>",
"settings": {
"responseSettings": {
"delay": 123,
"enabled": True,
"start": "<string>",
"end": "<string>",
"timezone": "<string>",
"outOfHoursMessage": "<string>"
},
"security": { "hipaaCompliance": True },
"emailSettings": {
"subjectLine": "<string>",
"signature": "<string>"
}
},
"initiationMessage": "<string>",
"prompt": "<string>",
"isActive": True,
"autopilot": True,
"messageChannel": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
direction: '<string>',
description: '<string>',
agent: '<string>',
settings: {
responseSettings: {
delay: 123,
enabled: true,
start: '<string>',
end: '<string>',
timezone: '<string>',
outOfHoursMessage: '<string>'
},
security: {hipaaCompliance: true},
emailSettings: {subjectLine: '<string>', signature: '<string>'}
},
initiationMessage: '<string>',
prompt: '<string>',
isActive: true,
autopilot: true,
messageChannel: '<string>'
})
};
fetch('https://api.trillet.ai/v1/api/message-flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trillet.ai/v1/api/message-flows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'direction' => '<string>',
'description' => '<string>',
'agent' => '<string>',
'settings' => [
'responseSettings' => [
'delay' => 123,
'enabled' => true,
'start' => '<string>',
'end' => '<string>',
'timezone' => '<string>',
'outOfHoursMessage' => '<string>'
],
'security' => [
'hipaaCompliance' => true
],
'emailSettings' => [
'subjectLine' => '<string>',
'signature' => '<string>'
]
],
'initiationMessage' => '<string>',
'prompt' => '<string>',
'isActive' => true,
'autopilot' => true,
'messageChannel' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trillet.ai/v1/api/message-flows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"settings\": {\n \"responseSettings\": {\n \"delay\": 123,\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n },\n \"security\": {\n \"hipaaCompliance\": true\n },\n \"emailSettings\": {\n \"subjectLine\": \"<string>\",\n \"signature\": \"<string>\"\n }\n },\n \"initiationMessage\": \"<string>\",\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"autopilot\": true,\n \"messageChannel\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trillet.ai/v1/api/message-flows")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"settings\": {\n \"responseSettings\": {\n \"delay\": 123,\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n },\n \"security\": {\n \"hipaaCompliance\": true\n },\n \"emailSettings\": {\n \"subjectLine\": \"<string>\",\n \"signature\": \"<string>\"\n }\n },\n \"initiationMessage\": \"<string>\",\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"autopilot\": true,\n \"messageChannel\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/message-flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"settings\": {\n \"responseSettings\": {\n \"delay\": 123,\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n },\n \"security\": {\n \"hipaaCompliance\": true\n },\n \"emailSettings\": {\n \"subjectLine\": \"<string>\",\n \"signature\": \"<string>\"\n }\n },\n \"initiationMessage\": \"<string>\",\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"autopilot\": true,\n \"messageChannel\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "messageFlowId",
"workspaceId": "workspaceIdExample",
"name": "Customer Engagement Campaign",
"direction": "bidirectional",
"description": "Manages interactions for promotional events via SMS",
"agent": "agentUniqueId",
"settings": {
"responseSettings": {
"delay": 0,
"workingHours": {
"enabled": false,
"start": "09:00",
"end": "17:00",
"timezone": "UTC",
"outOfHoursMessage": ""
}
},
"security": {
"hipaaCompliance": false
},
"emailSettings": {
"subjectLine": "Thank You for Joining Our Event",
"signature": "Best Regards"
}
},
"prompt": "You are a supportive assistant managing event inquiries.",
"initiationMessage": "Welcome to our service! How can we assist you today?",
"isActive": true,
"autopilot": true,
"messageChannel": "SMS",
"createdAt": "2025-01-02T10:15:00Z",
"updatedAt": "2025-01-02T10:15:00Z"
}
Message Flows
Create Message Flow
Create a new message flow with full settings.
POST
/
v1
/
api
/
message-flows
Create Message Flow
curl --request POST \
--url https://api.trillet.ai/v1/api/message-flows \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"name": "<string>",
"direction": "<string>",
"description": "<string>",
"agent": "<string>",
"settings": {
"responseSettings": {
"delay": 123,
"enabled": true,
"start": "<string>",
"end": "<string>",
"timezone": "<string>",
"outOfHoursMessage": "<string>"
},
"security": {
"hipaaCompliance": true
},
"emailSettings": {
"subjectLine": "<string>",
"signature": "<string>"
}
},
"initiationMessage": "<string>",
"prompt": "<string>",
"isActive": true,
"autopilot": true,
"messageChannel": "<string>"
}
'import requests
url = "https://api.trillet.ai/v1/api/message-flows"
payload = {
"name": "<string>",
"direction": "<string>",
"description": "<string>",
"agent": "<string>",
"settings": {
"responseSettings": {
"delay": 123,
"enabled": True,
"start": "<string>",
"end": "<string>",
"timezone": "<string>",
"outOfHoursMessage": "<string>"
},
"security": { "hipaaCompliance": True },
"emailSettings": {
"subjectLine": "<string>",
"signature": "<string>"
}
},
"initiationMessage": "<string>",
"prompt": "<string>",
"isActive": True,
"autopilot": True,
"messageChannel": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
direction: '<string>',
description: '<string>',
agent: '<string>',
settings: {
responseSettings: {
delay: 123,
enabled: true,
start: '<string>',
end: '<string>',
timezone: '<string>',
outOfHoursMessage: '<string>'
},
security: {hipaaCompliance: true},
emailSettings: {subjectLine: '<string>', signature: '<string>'}
},
initiationMessage: '<string>',
prompt: '<string>',
isActive: true,
autopilot: true,
messageChannel: '<string>'
})
};
fetch('https://api.trillet.ai/v1/api/message-flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.trillet.ai/v1/api/message-flows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'direction' => '<string>',
'description' => '<string>',
'agent' => '<string>',
'settings' => [
'responseSettings' => [
'delay' => 123,
'enabled' => true,
'start' => '<string>',
'end' => '<string>',
'timezone' => '<string>',
'outOfHoursMessage' => '<string>'
],
'security' => [
'hipaaCompliance' => true
],
'emailSettings' => [
'subjectLine' => '<string>',
'signature' => '<string>'
]
],
'initiationMessage' => '<string>',
'prompt' => '<string>',
'isActive' => true,
'autopilot' => true,
'messageChannel' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trillet.ai/v1/api/message-flows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"settings\": {\n \"responseSettings\": {\n \"delay\": 123,\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n },\n \"security\": {\n \"hipaaCompliance\": true\n },\n \"emailSettings\": {\n \"subjectLine\": \"<string>\",\n \"signature\": \"<string>\"\n }\n },\n \"initiationMessage\": \"<string>\",\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"autopilot\": true,\n \"messageChannel\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trillet.ai/v1/api/message-flows")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"settings\": {\n \"responseSettings\": {\n \"delay\": 123,\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n },\n \"security\": {\n \"hipaaCompliance\": true\n },\n \"emailSettings\": {\n \"subjectLine\": \"<string>\",\n \"signature\": \"<string>\"\n }\n },\n \"initiationMessage\": \"<string>\",\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"autopilot\": true,\n \"messageChannel\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/message-flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"direction\": \"<string>\",\n \"description\": \"<string>\",\n \"agent\": \"<string>\",\n \"settings\": {\n \"responseSettings\": {\n \"delay\": 123,\n \"enabled\": true,\n \"start\": \"<string>\",\n \"end\": \"<string>\",\n \"timezone\": \"<string>\",\n \"outOfHoursMessage\": \"<string>\"\n },\n \"security\": {\n \"hipaaCompliance\": true\n },\n \"emailSettings\": {\n \"subjectLine\": \"<string>\",\n \"signature\": \"<string>\"\n }\n },\n \"initiationMessage\": \"<string>\",\n \"prompt\": \"<string>\",\n \"isActive\": true,\n \"autopilot\": true,\n \"messageChannel\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "messageFlowId",
"workspaceId": "workspaceIdExample",
"name": "Customer Engagement Campaign",
"direction": "bidirectional",
"description": "Manages interactions for promotional events via SMS",
"agent": "agentUniqueId",
"settings": {
"responseSettings": {
"delay": 0,
"workingHours": {
"enabled": false,
"start": "09:00",
"end": "17:00",
"timezone": "UTC",
"outOfHoursMessage": ""
}
},
"security": {
"hipaaCompliance": false
},
"emailSettings": {
"subjectLine": "Thank You for Joining Our Event",
"signature": "Best Regards"
}
},
"prompt": "You are a supportive assistant managing event inquiries.",
"initiationMessage": "Welcome to our service! How can we assist you today?",
"isActive": true,
"autopilot": true,
"messageChannel": "SMS",
"createdAt": "2025-01-02T10:15:00Z",
"updatedAt": "2025-01-02T10:15:00Z"
}
Headers
string
required
API key used for authenticating requests to the API.
string
required
Workspace identifier for the API.
Request Body
string
required
The name of this message flow (e.g., “New Years Sale”).
string
required
Direction of the flow. Possible values: “inbound” “outbound” “bidirectional”.
string
Short description (e.g., “Handles customer support inquiries via SMS”).
string
required
ID of the OmniFlowAgent to associate with this flow.
object
Full configuration object. This can include:
Show settings
Show settings
object
string
required
The first message that triggers the message flow. This field is essential for
the generateMessage functionality.
string
required
A system prompt or instructions for the AI agent.
boolean
Enable or disable autopilot for this flow (default false).
boolean
Enable or disable autopilot for this flow (default false).
string
required
Channel type: “SMS” or “Email”.
Response Fields
string
The unique identifier for the newly created message flow.
string
The identifier of the workspace where the message flow is configured.
string
The name given to the message flow.
string
The direction of the message flow; possible values include “inbound”, “outbound”, or “bidirectional”.
string
A brief description of what the message flow is designed to handle.
string
The identifier of the agent associated with this message flow.
object
Configuration settings of the message flow, including response, security, and email settings.
object
Settings related to response timing and handling within the message flow.
number
The delay in seconds before a response is issued.
object
string
The system prompt or instructions for the AI agent.
string
The initial message that activates the message flow.
boolean
Indicates whether the message flow is currently active.
boolean
Indicates whether the autopilot feature of the message flow is enabled.
string
The communication channel used by the message flow, such as “SMS” or “Email”.
string
The timestamp when the message flow was created.
string
The timestamp when the message flow was last updated.
{
"_id": "messageFlowId",
"workspaceId": "workspaceIdExample",
"name": "Customer Engagement Campaign",
"direction": "bidirectional",
"description": "Manages interactions for promotional events via SMS",
"agent": "agentUniqueId",
"settings": {
"responseSettings": {
"delay": 0,
"workingHours": {
"enabled": false,
"start": "09:00",
"end": "17:00",
"timezone": "UTC",
"outOfHoursMessage": ""
}
},
"security": {
"hipaaCompliance": false
},
"emailSettings": {
"subjectLine": "Thank You for Joining Our Event",
"signature": "Best Regards"
}
},
"prompt": "You are a supportive assistant managing event inquiries.",
"initiationMessage": "Welcome to our service! How can we assist you today?",
"isActive": true,
"autopilot": true,
"messageChannel": "SMS",
"createdAt": "2025-01-02T10:15:00Z",
"updatedAt": "2025-01-02T10:15:00Z"
}
⌘I
