Trillet AI logo

Create Message Flow

Create a new message flow with full settings.

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

Headers

x-api-keystringrequired

API key used for authenticating requests to the API.

x-workspace-idstringrequired

Workspace identifier for the API.

Request Body

namestringrequired

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

directionstringrequired

Direction of the flow. Possible values: "inbound" "outbound" "bidirectional".

descriptionstring

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

agentstringrequired

ID of the OmniFlowAgent to associate with this flow.

settingsobject

Full configuration object. This can include:

initiationMessagestringrequired

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

promptstringrequired

A system prompt or instructions for the AI agent.

isActiveboolean

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

autopilotboolean

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

messageChannelstringrequired

Channel type: "SMS" or "Email".

Response Fields

_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

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

descriptionstring

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

agentstring

The identifier of the agent associated with this message flow.

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

Indicates if HIPAA compliance is enforced.

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 communication channel used by the message flow, such as "SMS" or "Email".

createdAtstring

The timestamp when the message flow was created.

updatedAtstring

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"
}