Create Message Flow
Create a new message flow with full settings.
Headers
x-api-keystringrequiredAPI key used for authenticating requests to the API.
x-workspace-idstringrequiredWorkspace identifier for the API.
Request Body
namestringrequiredThe name of this message flow (e.g., "New Years Sale").
directionstringrequiredDirection of the flow. Possible values: "inbound" "outbound" "bidirectional".
descriptionstringShort description (e.g., "Handles customer support inquiries via SMS").
agentstringrequiredID of the OmniFlowAgent to associate with this flow.
settingsobjectFull configuration object. This can include:
initiationMessagestringrequiredThe first message that triggers the message flow. This field is essential for the generateMessage functionality.
promptstringrequiredA system prompt or instructions for the AI agent.
isActivebooleanEnable or disable autopilot for this flow (default false).
autopilotbooleanEnable or disable autopilot for this flow (default false).
messageChannelstringrequiredChannel type: "SMS" or "Email".
Response Fields
_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.
directionstringThe direction of the message flow; possible values include "inbound", "outbound", or "bidirectional".
descriptionstringA brief description of what the message flow is designed to handle.
agentstringThe identifier of the agent associated with this message flow.
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.
hipaaCompliancebooleanIndicates if HIPAA compliance is enforced.
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 communication channel used by the message flow, such as "SMS" or "Email".
createdAtstringThe timestamp when the message flow was created.
updatedAtstringThe 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"
}