POST
/
v1
/
api
/
message-flows
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>"
}'
{
  "_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",
  "__v": 0
}

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

name
string
required

The name of this message flow (e.g., “New Years Sale”).

direction
string
required

Direction of the flow. Possible values: “inbound” “outbound” “bidirectional”.

description
string

Short description (e.g., “Handles customer support inquiries via SMS”).

agent
string
required

ID of the OmniFlowAgent to associate with this flow.

settings
object

Full configuration object. This can include:

initiationMessage
string
required

The first message that triggers the message flow. This field is essential for the generateMessage functionality.

prompt
string
required

A system prompt or instructions for the AI agent.

isActive
boolean

Enable or disable autopilot for this flow (default false).

autopilot
boolean

Enable or disable autopilot for this flow (default false).

messageChannel
string
required

Channel type: “SMS” or “Email”.

Response Fields

_id
string

The unique identifier for the newly created message flow.

workspaceId
string

The identifier of the workspace where the message flow is configured.

name
string

The name given to the message flow.

direction
string

The direction of the message flow; possible values include “inbound”, “outbound”, or “bidirectional”.

description
string

A brief description of what the message flow is designed to handle.

agent
string

The identifier of the agent associated with this message flow.

settings
object

Configuration settings of the message flow, including response, security, and email settings.

responseSettings
object

Settings related to response timing and handling within the message flow.

delay
number

The delay in seconds before a response is issued.

workingHours
object

Settings defining the working hours during which the message flow is active.

enabled
boolean

Whether working hours are enabled.

start
string

The start time of working hours.

end
string

The end time of working hours.

timezone
string

The timezone for the working hours.

outOfHoursMessage
string

The message delivered outside of working hours.

security
object

Security settings for the message flow.

hipaaCompliance
boolean

Indicates if HIPAA compliance is enforced.

emailSettings
object

Settings related to email communication.

subjectLine
string

The default subject line for emails sent within this flow.

signature
string

The signature appended to email messages.

prompt
string

The system prompt or instructions for the AI agent.

initiationMessage
string

The initial message that activates the message flow.

isActive
boolean

Indicates whether the message flow is currently active.

autopilot
boolean

Indicates whether the autopilot feature of the message flow is enabled.

messageChannel
string

The communication channel used by the message flow, such as “SMS” or “Email”.

createdAt
string

The timestamp when the message flow was created.

updatedAt
string

The timestamp when the message flow was last updated.

__v
number

The version number of the message flow document.

{
  "_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",
  "__v": 0
}