Trillet AI logo

Create Message Flow

Create a new message flow with full settings.

POSThttps://api.trillet.ai/v1/api/message-flows

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Request Body

namestringrequired

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

directionstring

Direction of the flow: inbound, outbound or bidirectional. Defaults to bidirectional.

descriptionstring

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

messageChannelstringrequired

The channel the flow sends and receives on. One of:

  • Twilio-SMS
  • Telnyx-SMS
  • Twilio-Email
  • Meta-Whatsapp
  • Meta-Facebook
  • Infobip-Whatsapp
  • Infobip-Facebook

The value is case-sensitive. Any other value, including "SMS" or "Email", is rejected.

agentstring

ID of the message agent (omni-flow agent) the flow uses. Message agents are created in the dashboard; there is no public API page for them yet.

settingsobjectrequired

The flow's settings. Required. Send {} for none.

The object you send is stored as the flow's settings; it is not merged with defaults, so send every setting you want the flow to have.

initiationMessagestring

The first message the flow sends when it starts a conversation, used by Generate Message.

promptstring

A system prompt or instructions for the AI agent.

isActiveboolean

Whether the flow is active. Defaults to true.

autopilotboolean

Whether replies are sent automatically without approval. Defaults to false.

Response Fields

201 Created with the new message flow.

_idstring

The unique identifier for the newly created message flow.

workspaceIdstring

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

namestring

The name given to the message flow.

directionstring

inbound, outbound or bidirectional.

descriptionstring

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

agentstring

The ID of the message agent associated with this message flow, or absent.

settingsobject

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

responseSettingsobject

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

delaynumber

The delay in seconds before a response is issued.

workingHoursobject

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

enabledboolean

Whether working hours are enabled.

startstring

The start time of working hours.

endstring

The end time of working hours.

timezonestring

The timezone for the working hours.

outOfHoursMessagestring

The message delivered outside of working hours.

securityobject

Security settings for the message flow.

hipaaComplianceboolean

Whether HIPAA mode is on, set from securityOptOut.

emailSettingsobject

Settings related to email communication.

subjectLinestring

The default subject line for emails sent within this flow.

signaturestring

The signature appended to email messages.

promptstring

The system prompt or instructions for the AI agent.

initiationMessagestring

The initial message that activates the message flow.

isActiveboolean

Indicates whether the message flow is currently active.

autopilotboolean

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

messageChannelstring

The channel, for example Twilio-SMS.

createdAtstring

The timestamp when the message flow was created.

updatedAtstring

The timestamp when the message flow was last updated.

{
  "name": "Customer Engagement Campaign",
  "direction": "bidirectional",
  "messageChannel": "Twilio-SMS",
  "agent": "c9c9c9c9c9c9c9c9c9c9c9c9",
  "prompt": "You are a supportive assistant managing event inquiries.",
  "initiationMessage": "Welcome to our service! How can we assist you today?",
  "autopilot": true,
  "settings": {
    "responseSettings": {
      "delay": 0,
      "workingHours": {
        "enabled": false,
        "start": "0900",
        "end": "1700",
        "timezone": "UTC",
        "outOfHoursMessage": ""
      }
    },
    "security": { "securityOptOut": false }
  }
}
{
  "_id": "d0d0d0d0d0d0d0d0d0d0d0d0",
  "workspaceId": "c1c1c1c1c1c1c1c1c1c1c1c1",
  "name": "Customer Engagement Campaign",
  "direction": "bidirectional",
  "description": "Manages interactions for promotional events via SMS",
  "agent": "c9c9c9c9c9c9c9c9c9c9c9c9",
  "settings": {
    "responseSettings": {
      "delay": 0,
      "workingHours": {
        "enabled": false,
        "start": "0900",
        "end": "1700",
        "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": "Twilio-SMS",
  "createdAt": "2025-01-02T10:15:00Z",
  "updatedAt": "2025-01-02T10:15:00Z"
}

Last updated on