Create Studio Flow from API

POST http://localhost:19602/flex/api/studio/flows

Request Body

{"friendly_name"=>"CBM Flow", "status"=>"published", "author_sid"=>"US12df79bc653bc8f00018a7a91ba86e07", "definition"=>{"description"=>"Bot flow for creating a Flex messaging task", "flags"=>{"allow_concurrent_calls"=>true}, "timeout"=>3600, "initial_state"=>"Trigger", "states"=>[{"type"=>"InitialState", "name"=>"Trigger", "properties"=>{"offset"=>{"x"=>0, "y"=>-10}}, "transitions"=>[{"event"=>"incomingMessage", "next"=>"SendMessageToAgent"}, {"event"=>"incomingCall", "next"=>nil}, {"event"=>"incomingRequest", "next"=>nil}, {"event"=>"incomingConversationMessage", "next"=>"SendConversationToAgent"}]}, {"type"=>"SendToFlex", "name"=>"SendMessageToAgent", "properties"=>{"offset"=>{"x"=>30, "y"=>180}, "workflow"=>"WWc7b0f2feae63727fe338bf1db6fdc1ec", "channel"=>"TCb4668c544632eeb6830c46aa9b68b7dc", "attributes"=>"{}", "timeout"=>nil, "priority"=>nil, "waitUrl"=>nil, "waitUrlMethod"=>nil}, "transitions"=>[{"event"=>"callComplete", "next"=>nil}, {"event"=>"failedToEnqueue", "next"=>nil}, {"event"=>"callFailure", "next"=>nil}]}, {"type"=>"SendToFlex", "name"=>"SendConversationToAgent", "properties"=>{"offset"=>{"x"=>380, "y"=>180}, "workflow"=>"WWc7b0f2feae63727fe338bf1db6fdc1ec", "channel"=>"TCb4668c544632eeb6830c46aa9b68b7dc", "attributes"=>"{}", "timeout"=>nil, "priority"=>nil, "waitUrl"=>nil, "waitUrlMethod"=>nil}, "transitions"=>[{"event"=>"callComplete", "next"=>nil}, {"event"=>"failedToEnqueue", "next"=>nil}, {"event"=>"callFailure", "next"=>nil}]}]}}

HEADERS

KeyDatatypeRequiredDescription
tw-active-account-sidstring
x-twilio-accountidstring
i-twilio-auth-account-sidstring