Toggle Autopilot
curl --request PUT \
--url https://api.trillet.ai/v1/api/message-flows/{id}/toggle-autopilot \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '{
"": "<string>"
}'import requests
url = "https://api.trillet.ai/v1/api/message-flows/{id}/toggle-autopilot"
payload = { "": "<string>" }
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-api-key': '<api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({'': '<string>'})
};
fetch('https://api.trillet.ai/v1/api/message-flows/{id}/toggle-autopilot', 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/{id}/toggle-autopilot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'' => '<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/{id}/toggle-autopilot"
payload := strings.NewReader("{\n \"\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.trillet.ai/v1/api/message-flows/{id}/toggle-autopilot")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/message-flows/{id}/toggle-autopilot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "1234567890abcdef12345678",
"workspaceId": "abcdef1234567890abcdef12",
"name": "SampleFlow",
"description": "Sample description for the flow.",
"agent": "0987654321fedcba09876543",
"prompt": "You are a helpful assistant.",
"initiationMessage": "Hello!",
"isActive": true,
"autopilot": true,
"messageChannel": "SMS",
"createdAt": "2025-01-01T12:00:00.000Z",
"updatedAt": "2025-01-15T08:30:00.000Z"
}
Message Flows
Toggle Autopilot
Toggle the autopilot mode of an existing message flow.
PUT
/
v1
/
api
/
message-flows
/
{id}
/
toggle-autopilot
Toggle Autopilot
curl --request PUT \
--url https://api.trillet.ai/v1/api/message-flows/{id}/toggle-autopilot \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '{
"": "<string>"
}'import requests
url = "https://api.trillet.ai/v1/api/message-flows/{id}/toggle-autopilot"
payload = { "": "<string>" }
headers = {
"x-api-key": "<api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-api-key': '<api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({'': '<string>'})
};
fetch('https://api.trillet.ai/v1/api/message-flows/{id}/toggle-autopilot', 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/{id}/toggle-autopilot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'' => '<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/{id}/toggle-autopilot"
payload := strings.NewReader("{\n \"\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.trillet.ai/v1/api/message-flows/{id}/toggle-autopilot")
.header("x-api-key", "<api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/message-flows/{id}/toggle-autopilot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "1234567890abcdef12345678",
"workspaceId": "abcdef1234567890abcdef12",
"name": "SampleFlow",
"description": "Sample description for the flow.",
"agent": "0987654321fedcba09876543",
"prompt": "You are a helpful assistant.",
"initiationMessage": "Hello!",
"isActive": true,
"autopilot": true,
"messageChannel": "SMS",
"createdAt": "2025-01-01T12:00:00.000Z",
"updatedAt": "2025-01-15T08:30:00.000Z"
}
Headers
string
required
API key used for authenticating requests to the API.
string
required
Workspace identifier for the API.
Path Parameters
string
required
The unique ID of the message flow where autopilot will be toggled.
Response Fields
string
The unique identifier for the message flow where autopilot was toggled.
string
The identifier of the workspace containing the message flow.
string
The name of the message flow.
string
A description of what the message flow is designed to handle.
string
The identifier of the agent associated with this message flow.
string
The system or initial prompt set for the AI agent in the message flow.
string
The initial message that triggers the message flow. This is crucial for the generateMessage functionality.
boolean
Indicates whether the message flow is currently active.
boolean
Shows the current state of autopilot for this message flow after toggling. If true, autopilot is now enabled; if false, it is now disabled.
string
The type of communication channel used by the message flow, such as “SMS”.
string
The timestamp when the message flow was created.
string
The timestamp the last time the message flow was updated.
{
"_id": "1234567890abcdef12345678",
"workspaceId": "abcdef1234567890abcdef12",
"name": "SampleFlow",
"description": "Sample description for the flow.",
"agent": "0987654321fedcba09876543",
"prompt": "You are a helpful assistant.",
"initiationMessage": "Hello!",
"isActive": true,
"autopilot": true,
"messageChannel": "SMS",
"createdAt": "2025-01-01T12:00:00.000Z",
"updatedAt": "2025-01-15T08:30:00.000Z"
}
