0

I was going through the REST v2 Quickstart tutorial where you can create a Flow via the API with a JSON file. Is there a way to export a Flow from a Canvas?

I created a series of wait and reply widgets flow in the Canvas and wanted to share the JSON file to other devs to import it into their local account.

chi
  • 1

1 Answers1

0

There are two options to do that, either via the UI or via the API :)

User Interface of Twilio Console

  1. Open the Flow in the Twilio Console.

  2. Click on the Trigger Widget and select Show Flow JSON. enter image description here

  3. This will display the JSON data that defines your Flow. You can copy this data and store it elsewhere.

enter image description here

Here's the docs page that explains this as well.

API

You can either use cURL or the Twilio CLI to fetch the definition of a flow:

export $(cat .env | xargs)
curl https://studio.twilio.com/v2/Flows/$QUIZ_FLOW_SID -u $ACCOUNT_SID:$AUTH_TOKEN -s  | jq ".definition" > studio-flow.json

# or
twilio api:studio:v2:flows:fetch --sid FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Here's the docs page that explains how to do this with the client library in other languages.

PS: You can import via both options as well :)

IObert
  • 2,118
  • 1
  • 10
  • 17