@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Twilio - Studio
@base https://studio.twilio.com
@version 1.0.0
@auth Bearer basic
@endpoints 19
@toc Flows(19)

@endpoint GET /v2/Flows/{FlowSid}/Executions
@desc Retrieve a list of all Executions for the Flow.
@required {FlowSid: str # The SID of the Flow with the Execution resources to read.}
@optional {DateCreatedFrom: str(date-time) # Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`., DateCreatedTo: str(date-time) # Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`., PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {executions: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint POST /v2/Flows/{FlowSid}/Executions
@desc Triggers a new Execution for the Flow
@required {FlowSid: str # The SID of the Excecution's Flow.}
@returns(201) {sid: str?, account_sid: str?, flow_sid: str?, contact_channel_address: str?, contact_sid: str?, flow_version: int?, context: any?, status: str, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?, links: map?} # Created

@endpoint GET /v2/Flows/{FlowSid}/Executions/{Sid}
@desc Retrieve an Execution
@required {FlowSid: str # The SID of the Flow with the Execution resource to fetch, Sid: str # The SID of the Execution resource to fetch.}
@returns(200) {sid: str?, account_sid: str?, flow_sid: str?, contact_channel_address: str?, contact_sid: str?, flow_version: int?, context: any?, status: str, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?, links: map?} # OK

@endpoint DELETE /v2/Flows/{FlowSid}/Executions/{Sid}
@desc Delete the Execution and all Steps relating to it.
@required {FlowSid: str # The SID of the Flow with the Execution resources to delete., Sid: str # The SID of the Execution resource to delete.}
@returns(204) The resource was deleted successfully.

@endpoint POST /v2/Flows/{FlowSid}/Executions/{Sid}
@desc Update the status of an Execution to `ended`.
@required {FlowSid: str # The SID of the Flow with the Execution resources to update., Sid: str # The SID of the Execution resource to update.}
@returns(200) {sid: str?, account_sid: str?, flow_sid: str?, contact_channel_address: str?, contact_sid: str?, flow_version: int?, context: any?, status: str, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?, links: map?} # OK

@endpoint GET /v2/Flows/{FlowSid}/Executions/{ExecutionSid}/Context
@desc Retrieve the most recent context for an Execution.
@required {FlowSid: str # The SID of the Flow with the Execution context to fetch., ExecutionSid: str # The SID of the Execution context to fetch.}
@returns(200) {account_sid: str?, context: any?, flow_sid: str?, execution_sid: str?, url: str(uri)?} # OK

@endpoint GET /v2/Flows/{FlowSid}/Executions/{ExecutionSid}/Steps
@desc Retrieve a list of all Steps for an Execution.
@required {FlowSid: str # The SID of the Flow with the Steps to read., ExecutionSid: str # The SID of the Execution with the Steps to read.}
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {steps: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v2/Flows/{FlowSid}/Executions/{ExecutionSid}/Steps/{Sid}
@desc Retrieve a Step.
@required {FlowSid: str # The SID of the Flow with the Step to fetch., ExecutionSid: str # The SID of the Execution resource with the Step to fetch., Sid: str # The SID of the ExecutionStep resource to fetch.}
@returns(200) {sid: str?, account_sid: str?, flow_sid: str?, execution_sid: str?, parent_step_sid: str?, name: str?, context: any?, transitioned_from: str?, transitioned_to: str?, type: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?, links: map?} # OK

@endpoint GET /v2/Flows/{FlowSid}/Executions/{ExecutionSid}/Steps/{StepSid}/Context
@desc Retrieve the context for an Execution Step.
@required {FlowSid: str # The SID of the Flow with the Step to fetch., ExecutionSid: str # The SID of the Execution resource with the Step to fetch., StepSid: str # The SID of the Step to fetch.}
@returns(200) {account_sid: str?, context: any?, execution_sid: str?, flow_sid: str?, step_sid: str?, url: str(uri)?} # OK

@endpoint POST /v2/Flows
@desc Create a Flow.
@returns(201) {sid: str?, account_sid: str?, author_sid: str?, friendly_name: str?, definition: any?, status: str, revision: int, commit_message: str?, valid: bool?, errors: [any]?, warnings: [any]?, date_created: str(date-time)?, date_updated: str(date-time)?, webhook_url: str(uri)?, url: str(uri)?, links: map?} # Created

@endpoint GET /v2/Flows
@desc Retrieve a list of all Flows.
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {flows: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint POST /v2/Flows/{Sid}
@desc Update a Flow.
@required {Sid: str # The SID of the Flow resource to fetch.}
@returns(200) {sid: str?, account_sid: str?, author_sid: str?, friendly_name: str?, definition: any?, status: str, revision: int, commit_message: str?, valid: bool?, errors: [any]?, warnings: [any]?, date_created: str(date-time)?, date_updated: str(date-time)?, webhook_url: str(uri)?, url: str(uri)?, links: map?} # OK

@endpoint GET /v2/Flows/{Sid}
@desc Retrieve a specific Flow.
@required {Sid: str # The SID of the Flow resource to fetch.}
@returns(200) {sid: str?, account_sid: str?, author_sid: str?, friendly_name: str?, definition: any?, status: str, revision: int, commit_message: str?, valid: bool?, errors: [any]?, warnings: [any]?, date_created: str(date-time)?, date_updated: str(date-time)?, webhook_url: str(uri)?, url: str(uri)?, links: map?} # OK

@endpoint DELETE /v2/Flows/{Sid}
@desc Delete a specific Flow.
@required {Sid: str # The SID of the Flow resource to delete.}
@returns(204) The resource was deleted successfully.

@endpoint GET /v2/Flows/{Sid}/Revisions
@desc Retrieve a list of all Flows revisions.
@required {Sid: str # The SID of the Flow resource to fetch.}
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {revisions: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v2/Flows/{Sid}/Revisions/{Revision}
@desc Retrieve a specific Flow revision.
@required {Sid: str # The SID of the Flow resource to fetch., Revision: str # Specific Revision number or can be `LatestPublished` and `LatestRevision`.}
@returns(200) {sid: str?, account_sid: str?, author_sid: str?, friendly_name: str?, definition: any?, status: str, revision: int, commit_message: str?, valid: bool?, errors: [any]?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint POST /v2/Flows/Validate
@desc Validate flow JSON definition
@returns(200) {valid: bool?} # OK

@endpoint GET /v2/Flows/{Sid}/TestUsers
@desc Fetch flow test users
@required {Sid: str # Unique identifier of the flow.}
@returns(200) {sid: str?, test_users: [str]?, url: str(uri)?} # OK

@endpoint POST /v2/Flows/{Sid}/TestUsers
@desc Update flow test users
@required {Sid: str # Unique identifier of the flow.}
@returns(200) {sid: str?, test_users: [str]?, url: str(uri)?} # OK

@end
