Create Message Flow
Create a new message flow with full settings.
Headers
x-workspace-idstringrequiredWorkspace identifier for the API.
Request Body
namestringrequiredThe name of this message flow (e.g., "New Years Sale").
directionstringDirection of the flow: inbound, outbound or bidirectional. Defaults to bidirectional.
descriptionstringShort description (e.g., "Handles customer support inquiries via SMS").
messageChannelstringrequiredThe channel the flow sends and receives on. One of:
Twilio-SMSTelnyx-SMSTwilio-EmailMeta-WhatsappMeta-FacebookInfobip-WhatsappInfobip-Facebook
The value is case-sensitive. Any other value, including "SMS" or "Email", is rejected.
agentstringID 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.
settingsobjectrequiredThe 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.
initiationMessagestringThe first message the flow sends when it starts a conversation, used by Generate Message.
promptstringA system prompt or instructions for the AI agent.
isActivebooleanWhether the flow is active. Defaults to true.
autopilotbooleanWhether replies are sent automatically without approval. Defaults to false.
Response Fields
201 Created with the new message flow.
_idstringThe unique identifier for the newly created message flow.
workspaceIdstringThe identifier of the workspace where the message flow is configured.
namestringThe name given to the message flow.
directionstringinbound, outbound or bidirectional.
descriptionstringA brief description of what the message flow is designed to handle.
agentstringThe ID of the message agent associated with this message flow, or absent.
settingsobjectConfiguration settings of the message flow, including response, security, and email settings.
responseSettingsobjectSettings related to response timing and handling within the message flow.
delaynumberThe delay in seconds before a response is issued.
workingHoursobjectSettings defining the working hours during which the message flow is active.
enabledbooleanWhether working hours are enabled.
startstringThe start time of working hours.
endstringThe end time of working hours.
timezonestringThe timezone for the working hours.
outOfHoursMessagestringThe message delivered outside of working hours.
securityobjectSecurity settings for the message flow.
hipaaCompliancebooleanWhether HIPAA mode is on, set from securityOptOut.
emailSettingsobjectSettings related to email communication.
subjectLinestringThe default subject line for emails sent within this flow.
signaturestringThe signature appended to email messages.
promptstringThe system prompt or instructions for the AI agent.
initiationMessagestringThe initial message that activates the message flow.
isActivebooleanIndicates whether the message flow is currently active.
autopilotbooleanIndicates whether the autopilot feature of the message flow is enabled.
messageChannelstringThe channel, for example Twilio-SMS.
createdAtstringThe timestamp when the message flow was created.
updatedAtstringThe 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