# Studio Flow and Widget JSON Schemas

Official [JSON Schemas](https://json-schema.org/) for Studio Flow definitions and widgets are available in the list below. Flow definitions must adhere to these schemas when creating or updating via the [Flows REST API](/docs/studio/rest-api/v2/flow).

These schemas can be used for reference or for client-side validation in your local development environment. For sample Flow definitions to use in your applications, use the JSON snippets from [Studio Flow Definition](/docs/studio/rest-api/v2/flow-definition).

```json title="Flow Definition Schema"
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/flow-definition",
    "title": "Definition schema for twilio studio flow ",
    "type": "object",
    "definitions": {
      "Flags": {
        "type": "object",
        "properties": {
          "allow_concurrent_calls": {
            "type": "boolean"
          }
        },
        "required": [
          "allow_concurrent_calls"
        ]
      }
    },
    "properties": {
      "description": {
        "type": "string"
      },
      "$schema": {
        "type": "string",
        "enum": [
          "https://schemas.twilio.com/studio/draft/2019-09/flow-definition"
        ],
        "default": "https://schemas.twilio.com/studio/draft/2019-09/flow-definition"
      },
      "flags": {
        "$ref": "#/definitions/Flags"
      },
      "initial_state": {
        "type": "string",
        "minLength": 1
      },
      "states": {
        "type": "array",
        "additionalItems": false,
        "minItems": 1,
        "maxItems": 1000,
        "items": {
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "add-member-to-chat-channel",
                "add-twiml-redirect",
                "capture-payments",
                "connect-call-to",
                "create-chat-channel",
                "create-task",
                "enqueue-call",
                "fork-stream",
                "gather-input-on-call",
                "make-http-request",
                "make-outgoing-call-v1",
                "make-outgoing-call-v2",
                "record-call",
                "record-voicemail",
                "run-function",
                "run-function-v2",
                "say-play",
                "send-and-wait-for-reply",
                "send-message",
                "send-to-flex",
                "set-variables",
                "split-based-on",
                "run-subflow",
                "trigger",
                "understand",
                "update-sync-object",
                "connect-virtual-agent",
                "connect-virtual-agent-v2"
              ]
            }
          },
          "required": [
            "type"
          ],
          "allOf": [
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "add-member-to-chat-channel"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/add-member-to-chat-channel"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "connect-call-to"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/connect-call-to"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "create-chat-channel"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/create-chat-channel"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "create-task"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/create-task"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "make-outgoing-call-v1"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/2/make-outgoing-call-v1"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "make-outgoing-call-v2"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/2/make-outgoing-call-v2"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "enqueue-call"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/enqueue-call"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "fork-stream"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/fork-stream"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "gather-input-on-call"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/gather-input-on-call"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "make-http-request"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/make-http-request"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "capture-payments"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/capture-payments"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "record-call"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/record-call"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "record-voicemail"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/record-voicemail"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "add-twiml-redirect"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/add-twiml-redirect"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "run-function"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/run-function"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "run-function-v2"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/run-function-v2"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "say-play"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/say-play"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "send-and-wait-for-reply"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/send-and-wait-for-reply"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "send-message"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/send-message"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "send-to-flex"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/send-to-flex"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "set-variables"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/set-variables"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "split-based-on"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/split-based-on"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "run-subflow"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/run-subflow"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "trigger"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/trigger"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "understand"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/understand"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "update-sync-object"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/update-sync-object"
              }
            },
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "connect-virtual-agent"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/connect-virtual-agent"
              }
            },
            
            {
              "if": {
                "properties": {
                  "type": {
                    "const": "connect-virtual-agent-v2"
                  }
                }
              },
              "then": {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/connect-virtual-agent-v2"
              }
            }            
          ]
        }
      }
    },
    "required": [
      "description",
      "initial_state",
      "states"
    ],
    "schema_revision": 1
}
```

```json title="Trigger Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/trigger",
    "title": "Trigger",
    "description": "The trigger widget",
    "definitions": {
      "IncomingCall": {
        "type": "object",
        "title": "Incoming Call",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "incomingCall"
              }
            },
            "required": [
              "event"
            ]
          }
        ]
      },
      "IncomingMessage": {
        "type": "object",
        "title": "Incoming Message (SMS or Chat)",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "incomingMessage"
              }
            },
            "required": [
              "event"
            ]
          }
        ]
      },
      "IncomingRequest": {
        "type": "object",
        "title": "REST API",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "incomingRequest"
              }
            },
            "required": [
              "event"
            ]
          }
        ]
      },
      "IncomingParent": {
        "type": "object",
        "title": "Incoming Parent",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "incomingParent"
              }
            },
            "required": [
              "event"
            ]
          }
        ]
      },
      "IncomingConversation": {
        "type": "object",
        "title": "Incoming Conversation",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "incomingConversationMessage"
              }
            },
            "required": [
              "event"
            ]
          }
        ]
      }
    },
    "type": "object",
    "properties": {
      "type": {
        "type": "string",
        "const": "trigger"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "minLength": 1,
        "items": {
          "anyOf": [
            {
              "$ref": "#/definitions/IncomingCall"
            },
            {
              "$ref": "#/definitions/IncomingMessage"
            },
            {
              "$ref": "#/definitions/IncomingRequest"
            },
            {
              "$ref": "#/definitions/IncomingParent"
            },
            {
              "$ref": "#/definitions/IncomingConversation"
            }
          ]
        }
      },
      "properties": {
        "type": "object"
      }
    },
    "required": [
      "type",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 2
}
```

```json title="Capture Payments Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/capture-payments",
    "type": "object",
    "title": "Capture Payments",
    "definitions": {
      "MaxFailedAttempts": {
        "type": "object",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "maxFailedAttempts"
              }
            }
          }
        ]
      },
      "ProviderError": {
        "type": "object",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "providerError"
              }
            }
          }
        ]
      },
      "ValidationError": {
        "type": "object",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "validationError"
              }
            }
          }
        ]
      },
      "PayInterrupted": {
        "type": "object",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "payInterrupted"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "capture-payments"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "timeout": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 5
          },
          "max_attempts": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3,
            "default": 2
          },
          "security_code": {
            "type": "boolean"
          },
          "postal_code": {
            "type": "string"
          },
          "payment_connector": {
            "type": "string"
          },
          "payment_token_type": {
            "type": "string",
            "enum": [
              "one-time",
              "reusable"
            ],
            "default": "reusable"
          },
          "payment_amount": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": [
                "eur",
                "gbp",
                "usd"
            ],
            "default": "usd"
          },
          "description": {
            "type": "string"
          },
          "valid_card_types": {
            "type": "array",
            "additionalItems": false,
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "amex",
                    "diners-club",
                    "discover",
                    "enroute",
                    "jcb",
                    "maestro",
                    "master-card",
                    "mastercard",
                    "optima",
                    "visa"
                  ]
                }
              ]
            }
          },
          "language": {
            "type": "string"
          },
          "min_postal_code_length": {
            "type": "integer"
          },
          "payment_method": {
            "type": "string",
            "enum": [
              "ACH_DEBIT",
              "CREDIT_CARD"
            ]
          },
          "bank_account_type": {
            "type": "string",
            "enum": [
              "COMMERCIAL_CHECKING",
              "COMMERCIAL_SAVINGS",
              "CONSUMER_CHECKING",
              "CONSUMER_SAVINGS"
            ]
          },
          "parameters": {
            "type": "array",
            "additionalItems": false,
            "items": {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Parameter"
            }
          }
        }
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "anyOf": [
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Hangup"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Success"
            },
            {
              "$ref": "#/definitions/MaxFailedAttempts"
            },
            {
              "$ref": "#/definitions/ProviderError"
            },
            {
              "$ref": "#/definitions/ValidationError"
            },
            {
              "$ref": "#/definitions/PayInterrupted"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Connect Call To Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/connect-call-to",
    "type": "object",
    "title": "Connect Call To",
    "definitions": {
      "CallEnded": {
        "type": "object",
        "title": "Connected Call Ended",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "callCompleted"
              }
            }
          }
        ]
      },
      "Hangup": {
        "type": "object",
        "title": "Caller Hung up",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "hangup"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "connect-call-to"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "to": {
            "type": "string"
          },
          "caller_id": {
            "type": "string"
          },
          "record": {
            "type": "boolean"
          },
          "noun": {
            "type": "string",
            "enum": [
              "client",
              "conference",
              "number",
              "number-multi",
              "sim",
              "sip"
            ]
          },
          "sip_endpoint": {
            "type": "string"
          },
          "sip_username": {
            "type": "string"
          },
          "sip_password": {
            "type": "string"
          },
          "timeout": {
            "type": "integer"
          },
          "time_limit": {
            "type": "string"
          }
        },
        "required": [
          "noun"
        ]
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "anyOf": [
            {
              "$ref": "#/definitions/CallEnded"
            },
            {
              "$ref": "#/definitions/Hangup"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Enqueue Call Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/enqueue-call",
    "title": "Enqueue Call",
    "type": "object",
    "definitions": {
      "FailedToEnqueue": {
        "type": "object",
        "title": "Failed to Enqueue",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "failedToEnqueue"
              }
            }
          }
        ]
      },
      "CallFailure": {
        "type": "object",
        "title": "Call Failed",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "callFailure"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "enqueue-call"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "workflow_sid": {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WorkflowSid"
          },
          "queue_name": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "timeout": {
            "type": "integer"
          },
          "task_attributes": {
            "type": "string"
          },
          "wait_url": {
            "type": "string"
          },
          "wait_url_method": {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/HttpMethod"
          }
        }
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "anyOf": [
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/CallComplete"
            },
            {
              "$ref": "#/definitions/FailedToEnqueue"
            },
            {
              "$ref": "#/definitions/CallFailure"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Connect Virtual Agent (CX)"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/connect-virtual-agent",
    "type": "object",
    "title": "Connect Virtual Agent",
    "definitions": {
      "Return": {
        "type": "object",
        "title": "Return",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "return"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "connect-virtual-agent"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "connector": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "sentiment_analysis": {
            "type": "string"
          },
          "status_callback": {
            "type": "string"
          }
        },
        "required": [
          "connector"
        ]
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "type": "object",
          "anyOf": [
            {
              "$ref": "#/definitions/Return"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Hangup"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "end-of-life",
    "schema_revision": 2
}
```

```json title="Connect Virtual Agent V2 (CX)"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/connect-virtual-agent-v2",
    "type": "object",
    "title": "Connect Virtual Agent",
    "definitions": {
      "LiveAgentHandoff": {
        "type": "object",
        "title": "LiveAgentHandoff",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "live-agent-handoff"
              }
            }
          }
        ]
      },
      "Completed": {
        "type": "object",
        "title": "Completed",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "completed"
              }
            }
          }
        ]
      },
      "Paused": {
        "type": "object",
        "title": "Paused",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "paused"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "connect-virtual-agent-v2"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "configurations": {
            "type": "array",
            "additionalItems": false,
            "items": {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Parameter"
            }
          },
          "connector_name": {
            "type": "string"
          },
          "connector_details": {
            "type": "object",
            "properties": {
              "addon_sid": {
                "type": "string"
              },
              "installed_addon_sid": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "addon_sid",
              "installed_addon_sid",
              "name"
            ]
          },
          "channel": {
            "type": "string",
            "default": "voice",
            "enum": [
              "voice",
              "conversations"
            ]
          },
          "parameters": {
            "type": "array",
            "additionalItems": false,
            "items": {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Parameter"
            }
          },
          "status_callback": {
            "type": "string"
          },
          "status_callback_method": {
            "type": "string",
            "default": "POST"
          },
          "timeout": {
            "type": "integer",
            "default": 172800
          },
          "session_behavior": {
            "type": "string",
            "default": "new_session",
            "enum": [
              "new_session",
              "resume_paused_session"
            ]
          },
          "resume_session_identification_method": {
            "type": "string",
            "default": "widget",
            "enum": [
              "widget",
              "manual"
            ]
          },
          "resume_session_identification_value": {
            "$comment": "This will either reference a ConnectVirtualAgent's unique widget name or liquid for a ConnectVirtualAgent's EndUserId",
            "type": "string"
          },
          "resume_session_event_name": {
            "type": "string"
          }
        },
        "required": []
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "type": "object",
          "anyOf": [
            {
              "$ref": "#/definitions/Completed"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Hangup"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Timeout"
            },
            {
              "$ref": "#/definitions/LiveAgentHandoff"
            },
            {
              "$ref": "#/definitions/Paused"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Failed"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 2
}
```

```json title="Fork Stream Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/fork-stream",
    "type": "object",
    "title": "Fork Stream",
    "properties": {
      "type": {
        "type": "string",
        "const": "fork-stream"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "stream_action": {
            "type": "string",
            "enum": [
              "start",
              "stop"
            ],
            "default": "start"
          },
          "stream_name": {
            "type": "string"
          },
          "stream_transport_type": {
            "type": "string",
            "enum": [
              "siprec",
              "websocket"
            ],
            "default": "webSocket"
          },
          "stream_connector": {
            "type": "string"
          },
          "stream_url": {
            "type": "string"
          },
          "stream_track": {
            "type": "string",
            "enum": [
              "both_tracks",
              "inbound_track",
              "outbound_track"
            ],
            "default": "inbound_track"
          },
          "stream_parameters": {
            "type": "array",
            "additionalItems": false,
            "items": {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Parameter"
            }
          }
        },
        "transitions": {
          "type": "array",
          "additionalItems": false,
          "items": {
            "type": "object",
            "allOf": [
              {
                "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
              },
              {
                "properties": {
                  "event": {
                    "type": "string",
                    "const": "next"
                  }
                }
              }
            ]
          }
        }
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "type": "object",
          "allOf": [
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
            },
            {
              "properties": {
                "event": {
                  "type": "string",
                  "const": "next"
                }
              }
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Gather Input On Call Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/gather-input-on-call",
    "type": "object",
    "title": "Gather Input On Call",
    "definitions": {
      "KeyPress": {
        "type": "object",
        "title": "User Pressed Keys",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "keypress"
              }
            }
          }
        ]
      },
      "Speech": {
        "type": "object",
        "title": "User Said Something",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "speech"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "gather-input-on-call"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "timeout": {
            "type": "integer"
          },
          "finish_on_key": {
            "type": "string"
          },
          "stop_gather": {
            "type": "boolean"
          },
          "number_of_digits": {
            "type": "integer"
          },
          "save_response_as": {
            "type": "string"
          },
          "say": {
            "type": "string"
          },
          "play": {
            "type": "string"
          },
          "voice": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "loop": {
            "type": "integer"
          },
          "hints": {
            "type": "string"
          },
          "gather_language": {
            "type": "string"
          },
          "speech_timeout": {
            "type": "string"
          },
          "speech_model": {
            "type": "string"
          },
          "profanity_filter": {
            "type": "string"
          }
        },
        "oneOf": [
          {
            "required": [
              "say"
            ]
          },
          {
            "required": [
              "play"
            ]
          }
        ]
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "anyOf": [
            {
              "$ref": "#/definitions/KeyPress"
            },
            {
              "$ref": "#/definitions/Speech"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Timeout"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Hangup"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Make HTTP Request Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/make-http-request",
    "title": "Make HTTP Request",
    "type": "object",
    "properties": {
      "type": {
        "type": "string",
        "const": "make-http-request"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "method": {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/HttpMethod",
            "default": "GET"
          },
          "url": {
            "type": "string",
            "minLength": 1
          },
          "body": {
            "type": "string"
          },
          "parameters": {
            "type": "array",
            "additionalItems": false,
            "items": {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Parameter"
            }
          },
          "content_type": {
            "type": "string",
            "default": "application/x-www-form-urlencoded"
          },
          "add_twilio_auth": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "url"
        ]
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "anyOf": [
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Success"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Failed"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga"
}
```

```json title="Make Outgoing Call v1 Schema (Deprecated)"
{
  "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
  "$id": "https://schemas.twilio.com/studio/draft/2019-09/2/make-outgoing-call-v1",
  "title": "Make Outgoing Call",
  "type": "object",
  "definitions": {
    "AnsweredByMachine": {
      "type": "object",
      "allOf": [
        {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
        },
        {
          "properties": {
            "event": {
              "type": "string",
              "const": "answeredByMachine"
            }
          }
        }
      ]
    },
    "Answered": {
      "type": "object",
      "allOf": [
        {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
        },
        {
          "properties": {
            "event": {
              "type": "string",
              "const": "answered"
            }
          }
        }
      ]
    },
    "Busy": {
      "type": "object",
      "allOf": [
        {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
        },
        {
          "properties": {
            "event": {
              "type": "string",
              "const": "busy"
            }
          }
        }
      ]
    },
    "NoAnswer": {
      "type": "object",
      "allOf": [
        {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
        },
        {
          "properties": {
            "event": {
              "type": "string",
              "const": "noAnswer"
            }
          }
        }
      ]
    },
    "Hangup": {
      "type": "object",
      "allOf": [
        {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
        },
        {
          "properties": {
            "event": {
              "type": "string",
              "const": "hangup"
            }
          }
        }
      ]
    }
  },
  "properties": {
    "type": {
      "type": "string",
      "const": "make-outgoing-call-v1"
    },
    "name": {
      "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
    },
    "properties": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "title": "Number to make call from",
          "default": "{{contact.channel.address}}"
        },
        "to": {
          "type": "string",
          "title": "Number to call",
          "default": "{{flow.channel.address}}"
        },
        "record": {
          "type": "boolean"
        },
        "timeout": {
          "type": "integer"
        }
      },
      "required": [
        "from",
        "to"
      ]
    },
    "transitions": {
      "type": "array",
      "additionalItems": false,
      "items": {
        "anyOf": [
          {
            "$ref": "#/definitions/Answered"
          },
          {
            "$ref": "#/definitions/Busy"
          },
          {
            "$ref": "#/definitions/NoAnswer"
          },
          {
            "$ref": "#/definitions/AnsweredByMachine"
          },
          {
            "$ref": "#/definitions/Hangup"
          },
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Failed"
          }
        ]
      }
    }
  },
  "required": [
    "properties",
    "transitions"
  ],
  "maturity": "ga",
  "schema_revision": 1
}
```

```json title="Make Outgoing Call v2 Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/2/make-outgoing-call-v2",
    "title": "Make Outgoing Call",
    "type": "object",
    "definitions": {
      "Answered": {
        "type": "object",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "answered"
              }
            }
          }
        ]
      },
      "Busy": {
        "type": "object",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "busy"
              }
            }
          }
        ]
      },
      "NoAnswer": {
        "type": "object",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "noAnswer"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "make-outgoing-call-v2"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "title": "Number to make call from",
            "default": "{{contact.channel.address}}"
          },
          "to": {
            "type": "string",
            "title": "Number to call",
            "default": "{{flow.channel.address}}"
          },
          "record": {
            "type": "boolean"
          },
          "recording_channels": {
            "type": "string"
          },
          "recording_status_callback": {
            "type": "string"
          },
          "trim": {
            "type": "string"
          },
          "detect_answering_machine": {
            "type": "boolean"
          },
          "machine_detection": {
            "type": "string"
          },
          "machine_detection_timeout": {
            "type": "string"
          },
          "machine_detection_speech_threshold": {
            "type": "string"
          },
          "machine_detection_speech_end_threshold": {
            "type": "string"
          },
          "machine_detection_silence_timeout": {
            "type": "string"
          },
          "send_digits": {
            "type": "string"
          },
          "timeout": {
            "type": "integer",
            "minimum": 0,
            "maximum": 600
          },
          "sip_auth_username": {
            "type": "string"
          },
          "sip_auth_password": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to"
        ]
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "anyOf": [
            {
              "$ref": "#/definitions/Answered"
            },
            {
              "$ref": "#/definitions/Busy"
            },
            {
              "$ref": "#/definitions/NoAnswer"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Failed"
            }
          ]
        }
      }
    },
    "required": [
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Update Profile Traits"
{
  "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
  "$id": "https://schemas.twilio.com/studio/draft/2019-09/update-profile-traits",
  "type": "object",
  "title": "Update Profile Traits",
  "description": "Update a profile's traits in a connected CDP",
  "definitions": {
    "ProfileUpdated": {
      "$id": "profileUpdated",
      "type": "object",
      "title": "Profile Updated",
      "allOf": [
        {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
        },
        {
          "properties": {
            "event": {
              "type": "string",
              "const": "profileUpdated"
            }
          }
        }
      ]
    },
    "ProfileNotFound": {
      "$id": "profileNotFound",
      "type": "object",
      "title": "Profile was not found",
      "allOf": [
        {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
        },
        {
          "properties": {
            "event": {
              "type": "string",
              "const": "profileNotFound"
            }
          }
        }
      ]
    }
  },
  "properties": {
    "type": {
      "type": "string",
      "const": "update-profile-traits"
    },
    "name": {
      "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
    },
    "properties": {
      "type": "object",
      "properties": {
        "profile_connect_sid": {
          "type": "string"
        },
        "traits": {
          "type": "array",
          "additionalItems": false,
          "items": {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Parameter"
          }
        },
        "context": {
          "type": "string"
        }
      }
    },
    "transitions": {
      "type": "array",
      "additionalItems": false,
      "minItems": 0,
      "items": {
        "anyOf": [
          {
            "$ref": "#/definitions/ProfileUpdated"
          },
          {
            "$ref": "#/definitions/ProfileNotFound"
          },
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Failed"
          }
        ]
      }
    }
  },
  "required": [
    "type",
    "name",
    "properties",
    "transitions"
  ],
  "maturity": "beta",
  "schema_revision": 1
}
```

```json title="Record Call Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/record-call",
    "type": "object",
    "title": "Record Call",
    "properties": {
      "type": {
        "type": "string",
        "const": "record-call"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "record_call": {
            "type": "boolean"
          },
          "recording_status_callback": {
            "type": "string"
          },
          "recording_status_callback_method": {
            "type": "string"
          },
          "recording_status_callback_events": {
            "type": "string"
          },
          "recording_channels": {
            "type": "string"
          },
          "trim": {
            "type": "string"
          }
        }
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "anyOf": [
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Success"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Failed"
            }
          ]
        }
      }
    },
    "required": [
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Record Voicemail Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/record-voicemail",
    "type": "object",
    "title": "Record Voicemail",
    "definitions": {
      "RecordingComplete": {
        "type": "object",
        "title": "On Reply",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "recordingComplete"
              }
            }
          }
        ]
      },
      "NoAudio": {
        "type": "object",
        "title": "On Reply",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "noAudio"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "record-voicemail"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "timeout": {
            "title": "Stop recording after (in seconds)",
            "type": "integer"
          },
          "finish_on_key": {
            "type": "string"
          },
          "max_length": {
            "type": "integer",
            "default": 3600
          },
          "transcribe": {
            "type": "boolean"
          },
          "transcription_callback_url": {
            "type": "string"
          },
          "trim": {
            "type": "string"
          },
          "play_beep": {
            "type": "string"
          },
          "recording_status_callback_url": {
            "type": "string"
          }
        }
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "anyOf": [
            {
              "$ref": "#/definitions/RecordingComplete"
            },
            {
              "$ref": "#/definitions/NoAudio"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Hangup"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Run Function Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/run-function",
    "type": "object",
    "title": "Run Function",
    "definitions": {
      "Fail": {
        "type": "object",
        "title": "Fail",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "fail"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "run-function"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "parameters": {
            "type": "array",
            "minLength": 1,
            "items": {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Parameter"
            }
          }
        },
        "required": [
          "url"
        ]
      },
      "transitions": {
        "type": "array",
        "items": {
          "anyOf": [
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Success"
            },
            {
              "$ref": "#/definitions/Fail"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Say/Play Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/say-play",
    "type": "object",
    "title": "Say Play",
    "definitions": {
      "AudioComplete": {
        "type": "object",
        "title": "Audio Complete",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "audioComplete"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "say-play"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "say": {
            "type": "string"
          },
          "play": {
            "type": "string"
          },
          "voice": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "loop": {
            "type": "integer"
          },
          "digits": {
            "type": "string"
          }
        },
        "oneOf": [
          {
            "required": [
              "say"
            ]
          },
          {
            "required": [
              "play"
            ]
          },
          {
            "required": [
              "digits"
            ]
          }
        ]
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "anyOf": [
            {
              "$ref": "#/definitions/AudioComplete"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Hangup"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Search for a Profile"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/look-up-profile",
    "type": "object",
    "title": "Look Up Profile",
    "description": "Look up a profile from a connected CDP based on identifier",
    "definitions": {
      "ProfileFound": {
        "$id": "profileFound",
        "type": "object",
        "title": "Profile Found",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "profileFound"
              }
            }
          }
        ]
      },
      "NoProfileFound": {
        "$id": "noProfileFound",
        "type": "object",
        "title": "No Profile Found",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "noProfileFound"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "look-up-profile"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "connector_instance_name": {
            "type": "string"
          },
          "profile_connector_instance": {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/ProfileConnectorInstance"
          },
          "identifiers": {
            "type": "array",
            "minLength": 1,
            "items": {
              "type": "string"
            }
          },
          "identifier": {
            "type": "string"
          },
          "contact_identifier_value": {
            "type": "string"
          },
          "context": {
            "type": "string"
          }
        },
        "required": [
          "contact_identifier_value"
        ]
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "minItems": 0,
        "items": {
          "anyOf": [
            {
              "$ref": "#/definitions/ProfileFound"
            },
            {
              "$ref": "#/definitions/NoProfileFound"
            },
            {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Failed"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Send & Wait For Reply Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/send-and-wait-for-reply",
    "title": "Send and wait for reply",
    "type": "object",
    "definitions": {
      "Reply": {
        "type": "object",
        "title": "On Reply",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "incomingMessage"
              }
            }
          }
        ]
      },
      "NoReply": {
        "type": "object",
        "title": "Failed to Send",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "timeout"
              }
            }
          }
        ]
      },
      "DeliveryFails": {
        "type": "object",
        "title": "Failed to Send",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "deliveryFailure"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "send-and-wait-for-reply"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "default": "{{flow.channel.address}}"
          },
          "timeout": {
            "oneOf":[
              {
                "type": "string",
                "default": "3600"
              },
              {
                "type": "integer",
                "default": 3600
              }
            ]
          },
          "save_response_as": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "service": {
            "title": "Programmable Chat Service",
            "type": "string",
            "default": "{{trigger.message.InstanceSid}}"
          },
          "channel": {
            "type": "string",
            "title": "Programmable Chat Channel",
            "default": "{{trigger.message.ChannelSid}}"
          },
          "attributes": {
            "type": "string",
            "title": "Message Attributes"
          },
          "content_sid": {
            "type": "string"
          },
          "content_variables": {
            "type": "array",
            "additionalItems": false,
            "items": {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Parameter"
            }
          },
          "message_type": {
            "type": "string"
          }
        },
        "required": [
          "from"
        ]
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "minItems": 1,
        "items": {
          "oneOf": [
            {
              "$ref": "#/definitions/Reply"
            },
            {
              "$ref": "#/definitions/NoReply"
            },
            {
              "$ref": "#/definitions/DeliveryFails"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Send Message Schema"
{
    "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
    "$id": "https://schemas.twilio.com/studio/draft/2019-09/send-message",
    "type": "object",
    "title": "Send Message",
    "definitions": {
      "Sent": {
        "type": "object",
        "title": "Message Sent",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "sent"
              }
            }
          }
        ]
      },
      "Failed": {
        "type": "object",
        "title": "Failed to Send",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "failed"
              }
            }
          }
        ]
      }
    },
    "properties": {
      "type": {
        "type": "string",
        "const": "send-message"
      },
      "name": {
        "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
      },
      "properties": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "default": "{{flow.channel.address}}"
          },
          "to": {
            "type": "string",
            "default": "{{contact.channel.address}}"
          },
          "media_url": {
            "type": "string"
          },
          "service": {
            "title": "Programmable Chat Service",
            "type": "string",
            "default": "{{trigger.message.InstanceSid}}"
          },
          "channel": {
            "type": "string",
            "title": "Programmable Chat Channel",
            "default": "{{trigger.message.ChannelSid}}"
          },
          "attributes": {
            "type": "string",
            "title": "Message Attributes"
          },
          "content_sid": {
            "type": "string"
          },
          "content_variables": {
            "type": "array",
            "additionalItems": false,
            "items": {
              "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/Parameter"
            }
          },
          "message_type": {
            "type": "string"
          }
        },
        "required": [
          "from"
        ]
      },
      "transitions": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "anyOf": [
            {
              "$ref": "#/definitions/Sent"
            },
            {
              "$ref": "#/definitions/Failed"
            }
          ]
        }
      }
    },
    "required": [
      "type",
      "name",
      "properties",
      "transitions"
    ],
    "maturity": "ga",
    "schema_revision": 1
}
```

```json title="Send to Flex Schema"
{
  "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
  "$id": "https://schemas.twilio.com/studio/draft/2019-09/send-to-flex",
  "type": "object",
  "title": "Send To Flex",
  "description": "Sends the call or chat message to flex",
  "definitions": {
    "FailedToEnqueue": {
      "$id": "failedToEnqueue",
      "type": "object",
      "title": "Task Creation Failed",
      "allOf": [
        {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
        },
        {
          "properties": {
            "event": {
              "type": "string",
              "const": "failedToEnqueue"
            }
          }
        }
      ]
    },
    "CallFailure": {
      "$id": "CallFailure",
      "type": "object",
      "title": "Call Failed",
      "description": "Call failed to enqueue",
      "allOf": [
        {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
        },
        {
          "properties": {
            "event": {
              "type": "string",
              "const": "callFailure"
            }
          }
        }
      ]
    },
    "ComposerStarted": {
      "$id": "composerStarted",
      "type": "object",
      "title": "Composer Started",
      "description": "Execution was started by Composer via Flow Inversion",
      "allOf": [
        {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
        },
        {
          "properties": {
            "event": {
              "type": "string",
              "const": "composerStarted"
            }
          }
        }
      ]
    }
  },
  "properties": {
    "type": {
      "type": "string",
      "const": "send-to-flex"
    },
    "name": {
      "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
    },
    "properties": {
      "type": "object",
      "properties": {
        "workflow": {
          "type": "string",
          "pattern": "^.*\\S+.*$",
          "minLength": 1
        },
        "channel": {
          "type": "string",
          "pattern": "^.*\\S+.*$",
          "minLength": 1
        },
        "attributes": {
          "type": "string"
        },
        "timeout": {
          "oneOf": [
            {"type": "string"},
            {"type": "integer"}
          ]
        },
        "priority": {
          "type": "string"
        },
        "waitUrl": {
          "type": "string"
        },
        "waitUrlMethod": {
          "type": "string"
        }
      },
      "required": [
        "workflow",
        "channel"
      ]
    },
    "transitions": {
      "type": "array",
      "additionalItems": false,
      "minItems": 0,
      "items": {
        "anyOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/CallComplete"
          },
          {
            "$ref": "#/definitions/FailedToEnqueue"
          },
          {
            "$ref": "#/definitions/CallFailure"
          },
          {
            "$ref": "#/definitions/ComposerStarted"
          }
        ]
      }
    }
  },
  "required": [
    "type",
    "name",
    "properties",
    "transitions"
  ],
  "maturity": "ga",
  "schema_revision": 1
}
```

```json title="Set Variables Schema"
{
  "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
  "$id": "https://schemas.twilio.com/studio/draft/2019-09/set-variables",
  "type": "object",
  "title": "Set Variables",
  "properties": {
    "type": {
      "type": "string",
      "const": "set-variables"
    },
    "name": {
      "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
    },
    "properties": {
      "variables": {
        "type": "array",
        "additionalItems": false,
        "items": {
          "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/TypedParameter"
        }
      }
    },
    "transitions": {
      "type": "array",
      "additionalItems": false,
      "items": {
        "type": "object",
        "allOf": [
          {
            "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/NextLink"
          },
          {
            "properties": {
              "event": {
                "type": "string",
                "const": "next"
              }
            }
          }
        ]
      }
    }
  },
  "required": [
    "type",
    "name",
    "properties",
    "transitions"
  ],
  "maturity": "ga",
  "schema_revision": 1
}
```

```json title="Split Based On Schema"
{
  "$schema": "https://schemas.twilio.com/studio/draft/2019-09/core#",
  "$id": "https://schemas.twilio.com/studio/draft/2019-09/split-based-on",
  "type": "object",
  "definitions": {
    "Condition": {
      "type": "object",
      "properties": {
        "friendly_name": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "enum": [
            "contains",
            "does_not_contain",
            "does_not_match_any_of",
            "does_not_start_with",
            "equal_to",
            "greater_than",
            "is_after_date",
            "is_after_time",
            "is_before_date",
            "is_before_time",
            "is_blank",
            "is_not_blank",
            "less_than",
            "matches_any_of",
            "not_equal_to",
            "regex",
            "starts_with"
          ]
        },
        "arguments": {
          "type": "array",
          "additionalItems": false,
          "minItems": 1,
          "maxItems": 100,
          "items": {
            "type": "string"
          }
        },
        "value": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "friendly_name",
        "type",
        "arguments",
        "value"
      ]
    }
  },
  "properties": {
    "type": {
      "type": "string",
      "const": "split-based-on"
    },
    "name": {
      "$ref": "https://schemas.twilio.com/studio/draft/2019-09/commons#/definitions/WidgetName"
    },
    "properties": {
      "type": "object",
      "properties": {
        "input": {
          "title": "Variable to test",
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "input"
      ]
    },
    "transitions": {
      "type": "array",
      "additionalItems": false,
      "items": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string",
            "enum": [
              "match",
              "noMatch"
            ]
          },
          "next": {
            "type": "string"
          },
          "condition": {
            "type": "array",
            "additionalItems": false,
            "items": {
              "$ref": "#/definitions/Condition"
            }
          }
        }
      }
    }
  },
  "required": [
    "type",
    "name",
    "properties",
    "transitions"
  ],
  "maturity": "ga",
  "schema_revision": 1
}
```
