openapi: 3.0.0
info:
  title: SFS MS Admin API
  description: see https://symphony-1.gitbook.io/federation/

  version: 0.0.1

servers:
  - url: https://CONNECT-DOMAIN

tags:
  - name: Entitlements
    description:
      This API provides endpoints to add or remove advisor entitlements.
      <br/> Entitlements allow an advisor to use an external network such as WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE.

  - name: Contact
    description:
      This API provides endpoints to manage Contacts. A Contact is a client of the WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE network (also referred as external network). Advisor, a user of the Symphony connect platform. A contact represents the relation between an external user (a WhatsApp, Wechat, SMS, SMS Direct or LINE user), and an advisor.<br />
      When an advisor onboards, or adds an external user, they become one of their contacts

  - name: Permissions
    description:
      An API for managing permissions. Permissions give an advisor the ability to perform certain actions, for example creating a room.<br/>
      <b>Note:</b> Permissions are more specific than entitlements.<br/>
      An entitlement gives an advisor the right to use an external network (for example, Wechat) whereas a permission gives access to a specific functionality within that external network. An entitlement is a precondiction for a permission. <br />
      If you want to grant the permission "create:room" to an advisor on WhatsApp, the advisor must have the WHATSAPP entitlement.

paths:
  /api/v2/customer/entitlements:
    get:
      tags:
        - Entitlements
      summary: List entitlements (recommended)
      description: |
        List the available entitlements.
      operationId: listEntitlements
      responses:
        "200":
          description: List of found entitlements
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/entitlements-response"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
    post:
      tags:
        - Entitlements
      summary:  Add entitlement (recommended)
      description: Entitle a Symphony user to use the external network.
      operationId: addEntitlement
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/entitlement-request"
      responses:
        "201":
          description: The user has successfully been added in the list of entitlements.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/add-entitlementv2-response"
        "400":
          description: Missing or malformed input
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_400"
                  - $ref: "#/components/schemas/advisor-phone-number-not-supported-problem"
                  - $ref: "#/components/schemas/advisor-phone-number-is-required-problem"
                  - $ref: "#/components/schemas/pre-entitlement-permissions-not-supported-problem"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Add user forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/forbidden-entitlement-type"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/tenant-configuration-not-found"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/advisor-phone-number-already-used-problem"
                  - $ref: "#/components/schemas/pre-entitlement-phone-number-mismatch"
                  - $ref: "#/components/schemas/number-not-available"
                  - $ref: "#/components/schemas/number-registration-not-possible"
        "500":
          description: Server error (SMS-Direct Second Number only)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/no-available-number"

      security:
        - sfsAuthentication: []

  /api/v1/customer/pre-entitlements/{symphonyId}/externalNetwork/{externalNetwork}:
    post:
      deprecated: true
      tags:
        - Customer pre-entitlements
      summary: (deprecated) Pre-entitle an advisor to a phone number (WhatsApp Direct only)
      operationId: addPreEntitlement
      description: |
        Pre-allocate a phone number to an advisor to allow the advisor to activate their phone number.
        Supported on WhatsApp Direct only
        Umony numbers are not eligible for pre-entitlements. Symphony users using Umony numbers can skip the pre-entitlement step and be entitled directly.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          required: true
          name: symphonyId
          schema:
            type: string
            pattern: '^\d+$'
          description: Symphony User Id
        - in: path
          required: true
          name: externalNetwork
          schema:
            type: string
          description: 'External network: WHATSAPP-DIRECT'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pre-entitlement-request'
      responses:
        '200':
          description: The phone number has been successfully allocated to the user.
        '409':
          description: Missing or malformed input
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/advisor-already-has-phone-allocated-problem'
                  - $ref: '#/components/schemas/phone-number-already-allocated-problem'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/tenant-configuration-not-found'
        '400':
          description: Missing or malformed input
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/symphony-user-not-found-problem'
                  - $ref: '#/components/schemas/entitlement-type-not-found-problem'
                  - $ref: '#/components/schemas/phone-number-pre-allocation-not-supported-problem'
        '500':
          description: Pre-entitlement Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pre-entitlement-failed'
    delete:
      deprecated: true
      tags:
        - Customer pre-entitlements
      summary: (deprecated) Remove an advisor pre-entitlement (WhatsApp Direct only)
      operationId: removePreEntitlement
      description: |
        Remove an advisor pre-entitlement
        Supported on WhatsApp Direct only
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          required: true
          name: symphonyId
          schema:
            type: string
            pattern: '^\d+$'
          description: Symphony User Id
        - in: path
          required: true
          name: externalNetwork
          schema:
            type: string
          description: 'External network: WHATSAPP-DIRECT'
      responses:
        '200':
          description: The pre-entitlement has been removed successfully.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/tenant-configuration-not-found'
                  - $ref: '#/components/schemas/pre-entitlement-not-found'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advisor-already-entitled'

        '400':
          description: Missing or malformed input
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/entitlement-type-not-found-problem'

  /api/v1/customer/entitlements/externalNetwork/{externalNetwork}/advisors:
    get:
      tags:
        - Entitlements
      summary: List entitled advisors
      description: |
        List all entitled advisors on a given external network.
      operationId: listEntitledAdvisors
      parameters:
        - name: externalNetwork
          in: path
          required: true
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          schema:
            type: string
            example: WHATSAPP
        - name: before
          in: query
          description: The before cursor for pagination
          schema:
            type: string
        - name: after
          in: query
          description: The after cursor for pagination
          schema:
            type: string
        - in: query
          name: listPermissions
          schema:
            type: boolean
            default: false
          required: false
          example: true
          description: Boolean query parameter that indicates whether the search API will return the list of permissions per advisor return, or not
      responses:
        "200":
          description: List of found entitled advisors.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/entitled-response"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  "/api/v2/customer/advisor/entitlements":
    get:
      tags:
        - Entitlements
      summary: Get an advisor's entitlement (recommended)
      description: |
        Check if a given advisor is entitled for a given external network. <br/>
        Advisors can be identified using their email address or their Symphony user ID
        (if both are provided, the Symphony user ID will take precedence)
      operationId: getCustomerEntitlement
      parameters:
        - name: advisorEmailAddress
          in: query
          description: Symphony user email address
          required: false
          schema:
            type: string
            example: william.smith@symphony.com
        - name: advisorSymphonyId
          in: query
          description: Symphony user ID
          required: false
          schema:
            type: string
            example: 12345678912365
        - name: externalNetwork
          in: query
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
      responses:
        "200":
          description: Advisor data (if an entitled advisor has been found)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/entitlement-response"
        '400':
          description: Missing or malformed input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advisor-id-not-provided'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
        "404":
          description: Entitlement not found (if no entitled advisor matching the parameters has been found)
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/entitlement-not-found-problem"
        "500":
          description: No available number
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/no-available-number"
      security:
        - sfsAuthentication: []
    delete:
      tags:
        - Entitlements
      summary: Remove entitlement (recommended)
      description: |
        Removes a given advisor's entitlement for a given external network. <br/>
        Advisors can be identified using their email address or their Symphony user ID
        (if both are provided, the Symphony user ID will take precedence)
      operationId: deleteCustomerEntitlement
      parameters:
        - name: advisorEmailAddress
          in: query
          description: Advisor's email address
          required: false
          schema:
            type: string
            example: william.smith@symphony.com
        - name: advisorSymphonyId
          in: query
          description: Symphony user ID
          required: false
          schema:
            type: string
            example: 12345678912365
        - name: externalNetwork
          in: query
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
      responses:
        "200":
          description: The entitlement has been successfully removed.
        "404":
          description: Entitlement not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/entitlement-not-found-problem"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  "/api/v1/customer/entitlements/{symphonyId}/entitlementType/{entitlementType}":
    get:
      deprecated: true
      tags:
        - Entitlements
      summary: Get an advisor's entitlement searching by Symphony user ID for a given external network (deprecated)
      description: |
        Get an advisor's entitlement searching by Symphony user ID for a given external network
      operationId: getCustomerEntitlementBySymphonyId
      parameters:
        - name: symphonyId
          in: path
          description: Symphony user ID
          required: true
          schema:
            type: string
            example: 12345678912365
        - name: entitlementType
          in: path
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
      responses:
        "200":
          description: Entitlement found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/entitlement-response"
        "404":
          description: Entitlement not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/entitlement-not-found-problem"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
    delete:
      deprecated: true
      tags:
        - Entitlements
      summary: Remove an advisor's entitlement by Symphony user ID for a given external network (deprecated)
      description: |
        Remove an advisor's entitlement for a given external network
      operationId: deleteCustomerEntitlementBySymphonyId
      parameters:
        - name: symphonyId
          in: path
          description: Symphony user ID
          required: true
          schema:
            type: string
            example: 12345678912365
        - name: entitlementType
          in: path
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
      responses:
        "200":
          description: The entitlement has been successfully removed
        "404":
          description: Entitlement not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/entitlement-not-found-problem"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []

  "/api/v1/customer/advisors/{advisorSymphonyId}/blockedPhoneNumbers":
    post:
      tags:
        - CustomerBlock
      summary: Block phone numbers
      operationId: blockPhoneNumbers
      description: |
        Block phone numbers for an advisor.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: advisorSymphonyId
          schema:
            type: string
            pattern: '^\d+$'
          required: true
          description: The symphonyId for which we are blocking the phone numbers
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/customer-block-phone-numbers-request'
      responses:
        '200':
          description: Request processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customer-block-phone-numbers-response'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not-entitled-on-direct-emp'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advisor-not-found'
    get:
      tags:
        - CustomerBlock
      summary: Get blocked phone numbers
      operationId: getBlockPhoneNumbers
      description: |
        Get blocked phone numbers for an advisor.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: advisorSymphonyId
          schema:
            type: string
            pattern: '^\d+$'
          required: true
          description: The Symphony ID for which we are getting the blocked phone numbers
      responses:
        '200':
          description: Request processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-blocked-phone-numbers-response'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not-entitled-on-direct-emp'
        '404':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advisor-not-found'
    delete:
      tags:
        - CustomerBlock
      summary: Unblock phone numbers
      operationId: unblockPhoneNumbers
      description: |
        Unblock phone numbers for an advisor.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: advisorSymphonyId
          schema:
            type: string
            pattern: '^\d+$'
          required: true
          description: The Symphony ID for which we are unblocking the phone numbers
        - in: query
          name: phoneNumbers
          schema:
            type: array
            items:
              type: string
              format: phone
            minItems: 1
            maxItems: 100
          required: true
          description: The phone numbers that we want to unblock for the specified advisor
      responses:
        '200':
          description: Request processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customer-block-phone-numbers-response'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not-entitled-on-direct-emp'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advisor-not-found'

  "/api/v2/customer/advisors/{advisorSymphonyId}/blockedPhoneNumbers":
    post:
      tags:
        - CustomerBlock
      summary: Block phone numbers (recommended)
      operationId: blockPhoneNumbersv2
      description: |
        Block phone numbers for an advisor.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: advisorSymphonyId
          schema:
            type: string
            pattern: '^\d+$'
          required: true
          description: The symphonyId for which we are blocking the phone numbers
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/customer-block-phone-numbers-request'
      responses:
        '200':
          description: Request processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customer-block-phone-numbers-response'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not-entitled-on-direct-emp'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advisor-not-found'
    get:
      tags:
        - CustomerBlock
      summary: Get blocked phone numbers (recommended)
      operationId: getBlockPhoneNumbersv2
      description: |
        Get blocked phone numbers for an advisor.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: advisorSymphonyId
          schema:
            type: string
            pattern: '^\d+$'
          required: true
          description: The Symphony ID for which we are getting the blocked phone numbers
      responses:
        '200':
          description: Request processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-blocked-phone-numbers-response'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not-entitled-on-direct-emp'
        '404':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advisor-not-found'
    delete:
      tags:
        - CustomerBlock
      summary: Unblock phone numbers (recommended)
      operationId: unblockPhoneNumbersv2
      description: |
        Unblock phone numbers for an advisor.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: advisorSymphonyId
          schema:
            type: string
            pattern: '^\d+$'
          required: true
          description: The Symphony ID for which we are unblocking the phone numbers
      responses:
        '200':
          description: Request processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/customer-block-phone-numbers-response'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not-entitled-on-direct-emp'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advisor-not-found'

  "/api/v2/customer/contacts/{contactSymphonyId}/advisor/{advisorSymphonyId}":
    delete:
      tags:
        - Contact
      summary: Remove contact (recommended)
      description: |
        Remove an advisor's contact searching by the advisor's Symphony user ID and the contact's Symphony user ID
      operationId: deleteContactv2
      parameters:
        - name: advisorSymphonyId
          in: path
          description: Advisor's Symphony user ID
          required: true
          schema:
            type: string
            format: number
            example: 1234567890
        - name: contactSymphonyId
          in: path
          description: Contact's Symphony user ID
          required: true
          schema:
            type: string
            format: number
            example: 1234567890
      responses:
        "204":
          description: Contact successfully removed
        "404":
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/contact-not-found"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
      security:
        - sfsAuthentication: []
  "/api/v1/customer/contacts/advisorEmailAddress/{advisorEmailAddress}/contactEmailAddress/{contactEmailAddress}/externalNetwork/{externalNetwork}":
    delete:
      deprecated: true
      tags:
        - Contact
      summary: Remove an advisor's contact (deprecated)
      description: |
        Remove an advisor's contact searching by the advisor's email address and the contact's email address for a given external network.
      operationId: deleteContact
      parameters:
        - name: advisorEmailAddress
          in: path
          description: Advisor's email address
          required: true
          schema:
            type: string
            format: email
            example: william.smith@symphony.com
        - name: contactEmailAddress
          in: path
          description: Contact's email address
          required: true
          schema:
            type: string
            format: email
            example: johndoe@symphony.com
        - name: externalNetwork
          in: path
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
      responses:
        "204":
          description: Contact successfully removed
        "404":
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/contact-not-found"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  "/api/v2/customer/contacts/{contactSymphonyId}":
    delete:
      tags:
        - Contact
      summary: Remove the contact from all advisors they are connected to for a given external network (recommended)
      description: |
        Remove the contact from all the advisors they are connected to for a given external network.
      operationId: deleteContactsBySymphonyIdAndExternalNetworkv2
      parameters:
        - name: contactSymphonyId
          in: path
          description: Contact's Symphony user ID
          required: true
          schema:
            type: string
            format: number
            example: 1234567890
      responses:
        "200":
          description: Contact found. The response includes a status report (SUCCESS or FAILURE) of the connection removal for each advisors initially connected to the contact.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/customer-contactsWithId-responsev2"
        "404":
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/contact-not-found"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
    put:
      tags:
        - Contact
      summary: Update contact (recommended)
      description: |
        Update a contact's first name, last name, company name (maximum 100 characters) and, if the advisor has the permission for this, the contact's email address for a given external network. <br />
        <b>Note:</b> Updating a contact's phone number is not supported.
      # to be validated        <br/> The "advisorEmailAddress" is the email address of the advisor who 1st onboarded the contact.
      operationId: updateContactsv2
      parameters:
        - name: contactSymphonyId
          in: path
          description: Contact's Symphony user ID
          required: true
          schema:
            type: string
            example: 1234567890
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/customer-update-contacts-requestv2"
      responses:
        "200":
          description: Contact successfully updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/update-contacts-response-v2"
        "400":
          description: Missing or malformed input
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/external-network-not-found"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Update user forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_403_1"
                  - $ref: "#/components/schemas/inline_response_403_0"
                  - $ref: "#/components/schemas/cannot-edit-advisor-own-contact-email"
        "404":
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_4"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/user-already-exists"
        "500":
          description: Contact update failed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/update-account-failed"
      security:
        - sfsAuthentication: []
  "/api/v1/customer/contacts/{contactSymphonyId}/copy":
    post:
      tags:
        - Contact
      summary: Copy contact
      description: |
        Create a new contact copy. <br />
        Some contacts might be shared between tenants. Shared contacts updates are not allowed. <br />
        This API allows to create a contact copy that is dedicated for the requesting tenant and that can be updated. <br />
        <br/>
        <b>Contacts that are created starting from the 23.03 release are already not shared between tenants. This API is dedicated for shared contacts created prior to the 23.03 release.</b><br/>
        <br/>
        <b>Please note:</b>
        <ul>
          <li>A new account is created for the user, with a new Symphony user ID.</li>
          <li>There is no change in the user's data.</li>
          <li>The original user account is removed from all rooms and the new account is added to these rooms. Then, a system message is pushed to each room: <i>Maintenance completed on account: {contact first name} {contact last name}. No action on your part is required.</i></li>
          <li>The email format of the user will appear differently in Content Export. <b>Old format</b>: <i>{network}.{phone}@symphony.com.</i> <b>New format</b>: <i>{network}.{phone}.{tenantId}@symphony.com</i></li>
          <li>This API is only supported for WHATSAPP and SMS contacts.</li>
          <li>Users who are still part of Symphony IMs cannot be copied. IMs should be first removed from Federation Services.</li>
          <li>The copy action is not required for users onboarded by a single tenant before the 23.03 release, or for all users onboarded after 23.03 release.</li>
        </ul>
      operationId: copyContact
      parameters:
        - name: contactSymphonyId
          in: path
          description: Contact's Symphony ID
          required: true
          schema:
            type: string
            pattern: '^\d+$'
            example: 1234567890
      responses:
        "200":
          description: Contact successfully copied
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/copy-contact-response"
        "400":
          description: Missing or malformed input
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/user-copy-not-supported-for-network"
        "403":
          description: Copy user forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/forbidden-entitlement-type'
                  - $ref: '#/components/schemas/user-copy-not-supported-for-ims'
        "404":
          description: Contact not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/contact-not-found"
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/current-tenant-has-own-user-copy'
        "500":
          description: Contact update failed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/copy-contact-failed"
      security:
        - sfsAuthentication: []
  "/api/v1/customer/contacts/contactEmailAddress/{contactEmailAddress}/externalNetwork/{externalNetwork}":
    delete:
      deprecated: true
      tags:
        - Contact
      summary: Remove the contact from all advisors they are connected to for a given external network (deprecated)
      description: |
        Removes the contact from all the advisors they are connected to, searching by the contact's email address and the external network. This operation will only affect the tenant's advisors.
      operationId: deleteContactsByEmailAndExternalNetwork
      parameters:
        - name: contactEmailAddress
          in: path
          description: Contact's email address
          required: true
          schema:
            type: string
            format: email
            example: johndoe@symphony.com
        - name: externalNetwork
          in: path
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
      responses:
        "200":
          description: Contact found. The response includes a status report (SUCCESS or FAILURE) of the connection removal for each advisor initially connected to the contact.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/customer-contactsWithId-response"
        "404":
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/contact-not-found"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  /api/v2/customer/contacts/removal:
    post:
      tags:
        - Contact
      summary: Bulk remove advisor-contact connection (recommended)
      description: |
        Remove specific advisor-contact connections in bulk.
      operationId: deleteContactsv2
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/deleteContacts-requestv2"
      responses:
        "200":
          description: Contacts found. The response includes a status report (SUCCESS, NOT_FOUND or FAILURE) of the connection removal for each advisor initially connected to each contact in the array of objects.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/deleteContacts-responsev2"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  /api/v1/customer/contacts/removal:
    post:
      deprecated: true
      tags:
        - Contact
      summary: Remove specific advisor-contact connections in bulk (deprecated)
      description: |
        Bulk remove the connections between advisor-contact pairs. Takes in the body of the request an array of objects composed of advisor's email address, contact's email address and external network.
      operationId: deleteContacts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/deleteContacts-request"
      responses:
        "200":
          description: Contacts found. The response includes a status report (SUCCESS or FAILURE) of the connection removal for each advisor initially connected to each contact in the array of objects.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/deleteContacts-response"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  "/api/v2/customer/contacts/advisor/{advisorSymphonyId}":
    delete:
      tags:
        - Contact
      summary: Remove all contacts (recommended)
      description: |
        Removes all contacts of an advisor matching the advisor's Symphony user ID.
      operationId: deleteAdvisorContactsv2
      parameters:
        - name: advisorSymphonyId
          in: path
          description: Advisor's Symphony user ID
          required: true
          schema:
            type: string
            format: number
            example: 1234567890
      responses:
        "200":
          description: Call completed - Report provided with the list of SUCCESSFUL and FAILED operations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/customer-deleteAdvisorContacts-responsev2"
        "404":
          description: Advisor or contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_1"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  "/api/v1/customer/contacts/advisorEmailAddress/{advisorEmailAddress}":
    delete:
      deprecated: true
      tags:
        - Contact
      summary: Removes all contacts of a given advisor (deprecated)
      description: |
        Removes all the contacts of an advisor matching the advisor's email address.
      operationId: deleteAdvisorContacts
      parameters:
        - name: advisorEmailAddress
          in: path
          description: Advisor's email address
          required: true
          schema:
            type: string
            example: william.smith@symphony.com
      responses:
        "200":
          description: Call completed - Report provided with the list of SUCCESSFUL and FAILED operations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/deleteContacts-response"
        "404":
          description: Advisor or contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_1"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []


  /api/v1/customer/permissions:
    get:
      tags:
        - Permissions
      summary: List permissions
      description: |
        List of available permissions for the external network at "CONNECT-DOMAIN"<br />
      operationId: listPermissions
      responses:
        "200":
          description: List of permissions found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/permissions-response"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  /api/v1/customer/externalNetwork/{externalNetwork}/permissions:
    get:
      tags:
        - Permissions
      summary: List EMP Permissions
      operationId: listEmpPermissions
      description: |
        List all permissions available for the external network at "CONNECT-DOMAIN"<br />
        For each permission, returns id, name and whether they are set by default or not<br />
      parameters:
        - name: externalNetwork
          in: path
          description: The external network.
          required: true
          schema:
            type: string
            example: "WHATSAPP"
      responses:
        "200":
          description: List of EMP permissions found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/enhanced-permissions-response"
      security:
        - sfsAuthentication: [ ]
  "/api/v2/customer/advisors/{advisorSymphonyId}/externalNetwork/{externalNetwork}/permissions":
    get:
      tags:
        - Permissions
      summary: List advisor's permissions (recommended)
      description: |
        List the permissions granted to an advisor on an external network.<br />
      operationId: listAdvisorPermissionsBySymphonyId
      parameters:
        - name: advisorSymphonyId
          in: path
          description: Advisor's Symphony user ID
          required: true
          schema:
            type: string
            example: 1234567890
        - name: externalNetwork
          in: path
          description: "The external network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
      responses:
        "200":
          description: List of advisor's permissions
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/advisor-permissions-response"
        "404":
          description: Advisor not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/advisor-not-found"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
    post:
      tags:
        - Permissions
      summary: Add permission to an advisor (recommended)
      description: |
        Grant permission to an advisor. \
        Refer to the Permissions table on the Authentication page for the default permissions. \
        For multi-company contacts, the contacts must be from the same network, e.g. all from WeChat or all from WhatsApp. Cross-network rooms are not authorized.</li>
      operationId: addPermissionBySymphonyId
      parameters:
        - name: advisorSymphonyId
          in: path
          description: Advisor's Symphony user ID
          required: true
          schema:
            type: string
            example: 1234567890
        - name: externalNetwork
          in: path
          description: The external network
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/advisor-permission-request"
      responses:
        "200":
          description: Permission successfully added to the advisor
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/advisor-permission-response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_2"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/permission-already-assigned"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  "/api/v1/customer/advisors/advisorEmailAddress/{advisorEmailAddress}/externalNetwork/{externalNetwork}/permissions":
    get:
      deprecated: true
      tags:
        - Permissions
      summary: List advisor's permissions (deprecated)
      description: |
        List an advisor's permissions.<br />
      operationId: listAdvisorPermissionsByEmail
      parameters:
        - name: advisorEmailAddress
          in: path
          description: Advisor's email address
          required: true
          schema:
            type: string
            example: william.smith@symphony.com
        - name: externalNetwork
          in: path
          description: "The external network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
      responses:
        "200":
          description: List of advisor's permissions
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/advisor-permissions-response"
        "404":
          description: Advisor not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/advisor-not-found"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
    post:
      deprecated: true
      tags:
        - Permissions
      summary: Add permission to an advisor (deprecated)
      description: |
        Grant permission to an advisor. \
        Refer to the Permissions table on the Authentication page for the default permissions. \
        For multi-company contacts, the contacts must be from the same network, e.g. all from WeChat or all from WhatsApp. Cross-network rooms are not authorized.</li>
      operationId: addPermissionByEmail
      parameters:
        - name: advisorEmailAddress
          in: path
          description: Advisor's email address
          required: true
          schema:
            type: string
        - name: externalNetwork
          in: path
          description: The external network
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/advisor-permission-request"
      responses:
        "200":
          description: Permission successfully added to the advisor
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/advisor-permission-response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_2"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/permission-already-assigned"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []

  "/api/v2/customer/advisors/{advisorSymphonyId}/externalNetwork/{externalNetwork}/permissions/{permissionName}":
    delete:
      tags:
        - Permissions
      summary: Remove permission (recommended)
      description: Remove a permission from an advisor.
      operationId: removePermissionBySymphonyIdv2
      parameters:
        - name: advisorSymphonyId
          in: path
          description: Advisor's Symphony user ID
          required: true
          schema:
            type: string
        - name: externalNetwork
          in: path
          description: The external network
          required: true
          schema:
            type: string
        - name: permissionName
          in: path
          description: permissionName to remove
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Permission successfully removed
        "404":
          description: Advisor not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_3"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  "/api/v1/customer/advisors/advisorEmailAddress/{advisorEmailAddress}/externalNetwork/{externalNetwork}/permissions/{permissionName}":
    delete:
      deprecated: true
      tags:
        - Permissions
      summary: Remove permission from an advisor (deprecated)
      description: Remove a permission from an advisor.
      operationId: removePermissionByEmail
      parameters:
        - name: advisorEmailAddress
          in: path
          description: Advisor's email address
          required: true
          schema:
            type: string
        - name: externalNetwork
          in: path
          description: The external network
          required: true
          schema:
            type: string
        - name: permissionName
          in: path
          description: permissionName to remove
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Permission removed successfully
        "404":
          description: Advisor not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_3"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []

  /api/v2/customer/advisors/permissions:
    post:
      tags:
        - Permissions
      summary: Add a permission to multiple advisors (recommended)
      description: "Grant permission to multiple advisors."
      operationId: addPermissionToMultipleAdvisor
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/advisors-permission-requestv2"
      responses:
        "200":
          description: Permission successfully added to the advisor
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/multiple-advisor-permission-response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_2"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/permission-already-assigned"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  /api/v1/customer/advisors/permissions:
    post:
      deprecated: true
      tags:
        - Permissions
      summary: Add permission to multiple advisors (deprecated)
      description: "Add a permission to multiple advisors."
      operationId: addPermissionToMultipleAdvisorByEmail
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/advisors-permission-request"
      responses:
        "200":
          description: Permission successfully added to the advisor
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/multiple-advisor-permission-response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_2"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/permission-already-assigned"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []

  #    delete:
  #      tags:
  #        - Permissions
  #      summary: Remove permission from multiple advisors
  #      description: |
  #        => Remove a permission from multiple advisors. **This endpoint will return an error 400**
  #      operationId: removePermissionFromMultipleAdvisorByEmail
  #      requestBody:
  #        content:
  #          application/json:
  #            schema:
  #              $ref: '#/components/schemas/advisor-permission-request'
  #      responses:
  #        '200':
  #          description: Request has been processed
  #          content:
  #            application/json:
  #              schema:
  #                $ref: '#/components/schemas/multiple-advisor-permission-response'
  #        '400':
  #          description: Request was not well formed
  #          content:
  #            application/json:
  #              schema:
  #                $ref: '#/components/schemas/inline_response_400'
  #        '401':
  #          description: Unauthorized
  #          content:
  #            application/json:
  #              schema:
  #                $ref: '#/components/schemas/inline_response_401'
  #        '403':
  #          description: Operation forbidden
  #          content:
  #            application/json:
  #              schema:
  #                $ref: '#/components/schemas/inline_response_403_0'
  #      security:
  #        - sfsAuthentication: []
  #  '/api/v1/customer/advisors/advisorEmailAddress/{advisorEmailAddress}/permissions':
  #    post:
  #      tags:
  #        - Permissions
  #      summary: Add permission to an advisor for all external networks
  #      description: => Add a permission to an advisor for all external networks.
  #      operationId: addPermissionForAllEnsByEmail
  #      parameters:
  #        - name: advisorEmailAddress
  #          in: path
  #          description: Advisor's email address
  #          required: true
  #          schema:
  #            type: string
  #            example: william.smith@symphony.com
  #      requestBody:
  #        content:
  #          application/json:
  #            schema:
  #              $ref: '#/components/schemas/advisor-permission-request'
  #      responses:
  #        '200':
  #          description: Operation completed
  #          content:
  #            application/json:
  #              schema:
  #                $ref: '#/components/schemas/bulk-advisor-permission-response'
  #        '404':
  #          description: Not found
  #          content:
  #            application/json:
  #              schema:
  #                $ref: '#/components/schemas/inline_response_404_2'
  #        '401':
  #          description: Unauthorized
  #          content:
  #            application/json:
  #              schema:
  #                $ref: '#/components/schemas/inline_response_401'
  #        '403':
  #          description: Operation forbidden
  #          content:
  #            application/json:
  #              schema:
  #                $ref: '#/components/schemas/inline_response_403_0'
  #      security:
  #        - sfsAuthentication: []
  /api/v2/customer/contacts:
    post:
      tags:
        - Contact
      summary: Add a contact and/or advisors to a contact (recommended)
      description: |
        Add a contact and/or advisor(s) to the contact.<br/>
        This end point can be called in 2 situations:<br/>
        <ol>
          <li>To create a contact and eventually immediately associate one or more advisors.</li>
          <li>To add more advisors to an existing contact.</li>
        </ol>
        In both cases, you must provide all the contact's mandatory fields listed as "body params".<br/>

        **Note** <br/>
        <ul>
        <!-- <li>to be checked A maximum of 25 advisorSymphonyId or advisorEmailAddress can be passed in on call.</li> -->
          <li>If both advisorSymphonyId and advisorEmailAddresses are passed, the advisorSymphonyId will prevail.</li>
        </ul>
      operationId: addContact
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/customer-contact-request"
      responses:
        "200":
          description: Contact added successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/add-contact-response"
        "400":
          description: Missing or malformed input
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_400_1"
        "403":
          description: Onboard user forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_403"
                  - $ref: "#/components/schemas/inline_response_403_0"
                  - $ref: '#/components/schemas/user-id-mismatch'
                  - $ref: '#/components/schemas/phone-international-onboarding-forbidden'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/tenant-configuration-not-found"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_409"
        "500":
          description: User creation failed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/create-account-failed"
      security:
        - sfsAuthentication: []
    get:
      tags:
        - Search
      summary: List contacts (recommended)
      description: |
        List contacts, can query by emailAddress, phoneNumber or by contactSymphonyId or by advisorSymphonyId.
        If the advisor has the admin:list-customers permission, they will be able to retrieve all pod contacts for a given externalNetwork, or to see other advisor's list of contacts.
      operationId: listContacts2
      parameters:
        - name: externalNetwork
          in: query
          description: "The external network: WHATSAPP, SMS, WECHAT, SMS-DIRECT, LINE or WHATSAPP-DIRECT"
          required: true
          schema:
            minLength: 1
            type: string
            example: WHATSAPP
        - name: emailAddress
          in: query
          description: Contact's email address
          required: false
          schema:
            type: string
            format: email
            example: johndoe@symphony.com
        - name: phoneNumber
          in: query
          description: Contact's phone number
          required: false
          schema:
            type: string
            format: phone
            example: +33 1 23 45 67 89
        - name: symphonyId
          in: query
          description: Contact's Symphony user ID
          required: false
          schema:
            type: string
            pattern: '^\d+$'
            example: 1234567890
        - name: advisorSymphonyId
          in: query
          description: The advisor's Symphony ID
          required: false
          schema:
            type: string
            pattern: '^\d+$'
            example: 1234567890
        - name: phoneBlocked
          in: query
          description: Filter only available or blocked contact's phones
          required: false
          schema:
            type: string
            enum:
              - "all"
              - "false"
              - "true"
            default: all
        - name: before
          in: query
          description: The before cursor for pagination
          required: false
          schema:
            type: string
        - name: after
          in: query
          description: The after cursor for pagination
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Contact found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/list-contact-response"
        "404":
          description: Contact or tenant not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/contact-not-found'
                  - $ref: '#/components/schemas/tenant-not-found'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_403_0"
                  - $ref: '#/components/schemas/user-id-mismatch'
      security:
        - sfsAuthentication: []

  /api/v1/customer/contacts:
    get:
      deprecated: true
      tags:
        - Search
      summary: Find a contact (deprecated)
      description: |
        Find a contact searching by email address and external network<br />
      operationId: findContacts
      parameters:
        - name: externalNetwork
          in: query
          description: "The external network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            minLength: 1
            type: string
            example: WHATSAPP
        - name: emailAddress
          in: query
          description: Contact's email address
          required: true
          schema:
            type: string
            format: email
            example: johndoe@symphony.com
      responses:
        "200":
          description: Contact found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/find-contact-response"
        "404":
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/contact-not-found"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  "/api/v1/customer/contacts/{contactEmailAddress}/update":
    post:
      deprecated: true
      tags:
        - Contact
      summary: Update Contact (deprecated)
      description: |
        Update the first name, last name, company name (maximum 100 characters long) of a contact for a given external network.
         <br/> Updating the contact's email address or phone number is not supported.
      # to be validated        <br/> the "advisorEmailAddress" is the email address of the advisor that first onboarded the contact.
      operationId: updateContacts
      parameters:
        - name: contactEmailAddress
          in: path
          description: Contact's email address
          required: true
          schema:
            type: string
            example: johndoe@symphony.com
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/customer-update-contacts-request"
      responses:
        "200":
          description: Contact successfully updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/update-contacts-response"
        "400":
          description: Missing or malformed input
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/external-network-not-found"
        "403":
          description: Update user forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_403_1"
                  - $ref: "#/components/schemas/inline_response_403_0"
                  - $ref: "#/components/schemas/cannot-edit-advisor-own-contact-email"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "404":
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_4"
        "500":
          description: Contact update failed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/update-account-failed"
      security:
        - sfsAuthentication: []
  /api/v1/customer/advisors:
    get:
      deprecated: true
      tags:
        - Search
      summary: Search for an advisor (deprecated)
      description: |
        Search for an advisor by email address or Symphony user ID and external network.<br />
      operationId: findAdvisor
      parameters:
        - name: externalNetwork
          in: query
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            minLength: 1
            type: string
            example: WHATSAPP
        - name: advisorEmailAddress
          in: query
          description: Advisor's email address
          required: false
          schema:
            type: string
            format: email
            example: william.smith@symphony.com
        - name: advisorSymphonyId
          in: query
          description: Advisor's Symphony user ID
          required: false
          schema:
            type: string
            format: email
            example: 1234567890
      responses:
        "200":
          description: Advisor found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/entitlement-response"
        "404":
          description: Advisor not found (Advisor may not be entitled for this external network)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_5"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []

  "/api/v2/customer/contact":
    get:
      tags:
        - Search
      summary: Get contact
      description: |
        Get a contact searching by their phone number, their external network and, optionally, their advisor's federation group.
      operationId: getContact
      parameters:
          - in: query
            name: phoneNumber
            description: contact's phone number
            schema:
              type: string
              format: phone
            required: true
          - in: query
            name: externalNetwork
            description: contact's external network
            schema:
              type: string
            required: true
          - in: query
            name: federationGroupId
            description: contact's federationGroupId
            schema:
              type: string
      responses:
        '200':
          description: Contact found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/find-contact-response-v2'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/external-network-not-found'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_404_6'
      security:
        - sfsAuthentication: []

  "/api/v2/customer/contacts/{contactSymphonyId}/advisors":
    get:
      tags:
        - Search
      summary: List a contact’s advisors (recommended)
      description: |
        Search for the advisors of a provided contact email address for a given external network.<br />
      operationId: findAdvisorsv2
      parameters:
        - name: contactSymphonyId
          in: path
          description: The Contact's Symphony user ID
          required: true
          schema:
            type: string
            format: number
            example: 1234567890
        - in: query
          name: before
          schema:
            type: string
          description: The before cursor for pagination
        - in: query
          name: after
          schema:
            type: string
          description: The after cursor for pagination
      responses:
        "200":
          description: List of advisor(s) found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/advisors-search-response"
        "404":
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_6"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []

  "/api/v1/customer/contacts/advisorSymphonyId/{advisorSymphonyId}/externalNetwork/{externalNetwork}/search":
    get:
      tags:
        - CustomerContact
      summary: Search contacts
      operationId: searchContacts
      description: >
        => Search an advisor's contacts related to a given externalNetwork
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: advisorSymphonyId
          schema:
            type: string
          required: true
        - in: path
          name: externalNetwork
          schema:
            type: string
          required: true
          example: WHATSAPP
        - in: query
          name: query
          required: true
          schema:
            type: string
          description: Start search by first name, then last name and then display name
          example: o
      responses:
        "200":
          description: List of contacts found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/search-contacts-response"

  "/api/v1/customer/contacts/contactEmailAddress/{contactEmailAddress}/externalNetwork/{externalNetwork}/advisors":
    get:
      deprecated: true
      tags:
        - Search
      summary: Search the advisors of a contact (deprecated)
      description: |
        Search for the advisors of a provided contact email address for a given external network.<br />
      operationId: findAdvisors
      parameters:
        - name: externalNetwork
          in: path
          description: "The external network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            minLength: 1
            type: string
            example: WHATSAPP
        - name: contactEmailAddress
          in: path
          description: Contact's email address
          required: true
          schema:
            type: string
            format: email
            example: johndoe@symphony.com
      responses:
        "200":
          description: List of advisor(s) found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/advisors-search-response"
        "404":
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_6"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []

  "/api/v1/customer/advisors/{advisorSymphonyId}/externalNetwork/{externalNetwork}/contacts":
    get:
      tags:
        - Search
      summary: List an advisor's contacts (recommended)
      description: |
        Search for the contacts associated with the provided advisor’s Symphony user ID for a given external network.<br/>
      operationId: findContactsOfAdvisorv2
      parameters:
        - name: externalNetwork
          in: path
          description: "The external network: WHATSAPP, SMS, WECHAT, SMS-DIRECT, LINE or WHATSAPP-DIRECT"
          required: true
          schema:
            minLength: 1
            type: string
            example: WHATSAPP
        - name: advisorSymphonyId
          in: path
          description: Advisor's Symphony user ID
          required: true
          schema:
            type: string
            format: number
            example: 1234567890
        - in: query
          name: before
          schema:
            type: string
          description: The before cursor for pagination
        - in: query
          name: after
          schema:
            type: string
          description: The after cursor for pagination
      responses:
        "200":
          description: List of contacts(s) found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/contacts-response"
        "404":
          description: Advisor not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_5"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  "/api/v1/customer/advisors/advisorEmailAddress/{advisorEmailAddress}/externalNetwork/{externalNetwork}/contacts":
    get:
      deprecated: true
      tags:
        - Search
      summary: Search an advisor's contacts (deprecated)
      description: |
        Search for contacts associated with the advisor whose email address is provided for a given external network.<br/>
      operationId: findContactsOfAdvisor
      parameters:
        - name: externalNetwork
          in: path
          description: "The external network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            minLength: 1
            type: string
            example: WHATSAPP
        - name: advisorEmailAddress
          in: path
          description: Advisor's email address
          required: true
          schema:
            type: string
            format: email
            example: william.smith@symphony.com
      responses:
        "200":
          description: List of contacts(s) found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/contacts-response"
        "404":
          description: Advisor not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_5"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []

  /api/v2/customer/rooms:
    get:
      tags:
        - Room
      summary: List an advisor's rooms (recommended)
      description: |
        List all rooms where an advisor is either a member or an owner for a given network.<br />
        Search is performed with the advisor's Symphony user ID.<br/>
        This end point returns at most 25 records per page.<br/>
      operationId: listRoomsv2
      parameters:
        - name: advisorSymphonyId
          in: query
          description: Advisor's Symphony user ID
          required: true
          schema:
            type: string
            format: number
            example: 1234567890
        - name: externalNetwork
          in: query
          description: "The external network: WECHAT or WHATSAPP or WHATSAPP-DIRECT or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
        - name: owner
          in: query
          description:
            If set to "true", lists the rooms where the advisor is an owner.
            If set to "false", lists the rooms where the advisor is an owner and the rooms where the advisor is only a member.
          schema:
            type: boolean
            default: true
        - name: before
          in: query
          description: The before cursor for pagination
          schema:
            type: string
        - name: after
          in: query
          description: The after cursor for pagination
          schema:
            type: string
      responses:
        "200":
          description: List of rooms found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/rooms-response"
        "400":
          description: Missing or malformed parameter
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/invalid-page-cursor"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
        '404':
          description: Not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/tenant-configuration-not-found'
                  - $ref: '#/components/schemas/advisor-not-found'
      security:
        - sfsAuthentication: []
    post:
      tags:
        - Room
      summary: Create room (recommended)
      description: |
        Create a room with the advisor whose Symphony user ID is provided.<br/>
        The advisor is set as a member.<br/>
        "externalNetworkRoomDisplayName" applies for WeChat only.
      operationId: createRoomv2
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/room-requestv2"
      responses:
        "200":
          description: Room created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/room-creation-response-v2"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_400_2"
                  - $ref: "#/components/schemas/incompatible-external-network-and-request-body"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_403_2"
                  - $ref: "#/components/schemas/inline_response_403_0"
                  - $ref: "#/components/schemas/federation-group-emp-forbidden"
                  - $ref: '#/components/schemas/user-id-mismatch'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "404":
          description: Advisor not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_404_7"
                  - $ref: "#/components/schemas/federation-group-not-found"
        "409":
          description: Conflict (room name already exists)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/room-already-exists"
        "500":
          description: Room creation failed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_500"
      security:
        - sfsAuthentication: []
  /api/v1/customer/rooms:
    get:
      deprecated: true
      tags:
        - Room
      summary: List an advisor's rooms (deprecated)
      description: |
        List all rooms where an advisor is either a member or an owner for a given network.<br />
        The search is performed with the advisor's email address.<br/>
        This end point returns at most 25 records per page.<br/>
      operationId: listRooms
      parameters:
        - name: advisorEmailAddress
          in: query
          description: Advisor's email address
          required: true
          schema:
            type: string
            format: email
            example: william.smith@symphony.com
        - name: externalNetwork
          in: query
          description: "The external network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
        - name: owner
          in: query
          description:
            If set to "true", list the rooms where the advisor is an owner.
            If set to "false", list the rooms where the advisor is only a member.
          schema:
            type: boolean
            default: true
        - name: before
          in: query
          description: The before cursor for pagination
          schema:
            type: string
        - name: after
          in: query
          description: The after cursor for pagination
          schema:
            type: string
      responses:
        "200":
          description: List of rooms found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/rooms-response"
        "400":
          description: Missing or malformed parameter
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/invalid-page-cursor"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
    post:
      deprecated: true
      tags:
        - Room
      summary: Create room (deprecated)
      description: |
        Create a room with the advisor whose email address is provided.<br/>
        The advisor is set as a member.<br/>
      operationId: createRoom
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/room-request"
      responses:
        "200":
          description: Room created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/room-creation-response"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_400_2"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_403_2"
                  - $ref: "#/components/schemas/inline_response_403_0"
                  - $ref: "#/components/schemas/federation-group-emp-forbidden"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_404_7"
                  - $ref: "#/components/schemas/federation-group-not-found"
        "409":
          description: Conflict (room name already exists)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/room-already-exists"
        "500":
          description: Room creation failed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_500"
      security:
        - sfsAuthentication: []

  /api/v1/customer/rooms/{streamId}/rename:
    post:
      tags:
        - Room
      summary: Rename a room
      operationId: renameRoom
      description: |
        Rename a room with the new room name which is provided.<br/>
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: streamId
          schema:
            type: string
          required: true
          description: StreamId of the room to rename.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/rename-room-request'
      responses:
        '200':
          description: Room name updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rename-room-response'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rename-room-forbidden'
        '404':
          description: Room not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/room-not-found'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/room-already-exists'
                  - $ref: '#/components/schemas/different-room-name-required'
                  - $ref: '#/components/schemas/cannot-rename-room-duplicate-room-name'
                  - $ref: '#/components/schemas/room-is-deactivated'
        '500':
          description: Rename room failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rename-room-failed'

  "/api/v1/customer/rooms/{streamId}/ownership":
    post:
      tags:
        - Room
      summary: Transfer room ownership to another advisor
      operationId: transferRoomOwnership
      description: |
        Transfer the room ownership to the advisor matching the provided Symphony user ID.<br/>
        This advisor should already be a member of the room.<br/>
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: streamId
          schema:
            type: string
          required: true
          description: StreamId of the room to transfer.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/transfer-room-ownership-request'
      responses:
        '204':
          description: Room owner updated successfully
        '404':
          description: Not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/tenant-configuration-not-found'
                  - $ref: '#/components/schemas/advisor-not-found'
                  - $ref: '#/components/schemas/room-not-found'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/already-room-owner'
                  - $ref: '#/components/schemas/not-a-room-member'
                  - $ref: '#/components/schemas/room-is-deactivated'
                  - $ref: '#/components/schemas/cannot-transfer-room-ownership-duplicate-room-name'

  "/api/v2/customer/rooms/{streamId}/members":
    delete:
      tags:
        - Room
      summary: Remove room member (recommended)
      description:
        Remove any member, advisor or contact from a room.  <br/>
        The room is identified by its streamID. <br/>
      operationId: removeRoomMemberv2
      parameters:
        - name: streamId
          in: path
          description: |
            Room's streamId.
            The streamId needs to be URLsafe Base64.
            To obtain the URLSafe Base64 Conversation ID:
              - replace forward slashes / with underscores
              - replace pluses + with minuses -
              - ignore any trailing equal signs =
            For example, the URLSafe Base64 encoding of: lX1hwfmQ+AK/k/a/BB0y2n///q2+0KfbdA== converts to lX1hwfmQ-AK_k_a_BB0y2n___q2-0KfbdA.
          required: true
          schema:
            type: string
            example: bjHSiY4iz3ar4iIh6-VzCX___peoM7cPdA
        - name: memberSymphonyId
          in: query
          description: The Symphony user ID of the member to remove
          required: true
          schema:
            type: string
            format: number
            example: 1234567890
        - name: advisorSymphonyId
          in: query
          description: The Symphony user ID of the advisor who is removing the member
          required: true
          schema:
            type: number
            example: 1234567890
      responses:
        "200":
          description: Member successfully removed from the room
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/remove-room-members-response"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_403_3"
                  - $ref: "#/components/schemas/inline_response_403_0"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_8"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_409_1"
      security:
        - sfsAuthentication: []
    post:
      tags:
        - Room
      summary: Add room member (recommended)
      description: |
        Add a member to a room:
        <ul>
          <li> An advisor must be entitled for the relevant external network.</li>
          <li> A contact must have already been onboarded.</li>
        </ul>
      operationId: addRoomMemberMultiRoomv2
      parameters:
        - name: streamId
          in: path
          description: |
            Room's streamId.
            The streamID needs to be URLsafe Base64.
            To obtain the URLSafe Base64 conversation ID:
               - Replace forward slashes / with underscores _
               - Replace pluses + with minuses -
               - Ignore any trailing equal signs =
            For example, the URLSafe Base64 encoding of: lX1hwfmQ+AK/k/a/BB0y2n///q2+0KfbdA== converts to lX1hwfmQ-AK_k_a_BB0y2n___q2-0KfbdA.
          required: true
          schema:
            type: string
            example: bjHSiY4iz3ar4iIh6-VzCX___peoM7cPdA
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/room-member-requestv2"
      responses:
        "200":
          description: Member successfully added to the room
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/room-member-response"
        "400":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_400_3"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_403_2"
                  - $ref: "#/components/schemas/inline_response_403_0"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_9"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/room-is-deactivated"
                  - $ref: "#/components/schemas/add-room-member-conflicted"
        "500":
          description: Failed to add member to the room
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/add-room-member-failed"
      security:
        - sfsAuthentication: []
  /api/v1/customer/rooms/{streamId}/members:
    get:
      tags:
        - Room
      summary: List room members
      description: |
        List a room’s members. The room is identified by its streamID.<br />
      operationId: listRoomMembers
      parameters:
        - name: streamId
          in: path
          description: |
            Room's streamId.
            The streamId needs to be URL safe Base64.
            To obtain the URLSafe Base64 conversation ID:
              - Replace forward slashes / with underscores _
              - Replace pluses + with minuses -
              - Ignore any trailing equal signs =
            For example, the URLSafe Base64 encoding of: lX1hwfmQ+AK/k/a/BB0y2n///q2+0KfbdA== converts to lX1hwfmQ-AK_k_a_BB0y2n___q2-0KfbdA.
          required: true
          schema:
            type: string
            example: lX1hwfmQ-AK_k_a_BB0y2n___q2-0KfbdA
        - name: before
          in: query
          description: The before cursor for pagination
          schema:
            type: string
        - name: after
          in: query
          description: The after cursor for pagination
          schema:
            type: string
      responses:
        "200":
          description: List of room members
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/room-members-response"
        "400":
          description: Missing or malformed parameter
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/invalid-page-cursor"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
    delete:
      deprecated: true
      tags:
        - Room
      summary: Remove room member (deprecated)
      description:
        Remove a member from a room, be it an advisor or a contact. <br/>
        The room is identified by its streamId. <br/>
      operationId: removeRoomMember
      parameters:
        - name: streamId
          in: path
          description: |
            Room's streamId.
            The streamId needs to be URL safe Base64.
            To obtain the URLSafe Base64 conversation ID:
              - Replace forward slashes / with underscores _
              - Replace pluses + with minuses -
              - Ignore any trailing equal signs =
            For example, the URLSafe Base64 encoding of: lX1hwfmQ+AK/k/a/BB0y2n///q2+0KfbdA== converts to lX1hwfmQ-AK_k_a_BB0y2n___q2-0KfbdA.

          required: true
          schema:
            type: string
            example: bjHSiY4iz3ar4iIh6-VzCX___peoM7cPdA
        - name: memberEmailAddress
          in: query
          description: The email address of the member to remove
          required: true
          schema:
            type: string
            format: email
            example: johndoe@symphony.com
        - name: externalNetwork
          in: query
          description: "The external network of the member to remove: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          required: true
          schema:
            type: string
            example: WHATSAPP
        - name: advisorEmailAddress
          in: query
          description: The email address of the advisor who is removing the member
          required: true
          schema:
            type: string
            example: william.smith@symphony.com
        - name: contact
          in: query
          description: If set to "true", the member to remove is a contact.<br/>
            If set to "false", the member to remove is an advisor.<br/>
          required: true
          schema:
            type: boolean
      responses:
        "200":
          description: Member successfully removed from the room
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/remove-room-members-response"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_403_3"
                  - $ref: "#/components/schemas/inline_response_403_0"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_8"
      security:
        - sfsAuthentication: []
  /api/v1/customer/rooms/{streamId}/features:
    post:
      tags:
        - Room
      summary: Update a room's features
      description: |
        Update a room's features. Only supported for WhatsApp. The room is identified by its streamID.<br />
      operationId: updateRoomFeatures
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/room-features-request"
      parameters:
        - name: streamId
          in: path
          description: |
            Room's streamId.
            The streamId needs to be URLsafe Base64.
            To obtain the URLSafe Base64 conversation ID:
              - Replace forward slashes / with underscores _
              - Replace pluses + with minuses -
              - Ignore any trailing equal signs =
            For example, the URLSafe Base64 encoding of: lX1hwfmQ+AK/k/a/BB0y2n///q2+0KfbdA== converts to lX1hwfmQ-AK_k_a_BB0y2n___q2-0KfbdA.
          required: true
          schema:
            type: string
            example: lX1hwfmQ-AK_k_a_BB0y2n___q2-0KfbdA
      responses:
        "204":
          description: Features updated successfully
        "400":
          description: Missing or malformed parameter
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/invalid-page-cursor"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: [ ]
  /api/v1/customer/rooms/{streamId}/activity:
    put:
      tags:
        - CustomerRoom
      summary: Update room activity
      operationId: updateRoomActivity
      description: Update room activity room by stream ID
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: streamId
          description: |
            Room's streamId. <br/>
            The streamID needs to be URLsafe Base64.<br/>
            To obtain the URLSafe Base64 Conversation ID:
            <ul>
              <li>Replace forward slashes / with underscores _ </li>
              <li>Replace pluses + with minuses - </li>
              <li>Ignore any trailing equal signs = </li>
            </ul>
            For example, the URLSafe Base64 encoding of: lX1hwfmQ+AK/k/a/BB0y2n///q2+0KfbdA== converts to lX1hwfmQ-AK_k_a_BB0y2n___q2-0KfbdA.
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/room-set-activity-request'
      responses:
        '200':
          description: Room Activity successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/room-set-activity-response'
        '404':
          description: Room not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/room-not-found'
        '500':
          description: Update room Status failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-room-status-failed'
        '501':
          description: Reactivation Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/reactivate-room-not-implemented'

  "/api/v1/customer/rooms/members":
    post:
      deprecated: true
      tags:
        - Room
      summary: Add room member (deprecated)
      description: |
        Add a member to a room:
        <ul>
          <li> An advisor must be entitled for the relevant external network.</li>
          <li> A contact must have already been onboarded.</li>
        <ul><br/>
      operationId: addRoomMemberMultiRoom
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/room-member-request"
      responses:
        "200":
          description: Member successfully added to the room
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/room-member-response"
        "400":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_400_3"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/inline_response_403_2"
                  - $ref: "#/components/schemas/inline_response_403_0"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_404_9"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/member-already-in-room"
        "500":
          description: Failed to add member to the room
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/add-room-member-failed"
      security:
        - sfsAuthentication: []

  /api/v2/customer/rooms/members:
    post:
      tags:
        - Room
      summary: Add room members in bulk (recommended)
      description: |
        Add multiple advisors and/or contacts to a room.<br />
        An advisor must be entitled for the relevant external network. A contact must have already been onboarded.
      operationId: addRoomMembersMultiRoomv2
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/bulk-room-member-multi-room-requestv2"
      responses:
        "200":
          description: Operation to add members to the room completed.
            Returns an object with the detail of each member's addition success or failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bulk-room-member-responsev2"
        "400":
          description: Missing or malformed parameter
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/rfc-error"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []
  /api/v1/customer/rooms/members/bulk:
    post:
      deprecated: true
      tags:
        - Room
      summary: Add room members in bulk (deprecated)
      description: |
        Add multiple members to a room:
        <ul>
          <li> Advisors must be entitled for the relevant external network.</li>
          <li> Contacts must have already been onboarded.</li>
        <ul><br/>
        Returns a report indicating the success or failure for each element of the array.<br/>
      operationId: addRoomMembersMultiRoom
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/bulk-room-member-multi-room-request"
      responses:
        "200":
          description: Operation to add members to the room completed.
            Returns an object with the detail of each member addition success or failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bulk-room-member-response"
        "400":
          description: Missing or malformed parameter
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/rfc-error"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"
      security:
        - sfsAuthentication: []

  /api/v1/customer/companies/search:
    get:
      tags:
        - Companies
      summary: Search for companies
      description: |
        Search for companies by name.<br />
        <b>Note:</b> The WeChat or WhatsApp or SMS or SMS Direct or LINE onboarding applications do not enforce consistency for company names.
      security:
        - sfsAuthentication: []
      operationId: searchCompanies
      parameters:
        - name: query
          in: query
          description: Start of the company's name to match
          required: true
          schema:
            minLength: 3
            type: string
            example: sym
      responses:
        "200":
          description: List of found companies
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/companies-search-response"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_401"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/inline_response_403_0"

  /api/v1/customer/federationGroups:
    get:
      tags:
        - Federation Group (**NEW**)
      summary: List all federation groups
      description: |
        List all federation groups
      operationId: listTenantFederationGroups
      parameters:
        - in: query
          name: before
          schema:
            type: string
          description: The before cursor for pagination
        - in: query
          name: after
          schema:
            type: string
          description: The after cursor for pagination
      responses:
        "200":
          description: List of federation groups
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/list-federation-groups-response"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Unauthorized"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Forbidden"
      security:
        - sfsAuthentication: []

  /api/v1/customer/advisors/{advisorSymphonyId}/externalNetwork/{externalNetwork}/federationGroup:
    put:
      tags:
        - Federation Group (**NEW**)
      summary:  Update advisor's federation group for the given external network.
      description: |
        Update advisor's federation group for the given external network.
      operationId: updateAdvisorFederationGroup
      parameters:
        - name: externalNetwork
          in: path
          required: true
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          schema:
            type: string
            example: WHATSAPP
        - name: advisorSymphonyId
          in: path
          required: true
          description: Advisor's Symphony user ID
          schema:
            type: string
            example: 12345678912365
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/update-federation-group-request"
      responses:
        "204":
          description: The advisor's federation group is updated successfully.
        "400":
          description: Missing or malformed input
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/missing-destination-federation-group'
                  - $ref: '#/components/schemas/multiple-destination-federation-group'
                  - $ref: '#/components/schemas/external-network-not-found'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Unauthorized"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/federation-group-emp-forbidden"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/federation-group-not-found"
                  - $ref: "#/components/schemas/advisor-not-found"

      security:
        - sfsAuthentication: []

  /api/v1/customer/advisors/federationGroup/bulk:
    post:
      tags:
        - Federation Group (**NEW**)
      summary:  Bulk update advisor's federation group
      description: |
        Bulk update advisor's federation group.
      operationId: bulkUpdateAdvisorsFederationGroup
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/bulk-update-federation-group-request"
      responses:
        "200":
          description: The advisor's federation group is updated successfully.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bulk-update-federation-group-response"
        "400":
          description: Missing or malformed input
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/external-network-not-found"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Unauthorized"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Forbidden"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/advisor-not-found'
                  - $ref: '#/components/schemas/federation-group-not-found'
      security:
        - sfsAuthentication: []

  /api/v1/customer/rooms/{streamId}/federationGroup:
    put:
      tags:
        - Federation Group (**NEW**)
      summary:  Set federation group of a room
      operationId: updateRoomFederationGroups
      description: Set the federation group of a room.
      parameters:
        - in: path
          name: streamId
          schema:
            type: string
          required: true
          description: StreamId of the room to transfer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/room-set-federation-group-request"
      responses:
        "204":
          description: The room's federation group has been updated successfully.
        "400":
          description: Missing or malformed input
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/missing-destination-federation-group'
                  - $ref: '#/components/schemas/multiple-destination-federation-group'
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Unauthorized"
        "403":
          description: Operation forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/federation-group-emp-forbidden"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/room-not-found"
                  - $ref: "#/components/schemas/federation-group-not-found"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/room-update-federation-group-errors"
      security:
        - sfsAuthentication: []

  /api/v1/customer/contacts/{contactSymphonyId}/advisor/{advisorSymphonyId}/resendInvite:
    post:
      tags:
        - Customer invite
      summary: Resend a new onboarding invitation to contact
      operationId: resendInvite
      description: >
        <b>Only applicable for networks requiring onboarding invitations: WeChat, LINE.</b><br/><br/>
        Sends a new onboarding invitation to the contact with the onboarding instructions and a new authentication one-time-password token, if applicable.<br/><br/>
        Required to reset the contact's invitation after it expires. The invitation expiry counter (7 days) is reset to zero and the status is changed from "Expired" to "Pending".<br/><br/>
        <b>LINE since 23.04:</b> If the user enters an expired one-time-password token within the first 7 days they were onboarded, they automatically receive a new valid token.<br/>
        After the 7 days, calling this api is required to reset the user invitation status and to generate a new token.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: contactSymphonyId
          schema:
            type: string
            format: number
            example: 1234567890
          required: true
          description: Contact's Symphony user ID
        - in: path
          name: advisorSymphonyId
          schema:
            type: string
            format: number
            example: 1234567890
          required: true
          description: Onboarder's Symphony user ID
      responses:
        '200':
          description: The invite has been resent successfully.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/resend-invite-response"
        '400':
          description: Missing or malformed input
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/invite-already-confirmed"
                  - $ref: "#/components/schemas/invites-not-configured-on-emp"
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/contact-not-found"
        '500':
          description: Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/resend-invite-failed'
  /api/v1/customer/tenant/empChannelConnector/{externalNetwork}:
    get:
      tags:
        - CustomerContact
      summary: List EMP connectors available for one or multiple contacts
      description: |
        List the EMP connectors available for one or multiple contacts by Symphony IDs \
        EMP connector corresponds to \
          - Official accounts for LINE
          - Business APIs for WhatsApp
          - Phone numbers for SMS
      operationId: listAvailableEmpChannelConnectors
      parameters:
        - name: externalNetwork
          in: path
          description: "The external network: LINE or WHATSAPP or SMS"
          required: true
          schema:
            minLength: 1
            type: string
            example: WHATSAPP
        - name: symphonyId
          in: query
          description: Contacts' Symphony IDs
          required: false
          schema:
            type: array
            items:
              type: string
              pattern: '^\d+$'
            example: 13606456398824
        - name: federationGroupId
          in: query
          description: Federation group ID
          required: false
          schema:
            type: string
            example: 83df14d1-9fdb-4cbb-9a9d-718e5e15266a
      responses:
        '200':
          description: EMP connectors found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/list-emp-channel-connector-response"
        '404':
          description: Not found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/federation-group-not-found'
                  - $ref: '#/components/schemas/tenant-not-found'
                  - $ref: '#/components/schemas/contact-not-found'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/federation-group-emp-forbidden'
        '406':
          description: Not acceptable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not-applicable-for-external-network'
      security:
        - sfsAuthentication: [ ]
  /api/v1/customer/phone-numbers:
    get:
      tags:
        - CustomerPhoneNumber
      summary: Get phone number details
      operationId: getPhoneNumbers
      description: Get phone numbers.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: query
          name: status
          schema:
            type: string
          description: |
            filter on the phone number status either
            - USED
            - FREE
            - RELEASED
            - ON_HOLD
        - in: query
          name: provider
          schema:
            type: string
          description: | 
            filter on the provider
            - UMONY
            - CUSTOMER_SUPPLIED
        - in: query
          name: product
          schema:
            type: string
          description: |
            filter on the product 
            - VOICE
            - SMS
            - PRE_ALLOCATED_NUMBER
            - PRE_ALLOCATED_FULL
            - SECOND_NUMBER
            - SECOND_NUMBER_FULL
        - in: query
          name: subNetwork
          schema:
            type: string
          description: |
            filter on the subnetwork:
            - SECOND-NUMBER
            - IN-NETWORK
      responses:
        '200':
          description: Request processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/phone-numbers-details-response'
  /api/v1/customer/phone-number/{phoneNumber}:
    get:
      tags:
        - CustomerNumber
      summary: Get information on a phone number provided by Symphony
      operationId: getPhoneNumberInfos
      description: >
        Get information on a phone number provided by Symphony
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: phoneNumber
          schema:
            type: string
            format: phone
          required: true
          description: Phone number provided by Symphony
      responses:
        '200':
          description: Found phone number provided by Symphony
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/number-response'
        '404':
          description: Phone number not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/number-not-found'
    put:
      tags:
        - CustomerNumber
      summary: Update a phone number
      operationId: updatePhoneNumber
      description: |
        This endpoint allows to update an existing phone number.

        Currently, the following operations are supported:
        - Unassign a phone number from an advisor (making it "on hold").
        - Assign a phone number to a new advisor.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: phoneNumber
          schema:
            type: string
            format: phone
          required: true
          description: The phone number to update.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-number-request'
      responses:
        '200':
          description: The phone number was successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/number-response'
        '400':
          description: |
            The advisor that the phone number is being associated to does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/symphony-user-not-found-problem'
        '403':
          description: |
            It is forbidden to update this phone number. This may happen if:
            - The advisor associated with the phone number is still entitled to a direct EMP,
            - The advisor that the phone number is being associated to is already entitled to a direct EMP with another
            phone number.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/advisor-still-entitled'
                  - $ref: '#/components/schemas/advisor-already-entitled-for-direct-emp'
        '404':
          description: |
            May happen if the phone number to update was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/number-not-found'

  /api/v1/customer/phone-number/{phoneNumber}/address:
    get:
      tags:
        - CustomerNumber
      summary: Get phone address
      operationId: getPhoneAddress
      description: >
        Get phone address
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: phoneNumber
          schema:
            type: string
            format: phone
          required: true
          description: Phone number
      responses:
        '200':
          description: Found phone address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/address-response'
        '404':
          description: Phone number not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/number-not-found'
    put:
      tags:
        - CustomerNumber
      summary: Update phone number's address
      operationId: updatePhoneAddress
      description: >
        Update phone number's address
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: phoneNumber
          schema:
            type: string
            format: phone
          required: true
          description: Phone number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/address-request'
      responses:
        '204':
          description: The phone number's address has been successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/address-response'
        '400':
          description: Nothing to update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/no-field-updated'
        '404':
          description: Phone number not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/number-not-found'
    delete:
      tags:
        - CustomerNumber
      summary: Remove phone number's address
      operationId: removePhoneAddress
      description: >
        Remove phone number's address
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: phoneNumber
          schema:
            type: string
            format: phone
          required: true
          description: Phone number
      responses:
        '204':
          description: The phone number's address has been successfully removed
        '404':
          description: Phone number not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/number-not-found'

  /api/v1/customer/advisors/{advisorSymphonyId}/phone-number:
    get:
      tags:
        - CustomerNumber
      summary: Get Advisor phone number details
      operationId: getAdvisorPhoneNumbers
      description: Get Advisor phone number details.
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: advisorSymphonyId
          description: Advisor's symphony ID
          required: true
          schema:
            type: string
            pattern: '^\d+$'
      responses:
        '200':
          description: Request processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/phone-number-info'
        '404':
          description: |
            This may happen if:
            - The advisor does not have any phone number associated.
            - The requested advisor is not found.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/phone-number-not-assigned'
                  - $ref: '#/components/schemas/advisor-not-found'

  /api/v1/customer/rooms/{streamId}/members/{memberSymphonyId}:
    put:
      tags:
        - Room
      summary: Update room member's attributes
      operationId: updateMember
      description: "Update room member's attributes, such as their role in the room."
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: streamId
          required: true
          schema:
            type: string
          description: The ID of the Symphony room.
        - in: path
          name: memberSymphonyId
          required: true
          schema:
            type: string
            pattern: '^\d+$'
          description: The ID of the member to update.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-member-request'
      responses:
        '200':
          description: Member's role updated successfully.
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/invalid-room-member-role'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/cannot-demote-last-owner'
                  - $ref: '#/components/schemas/cannot-promote-external-user'
                  - $ref: '#/components/schemas/cannot-demote-external-user'
        '404':
          description: Not Found.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/room-not-found'
                  - $ref: '#/components/schemas/room-member-not-found'
        '409':
          description: Conflict.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/room-is-deactivated'

  /api/v1/customer/rooms/{streamId}/contact/{contactId}/empChannelConnector:
    get:
      tags:
        - CustomerRoom
      summary: Get the room contact details
      description: Get the phone number / wa.me link used in the WhatsApp Connect chat room to send messages to a contact.
      operationId: getRoomContactDetails
      security:
        - sfsAuthentication: [ ]
      parameters:
        - in: path
          name: streamId
          schema:
            type: string
          required: true
          description: StreamId of the room.
        - in: path
          name: contactId
          schema:
            type: string
          required: true
          description: symphonyId of the contact.
      responses:
        '200':
          description: Contact connector information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contact-connector-response'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/room-not-found'
                  - $ref: '#/components/schemas/room-member-not-found'
                  - $ref: '#/components/schemas/emp-channel-connector-not-found'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not-implemented'

components:
  schemas:
    phone-number-info:
      type: object
      properties:
        phoneNumber:
          type: string
          example: 911234567890
        subNetwork:
          type: string
          description: |
            sub network of the phone, either:
            - SECOND-NUMBER
            - IN-NETWORK
        country:
          type: string
        carrier:
          type: string
        status:
          type: string
          description: |
            Phone number status
            - USED
            - FREE
            - RELEASED
            - ON_HOLD
        productCode:
          type: integer
        product:
          type: string
          description: |
            For fully ported or partially ported numbers
            - PRE_ALLOCATED_NUMBER
            - PRE_ALLOCATED_FULL
            - SECOND_NUMBER
            - SECOND_NUMBER_FULL
            - VOICE (For In-Network numbers only)
            - SMS (For In-Network numbers only)
        provider:
          type: string
          enum:
            - UMONY
            - CUSTOMER_SUPPLIED
        assignedTo:
          $ref: '#/components/schemas/assigned-to'
        externalNetworks:
          type: array
          items:
            $ref: '#/components/schemas/external-network'
    assigned-to:
      type: object
      properties:
        advisorSymphonyId:
          type: string
          example: 911234567890
        advisorFirstName:
          type: string
        advisorLastName:
          type: string
    external-network:
      type: object
      properties:
        externalNetwork:
          type: string
          example: WHATSAPP-DIRECT
        availability:
          type: string
        empStatus:
          type: string
          enum:
            - CONNECTED
            - DISCONNECTED
            - PENDING
            - UNKNOWN
    phone-number-not-assigned:
      type: object
      description: 'The specified advisor does not have a phone number assigned'
      properties:
        type:
          type: string
          format: 'phone.number.not.assigned'
        title:
          type: string
          format: 'The specified advisor does not have a phone number assigned'
        status:
          type: integer
          format: "404"
    entitlements-response:
      type: object
      properties:
        entitlements:
          example:
            - WECHAT
            - WHATSAPP
            - SMS
            - SMS-DIRECT
            - LINE
    entitled-response:
      type: object
      properties:
        entitlements:
          type: array
          items:
            $ref: "#/components/schemas/entitlement-response"
        pagination:
          $ref: "#/components/schemas/pagination"
    search-contact-response:
        type: object
        properties:
          firstName:
            type: string
            example: John
          lastName:
            type: string
            example: Doe
          companyName:
            type: string
            example: Company
          emailAddress:
            type: string
            example: johndoe@symphony.com
          phoneNumber:
            type: string
            example: 911234567890
          externalNetwork:
            type: string
            description: "External network : WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
            example: WHATSAPP
          symphonyId:
            type: string
            example: 12345678912365
          status:
            $ref: '#/components/schemas/contact-status'
          statusUpdateDate:
            type: string
            format: date-time
            example: 1547661232368
          ownAdvisorId:
            type: string
            example: 12345678912300
          preferredLanguage:
            type: string
            example: English
          invitationCode:
            type: string
            example: AB12DE43
          room: # Room is null if the emp is not 1:1 only
            $ref: '#/components/schemas/room-creation-response'
          isColleague:
            type: boolean
            default: false
            example: false
          consent:
            type: string
            enum:
              - OPTED_IN
              - OPTED_OUT
              - PENDING
            example: PENDING
          phoneNumberBlockedBy:
            type: array
            items:
              $ref: '#/components/schemas/blocked-by-item'

    entitlement-response:
      type: object
      properties:
        symphonyId:
          type: string
          example: "14362370637825"
        firstName:
          type: string
          example: William
        lastName:
          type: string
          example: Smith
        companyName:
          type: string
          example: Company
        displayName:
          type: string
          example: William Smith
        emailAddress:
          type: string
          example: william.smith@symphony.com
        avatar:
          type: string
          example: "https://YOURDOMAIN.symphony.com/avatars/3gXMhglCCTwLPL9JAprnyHzYn5-PR49-wYDG814n1g8.png"
        externalNetwork:
          type: string
          example: WHATSAPP_DIRECT
        federationGroupId:
          type: string
          example: federationGroupId
        status:
          type: string
          example: PRE_ENTITLED
        phone:
          $ref: "#/components/schemas/phone"
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/permission-response'
    phone:
      type: object
      description: "Phone number (direct EMP case)"
      properties:
        number:
          type: string
          example: "+1 234-567-8912"
        product:
          type: string
          example: "PRE_ALLOCATED_HOSTED"
        subNetwork:
          type: string
          description: "Sub-network: IN-NETWORK or SECOND-NUMBER"
          example: "SECOND-NUMBER"
        provider:
          type: string
          enum:
            - UMONY
            - CUSTOMER_SUPPLIED
    list-emp-channel-connector-response:
      type: object
      properties:
        empChannelConnectors:
          type: array
          items:
            $ref: '#/components/schemas/emp-channel-connector-response'
    emp-channel-connector-response:
      allOf:
        - $ref: "#/components/schemas/emp-channel-connector"
        - type: object
          properties:
            available:
              type: boolean
    emp-channel-connector:
      type: object
      properties:
        displayName:
          type: string
          example: Official Account Name
        id:
          type: string
          example: 123456
    add-entitlementv2-response:
      type: object
      properties:
        symphonyId:
          type: string
          example: 14362370637825
        firstName:
          type: string
          example: William
        lastName:
          type: string
          example: Smith
        companyName:
          type: string
          example: Company
        displayName:
          type: string
          example: William Smith
        emailAddress:
          type: string
          example: william.smith@symphony.com
        avatar:
          type: string
          example: "https://YOURDOMAIN.symphony.com/avatars/3gXMhglCCTwLPL9JAprnyHzYn5-PR49-wYDG814n1g8.png"
        externalNetwork:
          type: string
          example: WHATSAPP
        permissions:
          type: array
          items:
            $ref: "#/components/schemas/bulk-permission-item"
        federationGroupId:
          type: string
          example: federationGroupId
        ownContactId:
          type: string
          example: 14362370637825
        status:
          type: string
          enum:
            - PRE_ENTITLED
            - ENTITLED
        phone:
          $ref: "#/components/schemas/phone"
    invalid-page-cursor:
      type: object
      properties:
        type:
          type: string
          format: invalid.page.cursor
        title:
          type: string
          format: The provided cursor key is invalid or expired.
        status:
          type: integer
          format: "400"
      description: The provided cursor key is invalid or expired
    entitlement-request:
      required:
        - externalNetwork
      type: object
      properties:
        advisorEmailAddress:
          type: string
          example: william.smith@symphony.com
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        symphonyId:
          type: string
          example: 12345678912365
        advisorPhoneNumber:
          description: "Required for the advisor to access SMS Direct In-Network and supported for SMS Direct Second-Number. Supported for the advisor to access WhatsApp Direct. However, note that the advisor’s phone number is not applicable for onboarding the advisor to other external networks (WeChat, WhatsApp, SMS or LINE)."
          type: string
          format: phone
        permissions:
          type: array
          items:
            type: string
        federationGroupId:
          type: string
          example: federationGroupId
    pre-entitlement-request:
      type: object
      required:
        - advisorPhoneNumber
      properties:
        advisorPhoneNumber:
          type: string
          format: phone
        federationGroupId:
          type: string
    entitlement-user-already-exists-problem:
      type: object
      properties:
        type:
          type: string
          format: entitlement.already.exists
        title:
          type: string
          format: Entitlement already exists.
        status:
          type: integer
          format: "400"
      description: Entitlement already exists.
    advisor-phone-number-not-supported-problem:
      type: object
      properties:
        type:
          type: string
          format: advisor.phone.number.not.supported
        title:
          type: string
          format: Advisor's phone number not supported.
        status:
          type: integer
          format: "400"
      description: Advisor's phone number is not supported for this external network.
    advisor-phone-number-is-required-problem:
      type: object
      properties:
        type:
          type: string
          format: advisor.phone.number.is.required
        title:
          type: string
          format: Advisor's phone number is required.
        status:
          type: integer
          format: "400"
      description: Advisor's phone number is required for this external network.
    advisor-phone-number-already-used-problem:
      type: object
      properties:
        type:
          type: string
          format: advisor.phone.number.already.used
        title:
          type: string
          format: Advisor's phone number already used.
        status:
          type: integer
          format: "409"
      description: Advisor's phone number is already used.
    pre-entitlement-permissions-not-supported-problem:
      type: object
      properties:
        type:
          type: string
          format: 'pre.entitlement.permissions.not.supported'
        title:
          type: string
          format: 'Permissions are not supported for pre-entitlements.'
        status:
          type: integer
          format: "400"
    contact-status:
      type: string
      enum:
        - PENDING_CONFIRMATION
        - CONFIRMED
        - INVITE_EXPIRED
        - UNAVAILABLE
        - INCOMPLETE
        - OPTED_IN
        - OPTED_OUT
    symphony-user-not-found-problem:
      type: object
      properties:
        type:
          type: string
          format: symphony.user.not.found
        title:
          type: string
          format: Symphony user not found.
        status:
          type: integer
          format: "400"
      description: Symphony user not found.
    entitlement-type-not-found-problem:
      type: object
      properties:
        type:
          type: string
          format: entitlement.type.not.found
        title:
          type: string
          format: Entitlement type not found.
        status:
          type: integer
          format: "400"
      description: Entitlement type not found
    forbidden-entitlement-type:
      type: object
      properties:
        type:
          type: string
          format: forbidden.entitlement.type
        title:
          type: string
          format: Forbidden entitlement.type.
        status:
          type: integer
          format: "403"
      description: Forbidden entitlement type.
    pre-entitlement-phone-number-mismatch:
      description: The phone number of the pre-entitlement does not match.
      properties:
        type:
          type: string
          format: pre.entitlement.phone.number.mismatch
        title:
          type: string
          format: The phone number of the pre-entitlement does not match.
        status:
          type: integer
          format: "409"
    number-not-available:
      type: object
      description: Number not available
      properties:
        type:
          type: string
          format: number.not.available
        title:
          type: string
          format: Number not available
        status:
          type: integer
          format: "409"
    number-registration-not-possible:
      type: object
      description: Number registration is not possible
      properties:
        type:
          type: string
          format: number.registration.not.possible
        title:
          type: string
          format: Number registration not possible
        detailMessage:
          type: string
          format: Detail message
        status:
          type: integer
          format: "409"
    tenant-configuration-not-found:
      type: object
      properties:
        type:
          type: string
          format: tenant.configuration.not.found
        title:
          type: string
          format: Tenant configuration not found.
        status:
          type: integer
          format: "404"
      description: Tenant configuration not found.
    entitlement-not-found-problem:
      type: object
      properties:
        type:
          type: string
          format: entitlement.not.found
        title:
          type: string
          format: Entitlement not found.
        status:
          type: integer
          format: "404"
      description: Entitlement not found.
    contact-not-found:
      type: object
      properties:
        type:
          type: string
          format: contact.not.found
        title:
          type: string
          format: Contact not found
        status:
          type: integer
          format: "404"
      description: Contact not found
    company-not-found:
      type: object
      properties:
        type:
          type: string
          format: company.not.found
        title:
          type: string
          format: Company not found
        status:
          type: integer
          format: "404"
      description: Company not found
    no-available-number:
      type: object
      properties:
        type:
          type: string
          format: no.available.number
        title:
          type: string
          format: No available number.
        status:
          type: integer
          format: "500"
      description: No available number.
    incompatible-external-network-and-request-body:
      type: object
      description: 'Incompatible external network and request body.'
      properties:
        type:
          type: string
          format: 'incompatible.external.network.request.body'
        title:
          type: string
          format: 'Incompatible external network and request body.'
        status:
          type: integer
          format: "400"
    user-id-mismatch:
      type: object
      description: 'The token userId does not match the request.'
      properties:
        type:
          type: string
          format: 'user.id.mismatch'
        title:
          type: string
          format: 'The token userId does not match the request.'
        status:
          type: integer
          format: "403"
    phone-international-onboarding-forbidden:
      type: object
      description: 'Forbidden international onboarding.'
      properties:
        type:
          type: string
          format: 'phone.international.onboarding.forbidden'
        title:
          type: string
          format: 'Forbidden international onboarding.'
        status:
          type: integer
          format: "403"
    deleteContacts-response:
      type: object
      properties:
        report:
          type: array
          items:
            $ref: "#/components/schemas/deleteContact-response"
    deleteContact-response:
      type: object
      properties:
        contact:
          $ref: "#/components/schemas/deleteContact-request"
        status:
          $ref: "#/components/schemas/bulk-removal-status"
    deleteContact-request:
      required:
        - advisorEmailAddress
        - externalNetwork
        - contactEmailAddress
      type: object
      properties:
        advisorEmailAddress:
          type: string
          example: william.smith@symphony.com
        contactEmailAddress:
          type: string
          format: email
          example: johndoe@symphony.com
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
    customer-deleteAdvisorContacts-responsev2:
      type: object
      properties:
        report:
          type: array
          items:
            $ref: '#/components/schemas/customer-deleteAdvisorContact-responsev2'
    customer-deleteAdvisorContact-responsev2:
      type: object
      properties:
        contact:
          $ref: '#/components/schemas/customer-deleteAdvisorContact-contact'
        status:
          $ref: '#/components/schemas/bulk-removal-status'
    customer-deleteAdvisorContact-contact:
      required:
        - advisorSymphonyId
        - phoneNumber
        - externalNetwork
      type: object
      properties:
        advisorSymphonyId:
          type: string
          example: 1234567890
        phoneNumber:
          type: string
          example: +1 234567890
        externalNetwork:
          type: string
          example: WHATSAPP
    deleteContacts-request:
      type: object
      properties:
        contacts:
          type: array
          items:
            $ref: "#/components/schemas/deleteContact-request"
    customer-contactWithId-response:
      type: object
      properties:
        contact:
          $ref: "#/components/schemas/customer-contactWithId"
        status:
          $ref: "#/components/schemas/bulk-removal-status"
    customer-contactsWithId-response:
      type: object
      properties:
        report:
          type: array
          items:
            $ref: "#/components/schemas/customer-contactWithId-response"
    customer-contactWithId:
      type: object
      properties:
        advisorSymphonyId:
          type: string
        advisorEmailAddress:
          type: string
        contactEmailAddress:
          type: string
        externalNetwork:
          type: string
    deleteContacts-responsev2:
      type: object
      properties:
        report:
          type: array
          items:
            $ref: "#/components/schemas/deleteContact-responsev2"
    deleteContact-responsev2:
      type: object
      properties:
        contact:
          $ref: "#/components/schemas/deleteContact-requestv2"
        status:
          $ref: "#/components/schemas/bulk-removal-statusv2"
    deleteContact-requestv2:
      required:
        - advisorSymphonyId
        - contactSymphonyId
      type: object
      properties:
        advisorSymphonyId:
          type: string
          example: 1234567890
        contactSymphonyId:
          type: string
          format: number
          example: 1234567890
    deleteContacts-requestv2:
      type: object
      properties:
        contacts:
          type: array
          items:
            $ref: "#/components/schemas/deleteContact-requestv2"
    customer-contactWithId-responsev2:
      type: object
      properties:
        contact:
          $ref: "#/components/schemas/customer-contactWithIdv2"
        status:
          $ref: "#/components/schemas/bulk-removal-status"
    customer-contactsWithId-responsev2:
      type: object
      properties:
        report:
          type: array
          items:
            $ref: "#/components/schemas/customer-contactWithId-responsev2"
    customer-contactWithIdv2:
      type: object
      properties:
        advisorSymphonyId:
          type: string

    advisor-not-found:
      type: object
      properties:
        type:
          type: string
          example: advisor.not.found
        title:
          type: string
          example: advisor not found
        status:
          type: integer
          example: 404
      description: Advisor not found
    advisor-id-not-provided:
      description: 'Advisor ID or email not provided'
      properties:
        type:
          type: string
          format: 'advisor.identifier.not.provided'
        title:
          type: string
          format: 'Advisor ID or email not provided.'
        status:
          type: integer
          example: 400
    not-a-room-member:
      type: object
      description: 'Not a room member.'
      properties:
        type:
          type: string
          format: 'not.a.room.member'
        title:
          type: string
          format: 'Not a room member.'
        status:
          type: integer
          example: 409

    already-room-owner:
      type: object
      description: 'Advisor already room owner.'
      properties:
        type:
          type: string
          format: 'advisor.already.room.owner'
        title:
          type: string
          format: 'Advisor already room owner.'
        status:
          type: integer
          example: 409

    cannot-transfer-room-ownership-duplicate-room-name:
      type: object
      description: 'Cannot transfer room ownership because the advisor is already owner of a room with the same name'
      properties:
        type:
          type: string
          format: 'cannot.transfer.room.ownership.duplicate.room.name'
        title:
          type: string
          format: 'Cannot transfer room ownership because the advisor is already owner of a room with the same name'
        status:
          type: integer
          example: 409

    room-is-deactivated:
      type: object
      description: The Room is Deactivated.
      properties:
        type:
          type: string
          format: room.is.deactivated
        title:
          type: string
          format: The Room is Deactivated.
        status:
          type: integer
          example: 409
        roomName:
          type: string
          nullable: true
          format: name of the deactivated room
    Unauthorized:
      type: object
      properties:
        type:
          type: string
          example: unauthorized
        title:
          type: string
          example: Unauthorized
        status:
          type: integer
          example: 401
      description: Full authentication is required to access this resource
    Forbidden:
      type: object
      properties:
        type:
          type: string
          example: Forbidden
        title:
          type: string
          example: Forbidden
        status:
          type: integer
          example: 403
      description: Access is denied, you don't have the permission to perform this operation
    permissions-response:
      type: object
      properties:
        permissions:
          type: array
          items:
            $ref: "#/components/schemas/list-permission-response"
    enhanced-permissions-response:
      type: object
      properties:
        permissions:
          type: array
          items:
            $ref: "#/components/schemas/enhanced-permission-response"
    enhanced-permission-response:
      type: object
      properties:
        isDefault:
          type: boolean
        permissionId:
          type: string
        permissionName:
          type: string
    bulk-permission-item:
      type: object
      properties:
        status:
          type: integer
          example: 200
        response:
          $ref: "#/components/schemas/permission-response"
        error:
          $ref: "#/components/schemas/bulk-item-error"
    list-permission-response:
      type: string
      example: "create:room"
    permission-response:
      type: object
      properties:
        permissionName:
          type: string
          example: "create:room"
        permissionId:
          type: string
          example: "aef488fa-636e-483e-b366-278e07354e57"
    advisor-permissions-response:
      type: object
      properties:
        advisorSymphonyId:
          type: string
          example: 14362370637825
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        permissions:
          type: array
          items:
            $ref: "#/components/schemas/permission-response"
    advisors-permission-requestv2:
      required:
        - advisorSymphonyIds
        - externalNetwork
        - permissionName
      type: object
      properties:
        advisorSymphonyIds:
          type: array
          items:
            type: string
            example: 1234567890
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        permissionName:
          type: string
          example: "create:room"
    advisors-permission-request:
      required:
        - advisorEmailAddress
        - externalNetwork
        - permissionName
      type: object
      properties:
        advisorEmailAddress:
          type: array
          items:
            type: string
            example: william.smith@symphony.com
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        permissionName:
          type: string
          example: "create:room"
    advisor-permission-request:
      required:
        - permissionName
      type: object
      properties:
        permissionName:
          type: string
          example: "create:room"
    advisor-permission-response:
      type: object
      properties:
        advisorSymphonyId:
          type: string
          example: 14362370637825
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        permission:
          $ref: "#/components/schemas/permission-response"
    permission-not-found:
      type: object
      properties:
        type:
          type: string
          format: permission.not.found
        title:
          type: string
          format: Permission not found.
        status:
          type: integer
          format: "404"
      description: Permission not found.
    permission-already-assigned:
      type: object
      properties:
        type:
          type: string
          format: permission.already.assigned
          example: permission.already.assigned
        title:
          type: string
          format: Permission already assigned.
          example: Permission already assigned.
        status:
          type: integer
          format: "409"
          example: 409
      description: Permission already assigned.
    missing-destination-federation-group:
      type: object
      properties:
        type:
          type: string
          format: missing.destination.federation.group
        title:
          type: string
          format: Missing destination federation group
        status:
          type: integer
          format: "400"
    multiple-destination-federation-group:
      type: object
      properties:
        type:
          type: string
          format: multiple.destination.federation.group
        title:
          type: string
          format: Multiple destination federation group
        status:
          type: integer
          format: "400"
    bulk-advisor-permission-response:
      type: object
      properties:
        advisorsPermissions:
          type: array
          items:
            $ref: "#/components/schemas/bulk-advisor-permission-item-response"
    bulk-advisor-permission-item-response:
      type: object
      properties:
        status:
          type: integer
        response:
          $ref: "#/components/schemas/advisor-permission-response"
        error:
          $ref: "#/components/schemas/bulk-item-error"
    multiple-advisor-permission-response:
      type: object
      properties:
        advisorsPermissions:
          type: array
          items:
            type: object
            properties:
              status:
                type: integer
                example: 200
              response:
                type: object
                properties:
                  advisorSymphonyId:
                    type: string
                    description: Symphony user ID of the advisor
                    example: "12345678912365"
                  email:
                    type: string
                    description: email adress of the advisor
                    example: "william.smith@symphony.com"
                  externalNetwork:
                    description: WHATSAPP
                    type: string
                    example: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
                  permission:
                    type: object
                    properties:
                      permissionName:
                        type: string
                        example: "create:room"
              error:
                type: object
                description: Should an error occur while adding or removing the permission, this returned object will provide details about the error(s)
                properties:
                  title:
                    type: string
                    example: advisor.not.found
                  detail:
                    type: string
                    example: "Advisor 68719476737 does not exist"
    customer-contact-request:
      allOf:
        - $ref: "#/components/schemas/contact-request"
        - required:
            - onboarderEmailAddress
          type: object
          properties:
            advisorEmailAddresses:
              type: array
              description: A list of email addresses of the advisor to whom the contact is to be added. For WeChat, an "onboarder" is an advisor with the permission "create:contact". For WhatsApp, SMS, SMS Direct and LINE, the permission is set by default.
              items:
                type: string
                format: email
                example: william.smith@symphony.com
            onboarderEmailAddress:
              type: string
              example: william.smith@symphony.com
              description: If both advisorSymphonyIds and advisorEmailAddresses are empty, the contact will be added to the onboarder with this email address.
            createRoom:
              type: boolean
              description: Can be set to false in order to prevent the room creation when onboarding a contact on SMS Direct or WhatsApp Direct. This parameter can't be set to true for WhatsApp, SMS, Wechat and LINE for now.
    add-contact-response:
      type: object
      properties:
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        companyName:
          type: string
          example: Company
        emailAddress:
          type: string
          example: johndoe@symphony.com
        phoneNumber:
          type: string
          example: 911234567890
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        symphonyId:
          type: string
          example: 12345678912365
        status:
          type: string
          enum:
            - PENDING_CONFIRMATION
            - CONFIRMED
            - INVITE_EXPIRED
            - CANCELED
            - UNAVAILABLE
            - INCOMPLETE
        statusUpdateDate:
          type: string
          format: date-time
          example: 1547661232368
        preferredLanguage:
          type: string
          example: CHINESE_CHN, CHINESE_HKG, CHINESE_TAI, JAPANESE (among others, see release note for more)
        invitationCode:
          type: string
          example: "AB12DE43"
        phoneNumberBlockedBy:
          type: array
          items:
            $ref: '#/components/schemas/blocked-by-item'
    list-contact-response:
      type: object
      properties:
        contacts:
          type: array
          items:
            $ref: "#/components/schemas/find-contact-response-v2-with-block-status"
        pagination:
          $ref: "#/components/schemas/pagination"
    find-contact-response:
      type: object
      properties:
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        companyName:
          type: string
          example: Company
        emailAddress:
          type: string
          example: johndoe@symphony.com
        phoneNumber:
          type: string
          example: 911234567890
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        symphonyId:
          type: string
          example: 12345678912365
        advisors:
          type: array
          description: Advisors Symphony IDs
          items:
            type: string
          example: [123456789, 369258147, 7896564123]
        status:
          type: string
          enum: [PENDING_CONFIRMATION, CONFIRMED, INVITE_EXPIRED, CANCELED, UNAVAILABLE, INCOMPLETE]
        isColleague:
          type: boolean
          default: false
    find-contact-response-v2-with-block-status: #Not added yet in "Get contact by phone number"
      allOf:
        - $ref: "#/components/schemas/find-contact-response-v2"
        - $ref: '#/components/schemas/blocked-by-item'
    find-contact-response-v2:
      allOf:
        - $ref: "#/components/schemas/find-contact-response"
        - type: object
          properties:
            preferredLanguage:
              type: string
              example: CHINESE_CHN, CHINESE_HKG, CHINESE_TAI, JAPANESE (among others, see release note for more)
    blocked-by-item:
      type: object
      properties:
        advisorSymphonyId:
          type: string
          format: phone
        reason:
          $ref: '#/components/schemas/blocking-reason-enum'
        comment:
          type: string
        requestDate:
          type: string
          format: date-time

    external-network-not-found:
      type: object
      properties:
        type:
          type: string
          format: external.network.not.found
          example: Bad request
        title:
          type: string
          format: External network not found.
          example: Bad request
        status:
          type: integer
          format: "400"
          example: 400
      description: External network not found.
    invalid-user-info:
      type: object
      properties:
        type:
          type: string
          format: invalid.user.information
        title:
          type: string
          format: Invalid user information
        status:
          type: integer
          format: "400"
          example: 400
      description: Invalid user information
    rename-room-forbidden:
      type: object
      description: 'Rename room forbidden'
      properties:
        type:
          type: string
          format: 'rename.room.forbidden'
        title:
          type: string
          format: 'Not allowed to rename the room.'
        status:
          type: integer
          format: "403"
    different-room-name-required:
      type: object
      description: 'Different room name is required.'
      properties:
        type:
          type: string
          format: 'different.room.name.required'
        title:
          type: string
          format: 'Different room name is required.'
        status:
          type: integer
          format: "409"
    cannot-rename-room-duplicate-room-name:
      type: object
      description: 'Cannot rename room because the owner already has a room with the same name.'
      properties:
        type:
          type: string
          format: 'cannot.rename.room.duplicate.room.name'
        title:
          type: string
          format: 'Cannot rename room because the owner already has a room with the same name.'
        status:
          type: integer
          format: "409"
    rename-room-failed:
      type: object
      description: 'Failed to rename the room.'
      properties:
        type:
          type: string
          format: 'rename.room.failed'
        title:
          type: string
          format: 'Unable to rename the room.'
        status:
          type: integer
          format: "500"
    forbidden-advisor:
      type: object
      properties:
        type:
          type: string
          format: onboarding.forbidden.advisor
        title:
          type: string
          format: This Advisor is not permissioned for Onboarding.
        status:
          type: integer
          format: "403"
      description: This Advisor is not permissioned for Onboarding.
    forbidden-onboarder:
      type: object
      properties:
        type:
          type: string
          format: onboarding.forbidden.onboarder
        title:
          type: string
          format: This Onboarder is not entitled for this external network.
        #find where to define "onboarder" = Advisor with onboarding permission. Need to modify API code to change this message
        status:
          type: integer
          format: "403"
      description: This Onboarder is not entitled for this external network.
    #find where to define "onboarder" = Advisor with onboarding permission. Need to modify API code to change this message
    user-already-onboarded:
      type: object
      properties:
        type:
          type: string
          format: user.already.onboarded
        title:
          type: string
          format: Contact already onboarded.
        status:
          type: integer
          format: "409"
      description: Contact already onboarded.
    user-already-exists:
      type: object
      properties:
        type:
          type: string
          format: user.already.exists
        title:
          type: string
          format: Contact already exists.
        status:
          type: integer
          format: "409"
      description: Contact already exists.
    create-account-failed:
      type: object
      properties:
        type:
          type: string
          format: account.creation.failed
        title:
          type: string
          format: Unable to create the account.
        status:
          type: integer
          format: "500"
      description: Gateway microservice cannot create the Symphony account.
    customer-update-contacts-requestv2:
      required:
        - firstName
        - lastName
        - companyName
        - phoneNumber
        - advisorSymphonyId
      type: object
      properties:
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: DoeABC
        companyName:
          type: string
          example: Company
          maxLength: 100
        phoneNumber:
          type: string
          format: phone
          example: 911234567890
        emailAddress:
          type: string
          example: johndoe@symphony.com
        advisorSymphonyId:
          type: string
          pattern: '^\d+$'
          example: 1234567890
        preferredLanguage:
          type: string
          description: Contact preferred language. Refer to contact preferred language section at the beginning of this documentation for valid language name.
          example: CHINESE_CHN, CHINESE_HKG, CHINESE_TAI, JAPANESE, etc.
    customer-update-contacts-request:
      allOf:
        - $ref: "#/components/schemas/update-contacts-request"
        - required:
            - advisorEmailAddress
          type: object
          properties:
            advisorEmailAddress:
              type: string
              format: email
              example: william.smith@symphony.com
    update-contacts-response:
      type: object
      properties:
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: DoeABC
        companyName:
          type: string
          example: Company
        emailAddress:
          type: string
          example: johndoe@symphony.com
        phoneNumber:
          type: string
          example: 911234567890
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        symphonyId:
          type: string
          description: Federated user Symphony ID
          example: 12345678912365
        advisors:
          type: array
          description: Advisors Symphony IDs
          items:
            type: string
            example: 14362370637825
    update-contacts-response-v2:
      type: object
      properties:
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: DoeABC
        companyName:
          type: string
          example: Company
        emailAddress:
          type: string
          example: johndoe@symphony.com
        phoneNumber:
          type: string
          example: 911234567890
        symphonyId:
          type: string
          description: Federated user Symphony id
          example: 12345678912365
        advisors:
          type: array
          description: Advisors Symphony IDs
          items:
            type: string
            example: 14362370637825
        preferredLanguage:
          type: string
          description: Contact preferred language
          example: CHINESE_CHN, CHINESE_HKG, CHINESE_TAI, JAPANESE, etc.
    update-forbidden-for-advisor:
      type: object
      properties:
        type:
          type: string
          format: update.forbidden.advisor
        title:
          type: string
          format: Contacts update is forbidden for this Advisor.
        status:
          type: integer
          format: "403"
      description: Contacts update is forbidden for this Advisor.
    update-forbidden-for-contact:
      type: object
      properties:
        type:
          type: string
          format: update.forbidden.contact
        title:
          type: string
          format: Update forbidden for this contact.
        status:
          type: integer
          format: "403"
      description: Update forbidden for this contact.
    multi-tenant-federated-user-update-attempt:
      type: object
      properties:
        type:
          type: string
          format: multi.tenant.federated.user.update.attempt
        title:
          type: string
          format: Found Contact records spanning across more than one tenant.
        status:
          type: integer
          format: "403"
      description: Found Contact records spanning across more than one tenant.
    cannot-edit-advisor-own-contact-email:
      type: object
      properties:
        type:
          type: string
          format: cannot.edit.advisor.own.contact.email
        title:
          type: string
          format: Cannot edit advisor own contact email.
        status:
          type: integer
          format: "403"
      description: Cannot edit advisor own contact email
    update-account-failed:
      type: object
      properties:
        type:
          type: string
          format: account.update.failed
        title:
          type: string
          format: Unable to update the Contact.
        status:
          type: integer
          format: "500"
      description: Gateway microservice cannot update the Symphony account.
    advisors-search-response:
      type: object
      properties:
        advisors:
          type: array
          items:
            $ref: "#/components/schemas/entitlement-response"
        pagination:
          $ref: "#/components/schemas/pagination"
    search-contacts-response:
      type: object
      properties:
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/search-contact-response'
        pagination:
          $ref: '#/components/schemas/pagination'

    contacts-response:
      type: object
      properties:
        contacts:
          type: array
          items:
            $ref: "#/components/schemas/add-contact-response"
        pagination:
          $ref: "#/components/schemas/pagination"
    rooms-response:
      type: object
      properties:
        rooms:
          type: array
          items:
            $ref: "#/components/schemas/room-response"
        pagination:
          $ref: "#/components/schemas/pagination"
    room-response:
      type: object
      properties:
        streamId:
          type: string
          example: bjHSiY4iz3ar4iIh6-VzCX___peoM7cPdA
        roomName:
          type: string
          example: API room
        advisorSymphonyId:
          type: string
          example: 12345678912365
        federationGroupId:
          type: string
          example: federationGroupId
        created:
          type: string
          format: date-time
          example: 1547661232368
        updated:
          type: string
          format: date-time
          example: 1547661232370
        roomType:
          type: string
          enum:
            - ROOM
            - IM
        membersCount:
          type: integer
          example: 1
        company:
          type: string
          example: Company
        roomStatus:
          type: string
          enum:
            - ACTIVE
            - LIMITED
            - DEACTIVATED
            - UNKNOWN
        limitedMembersCount:
          type: integer
          example: 1
        pendingMembersCount:
          type: integer
          example: 2
        unknownStatusMembersCount:
          type: integer
          example: 0
    room-creation-response:
      type: object
      properties:
        streamId:
          type: string
          example: bjHSiY4iz3ar4iIh6-VzCX___peoM7cPdA
        roomName:
          type: string
          example: API room
        advisorSymphonyId:
          type: string
          example: 12345678912365
        federationGroupId:
          type: string
          example: federationGroupId
        created:
          type: string
          format: date-time
          example: 1547661232368
        updated:
          type: string
          format: date-time
          example: 1547661232370
        roomType:
          type: string
          enum:
            - ROOM
            - IM
        membersCount:
          type: integer
          example: 1
    room-creation-response-v2:
      allOf:
        - $ref: "#/components/schemas/room-creation-response"
        - type: object
          properties:
            externalNetworkRoomDisplayName:
              type: string
    room-request:
      required:
        - advisorEmailAddress
        - externalNetwork
        - roomName
      type: object
      properties:
        roomName:
          maxLength: 50
          type: string
          example: API room
        advisorEmailAddress:
          type: string
          format: email
          example: william.smith@symphony.com
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          maxLength: 50
          type: string
          example: WHATSAPP
    room-requestv2:
      required:
        - ownerSymphonyId
        - externalNetwork
        - roomName
      type: object
      properties:
        roomName:
          maxLength: 50
          type: string
          example: API room
        federationGroupId:
          type: string
          example: federationGroupId
        externalNetworkRoomDisplayName:
          maxLength: 50
          type: string
          example: API room
        ownerSymphonyId:
          type: string
          format: number
          example: 1234567890
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          maxLength: 50
          type: string
          example: WHATSAPP
        createGroup:
          type: boolean
          default: false
          description: If set to true, a WhatsApp Connect native group chat is created. If set to false or not provided, a standard WhatsApp Connect chat is created.
    rename-room-request:
      type: object
      required:
        - newRoomName
      properties:
        newRoomName:
          type: string
          minLength: 1
          maxLength: 50
    transfer-room-ownership-request:
      type: object
      required:
        - newRoomOwnerSymphonyId
      properties:
        newRoomOwnerSymphonyId:
          type: string
          format: number
          example: 1234567890
    rename-room-response:
      type: object
      properties:
        streamId:
          type: string
        oldRoomName:
          type: string
        newRoomName:
          type: string
    connection-not-accepted:
      type: object
      properties:
        type:
          type: string
          format: connection.not.accepted
        title:
          type: string
          format: connection with Symphony Connect Assistant is not accepted
        status:
          type: integer
          format: "400"
      description: Connection with Symphony Connect Assistant is not accepted
    federated-account-not-found:
      type: object
      properties:
        type:
          type: string
          format: federated.account.not.found
        title:
          type: string
          format: federated account not found
        status:
          type: integer
          format: "404"
      description: FederatedAccount not found.
    room-already-exists:
      type: object
      properties:
        type:
          type: string
          format: room.already.exists
        title:
          type: string
          format: Room already exists.
        status:
          type: integer
          format: "409"
      description: Room already exists.
    create-room-failed:
      type: object
      properties:
        type:
          type: string
          format: room.creation.failed
        title:
          type: string
          format: Unable to create the room.
        status:
          type: integer
          format: "500"
      description: Gateway microservice cannot create the room.
    missing-connection-with-connect-bot:
      type: object
      properties:
        type:
          type: string
          format: missing.connection.with.connect.bot
        title:
          type: string
          format: connection with Symphony Connect Assistant does not exist
        status:
          type: integer
          format: "500"
      description: Connection with Symphony Connect Assistant does not exist
    room-members-response:
      type: object
      properties:
        members:
          type: array
          items:
            $ref: "#/components/schemas/room-member-response"
        pagination:
          $ref: "#/components/schemas/pagination"
    room-member-response:
      type: object
      properties:
        streamId:
          type: string
          example: bjHSiY4iz3ar4iIh6-VzCX___peoM7cPdA
        symphonyId:
          type: string
          example: 12345678912365
        federatedUserId:
          type: string
          example: 14362370637825
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        companyName:
          type: string
          example: Company
        avatar:
          type: string
          example: "https://YOURDOMAIN.symphony.com/avatars/3gXMhglCCTwLPL9JAprnyHzYn5-PR49-wYDG814n1g8.png"
        displayName:
          type: string
          example: John Doe
        emailAddress:
          type: string
          example: johndoe@symphony.com
        isOwner:
          type: boolean
          example: false
        empChannelConnector:
          allOf:
            - $ref: "#/components/schemas/emp-channel-connector"
          description: "Network channel connector used for room member. Only for LINE"
    room-set-activity-response:
      type: object
      properties:
        isRoomActivityUpdated:
          type: boolean
        newRoomStatus:
          type: string
          enum:
            - ACTIVE
            - DEACTIVATED
    remove-room-members-response:
      type: object
      properties:
        isRoomDeleted:
          type: boolean
    advisor-contact-rooms-response:
      type: object
      description: Rooms for an advisor and contact
      properties:
        advisorSymphonyId:
          type: string
          format: string
          pattern: '^\d+$'
          example: 1234567890
        contactSymphonyId:
          type: string
          format: string
          pattern: '^\d+$'
          example: 1234567890
        sortedBy:
          type: string
          enum:
            - createdDate_DESC
        rooms:
          type: array
          description: Room basic information
          items:
            $ref: '#/components/schemas/room-basic-information'
    room-basic-information:
      type: object
      properties:
        stream-id:
          type: string
        room-name:
          type: string
        emp:
          type: string
        created-date:
          type: integer
          format: int64
    remove-room-member-forbidden:
      type: object
      properties:
        type:
          type: string
          format: remove.room.member.forbidden
        title:
          type: string
          format: Remove room member forbidden
        status:
          type: integer
          format: "403"
      description: Remove room member forbidden
    room-not-found:
      type: object
      properties:
        type:
          type: string
          format: room.not.found
        title:
          type: string
          format: Room not found
        status:
          type: integer
          format: "404"
      description: Room not found
    room-member-not-found:
      type: object
      properties:
        type:
          type: string
          format: room.member.not.found
        title:
          type: string
          format: Room member not found
        status:
          type: integer
          format: "404"
      description: Room member not found
    update-room-status-failed:
      type: object
      description: 'Gateway microservice cannot update the status of the room.'
      properties:
        type:
          type: string
          format: 'update.room.status.failed'
        title:
          type: string
          format: 'Unable to update the status of the room.'
        status:
          type: integer
          format: "500"
    emp-channel-connector-not-found:
      type: object
      description: 'Emp channel connector not found.'
      properties:
        type:
          type: string
          format: 'emp.channel.connector.not.found'
        title:
          type: string
          format: 'Emp channel connector not found'
        status:
          type: integer
          format: "404"
        users:
          type: array
          description: List of user ids for which the channel connector could not be found
          items:
            type: string
            pattern: '^\d+$'
        detailedMessage:
          type: string
          nullable: true
          format: 'Detailed message'
    reactivate-room-not-implemented:
      type: object
      description: 'Reactivate Room Not Implemented'
      properties:
        type:
          type: string
          format: 'reactivate.room.not.implemented'
        title:
          type: string
          format: 'Reactivate Room Not Implemented'
        status:
          type: integer
          format: "501"
    room-features-request:
      type: object
      properties:
        attachmentsDisabled:
          description: Allows to enable or disable attachments in a room. Only supported for WhatsApp.
          type: boolean
    room-set-activity-request:
      type: object
      required:
        - setActive
      properties:
        setActive:
          type: boolean
    room-member-request:
      required:
        - advisorEmailAddress
        - externalNetwork
        - contact
        - memberEmailAddress
        - streamId
      type: object
      properties:
        streamId:
          type: string
          example: bjHSiY4iz3ar4iIh6-VzCX___peoM7cPdA
        memberEmailAddress:
          type: string
          format: email
          example: johndoe@symphony.com
        advisorEmailAddress:
          type: string
          format: email
          example: william.smith@symphony.com
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        contact:
          type: boolean
          example: true
    room-member-requestv2:
      required:
        - advisorSymphonyId
        - memberSymphonyId
        - externalNetwork
        - contact
      type: object
      properties:
        memberSymphonyId:
          type: string
          format: number
          example: 1234567890
        advisorSymphonyId:
          type: string
          format: number
          example: 1234567890
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        contact:
          description: "Boolean indicating whether added member is an advisor (false) or a federated user (true)"
          type: boolean
          default: false
        empChannelConnector:
          description: "ID of the Emp channel Connector to use to reach the federated user. Required for LINE in case <i>automatic LINE channel selection</i> feature is not enabled for your tenant, not applicable for the other external networks."
          type: string
    multi-external-network-room-not-supported:
      type: object
      properties:
        type:
          type: string
          format: multi.external.network.room.not.supported
        title:
          type: string
          format: multi external network rooms not supported
        status:
          type: integer
          format: "400"
      description: Multi-External network rooms are not supported.
    multi-company-room-not-supported:
      type: object
      properties:
        type:
          type: string
          format: multi.company.room.not.supported
        title:
          type: string
          format: multi company rooms not supported
        status:
          type: integer
          format: "400"
      description: Multi-Company rooms are not supported.
    member-already-in-room:
      type: object
      properties:
        type:
          type: string
          format: member.already.in.room
        title:
          type: string
          format: Member already in room.
        status:
          type: integer
          format: "409"
      description: Member already in room.
    add-room-member-failed:
      type: object
      properties:
        type:
          type: string
          format: add.room.member.failed
        title:
          type: string
          format: Unable to add the member to room.
        status:
          type: integer
          format: "500"
      description: Gateway microservice cannot create/add the member to room.
    add-room-member-conflicted:
      type: object
      description: Gateway microservice cannot create/add the member in the room.
      properties:
        type:
          type: string
          format: add.room.member.conflicted
        title:
          type: string
          format: Unable to add the member in the room.
        status:
          type: integer
          format: "409"
    bulk-room-member-multi-room-requestv2:
      type: object
      properties:
        requests:
          maxItems: 20
          minItems: 1
          type: array
          items:
            $ref: "#/components/schemas/room-member-multi-room-requestv2"
        advisorSymphonyId:
          type: string
          format: number
          example: 1234567890
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
    room-member-multi-room-requestv2:
      required:
        - memberSymphonyId
        - streamId
      type: object
      properties:
        streamId:
          type: string
          example: bjHSiY4iz3ar4iIh6-VzCX___peoM7cPdA
        memberSymphonyId:
          type: string
          format: number
          example: 1234567890
        empChannelConnector:
          type: string
          format: string
          example: SYM0001
    bulk-room-member-responsev2:
      type: object
      properties:
        members:
          type: array
          items:
            $ref: "#/components/schemas/bulk-room-member-item-responsev2"
    bulk-room-member-item-responsev2:
      type: object
      properties:
        status:
          type: integer
        response:
          $ref: "#/components/schemas/room-member-response"
        error:
          $ref: "#/components/schemas/bulk-item-error"
    bulk-room-member-multi-room-request:
      type: object
      properties:
        requests:
          maxItems: 100
          minItems: 1
          type: array
          items:
            $ref: "#/components/schemas/room-member-multi-room-request"
        advisorEmailAddress:
          type: string
          format: email
          example: william.smith@symphony.com
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
    room-member-multi-room-request:
      required:
        - contact
        - memberEmailAddress
        - streamId
      type: object
      properties:
        streamId:
          type: string
          example: bjHSiY4iz3ar4iIh6-VzCX___peoM7cPdA
        memberEmailAddress:
          type: string
          format: email
          example: johndoe@symphony.com
        contact:
          type: boolean
          example: true
    bulk-room-member-response:
      type: object
      properties:
        members:
          type: array
          items:
            $ref: "#/components/schemas/bulk-room-member-item-response"
    bulk-room-member-item-response:
      type: object
      properties:
        status:
          type: integer
        response:
          $ref: "#/components/schemas/room-member-response"
        error:
          $ref: "#/components/schemas/bulk-item-error"
    list-federation-groups-item-response:
      type: object
      properties:
        federationGroupId:
          type: string
          description: Internal system federation group identifier
          example: company-federation-group1
        federationGroupName:
          type: string
          description: Out facing customer display name
          example: federationGroup
        activeExternalNetworks:
          type: array
          description: List of activated external network for the federation group
          items:
            type: string
            description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
            example: WHATSAPP
    list-federation-groups-response:
      type: object
      properties:
        federationGroups:
          type: array
          items:
            $ref: '#/components/schemas/list-federation-groups-item-response'
        pagination:
          $ref: '#/components/schemas/pagination'
    bulk-update-federation-group-item-request:
      type: object
      required:
        - externalNetwork
        - symphonyId
      properties:
        symphonyId:
          type: string
          example: 123456789
        externalNetwork:
          type: string
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          example: WHATSAPP
        federationGroupId:
          type: string
          example: company-federation-group1
    bulk-update-federation-group-request:
      type: object
      properties:
        request:
          type: array
          items:
            $ref: '#/components/schemas/bulk-update-federation-group-item-request'
          minItems: 1
          maxItems: 100
      example:
        request:
          - symphonyId: 1234512345
            externalNetwork: WHATSAPP
            federationGroupId: company-federation-group1
          - symphonyId: 1357913579
            externalNetwork: WHATSAPP
            federationGroupId: company-federation-group2
    update-federation-group-request:
      type: object
      required:
        - federationGroupId
      properties:
        federationGroupId:
          type: string
          example: company-federation-group1
        moveToDefault:
          type: boolean
    update-federation-group-response:
      type: object
      properties:
        symphonyId:
          type: string
          example: 123456789
        federationGroupId:
          type: string
          example: company-federation-group1
        externalNetwork:
          type: string
          example: WHATSAPP
    bulk-update-federation-group-item-response:
      type: object
      properties:
        status:
          type: integer
        response:
          type: object
          $ref: '#/components/schemas/update-federation-group-response'
        error:
          type: object
          $ref: '#/components/schemas/bulk-item-error'

    update-contact-response:
      type: object
      properties:
        blocked:
          type: object
          $ref: '#/components/schemas/block-contact-information'
    update-contact-request:
      type: object
      properties:
        blocked:
          type: object
          $ref: '#/components/schemas/block-contact-information'
    block-contact-information:
      type: object
      properties:
        reason:
          type: string
        comment:
          type: string
        updateDate:
          type: string
          format: date-time

    bulk-update-federation-group-response:
      type: object
      properties:
        responses:
          type: array
          items:
            $ref: '#/components/schemas/bulk-update-federation-group-item-response'
    room-set-federation-group-request:
      type: object
      properties:
        federationGroupId:
          type: string
          example: 123456789
        moveToDefault:
          type: boolean
          example: true
    rfc-error:
      type: object
      properties:
        type:
          type: string
          description: |
            An absolute URI that identifies the problem type. When dereferenced,
            it SHOULD provide human-readable documentation for the problem type
            (e.g., using HTML).
          format: uri
          example: "https://zalando.github.io/problem/constraint-violation"
          default: "about:blank"
        title:
          type: string
          description: |
            A short, summary of the problem type. Written in English and readable
            for engineers (usually not suited for non technical stakeholders and
            not localized); example: Service Unavailable
        status:
          maximum: 600
          exclusiveMaximum: true
          minimum: 100
          type: integer
          description: |
            The HTTP status code generated by the origin server for this occurrence
            of the problem.
          format: int32
          example: 503
        detail:
          type: string
          description: |
            A human readable explanation specific to this occurrence of the
            problem.
          example: Connection to database timed out
        instance:
          type: string
          description: |
            An absolute URI that identifies the specific occurrence of the problem.
            It may or may not yield further information if dereferenced.
          format: uri
    companies-search-response:
      type: object
      properties:
        companies:
          type: array
          items:
            $ref: "#/components/schemas/company-response"
    company-response:
      type: object
      properties:
        companyName:
          type: string
          example: symphony
    pagination:
      title: Pagination
      type: object
      properties:
        previous:
          type: string
          format: uri
          example: "?before=ewogICJlbWFpbEFkZHJlc3MiOiB7CiAgICAicyI6ICJtb2NrLnVzZXJAbW9jay5jb20iCiAgfQp9"
        next:
          type: string
          format: uri
          example: "?after=ewogICJlbWFpbEFkZHJlc3MiOiB7CiAgICAicyI6ICJtb2NrLnVzZXJAbW9jay5jb20iCiAgfQp9"
        cursors:
          $ref: "#/components/schemas/cursors"
    cursors:
      title: Cursors
      type: object
      properties:
        before:
          type: string
          example: ewogICJlbWFpbEFkZHJlc3MiOiB7CiAgICAicyI6ICJtb2NrLnVzZXJAbW9jay5jb20iCiAgfQp9
        after:
          type: string
          example: ewogICJlbWFpbEFkZHJlc3MiOiB7CiAgICAicyI6ICJtb2NrLnVzZXJAbW9jay5jb20iCiAgfQp9
    bulk-removal-status:
      type: string
      enum:
        - FAILURE
        - SUCCESS
    bulk-removal-statusv2:
      type: string
      enum:
        - FAILURE
        - SUCCESS
        - NOT_FOUND
    bulk-item-error:
      type: object
      properties:
        itemId:
          type: string
          description: Context dependent identifier of the item
        type:
          type: string
          description: |
            An absolute URI that identifies the problem type. When dereferenced,
            it SHOULD provide human-readable documentation for the problem type
            (e.g., using HTML).
          format: uri
          example: "https://zalando.github.io/problem/constraint-violation"
          default: "about:blank"
        title:
          type: string
          description: |
            A short, summary of the problem type. Written in English and readable
            for engineers (usually not suited for non technical stakeholders and
            not localized); example: Service Unavailable
        statusCode:
          maximum: 600
          exclusiveMaximum: true
          minimum: 100
          type: integer
          description: |
            The HTTP status code generated by the origin server for this occurrence
            of the problem.
          format: int32
          example: 503
        detail:
          type: string
          description: |
            A human readable explanation specific to this occurrence of the
            problem.
          example: Connection to database timed out
        instance:
          type: string
          description: |
            An absolute URI that identifies the specific occurrence of the problem.
            It may or may not yield further information if dereferenced.
          format: uri
        # TODO
        # use map instead of object
        # but readme.io does not support maps
        parameters:
          type: object
          properties:
            additionalProp1:
              type: "string"
            additionalProp2:
              type:  "string"
            additionalProp3:
              type:  "string"
    contact-request:
      required:
        - externalNetwork
        - firstName
        - lastName
        - phoneNumber
      type: object
      properties:
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        companyName:
          type: string
          example: Company
          description: For SMS, LINE, WHATSAPP and WECHAT, the companyName is mandatory
          maxLength: 100
        emailAddress:
          type: string
          format: email
          example: johndoe@symphony.com
          description: For SMS, LINE, WHATSAPP and WECHAT, the emailAddress is mandatory
        phoneNumber:
          type: string
          format: phone
          example: 911234567890
        externalNetwork:
          description: "External network: WECHAT or WHATSAPP or SMS or SMS-DIRECT or LINE"
          type: string
          example: WHATSAPP
        advisorSymphonyIds:
          type: array
          description: A list of Symphony user IDs of the advisors to add the contact to.
          items:
            pattern: ^\d+$
            type: number
            example: 14362370637825
        preferredLanguage:
          type: string
          description: Contact preferred language code
          example: CHINESE_CHN, CHINESE_HKG, CHINESE_TAI, JAPANESE (among others, see release note for more)
    update-contacts-request:
      required:
        - companyName
        - phoneNumber
        - externalNetwork
        - firstName
        - lastName
      type: object
      properties:
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: DoeABC
        companyName:
          type: string
          example: Company
          maxLength: 100
        phoneNumber:
          type: string
          format: phone
          example: 911234567890
        externalNetwork:
          type: string
          example: WHATSAPP
          description: WHATSAPP
    number-response:
      type: object
      required:
        - phoneNumber
      properties:
        phoneNumber:
          type: string
          example: 911234567890
        subNetwork:
          type: string
        country:
          type: string
        carrier:
          type: string
        provider:
          type: string
        status:
          type: string
        address:
          $ref: '#/components/schemas/address-response'
        assignedTo:
          $ref: '#/components/schemas/assigned-to'
    phone-numbers-details-response:
      type: object
      properties:
        numbers:
          type: array
          items:
            $ref: '#/components/schemas/phone-number-info'
    update-number-request:
      type: object
      properties:
        assignedTo:
          $ref: '#/components/schemas/assigned-to-request'
    assigned-to-request:
      type: object
      properties:
        advisorSymphonyId:
          type: string
          example: 911234567890
          description: |
            The Symphony identifier of the advisor to assign this resource to, or empty string to unassign.
    address-response:
      type: object
      properties:
        property:
          type: string
          example: Symphony
        line1:
          type: string
          example: 980 Avenue de Roumanille
        line2:
          type: string
          example: Le Fairway, Bâtiment A
        city:
          type: string
          example: Biot
        state:
          type: string
          example: France
        zip:
          type: string
          example: 06410
        zipPlusFour:
          type: string
          example: 06410
    address-request:
      type: object
      properties:
        property:
          type: string
          example: Symphony
        line1:
          type: string
          example: 980 Avenue de Roumanille
        line2:
          type: string
          example: Le Fairway, Bâtiment A
        city:
          type: string
          example: Biot
        state:
          type: string
          example: France
        zip:
          type: string
          example: 06410
        zipPlusFour:
          type: string
          example: 06410
    federation-group-emp-forbidden:
      type: object
      description: Access is denied, you don't have the permission to perform this operation
      properties:
        type:
          type: string
          format: federation.group.external.network.forbidden
        title:
          type: string
          example: The external network is not activated for federation group federation-group-id
        status:
          type: integer
          format: "403"
    not-applicable-for-external-network:
      type: object
      description: 'Not Applicable for the given external network.'
      properties:
        type:
          type: string
          format: 'not.applicable.for.external.network'
        title:
          type: string
          format: 'Not Applicable for the given external network.'
        status:
          type: integer
          format: "406"
    federation-group-not-found:
      type: object
      properties:
        type:
          type: string
          format: federation.group.not.found
        title:
          type: string
          format: Federation group not found.
        status:
          type: integer
          format: "404"
      description: Federation group not found
    not-implemented:
      type: object
      description: 'Not implemented'
      properties:
        type:
          type: string
          format: 'not.implemented'
        title:
          type: string
          format: 'Not implemented.'
        status:
          type: integer
          format: "501"
    tenant-not-found:
      type: object
      description: 'Tenant not found'
      properties:
        type:
          type: string
          format: 'tenant.not.found'
        title:
          type: string
          format: 'Tenant not found'
        status:
          type: integer
          format: "404"
    room-update-federation-group-errors:
      type: object
      properties:
        type:
          type: string
          example: room.update.failed
        title:
          type: string
          example: room update failed
        status:
          type: integer
          example: 409
        errors:
          type: array
          items:
            type: object
            properties:
              symphonyId:
                type: string
                example: 123456789
              reason:
                type: string
                description: External network specific error related to each room channel
                example: Could not allocate new phone number for the customer.
              errorCode:
                type: string
                description: External network specific error code
                example: no.business.api.available
    preferred-language-not-supported:
      type: object
      description: Preferred language not supported.
      properties:
        type:
          type: string
          format: preferred.language.not.supported
        title:
          type: string
          format: Preferred language not supported.
        status:
          type: integer
          format: "400"
    resend-invite-response:
      type: object
      properties:
        invitationCode:
          type: string
          example: "AB12DE43"
    invite-already-confirmed:
      type: object
      description: 'Invite is already confirmed.'
      properties:
        type:
          type: string
          format: 'invite.already.confirmed'
        title:
          type: string
          format: 'Invite is already confirmed.'
        status:
          type: integer
          format: "400"
    invites-not-configured-on-emp:
      type: object
      description: 'Invites not configured on EMP'
      properties:
        type:
          type: string
          format: 'invites.not.configured.on.emp'
        title:
          type: string
          format: 'Invites not configured on Emp.'
        status:
          type: integer
          format: "400"
    resend-invite-failed:
      type: object
      description: 'Invite resend failed.'
      properties:
        type:
          type: string
          format: 'resend.invite.failed'
        title:
          type: string
          format: 'Resend invite failed.'
        status:
          type: integer
          format: "500"
    copy-contact-response:
      type: object
      properties:
        newSymphonyId:
          type: string
          description: Symphony user ID of the account copy
          example: 12345678912365
        migratedStreamIds:
          type: array
          description: StreamIds of the rooms in which the user's account has been replaced with the account copy.
          items:
            type: string
    user-copy-not-supported-for-network:
      type: object
      properties:
        type:
          type: string
          format: user.copy.not.supported.for.network
        title:
          type: string
          format: user copy not supported for the external network
        status:
          type: integer
          format: "400"
      description: |
       Contact copy is not supported for the external network of the contact. Contact copy is supported only for WHATSAPP and SMS.
    current-tenant-has-own-user-copy:
      type: object
      properties:
        type:
          type: string
          format: current.tenant.has.own.user.copy
        title:
          type: string
          format: Current tenant has already its own copy for user.
        status:
          type: integer
          format: "409"
      description: Tenant requesting the contact copy already has its own copy of the contact. The copy contact action is not required.
    user-copy-not-supported-for-ims:
      type: object
      properties:
        type:
          type: string
          format: user.copy.not.own.supported.for.ims
        title:
          type: string
          format: User copy is not supported for user having IMs
        status:
          type: integer
          format: "403"
      description: Contact copy is not supported for users who are part of IMs. These IMs need to be removed first.
    copy-contact-failed:
      type: object
      description: 'Unable to copy the contact.'
      properties:
        type:
          type: string
          format: 'account.copy.failed'
        title:
          type: string
          format: 'Unable to copy the account.'
        status:
          type: integer
          format: "500"
    number-not-found:
      type: object
      description: 'Number not found'
      properties:
        type:
          type: string
          format: 'number.not.found'
        title:
          type: string
          format: 'Number not found'
        status:
          type: integer
          format: "404"
    no-numbers-found:
      type: object
      description: 'No numbers found'
      properties:
        type:
          type: string
          format: 'no.numbers.found'
        title:
          type: string
          format: 'No numbers found'
        status:
          type: integer
          format: "404"
    address-already-empty:
      type: object
      description: 'Address already empty'
      properties:
        type:
          type: string
          format: 'address.already.empty'
        title:
          type: string
          format: 'Address already empty'
        status:
          type: integer
          format: "400"
    no-field-updated:
      type: object
      description: 'No field updated'
      properties:
        type:
          type: string
          format: 'no.field.updated'
        title:
          type: string
          format: 'No field updated'
        status:
          type: integer
          format: "400"

    advisor-already-has-phone-allocated-problem:
      type: object
      description: 'The advisor already has an allocated phone number.'
      properties:
        type:
          type: string
          format: 'advisor.already.has.phone.allocated'
        title:
          type: string
          format: 'The advisor already has an allocated phone number.'
        status:
          type: integer
          format: "409"
    phone-number-already-allocated-problem:
      type: object
      description: 'The phone number is already allocated.'
      properties:
        type:
          type: string
          format: 'phone.already.allocated'
        title:
          type: string
          format: 'The phone number is already allocated.'
        status:
          type: integer
          format: "409"
    phone-number-pre-allocation-not-supported-problem:
      description: 'Phone number pre-allocation is not supported for this external network.'
      properties:
        type:
          type: string
          format: 'phone.number.pre.allocation.not.supported'
        title:
          type: string
          format: 'Phone number pre-allocation is not supported.'
        status:
          type: integer
          format: "400"
    pre-entitlement-failed:
      type: object
      description: 'Pre-entitlement failed.'
      properties:
        type:
          type: string
          format: 'pre.entitlement.failed'
        title:
          type: string
          format: 'Pre-entitlement failed.'
        status:
          type: integer
          format: "500"
    pre-entitlement-not-found:
      type: object
      description: 'Pre-entitlement not found'
      properties:
        type:
          type: string
          format: 'pre.entitlement.not.found'
        title:
          type: string
          format: 'Pre-entitlement not found'
        status:
          type: integer
          format: "404"

    advisor-already-entitled:
      type: object
      description: 'Advisor already entitled'
      properties:
        type:
          type: string
          format: 'advisor.already.entitled'
        title:
          type: string
          format: 'Advisor already entitled'
        status:
          type: integer
          format: "403"

    advisor-already-entitled-for-direct-emp:
      type: object
      description: Advisor is already entitled to another direct EMP
      properties:
        type:
          type: string
          format: advisor.already.entitled.for.direct.emp
        title:
          type: string
          format: The advisor for which the number is reassigned must not be entitled on a direct EMP
        status:
          type: integer
          format: "403"

    advisor-still-entitled:
      type: object
      description: |
        Returned when the advisor associated with the phone number is still entitled to a direct EMP.
      properties:
        type:
          type: string
          format: 'advisor.still.entitled'
        title:
          type: string
          format: An advisor is still entitled to a Direct EMP with this phone number
        status:
          type: integer
          format: "403"

    customer-block-phone-numbers-request:
      type: object
      required:
        - phoneNumbers
      properties:
        phoneNumbers:
          type: array
          items:
            $ref: '#/components/schemas/customer-block-phone-numbers-item-request'
          minItems: 1
          maxItems: 100

    customer-unblock-phone-numbers-request:
      type: object
      required:
        - phoneNumbers
      properties:
        phoneNumbers:
          type: string
          format: phone

    customer-block-phone-numbers-item-request:
      type: object
      required:
        - phoneNumber
        - reason
      properties:
        phoneNumber:
          type: string
          format: phone
        reason:
          $ref: '#/components/schemas/blocking-reason-enum'
        comment:
          type: string

    get-blocked-phone-numbers-response:
      type: object
      properties:
        phoneNumbers:
          type: array
          items:
            $ref: '#/components/schemas/get-blocked-phone-numbers-item'

    get-blocked-phone-numbers-item:
      type: object
      properties:
        phoneNumber:
          type: string
          format: phone
        reason:
          $ref: '#/components/schemas/blocking-reason-enum'
        comment:
          type: string

    blocking-reason-enum:
      type: string
      enum:
        - SPAM
        - ABUSE
        - COMPLIANCE
        - OTHER

    update-member-request:
      type: object
      properties:
        role:
          type: string
          description: The role to assign to the member.
          enum:
            - OWNER
            - DEFAULT

    # Responses
    customer-block-phone-numbers-response:
      type: object
      properties:
        phoneNumbers:
          type: array
          items:
            $ref: '#/components/schemas/customer-block-phone-numbers-item-response'

    customer-block-phone-numbers-item-response:
      type: object
      properties:
        phoneNumber:
          type: string
        status:
          type: integer
        error:
          type: object
          $ref: '#/components/schemas/bulk-item-error'

    not-entitled-on-direct-emp:
      type: object
      description: 'Not Entitled on direct emp.'
      properties:
        type:
          type: string
          format: 'not.entitled.on.direct.emp'
        title:
          type: string
          format: 'Not Entitled on direct emp.'
        status:
          type: integer
          format: "403"

    phone-number-not-found:
      type: object
      description: 'Phone number not found'
      properties:
        type:
          type: string
          format: 'phone.number.not.found'
        title:
          type: string
          format: 'Phone number not found'
        status:
          type: integer
          format: "404"

    subnetwork-not-implemented:
      type: object
      description: 'Subnetwork not implemented.'
      properties:
        type:
          type: string
          format: 'subnetwork.not.implemented'
        title:
          type: string
          format: 'subnetwork not implemented.'
        status:
          type: integer
          format: "501"

    cannot-demote-external-user:
      type: object
      description: "External users of the room cannot be demoted."
      properties:
        type:
          type: string
          format: 'cannot.demote.external.user'
        title:
          type: string
          format: "External users of the room cannot be demoted."
        status:
          type: integer
          format: "403"
      format: "403"

    cannot-promote-external-user:
      type: object
      description: "External users of the room cannot be promoted."
      properties:
        type:
          type: string
          format: 'cannot.promote.external.user'
        title:
          type: string
          format: "External users of the room cannot be promoted."
        status:
          type: integer
          format: "403"

    contact-connector-response:
      type: object
      description: ''
      properties:
        phoneNumber:
          type: string
          example: +13477782778
          description: Phone number from the federated database
        url:
          type: string
          example: https://wa.me/3999999999
          pattern: '^(https?:\/\/)?(www\.)?wa\.me\/\+?[0-9]{7,15}(\?text=.*)?$'
          description: contact wa.me link

    cannot-demote-last-owner:
      type: object
      description: "The last owner of the room cannot be demoted"
      properties:
        type:
          type: string
          format: 'cannot.demote.last.owner'
        title:
          type: string
          format: "The last owner of the room cannot be demoted"
        status:
          type: integer
          format: "403"

    invalid-room-member-role:
      type: object
      description: "The role for the room member is invalid."
      properties:
        type:
          type: string
          format: 'invalid.room.member.role'
        title:
          type: string
          format: "The role for the room member is invalid."
        status:
          type: integer
          format: 400

    inline_response_400:
      oneOf:
        - $ref: "#/components/schemas/entitlement-user-already-exists-problem"
        - $ref: "#/components/schemas/symphony-user-not-found-problem"
        - $ref: "#/components/schemas/entitlement-type-not-found-problem"
        - $ref: "#/components/schemas/advisor-id-not-provided"
    inline_response_404_1:
      oneOf:
        - $ref: "#/components/schemas/advisor-not-found"
        - $ref: "#/components/schemas/contact-not-found"
    inline_response_404_2:
      oneOf:
        - $ref: "#/components/schemas/tenant-configuration-not-found"
        - $ref: "#/components/schemas/advisor-not-found"
        - $ref: "#/components/schemas/permission-not-found"
    inline_response_404_3:
      oneOf:
        - $ref: "#/components/schemas/advisor-not-found"
        - $ref: "#/components/schemas/permission-not-found"
    inline_response_400_1:
      oneOf:
        - $ref: "#/components/schemas/external-network-not-found"
        - $ref: "#/components/schemas/invalid-user-info"
    inline_response_403:
      oneOf:
        - $ref: "#/components/schemas/forbidden-advisor"
        - $ref: "#/components/schemas/forbidden-onboarder"
        - $ref: "#/components/schemas/forbidden-entitlement-type"
    inline_response_409:
      oneOf:
        - $ref: "#/components/schemas/user-already-onboarded"
        - $ref: "#/components/schemas/user-already-exists"
    inline_response_409_1:
      oneOf:
        - $ref: "#/components/schemas/user-already-onboarded"
    inline_response_403_1:
      oneOf:
        - $ref: "#/components/schemas/forbidden-entitlement-type"
        - $ref: "#/components/schemas/update-forbidden-for-advisor"
        - $ref: "#/components/schemas/update-forbidden-for-contact"
        - $ref: "#/components/schemas/multi-tenant-federated-user-update-attempt"
    inline_response_404_4:
      oneOf:
        - $ref: "#/components/schemas/tenant-configuration-not-found"
        - $ref: "#/components/schemas/contact-not-found"
        - $ref: "#/components/schemas/advisor-not-found"
    inline_response_404_5:
      oneOf:
        - $ref: "#/components/schemas/advisor-not-found"
    inline_response_401:
      oneOf:
        - $ref: "#/components/schemas/Unauthorized"
    inline_response_403_0:
      oneOf:
        - $ref: "#/components/schemas/Forbidden"
    inline_response_404_6:
      oneOf:
        - $ref: "#/components/schemas/contact-not-found"
    inline_response_400_2:
      oneOf:
        - $ref: "#/components/schemas/connection-not-accepted"
    inline_response_403_2:
      oneOf:
        - $ref: "#/components/schemas/forbidden-advisor"
        - $ref: "#/components/schemas/forbidden-entitlement-type"
    inline_response_404_7:
      oneOf:
        - $ref: "#/components/schemas/tenant-configuration-not-found"
        - $ref: "#/components/schemas/advisor-not-found"
        - $ref: "#/components/schemas/federated-account-not-found"
        - $ref: "#/components/schemas/contact-not-found"
    inline_response_500:
      oneOf:
        - $ref: "#/components/schemas/create-room-failed"
        - $ref: "#/components/schemas/missing-connection-with-connect-bot"
    inline_response_403_3:
      oneOf:
        - $ref: "#/components/schemas/forbidden-advisor"
        - $ref: "#/components/schemas/remove-room-member-forbidden"
        - $ref: "#/components/schemas/forbidden-entitlement-type"
    inline_response_404_8:
      oneOf:
        - $ref: "#/components/schemas/room-not-found"
        - $ref: "#/components/schemas/room-member-not-found"
        - $ref: "#/components/schemas/advisor-not-found"
        - $ref: "#/components/schemas/tenant-configuration-not-found"
    inline_response_400_3:
      oneOf:
        - $ref: "#/components/schemas/multi-external-network-room-not-supported"
        - $ref: "#/components/schemas/multi-company-room-not-supported"
    inline_response_404_9:
      oneOf:
        - $ref: "#/components/schemas/tenant-configuration-not-found"
        - $ref: "#/components/schemas/advisor-not-found"
        - $ref: "#/components/schemas/room-not-found"

  securitySchemes:
    sfsAuthentication:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: HTTP header
security:
  - sfsAuthentication: []
