> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clerk.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Twilio MediaStreams

> Creates a dedicated websocket URL for a provided inbox



## OpenAPI

````yaml /swagger.yml post /public/twilio-connector/connect
openapi: 3.0.0
info:
  title: Public API Docs
  description: Clerk Public API
  version: '1.0'
  contact: {}
servers:
  - url: https://web-api.clerk.chat
    description: Production server
  - url: http://localhost:3000
    description: Production server
security: []
tags: []
paths:
  /public/twilio-connector/connect:
    post:
      tags:
        - Twilio
      summary: Twilio MediaStreams
      description: Creates a dedicated websocket URL for a provided inbox
      operationId: PublicTwilioConnectorController_connect
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectTwilioRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TwilioConnectorResponse'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized request
        '403':
          description: You do not have permission to access this resource
        '404':
          description: Resource not found
        '422':
          description: Invalid request parameters
        '429':
          description: Too many requests for this resource
        '500':
          description: Internal server error
      security:
        - api_key: []
components:
  schemas:
    ConnectTwilioRequest:
      type: object
      properties:
        inboxExternalId:
          type: string
          description: External ID of the inbox to connect the call to
          example: inbox-123
        direction:
          type: string
          enum:
            - inbound
            - outbound
          description: Direction of the call
          default: inbound
      required:
        - inboxExternalId
    TwilioConnectorResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/TwilioConnectorObject'
      required:
        - data
    TwilioConnectorObject:
      type: object
      properties:
        connectUrl:
          type: string
          description: >-
            Websocket address to use for bi-directional streaming. See
            https://www.twilio.com/docs/voice/media-streams#bidirectional-media-streams
      required:
        - connectUrl
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apiKey

````