openapi: 3.0.3
info:
  title: ContextSMS Teams Platform API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.0.0
  contact:
    name: Sabrhub API Support Team
    url: https://sabrhub.com/support
    email: support@sabrhub.com
  termsOfService: https://sabrhub.com/terms
  description: >
    # Overview


    **Build unified Microsoft Teams integrations with enterprise messaging
    capabilities.**


    ## Platform Capabilities  

    - Unified Teams Integration - Connect Teams with external messaging systems

    - Multi-tenant Support - Manage multiple customer organizations
    efficiently  

    - Advanced Routing - Intelligent message routing and delivery

    - Real-time Messaging - Instant message delivery and notifications


    ## Integration Workflow

    1. **Authenticate** → Secure login with Bearer token

    2. **Configure Team** → Set up organization settings

    3. **Manage Channels** → Create and configure team channels 

    4. **Route Messages** → Handle message routing and delivery

    5. **Process Webhooks** → Real-time event notifications
servers:
  - url: https://teams-backend.sabrhub.com/
    description: Teams Backend Server (production)
  - url: https://usermanagement.sabrhub.com/v1/
    description: Authentication Server (production)
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token for API authentication. Include as: Authorization:
        Bearer {token}
security:
  - BearerAuth: []
tags:
  - name: Authentication
    description: Endpoints related to user authentication and token management
  - name: Enterprise Management
    description: APIs for creating, retrieving, listing, and deleting enterprises
  - name: Mapping Management
    description: Manage phone number-to-messaging app mappings across enterprises
paths:
  /teams-auth/login:
    post:
      operationId: teamsAuthLogin
      tags:
        - Authentication
      summary: Authenticate Teams user and issue tokens
      description: >-
        Authenticate Teams user with username and password to obtain access
        tokens. This endpoint is specifically for Teams authentication and does
        not support service fallback.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - username
                - password
              properties:
                username:
                  type: string
                  format: email
                  description: User email address
                password:
                  type: string
                  description: User password
            example:
              username: test@email.com
              password: securePassword123
      responses:
        '200':
          description: Login successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  username:
                    type: string
                    example: test@email.com
                  accessToken:
                    type: string
                    example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                  refreshToken:
                    type: string
                    example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                  expirationTimeInUTC:
                    type: string
                    format: date-time
                    example: '2024-02-29T15:09:14.242875589'
                  roles:
                    type: array
                    items:
                      type: string
                    example:
                      - CSP_BUSINESS
                  tenantId:
                    type: string
                    example: Sabrhub
                  services:
                    type: array
                    items:
                      type: string
                    example:
                      - Teams
        '401':
          description: Unauthorized - Invalid credentials
          content:
            text/plain:
              schema:
                type: string
                example: Invalid credentials
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            text/plain:
              schema:
                type: string
                example: Too many login attempts. Please try again after 5 minute(s).
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X POST
            "https://usermanagement.sabrhub.com/v1/teams-auth/login" \
              -H "Content-Type: application/json" \
              -d '{"username": "test@email.com", "password": "securePassword123"}'
        - lang: JavaScript
          label: JavaScript
          source: >
            const response = await
            fetch('https://usermanagement.sabrhub.com/v1/teams-auth/login', {
              method: 'POST',
              headers: {
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                username: 'test@email.com',
                password: 'securePassword123'
              })
            });

            const data = await response.json();

            console.log(data);
        - lang: Python
          label: Python
          source: |
            import requests

            url = "https://usermanagement.sabrhub.com/v1/teams-auth/login"
            headers = {
                "Content-Type": "application/json"
            }
            payload = {
                "username": "test@email.com",
                "password": "securePassword123"
            }
            response = requests.post(url, json=payload, headers=headers)
            print(response.json())
  /teams-auth/createuser:
    post:
      operationId: teamsAuthCreateUser
      tags:
        - Authentication
      summary: Create a new Teams user
      description: >-
        Creates a new user in the Teams user pool. Requires authentication and
        proper role permissions. The user must have permission to create users
        with the specified roles.
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - password
                - roles
              properties:
                email:
                  type: string
                  format: email
                  description: User email address
                  example: newuser@example.com
                password:
                  type: string
                  description: User password
                  example: SecurePassword123!
                roles:
                  type: array
                  items:
                    type: string
                  description: Array of user roles (must have at least one role)
                  example:
                    - MAPPED_USER
                services:
                  type: array
                  items:
                    type: string
                  description: >-
                    Array of services the user has access to (optional, defaults
                    to Teams)
                  example:
                    - Teams
                tenantId:
                  type: string
                  description: >-
                    Tenant ID for the user (optional, auto-assigned if not
                    provided)
                  example: Sabrhub
                enterpriseId:
                  type: string
                  description: Enterprise ID associated with the user (optional)
                  example: E0000001
                toMigrate:
                  type: boolean
                  description: 'Flag indicating if user should be migrated (default: false)'
                  default: false
                  example: false
                notifyUser:
                  type: boolean
                  description: 'Whether to notify the user via email (default: true)'
                  default: true
                  example: true
            example:
              email: newuser@example.com
              password: SecurePassword123!
              roles:
                - MAPPED_USER
              services:
                - Teams
              notifyUser: true
      responses:
        '201':
          description: User created successfully
          content:
            text/plain:
              schema:
                type: string
                example: User created successfully
        '400':
          description: Bad Request - Invalid input or role validation failed
          content:
            text/plain:
              schema:
                type: string
                example: Role validation failed
        '401':
          description: Unauthorized - Authentication required
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X POST
            "https://usermanagement.sabrhub.com/v1/teams-auth/createuser" \
              -H "Authorization: Bearer <TOKEN>" \
              -H "Content-Type: application/json" \
              -d '{
                "email": "newuser@example.com",
                "password": "SecurePassword123!",
                "roles": ["MAPPED_USER"],
                "services": ["Teams"],
                "notifyUser": true
              }'
        - lang: JavaScript
          label: JavaScript
          source: >
            const response = await
            fetch('https://usermanagement.sabrhub.com/v1/teams-auth/createuser',
            {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer <TOKEN>',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                email: 'newuser@example.com',
                password: 'SecurePassword123!',
                roles: ['MAPPED_USER'],
                services: ['Teams'],
                notifyUser: true
              })
            });

            const text = await response.text();

            console.log(text);
        - lang: Python
          label: Python
          source: |
            import requests

            url = "https://usermanagement.sabrhub.com/v1/teams-auth/createuser"
            headers = {
                "Authorization": "Bearer <TOKEN>",
                "Content-Type": "application/json"
            }
            payload = {
                "email": "newuser@example.com",
                "password": "SecurePassword123!",
                "roles": ["MAPPED_USER"],
                "services": ["Teams"],
                "notifyUser": True
            }
            response = requests.post(url, json=payload, headers=headers)
            print(response.text)
  /enterprise/{cspId}:
    post:
      tags:
        - Enterprise Management
      summary: Create enterprise
      description: >-
        Create a new enterprise. Returns enterprise metadata, created/update
        timestamps and status.
      operationId: createEnterprise
      parameters:
        - name: cspId
          in: path
          required: true
          description: Unique ID for which the enterprise is being created.
          schema:
            type: string
            example: CSP0000003
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - contact
                - number
                - email
              properties:
                name:
                  type: string
                  example: test
                contact:
                  type: string
                  example: test
                number:
                  type: string
                  example: '+13234222322'
                email:
                  type: string
                  format: email
                  example: test@gmail.com
                defaultMmsSelection:
                  type: boolean
                  description: Default MMS selection preference
                  example: true
                enterpriseFeatures:
                  type: array
                  description: Array of platform-specific enterprise feature configurations
                  items:
                    type: object
                    properties:
                      platformType:
                        type: string
                        enum:
                          - Teams
                          - Webex
                        example: Teams
                      enabled:
                        type: boolean
                        description: Indicates if the feature is enabled (isActive)
                        example: true
                      groupTexting:
                        type: boolean
                        example: true
                      broadcastTexting:
                        type: boolean
                        example: true
                      mmsEnabled:
                        type: boolean
                        example: false
                      teamTexting:
                        type: boolean
                        example: true
                      scheduleSend:
                        type: boolean
                        example: true
                      aiSmartReplies:
                        type: boolean
                        example: false
                      aiChatAssist:
                        type: boolean
                        example: false
                      cdrAccess:
                        type: boolean
                        example: false
                      crmIntegration:
                        type: boolean
                        example: false
                      contactsIntegration:
                        type: boolean
                        example: false
                  example:
                    - platformType: Teams
                      enabled: true
                      groupTexting: true
                      broadcastTexting: true
                      mmsEnabled: false
                      teamTexting: true
                      scheduleSend: true
                      aiSmartReplies: false
                      aiChatAssist: false
                      cdrAccess: false
                      crmIntegration: false
                      contactsIntegration: false
                    - platformType: Webex
                      enabled: true
                      groupTexting: true
                      broadcastTexting: true
                      mmsEnabled: false
                      teamTexting: true
                      scheduleSend: true
                      aiSmartReplies: false
                      aiChatAssist: false
                      cdrAccess: false
                      crmIntegration: false
                      contactsIntegration: false
      responses:
        '201':
          description: Enterprise created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  enterpriseId:
                    type: string
                    example: E0000090
                  name:
                    type: string
                    example: test enterprise2
                  contact:
                    type: string
                    example: Test Contact
                  number:
                    type: string
                    example: '+12223334444'
                  email:
                    type: string
                    format: email
                    example: test@email.com
                  deleted:
                    type: boolean
                    example: false
                  createdDate:
                    type: string
                    format: date-time
                    example: '2023-10-29T12:06:17.442Z'
                  updateDate:
                    type: string
                    format: date-time
                    example: '2023-10-29T12:06:17.443Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  fields:
                    type: string
                  message:
                    type: string
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Tenant access denied
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X POST
            "https://teams-backend.sabrhub.com/enterprise/CSP0000003" \
              -H "Authorization: Bearer <TOKEN>" \
              -H "Content-Type: application/json" \
              -d '{
                "name": "test",
                "contact": "test",
                "number": "+13234222322",
                "email": "test@gmail.com",
                "defaultMmsSelection": true,
                "enterpriseFeatures": [
                  {
                    "platformType": "Teams",
                    "enabled": true,
                    "groupTexting": true,
                    "broadcastTexting": true,
                    "mmsEnabled": false,
                    "teamTexting": true,
                    "scheduleSend": true,
                    "aiSmartReplies": false,
                    "aiChatAssist": false,
                    "cdrAccess": false,
                    "crmIntegration": false,
                    "contactsIntegration": false
                  },
                  {
                    "platformType": "Webex",
                    "enabled": true,
                    "groupTexting": true,
                    "broadcastTexting": true,
                    "mmsEnabled": false,
                    "teamTexting": true,
                    "scheduleSend": true,
                    "aiSmartReplies": false,
                    "aiChatAssist": false,
                    "cdrAccess": false,
                    "crmIntegration": false,
                    "contactsIntegration": false
                  }
                ]
              }'
        - lang: JavaScript
          label: JavaScript
          source: >
            const payload = {
              name: "test",
              contact: "test",
              number: "+13234222322",
              email: "test@gmail.com",
              defaultMmsSelection: true,
              enterpriseFeatures: [
                {
                  platformType: "Teams",
                  enabled: true,
                  groupTexting: true,
                  broadcastTexting: true,
                  mmsEnabled: false,
                  teamTexting: true,
                  scheduleSend: true,
                  aiSmartReplies: false,
                  aiChatAssist: false,
                  cdrAccess: false,
                  crmIntegration: false,
                  contactsIntegration: false
                },
                {
                  platformType: "Webex",
                  enabled: true,
                  groupTexting: true,
                  broadcastTexting: true,
                  mmsEnabled: false,
                  teamTexting: true,
                  scheduleSend: true,
                  aiSmartReplies: false,
                  aiChatAssist: false,
                  cdrAccess: false,
                  crmIntegration: false,
                  contactsIntegration: false
                }
              ]
            };


            const response = await
            fetch('https://teams-backend.sabrhub.com/enterprise/CSP0000003', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer <TOKEN>',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify(payload)
            });

            const data = await response.json();

            console.log(data);
        - lang: Python
          label: Python
          source: |
            import requests

            url = "https://teams-backend.sabrhub.com/enterprise/CSP0000003"
            payload = {
                "name": "test",
                "contact": "test",
                "number": "+13234222322",
                "email": "test@gmail.com",
                "defaultMmsSelection": True,
                "enterpriseFeatures": [
                    {
                        "platformType": "Teams",
                        "enabled": True,
                        "groupTexting": True,
                        "broadcastTexting": True,
                        "mmsEnabled": False,
                        "teamTexting": True,
                        "scheduleSend": True,
                        "aiSmartReplies": False,
                        "aiChatAssist": False,
                        "cdrAccess": False,
                        "crmIntegration": False,
                        "contactsIntegration": False
                    },
                    {
                        "platformType": "Webex",
                        "enabled": True,
                        "groupTexting": True,
                        "broadcastTexting": True,
                        "mmsEnabled": False,
                        "teamTexting": True,
                        "scheduleSend": True,
                        "aiSmartReplies": False,
                        "aiChatAssist": False,
                        "cdrAccess": False,
                        "crmIntegration": False,
                        "contactsIntegration": False
                    }
                ]
            }
            headers = {
                "Authorization": "Bearer <TOKEN>",
                "Content-Type": "application/json"
            }
            response = requests.post(url, json=payload, headers=headers)
            print(response.json())
  /enterprise/getenterprise/{enterpriseId}:
    get:
      tags:
        - Enterprise Management
      summary: Fetch single enterprise by ID
      description: >-
        Retrieve full enterprise details (name, contact, number, email, deleted
        flag, timestamps) for the specified enterpriseId.
      operationId: readSingleEnterprise
      parameters:
        - name: enterpriseId
          in: path
          required: true
          schema:
            type: string
            example: E0000090
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  enterpriseId:
                    type: string
                    example: E0000090
                  name:
                    type: string
                    example: test enterprise2
                  contact:
                    type: string
                    example: Test Contact
                  number:
                    type: string
                    example: '+12223334444'
                  email:
                    type: string
                    example: test@example.com
                  deleted:
                    type: boolean
                    example: false
                  createdDate:
                    type: string
                    format: date-time
                    example: '2023-10-29T12:06:17.442Z'
                  updateDate:
                    type: string
                    format: date-time
                    example: '2023-10-29T12:06:17.443Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  fields:
                    type: string
                  message:
                    type: string
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Tenant access denied
        '404':
          description: Not Found
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X GET
            "https://teams-backend.sabrhub.com/enterprise/getenterprise/E0000090"
            \
              -H "Authorization: Bearer <TOKEN>"
        - lang: JavaScript
          label: JavaScript
          source: >
            const response = await
            fetch('https://teams-backend.sabrhub.com/enterprise/getenterprise/E0000090',
            {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer <TOKEN>'
              }
            });

            const data = await response.json();

            console.log(data);
        - lang: Python
          label: Python
          source: >
            import requests


            url =
            "https://teams-backend.sabrhub.com/enterprise/getenterprise/E0000090"

            headers = {"Authorization": "Bearer <TOKEN>"}

            response = requests.get(url, headers=headers)

            print(response.json())
  /enterprise/{enterpriseId}:
    put:
      tags:
        - Enterprise Management
      summary: Update enterprise by ID
      description: >-
        Update an existing enterprise with provided details including enterprise
        features. Use applyToMappings flags in enterpriseFeatures to control
        whether feature changes should be applied to all existing mappings.
        Returns the updated enterprise metadata.
      operationId: updateEnterprise
      parameters:
        - name: enterpriseId
          in: path
          required: true
          description: Unique ID of the enterprise to update
          schema:
            type: string
            example: E0000090
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: Updated Enterprise Name
                contact:
                  type: string
                  example: Updated Contact
                number:
                  type: string
                  example: '+12223334444'
                email:
                  type: string
                  format: email
                  example: updated@email.com
                defaultMmsSelection:
                  type: boolean
                  description: Default MMS selection preference
                  example: true
                enterpriseFeatures:
                  type: array
                  description: >-
                    Array of platform-specific enterprise feature configurations
                    with applyToMappings flags
                  items:
                    type: object
                    properties:
                      platformType:
                        type: string
                        enum:
                          - Teams
                          - Webex
                        example: Teams
                      enabled:
                        type: boolean
                        description: Indicates if the feature is enabled (isActive)
                        example: true
                      groupTexting:
                        type: boolean
                        example: true
                      broadcastTexting:
                        type: boolean
                        example: true
                      mmsEnabled:
                        type: boolean
                        example: false
                      teamTexting:
                        type: boolean
                        example: true
                      scheduleSend:
                        type: boolean
                        example: true
                      aiSmartReplies:
                        type: boolean
                        example: false
                      aiChatAssist:
                        type: boolean
                        example: false
                      cdrAccess:
                        type: boolean
                        example: false
                      crmIntegration:
                        type: boolean
                        example: false
                      contactsIntegration:
                        type: boolean
                        example: false
                      applyToMappings:
                        type: boolean
                        description: Apply platform enable/disable to all mappings
                        example: true
                      mmsEnabledApplyToMappings:
                        type: boolean
                        description: Apply mmsEnabled change to all mappings
                        example: false
                      groupTextingApplyToMappings:
                        type: boolean
                        description: Apply groupTexting change to all mappings
                        example: false
                      broadcastTextingApplyToMappings:
                        type: boolean
                        description: Apply broadcastTexting change to all mappings
                        example: false
                      teamTextingApplyToMappings:
                        type: boolean
                        description: Apply teamTexting change to all mappings
                        example: false
                      scheduleSendApplyToMappings:
                        type: boolean
                        description: Apply scheduleSend change to all mappings
                        example: false
                      aiSmartRepliesApplyToMappings:
                        type: boolean
                        description: Apply aiSmartReplies change to all mappings
                        example: false
                      aiChatAssistApplyToMappings:
                        type: boolean
                        description: Apply aiChatAssist change to all mappings
                        example: false
                      cdrAccessApplyToMappings:
                        type: boolean
                        description: Apply cdrAccess change to all mappings
                        example: false
                      crmIntegrationApplyToMappings:
                        type: boolean
                        description: Apply crmIntegration change to all mappings
                        example: false
                      contactsIntegrationApplyToMappings:
                        type: boolean
                        description: Apply contactsIntegration change to all mappings
                        example: false
                  example:
                    - platformType: Teams
                      enabled: true
                      groupTexting: true
                      broadcastTexting: true
                      mmsEnabled: false
                      teamTexting: true
                      scheduleSend: true
                      aiSmartReplies: false
                      aiChatAssist: false
                      cdrAccess: false
                      crmIntegration: false
                      contactsIntegration: false
                      applyToMappings: true
                      mmsEnabledApplyToMappings: false
                      groupTextingApplyToMappings: false
                      broadcastTextingApplyToMappings: false
                      teamTextingApplyToMappings: false
                      scheduleSendApplyToMappings: false
                      aiSmartRepliesApplyToMappings: false
                      aiChatAssistApplyToMappings: false
                      cdrAccessApplyToMappings: false
                      crmIntegrationApplyToMappings: false
                      contactsIntegrationApplyToMappings: false
      responses:
        '200':
          description: Enterprise updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  enterpriseId:
                    type: string
                    example: E0000090
                  name:
                    type: string
                    example: Updated Enterprise Name
                  contact:
                    type: string
                    example: Updated Contact
                  number:
                    type: string
                    example: '+12223334444'
                  email:
                    type: string
                    format: email
                    example: updated@email.com
                  deleted:
                    type: boolean
                    example: false
                  createdDate:
                    type: string
                    format: date-time
                    example: '2023-10-29T12:06:17.442Z'
                  updateDate:
                    type: string
                    format: date-time
                    example: '2023-10-29T15:30:00.000Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  fields:
                    type: string
                  message:
                    type: string
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Tenant access denied
        '404':
          description: Enterprise not found
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X PUT "https://teams-backend.sabrhub.com/enterprise/E0000090"
            \
              -H "Authorization: Bearer <TOKEN>" \
              -H "Content-Type: application/json" \
              -d '{
                "name": "Updated Enterprise Name",
                "contact": "Updated Contact",
                "number": "+12223334444",
                "email": "updated@email.com",
                "defaultMmsSelection": true,
                "enterpriseFeatures": [
                  {
                    "platformType": "Teams",
                    "enabled": true,
                    "groupTexting": true,
                    "broadcastTexting": true,
                    "mmsEnabled": false,
                    "teamTexting": true,
                    "scheduleSend": true,
                    "aiSmartReplies": false,
                    "aiChatAssist": false,
                    "cdrAccess": false,
                    "crmIntegration": false,
                    "contactsIntegration": false,
                    "applyToMappings": true,
                    "mmsEnabledApplyToMappings": false,
                    "groupTextingApplyToMappings": false,
                    "broadcastTextingApplyToMappings": false,
                    "teamTextingApplyToMappings": false,
                    "scheduleSendApplyToMappings": false,
                    "aiSmartRepliesApplyToMappings": false,
                    "aiChatAssistApplyToMappings": false,
                    "cdrAccessApplyToMappings": false,
                    "crmIntegrationApplyToMappings": false,
                    "contactsIntegrationApplyToMappings": false
                  }
                ]
              }'
        - lang: JavaScript
          label: JavaScript
          source: >
            const payload = {
              name: "Updated Enterprise Name",
              contact: "Updated Contact",
              number: "+12223334444",
              email: "updated@email.com",
              defaultMmsSelection: true,
              enterpriseFeatures: [
                {
                  platformType: "Teams",
                  enabled: true,
                  groupTexting: true,
                  broadcastTexting: true,
                  mmsEnabled: false,
                  teamTexting: true,
                  scheduleSend: true,
                  aiSmartReplies: false,
                  aiChatAssist: false,
                  cdrAccess: false,
                  crmIntegration: false,
                  contactsIntegration: false,
                  applyToMappings: true,
                  mmsEnabledApplyToMappings: false,
                  groupTextingApplyToMappings: false,
                  broadcastTextingApplyToMappings: false,
                  teamTextingApplyToMappings: false,
                  scheduleSendApplyToMappings: false,
                  aiSmartRepliesApplyToMappings: false,
                  aiChatAssistApplyToMappings: false,
                  cdrAccessApplyToMappings: false,
                  crmIntegrationApplyToMappings: false,
                  contactsIntegrationApplyToMappings: false
                }
              ]
            };


            const response = await
            fetch('https://teams-backend.sabrhub.com/enterprise/E0000090', {
              method: 'PUT',
              headers: {
                'Authorization': 'Bearer <TOKEN>',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify(payload)
            });

            const data = await response.json();

            console.log(data);
        - lang: Python
          label: Python
          source: |
            import requests

            url = "https://teams-backend.sabrhub.com/enterprise/E0000090"
            payload = {
                "name": "Updated Enterprise Name",
                "contact": "Updated Contact",
                "number": "+12223334444",
                "email": "updated@email.com",
                "defaultMmsSelection": True,
                "enterpriseFeatures": [
                    {
                        "platformType": "Teams",
                        "enabled": True,
                        "groupTexting": True,
                        "broadcastTexting": True,
                        "mmsEnabled": False,
                        "teamTexting": True,
                        "scheduleSend": True,
                        "aiSmartReplies": False,
                        "aiChatAssist": False,
                        "cdrAccess": False,
                        "crmIntegration": False,
                        "contactsIntegration": False,
                        "applyToMappings": True,
                        "mmsEnabledApplyToMappings": False,
                        "groupTextingApplyToMappings": False,
                        "broadcastTextingApplyToMappings": False,
                        "teamTextingApplyToMappings": False,
                        "scheduleSendApplyToMappings": False,
                        "aiSmartRepliesApplyToMappings": False,
                        "aiChatAssistApplyToMappings": False,
                        "cdrAccessApplyToMappings": False,
                        "crmIntegrationApplyToMappings": False,
                        "contactsIntegrationApplyToMappings": False
                    }
                ]
            }
            headers = {
                "Authorization": "Bearer <TOKEN>",
                "Content-Type": "application/json"
            }
            response = requests.put(url, json=payload, headers=headers)
            print(response.json())
  /enterprise/deleteenterprise/{enterpriseId}:
    delete:
      operationId: deleteEnterprise
      tags:
        - Enterprise Management
      summary: Delete enterprise by ID
      description: >-
        Remove the enterprise identified by enterpriseId. Returns a deletion
        confirmation or 404 if not found.
      parameters:
        - name: enterpriseId
          in: path
          required: true
          schema:
            type: string
            example: E0000090
      responses:
        '200':
          description: Enterprise deleted successfully.
          content:
            text/plain:
              schema:
                type: string
                example: Deleted enterprise E0000090
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  fields:
                    type: string
                  message:
                    type: string
        '403':
          description: Forbidden - Tenant access denied
        '404':
          description: Enterprise not found
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X DELETE
            "https://teams-backend.sabrhub.com/enterprise/deleteenterprise/E0000090"
            \
              -H "Authorization: Bearer <TOKEN>"
        - lang: JavaScript
          label: JavaScript
          source: >
            const response = await
            fetch('https://teams-backend.sabrhub.com/enterprise/deleteenterprise/E0000090',
            {
              method: 'DELETE',
              headers: {
                'Authorization': 'Bearer <TOKEN>'
              }
            });

            const text = await response.text();

            console.log(text);
        - lang: Python
          label: Python
          source: >
            import requests


            url =
            "https://teams-backend.sabrhub.com/enterprise/deleteenterprise/E0000090"

            headers = {"Authorization": "Bearer <TOKEN>"}

            response = requests.delete(url, headers=headers)

            print(response.text)
  /mapping/add/{enterpriseId}:
    post:
      operationId: addMapping
      tags:
        - Mapping Management
      summary: Add phone-to-app mapping
      description: >-
        Create a number→messaging-app mapping for the specified enterprise.
        Returns the mapping id and mapping details.
      parameters:
        - name: enterpriseId
          in: path
          required: true
          schema:
            type: string
            example: E0000027
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - phoneNumber
                - messagingAppType
                - messagingAppId
                - name
              properties:
                phoneNumber:
                  type: string
                  example: '+12223334444'
                messagingAppType:
                  type: string
                  enum:
                    - Teams
                  example: Teams
                messagingAppId:
                  type: string
                  example: test@example.com
                name:
                  type: string
                  example: Tester
                mmsEnabled:
                  type: boolean
                  example: false
                mappingFeatures:
                  type: array
                  description: Array of platform-specific feature configurations
                  items:
                    type: object
                    properties:
                      platformType:
                        type: string
                        enum:
                          - Teams
                          - Webex
                        example: Teams
                      enabled:
                        type: boolean
                        example: true
                      groupTexting:
                        type: boolean
                        example: false
                      broadcastTexting:
                        type: boolean
                        example: false
                      mmsEnabled:
                        type: boolean
                        example: false
                      teamTexting:
                        type: boolean
                        example: true
                      scheduleSend:
                        type: boolean
                        example: false
                      aiSmartReplies:
                        type: boolean
                        example: false
                      aiChatAssist:
                        type: boolean
                        example: false
                      cdrAccess:
                        type: boolean
                        example: false
                      crmIntegration:
                        type: boolean
                        example: false
                      contactsIntegration:
                        type: boolean
                        example: false
                  example:
                    - platformType: Teams
                      enabled: true
                      groupTexting: false
                      broadcastTexting: false
                      mmsEnabled: false
                      teamTexting: true
                      scheduleSend: false
                      aiSmartReplies: false
                      aiChatAssist: false
                      cdrAccess: false
                      crmIntegration: false
                      contactsIntegration: false
                    - platformType: Webex
                      enabled: true
                      groupTexting: false
                      broadcastTexting: false
                      mmsEnabled: false
                      teamTexting: true
                      scheduleSend: false
                      aiSmartReplies: false
                      aiChatAssist: false
                      cdrAccess: false
                      crmIntegration: false
                      contactsIntegration: false
                notifyUser:
                  type: boolean
                  description: Whether to notify the user via email
                  example: true
                emailNotifyMap:
                  type: object
                  description: Map of email addresses to notification preferences
                  additionalProperties:
                    type: boolean
                  example:
                    test222@gmail.com: false
      responses:
        '201':
          description: Mapping added successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  numberToMessageAppMapId:
                    type: string
                    example: NTMAP0000123
                  phoneNumber:
                    type: string
                    example: '+12223334444'
                  messagingAppType:
                    type: string
                    example: Teams
                  messagingAppId:
                    type: string
                    example: test@example.com
                  name:
                    type: string
                    example: Tester
                  mmsEnabled:
                    type: boolean
                    example: false
                  status:
                    type: string
                    example: ACTIVE
                  createdDate:
                    type: string
                    format: date-time
                  updateDate:
                    type: string
                    format: date-time
        '400':
          description: Invalid mapping data
          content:
            application/json:
              schema:
                type: object
                properties:
                  fields:
                    type: string
                  message:
                    type: string
        '403':
          description: Forbidden - Tenant access denied
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X POST
            "https://teams-backend.sabrhub.com/mapping/add/E0000027" \
              -H "Authorization: Bearer <TOKEN>" \
              -H "Content-Type: application/json" \
              -d '{
                "name": "test",
                "phoneNumber": "+13322222223",
                "messagingAppId": "test222@gmail.com",
                "messagingAppType": "Teams",
                "mmsEnabled": false,
                "mappingFeatures": [
                  {
                    "platformType": "Teams",
                    "enabled": true,
                    "groupTexting": false,
                    "broadcastTexting": false,
                    "mmsEnabled": false,
                    "teamTexting": true,
                    "scheduleSend": false,
                    "aiSmartReplies": false,
                    "aiChatAssist": false,
                    "cdrAccess": false,
                    "crmIntegration": false,
                    "contactsIntegration": false
                  },
                  {
                    "platformType": "Webex",
                    "enabled": true,
                    "groupTexting": false,
                    "broadcastTexting": false,
                    "mmsEnabled": false,
                    "teamTexting": true,
                    "scheduleSend": false,
                    "aiSmartReplies": false,
                    "aiChatAssist": false,
                    "cdrAccess": false,
                    "crmIntegration": false,
                    "contactsIntegration": false
                  }
                ],
                "notifyUser": true,
                "emailNotifyMap": {
                  "test222@gmail.com": false
                }
              }'
        - lang: JavaScript
          label: JavaScript
          source: >
            const payload = {
              name: "test",
              phoneNumber: "+13322222223",
              messagingAppId: "test222@gmail.com",
              messagingAppType: "Teams",
              mmsEnabled: false,
              mappingFeatures: [
                {
                  platformType: "Teams",
                  enabled: true,
                  groupTexting: false,
                  broadcastTexting: false,
                  mmsEnabled: false,
                  teamTexting: true,
                  scheduleSend: false,
                  aiSmartReplies: false,
                  aiChatAssist: false,
                  cdrAccess: false,
                  crmIntegration: false,
                  contactsIntegration: false
                },
                {
                  platformType: "Webex",
                  enabled: true,
                  groupTexting: false,
                  broadcastTexting: false,
                  mmsEnabled: false,
                  teamTexting: true,
                  scheduleSend: false,
                  aiSmartReplies: false,
                  aiChatAssist: false,
                  cdrAccess: false,
                  crmIntegration: false,
                  contactsIntegration: false
                }
              ],
              notifyUser: true,
              emailNotifyMap: {
                "test222@gmail.com": false
              }
            };


            const response = await
            fetch('https://teams-backend.sabrhub.com/mapping/add/E0000027', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer <TOKEN>',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify(payload)
            });

            const data = await response.json();

            console.log(data);
        - lang: Python
          label: Python
          source: |
            import requests

            url = "https://teams-backend.sabrhub.com/mapping/add/E0000027"
            payload = {
                "name": "test",
                "phoneNumber": "+13322222223",
                "messagingAppId": "test222@gmail.com",
                "messagingAppType": "Teams",
                "mmsEnabled": False,
                "mappingFeatures": [
                    {
                        "platformType": "Teams",
                        "enabled": True,
                        "groupTexting": False,
                        "broadcastTexting": False,
                        "mmsEnabled": False,
                        "teamTexting": True,
                        "scheduleSend": False,
                        "aiSmartReplies": False,
                        "aiChatAssist": False,
                        "cdrAccess": False,
                        "crmIntegration": False,
                        "contactsIntegration": False
                    },
                    {
                        "platformType": "Webex",
                        "enabled": True,
                        "groupTexting": False,
                        "broadcastTexting": False,
                        "mmsEnabled": False,
                        "teamTexting": True,
                        "scheduleSend": False,
                        "aiSmartReplies": False,
                        "aiChatAssist": False,
                        "cdrAccess": False,
                        "crmIntegration": False,
                        "contactsIntegration": False
                    }
                ],
                "notifyUser": True,
                "emailNotifyMap": {
                    "test222@gmail.com": False
                }
            }
            headers = {
                "Authorization": "Bearer <TOKEN>",
                "Content-Type": "application/json"
            }
            response = requests.post(url, json=payload, headers=headers)
            print(response.json())
  /numbertomessageappmapping/enterprise/{enterpriseId}:
    get:
      operationId: getEnterpriseMappings
      tags:
        - Mapping Management
      summary: List enterprise mappings by ID
      description: >-
        Return mappings for the specified enterprise (phoneNumber,
        messagingAppType, messagingAppId, name).
      parameters:
        - name: enterpriseId
          in: path
          required: true
          schema:
            type: string
            example: E0000001
      responses:
        '200':
          description: List of mappings for the specified enterprise.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    enterpriseId:
                      type: string
                      example: E0000001
                    numberToMessageAppMap:
                      type: object
                      properties:
                        numberToMessageAppMapId:
                          type: string
                          example: NTMAP0000123
                        phoneNumber:
                          type: string
                          example: '+12223334444'
                        messagingAppType:
                          type: string
                          example: Teams
                        messagingAppId:
                          type: string
                          example: test@example.com
                        name:
                          type: string
                          example: Mapping Name
                        status:
                          type: string
                          example: ACTIVE
                        createdDate:
                          type: string
                          format: date-time
                        updateDate:
                          type: string
                          format: date-time
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  fields:
                    type: string
                  message:
                    type: string
        '403':
          description: Forbidden - Tenant access denied
        '404':
          description: Enterprise not found
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X GET
            "https://teams-backend.sabrhub.com/numbertomessageappmapping/enterprise/E0000001"
            \
              -H "Authorization: Bearer <TOKEN>"
        - lang: JavaScript
          label: JavaScript
          source: >
            const response = await
            fetch('https://teams-backend.sabrhub.com/numbertomessageappmapping/enterprise/E0000001',
            {
              method: 'GET',
              headers: {
                'Authorization': 'Bearer <TOKEN>'
              }
            });

            const data = await response.json();

            console.log(data);
        - lang: Python
          label: Python
          source: >
            import requests


            url =
            "https://teams-backend.sabrhub.com/numbertomessageappmapping/enterprise/E0000001"

            headers = {"Authorization": "Bearer <TOKEN>"}

            response = requests.get(url, headers=headers)

            print(response.json())
  /mapping/{numberToMessageAppMapId}:
    put:
      summary: Update mapping details by ID
      description: >-
        Update mapping details (messagingAppId, phoneNumber, name, mmsEnabled,
        mappingFeatures, notifyUser, emailNotifyMap) for the specified mapping
        ID and return the updated mapping.
      operationId: updateMapping
      tags:
        - Mapping Management
      parameters:
        - name: numberToMessageAppMapId
          in: path
          required: true
          schema:
            type: string
            example: NTMAP0000123
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                messagingAppId:
                  type: string
                  example: app456
                phoneNumber:
                  type: string
                  example: '+12223334444'
                name:
                  type: string
                  example: Updated Name
                mmsEnabled:
                  type: boolean
                  example: false
                mappingFeatures:
                  type: array
                  description: Array of platform-specific feature configurations
                  items:
                    type: object
                    properties:
                      platformType:
                        type: string
                        enum:
                          - Teams
                          - Webex
                        example: Teams
                      enabled:
                        type: boolean
                        example: true
                      groupTexting:
                        type: boolean
                        example: false
                      broadcastTexting:
                        type: boolean
                        example: false
                      mmsEnabled:
                        type: boolean
                        example: false
                      teamTexting:
                        type: boolean
                        example: true
                      scheduleSend:
                        type: boolean
                        example: false
                      aiSmartReplies:
                        type: boolean
                        example: false
                      aiChatAssist:
                        type: boolean
                        example: false
                      cdrAccess:
                        type: boolean
                        example: false
                      crmIntegration:
                        type: boolean
                        example: false
                      contactsIntegration:
                        type: boolean
                        example: false
                notifyUser:
                  type: boolean
                  description: Whether to notify the user via email
                  example: true
                emailNotifyMap:
                  type: object
                  description: Map of email addresses to notification preferences
                  additionalProperties:
                    type: boolean
                  example:
                    test222@gmail.com: false
      responses:
        '200':
          description: Mapping updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  numberToMessageAppMapId:
                    type: string
                    example: NTMAP0000123
                  messagingAppId:
                    type: string
                    example: app456
                  phoneNumber:
                    type: string
                    example: '+12223334444'
                  name:
                    type: string
                    example: Updated Name
                  messagingAppType:
                    type: string
                    example: Teams
                  status:
                    type: string
                    example: ACTIVE
        '400':
          description: Invalid mapping update
          content:
            application/json:
              schema:
                type: object
                properties:
                  fields:
                    type: string
                  message:
                    type: string
        '403':
          description: Forbidden - Tenant access denied
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X PUT "https://teams-backend.sabrhub.com/mapping/NTMAP0000123"
            \
              -H "Authorization: Bearer <TOKEN>" \
              -H "Content-Type: application/json" \
              -d '{
                "messagingAppId": "app456",
                "phoneNumber": "+12223334444",
                "name": "Updated Name",
                "mmsEnabled": false,
                "mappingFeatures": [
                  {
                    "platformType": "Teams",
                    "enabled": true,
                    "groupTexting": false,
                    "broadcastTexting": false,
                    "mmsEnabled": false,
                    "teamTexting": true,
                    "scheduleSend": false,
                    "aiSmartReplies": false,
                    "aiChatAssist": false,
                    "cdrAccess": false,
                    "crmIntegration": false,
                    "contactsIntegration": false
                  }
                ],
                "notifyUser": true,
                "emailNotifyMap": {
                  "app456": false
                }
              }'
        - lang: JavaScript
          label: JavaScript
          source: >
            const payload = {
              messagingAppId: "app456",
              phoneNumber: "+12223334444",
              name: "Updated Name",
              mmsEnabled: false,
              mappingFeatures: [
                {
                  platformType: "Teams",
                  enabled: true,
                  groupTexting: false,
                  broadcastTexting: false,
                  mmsEnabled: false,
                  teamTexting: true,
                  scheduleSend: false,
                  aiSmartReplies: false,
                  aiChatAssist: false,
                  cdrAccess: false,
                  crmIntegration: false,
                  contactsIntegration: false
                }
              ],
              notifyUser: true,
              emailNotifyMap: {
                "app456": false
              }
            };


            const response = await
            fetch('https://teams-backend.sabrhub.com/mapping/NTMAP0000123', {
              method: 'PUT',
              headers: {
                'Authorization': 'Bearer <TOKEN>',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify(payload)
            });

            const data = await response.json();

            console.log(data);
        - lang: Python
          label: Python
          source: |
            import requests

            url = "https://teams-backend.sabrhub.com/mapping/NTMAP0000123"
            payload = {
                "messagingAppId": "app456",
                "phoneNumber": "+12223334444",
                "name": "Updated Name",
                "mmsEnabled": False,
                "mappingFeatures": [
                    {
                        "platformType": "Teams",
                        "enabled": True,
                        "groupTexting": False,
                        "broadcastTexting": False,
                        "mmsEnabled": False,
                        "teamTexting": True,
                        "scheduleSend": False,
                        "aiSmartReplies": False,
                        "aiChatAssist": False,
                        "cdrAccess": False,
                        "crmIntegration": False,
                        "contactsIntegration": False
                    }
                ],
                "notifyUser": True,
                "emailNotifyMap": {
                    "app456": False
                }
            }
            headers = {
                "Authorization": "Bearer <TOKEN>",
                "Content-Type": "application/json"
            }
            response = requests.put(url, json=payload, headers=headers)
            print(response.json())
    delete:
      summary: Delete mapping by its ID
      description: >-
        Delete the mapping identified by numberToMessageAppMapId. Returns 200 on
        success or 404 if the mapping is not found.
      operationId: deleteMappingById
      tags:
        - Mapping Management
      parameters:
        - name: numberToMessageAppMapId
          in: path
          required: true
          description: The ID of the message app map to be deleted.
          schema:
            type: string
          example: NTMAP0000123
      responses:
        '200':
          description: Mapping deleted successfully
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  fields:
                    type: string
                  message:
                    type: string
        '403':
          description: Forbidden - Tenant access denied
        '404':
          description: Mapping not found
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X DELETE
            "https://teams-backend.sabrhub.com/mapping/NTMAP0000123" \
              -H "Authorization: Bearer <TOKEN>"
        - lang: JavaScript
          label: JavaScript
          source: >
            const response = await
            fetch('https://teams-backend.sabrhub.com/mapping/NTMAP0000123', {
              method: 'DELETE',
              headers: {
                'Authorization': 'Bearer <TOKEN>'
              }
            });

            console.log(response.status);
        - lang: Python
          label: Python
          source: |
            import requests

            url = "https://teams-backend.sabrhub.com/mapping/NTMAP0000123"
            headers = {"Authorization": "Bearer <TOKEN>"}
            response = requests.delete(url, headers=headers)
            print(response.status_code)
  /mapping/messagingAppId:
    post:
      summary: Retrieve mapping by app ID
      description: >-
        Lookup and return mapping details using messagingAppId (phone, app type,
        mapping id, name).
      operationId: readMappingByMessagingAppId
      tags:
        - Mapping Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
                  example: app789@example.com
                platformType:
                  type: string
                  description: Platform type (optional)
      responses:
        '200':
          description: Mapping read successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    numberToMessageAppMapId:
                      type: string
                      example: NTMAP0000456
                    messagingAppId:
                      type: string
                      example: app789@example.com
                    phoneNumber:
                      type: string
                      example: '+12223334444'
                    messagingAppType:
                      type: string
                      example: Teams
                    name:
                      type: string
                      example: Mapping Name
                    status:
                      type: string
                      example: ACTIVE
                    createdDate:
                      type: string
                      format: date-time
                    updateDate:
                      type: string
                      format: date-time
                    feature:
                      type: object
                      description: Feature validation details
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  fields:
                    type: string
                  message:
                    type: string
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >
            curl -X POST
            "https://teams-backend.sabrhub.com/mapping/messagingAppId" \
              -H "Authorization: Bearer <TOKEN>" \
              -H "Content-Type: application/json" \
              -d '{"email": "app789@example.com"}'
        - lang: JavaScript
          label: JavaScript
          source: >
            const response = await
            fetch('https://teams-backend.sabrhub.com/mapping/messagingAppId', {
              method: 'POST',
              headers: {
                'Authorization': 'Bearer <TOKEN>',
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                email: 'app789@example.com'
              })
            });

            const data = await response.json();

            console.log(data);
        - lang: Python
          label: Python
          source: |
            import requests

            url = "https://teams-backend.sabrhub.com/mapping/messagingAppId"
            payload = {"email": "app789@example.com"}
            headers = {
                "Authorization": "Bearer <TOKEN>",
                "Content-Type": "application/json"
            }
            response = requests.post(url, json=payload, headers=headers)
            print(response.json())
