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

# Update Twilio Flex integration settings

> Change the Twilio Flex AI queue, worker email domain, handoff toggles, or synced task attributes.



## OpenAPI

````yaml patch /integrations/twilio-flex/settings
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /integrations/twilio-flex/settings:
    patch:
      summary: Update Twilio Flex integration settings
      description: >-
        Partially update the Twilio Flex integration: AI queue, AI worker email
        domain, handoff toggles and contact-synced task attributes. Omitted
        fields keep their value; credentials cannot be changed here and the
        TaskRouter workspace is not re-provisioned. 404 when Twilio Flex is not
        connected.
      operationId: updateTwilioFlexSettings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ai_queue_sid:
                  description: Optional AI queue SID for routing AI-handled conversations
                  type: string
                ai_worker_email_domain:
                  description: >-
                    Optional email domain for AI workers. When set, each worker
                    gets an email like opencx{N}-{random}@{domain} on its Twilio
                    attributes. Set to empty string or null to clear.
                  anyOf:
                    - type: string
                      minLength: 1
                      pattern: ^[a-z0-9.-]+\.[a-z]{2,}$
                    - type: 'null'
                internal_notes_enabled:
                  description: >-
                    Whether to post internal notes (e.g. the AI handoff summary)
                    to the Flex conversation. Twilio Conversations has no
                    internal-note concept — notes are delivered to ALL
                    participants including the customer — so this is disabled by
                    default. Notes are stamped with an internal_note message
                    attribute so client apps can filter them. Omitting the field
                    keeps the stored value.
                  type: boolean
                interactions_handoff_enabled:
                  description: >-
                    Whether OpenCX drives the handoff routing itself via the
                    Flex Interactions API (inviting a human into the
                    interaction). Disabled by default: most customers listen to
                    the OpenCX conversation-handoff webhook and run their own
                    Interactions transfer — enabling this on top of that
                    produces duplicate chat requests. Omitting the field keeps
                    the stored value.
                  type: boolean
                contact_synced_task_attributes:
                  description: >-
                    Task attribute names to promote from the session onto the
                    contact, written as your Flex workflow sends them (e.g.
                    "user_id", "is_hvc", "customers.name"). Empty (the default)
                    syncs nothing. Only durable, customer-level attributes
                    belong here — per-conversation values like an order id would
                    be overwritten on every new session. Omitting the field
                    keeps the stored value.
                  type: array
                  items:
                    type: string
                    minLength: 1
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  connected:
                    type: boolean
                  settings:
                    anyOf:
                      - type: object
                        properties:
                          account_sid:
                            type: string
                            description: Twilio Account SID
                          workspace_sid:
                            type: string
                            description: TaskRouter workspace SID
                          ai_queue_sid:
                            anyOf:
                              - type: string
                              - type: 'null'
                            description: >-
                              TaskRouter queue for AI-handled conversations;
                              null = none
                          ai_worker_sids:
                            type: array
                            items:
                              type: string
                            description: TaskRouter workers that represent the AI
                          ai_chat_capacity:
                            anyOf:
                              - type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              - type: 'null'
                          ai_worker_email_domain:
                            anyOf:
                              - type: string
                              - type: 'null'
                            description: >-
                              Domain used to give each AI worker an email
                              attribute; null = none
                          enabled:
                            type: boolean
                          internal_notes_enabled:
                            type: boolean
                            description: >-
                              Post the handoff summary into the conversation
                              (visible to the customer too)
                          interactions_handoff_enabled:
                            type: boolean
                            description: >-
                              OpenCX routes the handoff itself through Flex
                              Interactions
                          contact_synced_task_attributes:
                            type: array
                            items:
                              type: string
                            description: Task attributes copied onto the contact
                        required:
                          - account_sid
                          - workspace_sid
                          - ai_queue_sid
                          - ai_worker_sids
                          - ai_chat_capacity
                          - ai_worker_email_domain
                          - enabled
                          - internal_notes_enabled
                          - interactions_handoff_enabled
                          - contact_synced_task_attributes
                        additionalProperties: false
                      - type: 'null'
                  unusable_contact_sync_attributes:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        reason:
                          type: string
                          enum:
                            - invalid
                            - not_seen
                      required:
                        - name
                        - reason
                      additionalProperties: false
                    description: >-
                      Synced attribute names that will never match: 'invalid' =
                      malformed, 'not_seen' = absent from recent tasks.
                      Advisory; the save still happened.
                required:
                  - connected
                  - settings
                  - unusable_contact_sync_attributes
                additionalProperties: false
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.