{
  "components": {
    "securitySchemes": {
      "accountSid_authToken": {
        "scheme": "basic",
        "type": "http"
      }
    },
    "schemas": {
      "flex.v2.flex_user": {
        "type": "object",
        "properties": {
          "account_sid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^AC[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "The unique SID of the account that created the resource."
          },
          "instance_sid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^GO[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "The unique ID created by Twilio to identify a Flex instance."
          },
          "user_sid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^US[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "The unique SID identifier of the Twilio Unified User."
          },
          "flex_user_sid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^FU[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "The unique SID identifier of the Flex User."
          },
          "worker_sid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^WK[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "The unique SID identifier of the worker."
          },
          "workspace_sid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^WS[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "The unique SID identifier of the workspace."
          },
          "flex_team_sid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^QO[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "The unique SID identifier of the Flex Team."
          },
          "username": {
            "type": "string",
            "nullable": true,
            "description": "Username of the User."
          },
          "email": {
            "type": "string",
            "nullable": true,
            "description": "Email of the User."
          },
          "locale": {
            "type": "string",
            "nullable": true,
            "description": "The locale preference of the user."
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The roles of the user."
          },
          "created_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "The date that this user was created, given in ISO 8601 format."
          },
          "updated_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "The date that this user was updated, given in ISO 8601 format."
          },
          "version": {
            "type": "integer",
            "default": 0,
            "description": "The current version of the user."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "nullable": true
          }
        }
      },
      "flex.v2.web_channel": {
        "type": "object",
        "properties": {
          "conversation_sid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^CH[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "The unique string representing the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) created."
          },
          "identity": {
            "type": "string",
            "nullable": true,
            "description": "The unique string representing the User created and should be authorized to participate in the Conversation. For more details, see [User Identity & Access Tokens](https://www.twilio.com/docs/conversations/identity).",
            "x-twilio": {
              "pii": {
                "handling": "standard",
                "deleteSla": 30
              }
            }
          }
        }
      }
    }
  },
  "info": {
    "title": "Twilio - Flex",
    "description": "This is the public Twilio REST API.",
    "termsOfService": "https://www.twilio.com/legal/tos",
    "contact": {
      "name": "Twilio Support",
      "url": "https://support.twilio.com",
      "email": "support@twilio.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.0",
    "x-twilio": {
      "apiStandards": "v0.1"
    }
  },
  "openapi": "3.0.1",
  "paths": {
    "/v2/Instances/{InstanceSid}/Users/{FlexUserSid}": {
      "servers": [
        {
          "url": "https://flex-api.twilio.com"
        }
      ],
      "description": "",
      "x-twilio": {
        "defaultOutputProperties": [
          "account_sid",
          "instance_sid",
          "flex_user_sid",
          "user_sid",
          "created_date"
        ],
        "mountName": "flex_user",
        "pathType": "instance"
      },
      "get": {
        "description": "Fetch flex user for the given flex user sid",
        "summary": "Fetch flex user for the given flex user sid",
        "tags": [
          "FlexV2FlexUser"
        ],
        "parameters": [
          {
            "name": "InstanceSid",
            "in": "path",
            "description": "The unique ID created by Twilio to identify a Flex instance.",
            "schema": {
              "type": "string",
              "minLength": 34,
              "maxLength": 34,
              "pattern": "^GO[0-9a-fA-F]{32}$"
            },
            "required": true
          },
          {
            "name": "FlexUserSid",
            "in": "path",
            "description": "The unique id for the flex user to be retrieved.",
            "schema": {
              "type": "string",
              "minLength": 34,
              "maxLength": 34,
              "pattern": "^FU[0-9a-fA-F]{32}$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/flex.v2.flex_user"
                },
                "examples": {
                  "fetch": {
                    "value": {
                      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "instance_sid": "GOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "flex_user_sid": "FUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "flex_team_sid": "QOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "username": "username",
                      "email": "sample@example.com",
                      "locale": "en-US",
                      "roles": [
                        "agent"
                      ],
                      "created_date": "2024-07-31T04:00:00Z",
                      "updated_date": "2024-07-31T04:00:00Z",
                      "version": 1,
                      "url": "https://flex-api.twilio.com/v2/Instances/GOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/FUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                    }
                  }
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "Specify the origin(s) allowed to access the resource",
                "schema": {
                  "type": "string"
                },
                "example": "*"
              },
              "Access-Control-Allow-Methods": {
                "description": "Specify the HTTP methods allowed when accessing the resource",
                "schema": {
                  "type": "string"
                },
                "example": "POST, OPTIONS"
              },
              "Access-Control-Allow-Headers": {
                "description": "Specify the headers allowed when accessing the resource",
                "schema": {
                  "type": "string"
                },
                "example": "Content-Type, Authorization"
              },
              "Access-Control-Allow-Credentials": {
                "description": "Indicates whether the browser should include credentials",
                "schema": {
                  "type": "boolean"
                }
              },
              "Access-Control-Expose-Headers": {
                "description": "Headers exposed to the client",
                "schema": {
                  "type": "string",
                  "example": "X-Custom-Header1, X-Custom-Header2"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "accountSid_authToken": []
          }
        ],
        "operationId": "FetchFlexUser"
      },
      "post": {
        "description": "Update flex user for the given flex user sid",
        "summary": "Update flex user for the given flex user sid",
        "tags": [
          "FlexV2FlexUser"
        ],
        "parameters": [
          {
            "name": "InstanceSid",
            "in": "path",
            "description": "The unique ID created by Twilio to identify a Flex instance.",
            "schema": {
              "type": "string",
              "minLength": 34,
              "maxLength": 34,
              "pattern": "^GO[0-9a-fA-F]{32}$"
            },
            "required": true
          },
          {
            "name": "FlexUserSid",
            "in": "path",
            "description": "The unique id for the flex user.",
            "schema": {
              "type": "string",
              "minLength": 34,
              "maxLength": 34,
              "pattern": "^FU[0-9a-fA-F]{32}$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/flex.v2.flex_user"
                },
                "examples": {
                  "update": {
                    "value": {
                      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "instance_sid": "GOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "flex_user_sid": "FUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "flex_team_sid": "QOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "username": "username",
                      "email": "sample@example.com",
                      "locale": "en-US",
                      "roles": [
                        "agent"
                      ],
                      "created_date": "2024-07-31T04:00:00Z",
                      "updated_date": "2024-07-31T04:00:00Z",
                      "version": 1,
                      "url": "https://flex-api.twilio.com/v2/Instances/GOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/FUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                    }
                  }
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "Specify the origin(s) allowed to access the resource",
                "schema": {
                  "type": "string"
                },
                "example": "*"
              },
              "Access-Control-Allow-Methods": {
                "description": "Specify the HTTP methods allowed when accessing the resource",
                "schema": {
                  "type": "string"
                },
                "example": "POST, OPTIONS"
              },
              "Access-Control-Allow-Headers": {
                "description": "Specify the headers allowed when accessing the resource",
                "schema": {
                  "type": "string"
                },
                "example": "Content-Type, Authorization"
              },
              "Access-Control-Allow-Credentials": {
                "description": "Indicates whether the browser should include credentials",
                "schema": {
                  "type": "boolean"
                }
              },
              "Access-Control-Expose-Headers": {
                "description": "Headers exposed to the client",
                "schema": {
                  "type": "string",
                  "example": "X-Custom-Header1, X-Custom-Header2"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "accountSid_authToken": []
          }
        ],
        "operationId": "UpdateFlexUser",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "title": "UpdateFlexUserRequest",
                "properties": {
                  "Email": {
                    "type": "string",
                    "description": "Email of the User."
                  },
                  "UserSid": {
                    "type": "string",
                    "minLength": 34,
                    "maxLength": 34,
                    "pattern": "^US[0-9a-fA-F]{32}$",
                    "description": "The unique SID identifier of the Twilio Unified User."
                  },
                  "Locale": {
                    "type": "string",
                    "description": "The locale preference of the user."
                  }
                }
              },
              "examples": {
                "update": {
                  "value": {
                    "Email": "sample@example.com"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/WebChats": {
      "servers": [
        {
          "url": "https://flex-api.twilio.com"
        }
      ],
      "description": "",
      "x-twilio": {
        "defaultOutputProperties": [
          "conversation_sid"
        ],
        "mountName": "web_channels",
        "className": "web_channels",
        "pathType": "list"
      },
      "post": {
        "description": "",
        "summary": "",
        "tags": [
          "FlexV2WebChannels"
        ],
        "parameters": [
          {
            "name": "Ui-Version",
            "in": "header",
            "description": "The Ui-Version HTTP request header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/flex.v2.web_channel"
                },
                "examples": {
                  "create": {
                    "value": {
                      "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "identity": "seinfeld"
                    }
                  }
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "Specify the origin(s) allowed to access the resource",
                "schema": {
                  "type": "string"
                },
                "example": "*"
              },
              "Access-Control-Allow-Methods": {
                "description": "Specify the HTTP methods allowed when accessing the resource",
                "schema": {
                  "type": "string"
                },
                "example": "POST, OPTIONS"
              },
              "Access-Control-Allow-Headers": {
                "description": "Specify the headers allowed when accessing the resource",
                "schema": {
                  "type": "string"
                },
                "example": "Content-Type, Authorization"
              },
              "Access-Control-Allow-Credentials": {
                "description": "Indicates whether the browser should include credentials",
                "schema": {
                  "type": "boolean"
                }
              },
              "Access-Control-Expose-Headers": {
                "description": "Headers exposed to the client",
                "schema": {
                  "type": "string",
                  "example": "X-Custom-Header1, X-Custom-Header2"
                }
              }
            },
            "description": "Created"
          }
        },
        "security": [
          {
            "accountSid_authToken": []
          }
        ],
        "operationId": "CreateWebChannel",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "title": "CreateWebChannelRequest",
                "properties": {
                  "AddressSid": {
                    "type": "string",
                    "description": "The SID of the Conversations Address. See [Address Configuration Resource](https://www.twilio.com/docs/conversations/api/address-configuration-resource) for configuration details. When a conversation is created on the Flex backend, the callback URL will be set to the corresponding Studio Flow SID or webhook URL in your address configuration."
                  },
                  "ChatFriendlyName": {
                    "type": "string",
                    "description": "The Conversation's friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example."
                  },
                  "CustomerFriendlyName": {
                    "type": "string",
                    "description": "The Conversation participant's friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example."
                  },
                  "PreEngagementData": {
                    "type": "string",
                    "description": "The pre-engagement data."
                  },
                  "Identity": {
                    "type": "string",
                    "description": "The Identity of the guest user. See the [Conversation User Resource](https://www.twilio.com/docs/conversations/api/user-resource) for an example."
                  }
                },
                "required": [
                  "AddressSid"
                ]
              },
              "examples": {
                "create": {
                  "value": {
                    "AddressSid": "IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                    "ChatFriendlyName": "LoquaciousLarry",
                    "CustomerFriendlyName": "LarryDavid",
                    "Identity": "seinfeld"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://flex-api.twilio.com"
    }
  ],
  "tags": [
    {
      "name": "FlexV2FlexTeam"
    },
    {
      "name": "FlexV2FlexUser"
    },
    {
      "name": "FlexV2Version"
    },
    {
      "name": "FlexV2WebChannels"
    },
    {
      "name": "FlexV2WebchatInitToken"
    },
    {
      "name": "FlexV2WebchatRefreshToken"
    }
  ],
  "security": [
    {
      "accountSid_authToken": []
    }
  ]
}