swagger: '2.0'
host: 'orgId.domain'
schemes:
  - https
info:
  version: '3.1'
  title: Alvaria Cloud User Management REST API
  contact:
    name: Alvaria
    url: 'https://www.alvaria.com'
    email: support@alvaria.com
  license:
    name: 'License: Creative Commons Attribution 4.0 International Public License'
    url: 'https://creativecommons.org/licenses/by/4.0/legalcode'
  description: |-
    ## Overview

      The Alvaria&trade; Cloud User Management REST APIs enable developers to retrieve and manage properties related to the following Alvaria&trade; Cloud resources.
      - __Users__ -  individual accounts created in Alvaria&trade; Cloud for example, Agent, Manager and Team Lead
      - __Teams__ -  groups that contain specific Alvaria&trade; Cloud users
    
      __Note__: The domain in the base URL corresponds to the Alvaria&trade; website that hosts the API. Presently, it differs by cloud vendor.
    
      __Table 1__: base URLs for each cloud solution
      | **Cloud Vendor**  | **Details**  | **Domain** |
      | --- | --- | --- |
      | Amazon Web Service (AWS) | | via.aspect-cloud.net |
      | Amazon Web Service (AWS) | tri (workforce only) | wos.alvaria.cloud |
      | Microsoft Azure | | via.aspect-cloud.net |
      | GCP | | apc.alvaria.cloud |
paths:
  '/via/v3/organizations/{orgId}/userManagement/users':
    parameters:
      - $ref: '#/parameters/orgId'
    get:
      tags:
        - Users
      operationId: getUsers
      summary: Get Users
      description: >-
        Retrieves a paginated collection of users in JSON format.
        Note: Output in CSV format is deprecated. Please, use getBulkUsersInCsv endpoint.
      security:
        - oauth:
            - myaccount.users.list
          apiKey: []
      parameters:
        - $ref: '#/parameters/emailFilterParam'
        - $ref: '#/parameters/firstNameFilterParam'
        - $ref: '#/parameters/lastNameFilterParam'
        - $ref: '#/parameters/phoneNumberFilterParam'
        - $ref: '#/parameters/startIndex'
        - $ref: '#/parameters/maxResults'
        - $ref: '#/parameters/roleFilterParam'
        - $ref: '#/parameters/teamFilterParam'
        - $ref: '#/parameters/managerOfFilterParam'
        - $ref: '#/parameters/uiStatusFilterParam'
        - $ref: '#/parameters/corpEmailFilterParam'
      produces:
        - application/json
      responses:
        '200':
          description: Successful response
          schema:
            $ref: '#/definitions/V3UserCollection'
          examples:
            application/json:
                {
                  "kind": "via#userList",
                  "users": [
                    {
                      "active": true,
                      "kind": "via#user",
                      "id": "192e14fab017122",
                      "email": "user1@orgname.com",
                      "firstName": "alvaria",
                      "lastName": "user",
                      "displayName" : "alvaria user",
                      "friendlyName": [
                        {
                          "locale": "en-US",
                          "value": "alvaria user"
                        }
                      ],
                      "phoneNumber": "123456789",
                      "role": "manager",
                      "country" : "US",
                      "timezone" : "America/New_York",
                      "language" : "en",
                      "entitlements" : ["viacoreinbound","workforcemanagement"],
                      "team": "alphaTeam",
                      "managerOf": ["alphaTeam","betaTeam"],
                      "orgEmail": "alvaria.user@orgname.com",
                      "mfaStage": "ENROLLMENT",
                      "creationTime": "2020-09-11T23:19:49Z",
                      "lastModifiedTime": "2020-10-18T16:05:52Z",
                      "lastLoginTime": "2020-11-14T18:24:42Z"
                    }
                  ],
                  "totalItems": 1
                }
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
    post:
      tags:
        - Users
      operationId: createUser
      summary: Create User
      description: Creates a User
      security:
        - oauth:
            - myaccount.users.create
          apiKey: []
      parameters:
        - $ref: '#/parameters/V3CreateUserRequest'
      consumes:
        - application/json
      produces:
        - application/json
      responses:
        '201':
          description: User created
          schema:
            $ref: '#/definitions/V3User'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/{userId}':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/userId'
    get:
      tags:
        - Users
      operationId: getUser
      summary: Get User
      description: Retrieves a User
      security:
        - oauth:
            - myaccount.users.view
          apiKey: []
      produces:
        - application/json
      responses:
        '200':
          description: Successful response
          schema:
            $ref: '#/definitions/V3User'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
    put:
      tags:
        - Users
      operationId: updateUser
      summary: Update User
      description: Updates a User
      security:
        - oauth:
            - myaccount.users.modify
          apiKey: []
      parameters:
        - $ref: '#/parameters/V3UpdateUserRequest'
      consumes:
        - application/json
      produces:
        - application/json
      responses:
        '200':
          description: User updated
          schema:
            $ref: '#/definitions/V3User'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
    delete:
      deprecated: true
      tags:
        - Users
      operationId: deleteUser
      summary: Delete User (deprecated)
      description: >- 
        Deletes a User. This endpoint immediately removes a user. It is recommended to use v4 version of this API. 
        New v4 API brings more reliable deletion process that is suitable for a distributed user provisioning process.
      security:
        - oauth:
            - myaccount.users.delete
          apiKey: []
      parameters:
        - $ref: '#/parameters/V3RemoveUserRequest'
      consumes:
        - application/json
      produces:
        - application/json
      responses:
        '204':
          description: User removed
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '409':
          description: Cannot remove accountowner
          schema:
            $ref: '#/definitions/ErrorResponse'
        '412':
          description: Cannot remove inactive users, Not allowed by truth source
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/{userId}/suspend':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/userId'
    post:
      tags:
        - Users
      operationId: updateUserSuspendStatus
      summary: Update User Suspend Status
      description: Updates the suspend status of a User
      security:
        - oauth:
            - myaccount.users.suspend
          apiKey: []
      parameters:
        - $ref: '#/parameters/V3UserSuspendRequest'
      consumes:
        - application/json
      produces:
        - application/json
      responses:
        '204':
          description: User suspend status updated
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/{userId}/managerOf':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/userId'
    get:
      tags:
        - Users
        - Teams
      operationId: getTeamsManagedByUser
      summary: Get Teams Managed By User
      description: Retrieves the Teams managed by a User
      security:
        - oauth:
            - myaccount.users.list.managed.teams
          apiKey: []
      produces:
        - application/json
      responses:
        '200':
          description: Successful response
          schema:
            $ref: '#/definitions/V3TeamCollection'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/jobs/csv':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/emailFilterParam'
      - $ref: '#/parameters/roleFilterParam'
      - $ref: '#/parameters/teamFilterParam'
      - $ref: '#/parameters/givenNameFilterParam'
      - $ref: '#/parameters/firstNameFilterParam'
      - $ref: '#/parameters/snFilterParam'
      - $ref: '#/parameters/lastNameFilterParam'
      - $ref: '#/parameters/telephoneNumberFilterParam'
      - $ref: '#/parameters/managerOfFilterParam'
      - $ref: '#/parameters/uiStatusFilterParam'
      - $ref: '#/parameters/corpEmailFilterParam'
    get:
      tags:
        - Bulk Operations
        - Users
      operationId: getBulkUsersInCsv
      summary: Retrieves a collection of Users in csv format
      description: Retrieves a collection of Users in csv format suitable for bulk modify operation
      produces:
        - text/csv
      security:
        - oauth:
            - myaccount.users.bulk.modify.list
          apiKey: [ ]
      responses:
        '200':
          description: Ok
          schema:
            type: string
            format: binary
          examples:
            text/csv:
              value: >-
                First Name,Last Name,Display Name,Current Email,Modified Email,Telephone,Role,Country,Timezone,Language,Manager of Team,Member of Team,User Capabilities,WFM SecurityProfile Code,WFM EmployeeFilterProfile Code,Employee ID,Organization Email,RD Web Access
                a,bulk2,abulk2,a.bulk2@cork.com,b.coke5@cork.com,123456789,manager,US,America/New_York,en,team1,a,WorkforceManagement|Outreach,Admin,EmpProfile98,123456,a.bulk2@cork.com,true
                a,bulk3,abulk3,a.bulk3@cork.com,none,123456789,agent,US,America/New_York,en,none,a,WorkforceManagement,Admin,EmpProfile98,1234567,a.bulk3@cork.com,
                a,bulk4,abulk4,a.bulk4@cork.com,none,123456789,agent,US,America/New_York,en,none,a,Outreach,Admin,EmpProfile98,12345678,a.bulk4@cork.com,
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/jobs':
    parameters:
      - $ref: '#/parameters/orgId'
    get:
      tags:
        - Bulk Operations
        - Users
      operationId: getBulkUserJobs
      summary: Get Bulk Operation Jobs
      description: Get Bulk Operation Jobs
      security:
        - oauth:
            - myaccount.users.bulk.status.list
          apiKey: []
      produces:
        - application/json
      responses:
        '200':
          description: Ok
          schema:
            $ref: '#/definitions/BulkUserJobCollection'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/jobs/upload/template':
    parameters:
      - $ref: '#/parameters/orgId'
    get:
      tags:
        - Bulk Operations
        - Users
      operationId: getCreateBulkJobTemplate
      produces:
        - text/csv
      summary: Get CSV Template for a Create Bulk Operation Job
      description: Get CSV Template for a Create Bulk Operation Job
      security:
        - oauth:
            - myaccount.users.bulk.create
          apiKey: []
      responses:
        '200':
          description: Ok
          headers:
            Content-Disposition:
              type: string
              description: Filename and Type
              default: "attachment; filename=upload.csv"
          schema:
            title: "upload.csv"
            type: string
            example: >-
              First Name,Last Name,Display Name,Email,Telephone,Role,Country,Timezone,Language,Manager of Team,Member of Team,User Capabilities,WFM SecurityProfile Code,WFM EmployeeFilterProfile Code,Employee ID,Organization Email,RD Web Access
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/jobs/modify/template':
    parameters:
      - $ref: '#/parameters/orgId'
    get:
      tags:
        - Bulk Operations
        - Users
      operationId: getModifyBulkJobTemplate
      produces:
        - text/csv
      summary: Get CSV Template for a Modify Bulk Operation Job
      description: Get CSV Template for a Modify Bulk Operation Job
      security:
        - oauth:
            - myaccount.users.bulk.modify
          apiKey: [ ]
      responses:
        '200':
          description: Ok
          headers:
            Content-Disposition:
              type: string
              description: Filename and Type
              default: "attachment; filename=modify.csv"
          schema:
            title: "modify.csv"
            type: string
            example: >-
              First Name,Last Name,Display Name,Current Email,Modified Email,Telephone,Role,Country,Timezone,Language,Manager of Team,Member of Team,User Capabilities,WFM SecurityProfile Code,WFM EmployeeFilterProfile Code,Employee ID,Organization Email,RD Web Access
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/jobs/delete/template':
    parameters:
      - $ref: '#/parameters/orgId'
    get:
      tags:
        - Bulk Operations
        - Users
      operationId: getDeleteBulkJobTemplate
      produces:
        - text/csv
      summary: Get CSV Template for a Delete Bulk Operation Job
      description: Get CSV Template for a Delete Bulk Operation Job
      security:
        - oauth:
            - myaccount.users.bulk.delete
          apiKey: [ ]
      responses:
        '200':
          description: Ok
          headers:
            Content-Disposition:
              type: string
              description: Filename and Type
              default: "attachment; filename=delete.csv"
          schema:
            title: "delete.csv"
            type: string
            example: >-
              Email To Delete,Manager To Delegate
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/jobs/upload':
    parameters:
      - $ref: '#/parameters/orgId'
    post:
      tags:
        - Bulk Operations
        - Users
      operationId: createBulkCsv
      consumes:
        - multipart/form-data
      produces:
        - application/json
      summary: Upload a CSV file for bulk create user operations
      description: Upload a CSV file for bulk create user operations
      parameters:
        - name: users
          in: formData
          type: file
          description: >-
            MultiPart form CSV.
            First Name,Last Name,Display Name,Email,Telephone,Role,Country,Timezone,Language,Manager of Team,Member of Team,User Capabilities,WFM SecurityProfile Code,WFM EmployeeFilterProfile Code,Employee ID,Organization Email,RD Web Access
            a,bulk2,abulk2,a.bulk2@cork.com,123456789,agent,US,America/New_York,en,none,a,WorkforceManagement|Outreach,Admin,EmpProfile98,123456,a.bulk2@cork.com,true
            a,bulk3,abulk3,a.bulk3@cork.com,123456789,agent,US,America/New_York,en,none,a,WorkforceManagement,Admin,EmpProfile98,1234567,a.bulk3@cork.com,false
            a,bulk4,abulk4,a.bulk4@cork.com,123456789,agent,US,America/New_York,en,none,a,Outreach,Admin,EmpProfile98,12345678,a.bulk4@cork.com,

            Allowed values in CSV fields ->

             * _Role_ ->
            agent, teamlead, manager, developer, useradministrator
            NOTE that roles must be lowercase

             * _User Capabilities_ ->
            performancemanagement, qualitymanagement, qualitymanagementscreencapture,
            qualitymanagementvoicerecording, viacoreinbound, viacoreoutreach,
            workforcemanagement, workforcemanagementencompass
          required: true
      security:
        - oauth:
            - myaccount.users.bulk.create
          apiKey: []
      responses:
        '202':
          description: Accepted
          schema:
            $ref: '#/definitions/BulkUserOperationResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '413':
          description: Payload Too Large
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/jobs/modify':
    parameters:
      - $ref: '#/parameters/orgId'
    post:
      tags:
        - Bulk Operations
        - Users
      operationId: modifyBulkCsv
      consumes:
        - multipart/form-data
      produces:
        - application/json
      summary: Upload a CSV file for bulk modify user operations
      description: Upload a CSV file for bulk modify user operations
      parameters:
        - name: users
          in: formData
          type: file
          description: >-
            MultiPart form CSV.
            First Name,Last Name,Display Name,Current Email,Modified Email,Telephone,Role,Country,Timezone,Language,Manager of Team,Member of Team,User Capabilities,WFM SecurityProfile Code,WFM EmployeeFilterProfile Code,Employee ID,Organization Email,RD Web Access
            a,bulk2,abulk2,a.bulk2@cork.com,b.coke5@cork.com,123456789,manager,US,America/New_York,en,team1,a,WorkforceManagement|Outreach,Admin,EmpProfile98,123456,a.bulk2@cork.com,true
            a,bulk3,abulk3,a.bulk3@cork.com,none,123456789,agent,US,America/New_York,en,none,a,WorkforceManagement,Admin,EmpProfile98,1234567,a.bulk3@cork.com,false
            a,bulk4,abulk4,a.bulk4@cork.com,none,123456789,agent,US,America/New_York,en,none,a,Outreach,Admin,EmpProfile98,12345678,a.bulk4@cork.com,

            Allowed values in CSV fields ->

             * _Role_ ->
            agent, teamlead, manager, developer, useradministrator
            NOTE that roles must be lowercase

             * _User Capabilities_ ->
            performancemanagement, qualitymanagement, qualitymanagementscreencapture,
            qualitymanagementvoicerecording, viacoreinbound, viacoreoutreach,
            workforcemanagement, workforcemanagementencompass
          required: true
      security:
        - oauth:
            - myaccount.users.bulk.modify
          apiKey: [ ]
      responses:
        '202':
          description: Accepted
          schema:
            $ref: '#/definitions/BulkUserOperationResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '413':
          description: Payload Too Large
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/jobs/delete':
    parameters:
      - $ref: '#/parameters/orgId'
    post:
      tags:
        - Bulk Operations
        - Users
      operationId: deleteBulkCsv
      consumes:
        - multipart/form-data
      produces:
        - application/json
      summary: Upload a CSV file for bulk delete user operations
      description: Upload a CSV file for bulk delete user operations
      parameters:
        - name: users
          in: formData
          type: file
          description: >-
            MultiPart form CSV.
            Email To Delete,Manager To Delegate
            a.bulk2@cork.com,a.manager1@cork.com
            a.bulk3@cork.com,a.manager2@cork.com
            a.bulk4@cork.com,a.manager3@cork.com

            Allowed values in CSV fields ->

             * _Role_ ->
            agent, teamlead, manager, developer, useradministrator
            NOTE that roles must be lowercase

             * _User Capabilities_ ->
            performancemanagement, qualitymanagement, qualitymanagementscreencapture,
            qualitymanagementvoicerecording, viacoreinbound, viacoreoutreach,
            workforcemanagement, workforcemanagementencompass
          required: true
      security:
        - oauth:
            - myaccount.users.bulk.delete
          apiKey: [ ]
      responses:
        '202':
          description: Accepted
          schema:
            $ref: '#/definitions/BulkUserOperationResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '413':
          description: Payload Too Large
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/jobs/{jobId}/status':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/jobId'
    get:
      tags:
        - Bulk Operations
        - Users
      operationId: getBulkJobStatus
      produces:
        - application/json
      summary: Get Bulk Operation Job Status
      description: Get Bulk Operation Job Status
      security:
        - oauth:
            - myaccount.users.bulk.status
          apiKey: []
      responses:
        '200':
          description: Ok
          schema:
            $ref: '#/definitions/JobStatusResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/jobs/{jobId}/report':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/jobId'
    get:
      tags:
        - Bulk Operations
        - Users
      operationId: getBulkJobReport
      produces:
        - text/csv
      summary: Get Bulk Operation Job Report
      description: Get Bulk Operation Job Report
      security:
        - oauth:
            - myaccount.users.bulk.report
          apiKey: []
      responses:
        '200':
          description: Ok
          headers:
            Content-Disposition:
              type: string
              description: Filename and Type
              default: "attachment; filename=BulkUserJobStatusReport.csv"
          schema:
            type: string
            format: binary
          examples:
            text/csv:
              value: >-
                Email,Status,Errors
                "a.bulk2@cork.com","completed"
                "a.bulk3@cork.com","failed","CUSTOMER READABLE ERRORS HERE"
                "a.bulk4@cork.com","expired","The Job timed out before the user could be processed",
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/teams':
    parameters:
      - $ref: '#/parameters/orgId'
    get:
      tags:
        - Teams
      operationId: getTeams
      summary: Get Teams
      description: Retrieves a list of Teams (WEM 22+ Orgs Only)
      security:
        - oauth:
            - myaccount.teams.list
          apiKey: []
      parameters:
        - $ref: '#/parameters/teamNameFilterParam'
        - $ref: '#/parameters/startIndex'
        - $ref: '#/parameters/maxResults'
      produces:
        - application/json
      responses:
        '200':
          description: Successful response
          schema:
            $ref: '#/definitions/V3TeamCollection'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
    post:
      tags:
        - Teams
      operationId: createTeam
      summary: Create Team
      description: Creates a Team (WEM 22+ Orgs Only)
      security:
        - oauth:
            - myaccount.teams.create
          apiKey: []
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/V3CreateTeamRequest'
      responses:
        '201':
          description: Team created
          schema:
            $ref: '#/definitions/V3Team'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '409':
          description: Team with this name already exists
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/teams/{teamId}':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/teamId'
    get:
      tags:
        - Teams
      operationId: getTeam
      summary: Get Team
      description: Retrieves a Team (WEM 22+ Orgs Only)
      security:
        - oauth:
            - myaccount.teams.view
          apiKey: []
      produces:
        - application/json
      responses:
        '200':
          description: Team retrieved
          schema:
            $ref: '#/definitions/V3Team'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Team Not found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
    put:
      tags:
        - Teams
      operationId: updateTeam
      summary: Update Team
      description: Updates a Team (WEM 22+ Orgs Only)
      security:
        - oauth:
            - myaccount.teams.modify
          apiKey: []
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/V3UpdateTeamRequest'
      responses:
        '200':
          description: Team updated
          schema:
            $ref: '#/definitions/V3Team'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '409':
          description: Team with this name already exists
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
    delete:
      tags:
        - Teams
      operationId: deleteTeam
      summary: Delete Team
      description: Deletes a Team (WEM 22+ Orgs Only). Only Teams with no members assigned can be removed.
      security:
        - oauth:
            - myaccount.teams.delete
          apiKey: []
      produces:
        - application/json
      responses:
        '204':
          description: Team removed
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '412':
          description: Team cannot be deleted
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/teams/{teamId}/members':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/teamId'
      - $ref: '#/parameters/startIndex'
      - $ref: '#/parameters/maxResults'
    get:
      tags:
        - Teams
        - Users
      operationId: getTeamMembers
      summary: Get Team Members
      description: Retrieves the members of a Team (WEM 22+ Orgs Only)
      security:
        - oauth:
            - myaccount.teams.list.members
          apiKey: []
      produces:
        - application/json
      responses:
        '200':
          description: Successful response
          schema:
            $ref: '#/definitions/V3UserFragmentCollection'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/teams/{teamId}/managers':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/teamId'
      - $ref: '#/parameters/startIndex'
      - $ref: '#/parameters/maxResults'
    get:
      tags:
        - Teams
        - Users
      operationId: getTeamManagers
      summary: Get Team Managers
      description: Retrieves the managers of a Team (WEM 22+ Orgs Only)
      security:
        - oauth:
            - myaccount.teams.list.managers
          apiKey: []
      produces:
        - application/json
      responses:
        '200':
          description: Successful response
          schema:
            $ref: '#/definitions/V3UserFragmentCollection'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v3/organizations/{orgId}/userManagement/users/{userId}/workforce/info':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/userId'
    get:
      tags:
        - Users
        - Workforce
      operationId: getWFMInfo
      summary: Get WFM Information available for a given user
      description: Retrieves the WFM Security and Employee Filter Profile key values available for use in create User and update User requests
      security:
        - oauth:
            - myaccount.users.view.wfm
          apiKey: []
      produces:
        - application/json
      responses:
        '200':
          description: Successful response
          schema:
            $ref: '#/definitions/V3WfmInfo'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '405':
          description: Method Not Allowed
          schema:
            $ref: '#/definitions/ErrorResponse'
        '412':
          description: Organization doesn't have wfm capabilities
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
  '/via/v4/organizations/{orgId}/userManagement/users/{userId}':
    parameters:
      - $ref: '#/parameters/orgId'
      - $ref: '#/parameters/userId'
    delete:
      tags:
        - Users
      operationId: v4DeleteUser
      summary: Delete User
      description: >- 
        Deletes a User. By calling this endpoint developer can submit a request to delete the user. User's deletion
        status can be checked by calling Get User API and checking user's status. Once user is successfully deleted,
        Get User API will return a 404 response.
      security:
        - oauth:
            - myaccount.users.delete
          apiKey: []
      parameters:
        - $ref: '#/parameters/V4RemoveUserRequest'
      consumes:
        - application/json
      produces:
        - application/json
      responses:
        '202':
          description: User delete request accepted
          schema:
            $ref: '#/definitions/V4RemoveUserResponse'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/ErrorResponse'
        '401':
          description: Unauthorized
          schema:
            $ref: '#/definitions/ErrorResponse'
        '403':
          description: Forbidden
          schema:
            $ref: '#/definitions/ErrorResponse'
        '404':
          description: Not found
          schema:
            $ref: '#/definitions/ErrorResponse'
        '409':
          description: Cannot remove accountowner
          schema:
            $ref: '#/definitions/ErrorResponse'
        '412':
          description: Cannot remove inactive users, Not allowed by truth source
          schema:
            $ref: '#/definitions/ErrorResponse'
        '429':
          description: Throttled
          schema:
            $ref: '#/definitions/ErrorResponse'
        '500':
          description: Internal server error
          schema:
            $ref: '#/definitions/ErrorResponse'
definitions:
  ErrorResponse:
    type: object
    properties:
      timestamp:
        type: string
        format: date-time
        example: "2020-09-11T23:19:49Z"
      status:
        type: integer
        format: int32
        example: 400
      error:
        type: string
        example: "Bad Request"
      message:
        type: string
        example: "Team 7284fa1f-ef75-49b4-a2ba-d836ddc02f03 doesn't exist"
      path:
        type: string
        example: "/via/v3/organizations/pwdcustomorg/userManagement/users"
  V3UserCollection:
    type: object
    required:
      - kind
      - users
      - totalItems
    properties:
      kind:
        description: >-
          Identifier used by Alvaria&trade; Cloud components to serialize the payload
          of the results.
        type: string
        default: via#userList
        example: via#userList
      users:
        type: array
        items:
          $ref: '#/definitions/V3UserItem'
      totalItems:
        type: integer
        description: The total number of Entity instances existing in the system.
        example: 1
  V3UserFragmentCollection:
    type: object
    required:
      - kind
      - users
      - totalItems
    properties:
      kind:
        description: >-
          Identifier used by Alvaria&trade; Cloud components to serialize the payload
          of the results.
        type: string
        default: via#userList
        example: via#userList
      users:
        type: array
        items:
          $ref: '#/definitions/V3UserFragment'
      totalItems:
        type: integer
        description: The total number of Entity instances existing in the system.
        example: 1
  V3UserFragment:
    title: UserFragment
    type: object
    properties:
      active:
        type: boolean
        description: Set to True if the entity is available for use.
        default: true
        example: true
      kind:
        description: >-
          Identifier used by Alvaria&trade; Cloud components to serialize the payload
          of the results.
        type: string
        default: via#user
        example: via#user
      id:
        description: Alvaria-generated unique identifier for the user
        type: string
        example: 192e14fab017122
      email:
        description: Email address of the User entity.
        type: string
        example: user1@orgname.com
      firstName:
        description: First name of the User entity.
        type: string
        example: alvaria
      lastName:
        description: Last name of the User entity.
        type: string
        example: user
      friendlyName:
        type: array
        description: >-
          Friendly name, which is the user's first and last name from the
          user's My Account profile.
        items:
          $ref: '#/definitions/FriendlyName'
        example:
          - locale: en-US
            value: alvaria user
      role:
        description: Via role of the User entity.
        type: string
        example: agent
      teamId:
        description: >-
          Alvaria-generated unique identifier for the team this user is a member of. The details for the team 
          can be retrieved through a call to the GET /teams endpoint.
        type: string
        example: 67455bfd-eb13-40a7-ba74-e632edec3106
      mfaStage:
        type: string
        enum:
          - UNKNOWN
          - ENROLLMENT
          - ENFORCE
        description: >-
          Mfa stage of a user: UNKNOWN is an initial mfa stage of a user,          
          in ENROLLMENT stage user is in the process of setting up MFA,
          in ENFORCE stage user is challenged MFA on login
        example: ENROLLMENT
      creationTime:
        format: date-time
        description: The time the user instance was created
        type: string
        example: "2020-09-11T23:19:49Z"
      lastModifiedTime:
        format: date-time
        description: The time of the most recent change to the user instance
        type: string
        example: "2020-10-18T16:05:52Z"
      lastLoginTime:
        format: date-time
        description: The time of the most recent login for the user instance
        type: string
        example: "2020-11-14T18:24:42Z"
  V3User:
    title: UserResponse
    type: object
    required:
      - kind
      - active
      - id
    properties:
      active:
        type: boolean
        description: Set to True if the User entity is available for use.
        example: true
        default: true
      kind:
        description: >-
          Identifier used by Alvaria&trade; Cloud components to serialize the payload
          of the results.
        type: string
        default: via#user
        example: via#user
      id:
        description: Alvaria-generated unique identifier for the user
        type: string
        example: 2049f439be17920
      email:
        description: Email address of the user
        type: string
        example: alvaria.user@orgname.com
      firstName:
        description: First name of the user
        type: string
        example: alvaria
      lastName:
        description: Last name of the user
        type: string
        example: user
      displayName:
        description: Display name of the user
        type: string
        example: alvaria user
      friendlyName:
        type: array
        description: >-
          Friendly name, which is the user's first and last name from the
          user's My Account profile.
        items:
          $ref: '#/definitions/FriendlyName'
        example:
          - locale: en-US
            value: alvaria user
      phoneNumber:
        type: string
        description: Phone number of the user
        example: "12345678"
      role:
        description: Via role of the User entity.
        type: string
        example: manager
      country:
        type: string
        description: Country code of the user
        example: US
      timezone:
        type: string
        description: Timezone of the user
        example: America/New_York
      language:
        type: string
        description: Preferred language of the user
        example: en
      team:
        type: string
        description: >-
           Alvaria-generated unique identifier for the team this user is a member of. The details for the team can be retrieved through a call to the 
           GET /teams/{ID} endpoint.
        example: 2dc7f7a5-98d0-4812-9895-0992dbecd434
      managerOf:
        type: array
        description: >-
          List of IDs for the teams this user is a manager of (if manager). The details for each team can be 
          retrieved through a call to the GET /teams/{ID} endpoint.
        items:
          type: string
        example: [2dc7f7a5-98d0-4812-9895-0992dbecd434, f718bd59-d647-4251-a2a2-a62324e8d559]
      entitlements:
        type: array
        description: The entitlements of the user
        items:
          type: string
        example: [viacoreinbound, viacoreoutreach, workforcemanagement]
      securityProfile:
        type: string
        description: >-
           The user's WFM Security profile key. Defines the set of permissions that determine which application 
           features a user can access within WFM. The details for this securityProfile can be retrieved through a call
           to the GET /wfminfo endpoint.
        example: "-979999789076"
      employeeFilterProfile:
        type: string
        description: >-
           The user's WFM employee filter profile key. Defines the set of permissions that determine which employee 
           records a user can access within WFM. The details for this employeeFilterProfile can be retrieved through a 
           call to the GET /wfminfo endpoint.
        example: "-979999789076"
      employeeId:
        type: string
        description: Unique, human-readable identifier for the WFM employee record associated with this user.
        example: "123456"
      orgEmail:
        type: string
        description: >-
          Email address of the user [maximum of 64 characters, contains a single @ character, 
          @ character not preceded by a dot character, valid characters [a-zA-Z0-9@$'-_.]].
          This email is used for MFA enrollment
        example: alvaria.user@orgname.com
      mfaStage:
        type: string
        enum:
          - UNKNOWN
          - ENROLLMENT
          - ENFORCE
        description: >-
          Mfa stage of a user: UNKNOWN is an initial mfa stage of a user,          
          in ENROLLMENT stage user is in the process of setting up MFA,
          in ENFORCE stage user is challenged MFA on login
        example: ENROLLMENT
      rdWebAccess:
        type: boolean
        description: >-
          Indicates whether user can have an access to RD Web. Field is ignored for non WFM users.
        example: false
        default: false
      creationTime:
        format: date-time
        description: The time the user instance was created
        type: string
        example: "2020-09-11T23:19:49Z"
      lastModifiedTime:
        format: date-time
        description: The time of the most recent change to the user instance
        type: string
        example: "2020-10-18T16:05:52Z"
      lastLoginTime:
        format: date-time
        description: The time of the most recent login for the user instance
        type: string
        example: "2020-11-14T18:24:42Z"
  V3UserItem:
    title: UserListItem
    type: object
    required:
      - kind
      - active
      - id
    properties:
      active:
        type: boolean
        description: Set to True if the User entity is available for use.
        example: true
        default: true
      kind:
        description: >-
          Identifier used by Alvaria&trade; Cloud components to serialize the payload
          of the results.
        type: string
        default: via#user
        example: via#user
      id:
        description: Alvaria-generated unique identifier for the user
        type: string
        example: 2049f439be17920
      email:
        description: Email address of the user
        type: string
        example: alvaria.user@orgname.com
      firstName:
        description: First name of the user
        type: string
        example: alvaria
      lastName:
        description: Last name of the user
        type: string
        example: user
      displayName:
        description: Display name of the user
        type: string
        example: alvaria user
      friendlyName:
        type: array
        description: >-
          Friendly name, which is the user's first and last name from the
          user's My Account profile.
        items:
          $ref: '#/definitions/FriendlyName'
        example:
          - locale: en-US
            value: alvaria user
      phoneNumber:
        type: string
        description: Phone number of the user
        example: "12345678"
      role:
        description: Via role of the User entity.
        type: string
        example: manager
      country:
        type: string
        description: Country code of the user
        example: US
      timezone:
        type: string
        description: Timezone of the user
        example: America/New_York
      language:
        type: string
        description: Preferred language of the user
        example: en
      team:
        type: string
        description: The name of the team the user is a member of
        example: "alphaTeam"
      managerOf:
        type: array
        description: >-
            List of team names this user is manager of (if manager)
        items:
          type: string
        example: ["alphaTeam","betaTeam"]
      entitlements:
        type: array
        description: The entitlements of the user
        items:
          type: string
        example: [viacoreinbound, viacoreoutreach, workforcemanagement]
      orgEmail:
        type: string
        description: >-
            Email address of the user, used for MFA enrollment
        example: alvaria.user@orgname.com
      mfaStage:
        type: string
        enum:
          - UNKNOWN
          - ENROLLMENT
          - ENFORCE
        description: >-
          Mfa stage of a user: UNKNOWN is an initial mfa stage of a user,          
          in ENROLLMENT stage user is in the process of setting up MFA,
          in ENFORCE stage user is challenged MFA on login
        example: ENROLLMENT
      creationTime:
        format: date-time
        description: The time the user instance was created
        type: string
        example: "2020-09-11T23:19:49Z"
      lastModifiedTime:
        format: date-time
        description: The time of the most recent change to the user instance
        type: string
        example: "2020-10-18T16:05:52Z"
      lastLoginTime:
        format: date-time
        description: The time of the most recent login for the user instance
        type: string
        example: "2020-11-14T18:24:42Z"
  FriendlyName:
    required:
      - locale
      - value
    properties:
      locale:
        type: string
        description: The IETF Language Tag.
        example: en-US
        minLength: 1
      value:
        type: string
        minLength: 1
        description: The Localized value of the Entity Name.
        example: andrea anderson
  BulkUserJobCollection:
    required:
      - jobs
      - totalItems
    type: object
    properties:
      jobs:
        type: array
        items:
          $ref: '#/definitions/BulkUserOperationResponse'
        example:
          - status: pending
            jobType: upload
            createdAt: ""
            createdBy: ""
            id: c9665020-5cfd-47ec-9079-7f1a3b4f3963
            upsert: false
            sendCompletionEmail: false
      totalItems:
        type: integer
        description: The total number of Entity instances existing in the system.
        example: 1
  BulkUserOperationResponse:
    title: BulkUserJob
    required:
      - status
      - jobType
      - createdAt
      - createdBy
      - id
      - upsert
      - sendCompletionEmail
    type: object
    properties:
      status:
        type: string
        description: Status of the Job
        default: pending
        example: pending
      jobType:
        description: Type of the Job
        type: string
        example: upload
      createdAt:
        description: Time of Job Creation
        type: string
        example: ""
      createdBy:
        description: User who created the Job
        type: string
        example: ""
      id:
        description: Alvaria-generated unique identifier for the Job
        type: string
        example: c9665020-5cfd-47ec-9079-7f1a3b4f3963
      upsert:
        description: Set to True if the operation was an Upsert.
        type: boolean
        example: false
      sendCompletionEmail:
        description: Set to True if an email will be sent on Bob completetion.
        type: boolean
        example: false
  V3WfmInfo:
    title: WFMInfoResponse
    type: object
    properties:
      securityProfiles:
        type: array
        description: Defines the set of permissions that determine the application features a user can access within WFM.
        items:
          $ref: '#/definitions/WFMProfile'
      employeeFilterProfiles:
        type: array
        description: Defines the set of permissions that determine the employee records a user can access within WFM.
        items:
          $ref: '#/definitions/WFMProfile'
      employeeIdSize:
        type: integer
        description: Defines the size limit in WFM for the employeeId field used in the create and update user requests
        example: 10
  WFMProfile:
    title: WFMProfile
    type: object
    properties:
      code:
        type: string
        description: Code value of the profile
        example: "LIMITED"
      description:
        type: string
        description: Description of the profile
        example: "Limited Access"
      key:
        type: string
        description: Unique WFM ID of the profile
        example: "-979999789076"
  JobStatusResponse:
    title: JobStatusResponse
    required:
      - status
      - jobType
      - createdAt
      - id
    type: object
    properties:
      status:
        type: string
        description: Status of the Job
        default: pending
        example: pending
      jobType:
        description: Type of the Job
        type: string
        example: upload
      createdAt:
        description: Time of Job Creation
        type: string
        example: ""
      id:
        description: Alvaria-generated unique identifier for the Job
        type: string
        example: c9665020-5cfd-47ec-9079-7f1a3b4f3963
      percentageDone:
        description: Indicator for what percentage of the Job is done.
        type: integer
        example: 50
      timeLeftSeconds:
        description: Unused
        type: string
        example: "0"
      location:
        description: Location for the Job Report.
        type: string
        example: "https://orgName.via.aspect-cloud.net/via/v3/organizations/orgName/userManagement/jobs/c9665020-5cfd-47ec-9079-7f1a3b4f3963/report"
      jobSummary:
        $ref: '#/definitions/MyaspectJobStats'
  MyaspectJobStats:
    title: MyaspectJobStats
    required:
      - pending
      - failed
      - total
      - expired
      - completed
    type: object
    properties:
      pending:
        type: integer
        description: Number of pending rows in Job
        default: 0
        example: 0
      failed:
        type: integer
        description: Number of failed rows in Job
        default: 0
        example: 0
      total:
        type: integer
        description: Number of total rows in Job
        default: 0
        example: 0
      expired:
        type: integer
        description: Number of expired rows in Job
        default: 0
        example: 0
      completed:
        type: integer
        description: Number of completed rows in Job
        default: 0
        example: 0
  V3TeamCollection:
    required:
      - kind
      - teams
      - totalItems
    type: object
    properties:
      kind:
        description: >-
          Identifier used by Alvaria&trade; Cloud components to serialize the payload
          of the results.
        type: string
        default: via#teamList
        example: via#teamList
      teams:
        type: array
        items:
          $ref: '#/definitions/V3Team'
        example:
          - active: true
            kind: via#team
            id: 2dc7f7a5-98d0-4812-9895-0992dbecd434
            friendlyName:
              - locale: en-US
                value: alphaTeam
            description: Customer Support Team 1
          - active: true
            kind: via#team
            id: f718bd59-d647-4251-a2a2-a62324e8d559
            friendlyName:
              - locale: en-US
                value: betaTeam
            description: Customer Support Team 2
      totalItems:
        type: integer
        description: The total number of Entity instances existing in the system.
        example: 2
  V3Team:
    type: object
    required:
      - kind
      - active
      - id
      - friendlyName
      - description
    properties:
      kind:
        description: >-
          Identifier used by Alvaria&trade; Cloud components to serialize the payload
          of the results.
        type: string
        default: via#team
        example: via#team
      active:
        type: boolean
        description: Set to True if the entity is available for use.
        example: true
        default: true
      id:
        description: Alvaria-generated unique identifier for the Entity
        type: string
        example: 2dc7f7a5-98d0-4812-9895-0992dbecd434
      friendlyName:
        type: array
        minItems: 1
        items:
          $ref: '#/definitions/FriendlyName'
        description: Unique descriptive name for this Team instance
        example:
          - locale: en-US
            value: team1
      description:
        type: string
        description: Description of the Team
        example: Customer Support Team 1
        default: ""
  V3CreateTeamRequest:
    type: object
    required:
      - name
    properties:
      name:
        type: string
        description: >-
          Name of the Team. Must be unique across the org - Maximum 63 chars, valid characters [A-Za-z0-9_-], 
          cannot start with characters [0-9_-]
        example: team1
      description:
        type: string
        description: Description of the Team
        example: Customer Support Team 1
        default: ""
  V3UpdateTeamRequest:
    type: object
    required:
      - name
    properties:
      name:
        type: string
        description: >-
          Name of the Team. Must be unique across the org - Maximum 63 chars, valid characters [A-Za-z0-9_-], 
          cannot start with characters [0-9_-]
        example: team1
      description:
        type: string
        description: Description of the Team
        example: Customer Support Team 1
        default: ""
  V3RemoveUserRequest:
    type: object
    required:
      - managerToAssignAssets
    properties:
      managerToAssignAssets:
        type: string
        description: >- 
          Email address or unique identifier of a manager user to assign open assets of the deleted user to. 
          The selected manager user must be a different user to the one being deleted.
        example: alvaria.manager@orgname.com
  V3UserSuspendRequest:
    type: object
    required:
      - suspend
    properties:
      suspend:
        type: boolean
        description: >-
          Flag indicating whether to suspend (true) or unsuspend (false) a user. A user must have an 
          'Active' status in order to be suspended and an 'Inactive' status in order to be unsuspended.
        example: true
  V3CreateUserRequest:
    type: object
    required:
      - email
      - firstName
      - lastName
      - displayName
      - phoneNumber
      - role
      - country
      - timezone
      - language
      - password
    properties:
      email:
        type: string
        description: >-
          Email address of the user - maximum of 64 characters, contains a single @ character, 
          @ character not preceded by a dot character, valid characters [a-zA-Z0-9@$'-_.]
        example: alvaria.user@orgname.com
      firstName:
        type: string
        description: First name of the user - non-empty, maximum 60 characters, must not contain the following characters 
          [/*()&![]"\#%^{}]
        example: alvaria
      lastName:
        type: string
        description: Last name of the user - non-empty, maximum 60 characters, must not contain the following characters 
          [/*()&![]"\#%^{}]
        example: user
      displayName:
        type: string
        description: Display name of the user - maximum 500 characters
        example: alvaria user
      phoneNumber:
        type: string
        description: Phone number of the user - numeric [0-9] characters only, contains between 1 to 20 characters
        example: "12345678"
      role:
        type: string
        description: Via role of the user - [useradministrator, developer, manager, teamlead, agent]
        example: manager
      country:
        type: string
        description: Country code of the user - [US, GB, AR, AU, AT, BE, BR, BG, CA, CL, CN, CO, CR, HR, CY, CZ, DK, 
          DO, SV, EE, FI, FR, DE, GR, GT, HN, HU, IN, IE, IT, JM, JP, LV, LT, LU, MT, MX, NL, NI, NO, PA, PE, PH, PL,
          PT, RO, SK, SI, ES, SE, CH, TT, VE]
        example: US
      timezone:
        type: string
        description: Timezone of the user - [Pacific/Honolulu, America/Anchorage, America/Los_Angeles, 
          America/Phoenix, America/Denver, America/Chicago, America/Mexico_City, America/New_York, 
          America/Halifax, America/Puerto_Rico, America/St_Johns, America/Argentina/Buenos_Aires, America/Sao_Paulo, 
          America/Bogota, Atlantic/South_Georgia, Atlantic/Cape_Verde, Europe/London, Europe/Berlin, Africa/Maputo, 
          Africa/Cairo, EET, Africa/Nairobi, Asia/Riyadh, Asia/Yerevan, Asia/Kolkata, Asia/Dhaka, Asia/Ho_Chi_Minh, 
          Asia/Shanghai, Australia/Perth, Asia/Seoul, Asia/Tokyo, Australia/Darwin, Australia/Sydney, 
          Pacific/Guadalcanal, Pacific/Auckland]
        example: America/New_York
      language:
        type: string
        description: Preferred language of the user - [ca, hr, cs, da, nl, en, et, fi, fr, de, el, hu, is, ga, it, jp, 
           lv, lt, mt, no, pl, pt, ro, es]
        example: en
      team:
        type: string
        description: >-
          Alvaria-generated unique identifier for the team this user is a member of. Team ID values to use can be 
          retrieved through a call to the GET /teams endpoint.
        example: 2dc7f7a5-98d0-4812-9895-0992dbecd434
        default: ""
      managerOf:
        type: array
        description: >-
          List of Alvaria-generated unique identifiers for the teams the user manages (if manager). The Team ID values 
          to use can be retrieved through a call to the GET /teams endpoint.
        items:
          type: string
        example: [2dc7f7a5-98d0-4812-9895-0992dbecd434, f718bd59-d647-4251-a2a2-a62324e8d559]
        default: []
      password:
        type: string
        description: >-
          The password of the user - minimum of 14 characters, 1 uppercase letter, 1 lowercase letter, 
          at least 1 special character from }{[]!"$%^&*()@~=+;:?>/.,_-`#<
          and not matching either the username, firstname, lastname fields. This field is optional if the 
          Organizations ignoreNewUserPwd configuration value is explicitly set to true (default: false) 
          in which case any value supplied will be ignored and a random password will be generated for the user
        example: "aZcX!2E4$6wDyB"
      entitlements:
        type: array
        description: >-
          Entitlements to assign to the user - [motivate, motivateactive, performancemanagement, qualitymanagement, 
          qualitymanagementscreencapture,qualitymanagementvoicerecording, viacoreinbound, viacoreoutreach, 
          workforcemanagement, workforcemanagementencompass]
        items:
          type: string
        example: [viacoreinbound,viacoreoutreach,workforcemanagement]
        default: []
      securityProfile:
        type: string
        description: >-
          The user's WFM Security profile key. Defines the set of permissions that determine which application 
          features a user can access within WFM. Required field when a wfm entitlement (workforcemanagement, 
          workforcemanagementencompass) is included as a user entitlement and role is either (agent, teamlead, manager).
          A list of valid security profiles can be retrieved through a call to the GET /wfminfo endpoint.
        example: "-979999789076"
        default: ""
      employeeFilterProfile:
        type: string
        description: >-
          The user's WFM employee filter profile key. Defines the set of permissions that determine which employee 
          records a user can access within WFM. Required field when a wfm entitlement (workforcemanagement, 
          workforcemanagementencompass) is included as a user entitlement and role is either (agent, teamlead, manager).
          A list of valid employee filter profiles can be retrieved through a call to the GET /wfminfo endpoint.
        example: "-979999789076"
        default: ""
      employeeId:
        type: string
        description: >-
          An optional, unique, human-readable employee identification code for a WFM user. Only 'agent' users with wfm 
          entitlements (workforcemanagement, workforcemanagementencompass) assigned can have an employeeId value set 
          otherwise this value will be ignored. If supplied then an employee record will be created in WFM and linked 
          to the new user. If omitted no employee record will be created and the WFM user will not be activated. 
          The maximum length for an employeeId can be retrieved through a call to the GET /wfminfo endpoint.
        example: "123456"
        default: ""
      orgEmail:
        type: string
        description: >-
          Email address of the user - maximum of 64 characters, contains a single @ character, 
          @ character not preceded by a dot character, valid characters [a-zA-Z0-9@$'-_.]].
          This email is used for MFA enrollment
        example: alvaria.user@orgname.com
        default: ""
      rdWebAccess:
        type: boolean
        description: >-
          Indicates whether user can have an access to RD Web. Field is ignored for non WFM users.
        example: false
        default: false
  V3UpdateUserRequest:
    type: object
    required:
      - email
      - firstName
      - lastName
      - displayName
      - phoneNumber
      - role
      - country
      - timezone
      - language
    properties:
      email:
        type: string
        description: >-
          Email address of the user - maximum of 64 characters, contains a single @ character, 
          @ character not preceded by a dot character, valid characters [a-zA-Z0-9@$'-_.]
        example: alvaria.user@orgname.com
      firstName:
        type: string
        description: First name of the user - non-empty, maximum 60 characters, must not contain the following characters
          [/*()&![]"\#%^{}]
        example: alvaria
      lastName:
        type: string
        description: Last name of the user - non-empty, maximum 60 characters, must not contain the following characters
          [/*()&![]"\#%^{}]
        example: user
      displayName:
        type: string
        description: Display name of the user - maximum 500 characters
        example: alvaria user
      phoneNumber:
        type: string
        description: Phone number of the user - numeric [0-9] characters only, contains between 1 to 20 characters
        example: "12345678"
      role:
        type: string
        description: Via role of the user - [useradministrator, developer, manager, teamlead, agent]
        example: manager
      country:
        type: string
        description: Country code of the user - [US, GB, AR, AU, AT, BE, BR, BG, CA, CL, CN, CO, CR, HR, CY, CZ, DK,
          DO, SV, EE, FI, FR, DE, GR, GT, HN, HU, IN, IE, IT, JM, JP, LV, LT, LU, MT, MX, NL, NI, NO, PA, PE, PH, PL,
          PT, RO, SK, SI, ES, SE, CH, TT, VE]
        example: US
      timezone:
        type: string
        description: Timezone of the user - [Pacific/Honolulu, America/Anchorage, America/Los_Angeles,
          America/Phoenix, America/Denver, America/Chicago, America/Mexico_City, America/New_York,
          America/Halifax, America/Puerto_Rico, America/St_Johns, America/Argentina/Buenos_Aires, America/Sao_Paulo,
          America/Bogota, Atlantic/South_Georgia, Atlantic/Cape_Verde, Europe/London, Europe/Berlin, Africa/Maputo,
          Africa/Cairo, EET, Africa/Nairobi, Asia/Riyadh, Asia/Yerevan, Asia/Kolkata, Asia/Dhaka, Asia/Ho_Chi_Minh,
          Asia/Shanghai, Australia/Perth, Asia/Seoul, Asia/Tokyo, Australia/Darwin, Australia/Sydney,
          Pacific/Guadalcanal, Pacific/Auckland]
        example: America/New_York
      language:
        type: string
        description: Preferred language of the user - [ca, hr, cs, da, nl, en, et, fi, fr, de, el, hu, is, ga, it, jp,
          lv, lt, mt, no, pl, pt, ro, es]
        example: en
      team:
        type: string
        description: >-
          Alvaria-generated unique identifier for the team this user is a member of. Team ID values to use can be 
          retrieved through a call to the GET /teams endpoint.
        example: 2dc7f7a5-98d0-4812-9895-0992dbecd434
        default: ""
      managerOf:
        type: array
        description: >-
          List of Alvaria-generated unique identifiers for the teams the user manages (if manager). The Team ID values 
          to use can be retrieved through a call to the GET /teams endpoint.
        items:
          type: string
        example: [2dc7f7a5-98d0-4812-9895-0992dbecd434, f718bd59-d647-4251-a2a2-a62324e8d559]
        default: []
      entitlements:
        type: array
        description: >-
          Entitlements to assign to the user - [motivate, motivateactive, performancemanagement, qualitymanagement, 
          qualitymanagementscreencapture,qualitymanagementvoicerecording, viacoreinbound, viacoreoutreach, 
          workforcemanagement, workforcemanagementencompass]
        items:
          type: string
        example: [viacoreinbound,viacoreoutreach,workforcemanagement]
        default: []
      securityProfile:
        type: string
        description: >-
          The user's WFM Security profile key. Defines the set of permissions that determine which application 
          features a user can access within WFM. Required field when a wfm entitlement (workforcemanagement, 
          workforcemanagementencompass) is included as a user entitlement and role is either (agent, teamlead, manager).
          A list of valid security profiles can be retrieved through a call to the GET /wfminfo endpoint.
        example: "-979999789076"
        default: ""
      employeeFilterProfile:
        type: string
        description: >-
          The user's WFM employee filter profile key. Defines the set of permissions that determine which employee 
          records a user can access within WFM. Required field when a wfm entitlement (workforcemanagement, 
          workforcemanagementencompass) is included as a user entitlement and role is either (agent, teamlead, manager).
          A list of valid employee filter profiles can be retrieved through a call to the GET /wfminfo endpoint.
        example: "-979999789076"
        default: ""
      employeeId:
        type: string
        description: >-
          An optional, unique, human-readable employee identification code for a WFM user. Only 'agent' users with wfm 
          entitlements (workforcemanagement, workforcemanagementencompass) assigned can have an employeeId value set 
          otherwise this value will be ignored. If supplied then an employee record will be created in WFM and linked 
          to the new user. If omitted no employee record will be created and the WFM user will not be activated. 
          The maximum length for an employeeId can be retrieved through a call to the GET /wfminfo endpoint.
        example: "123456"
        default: ""
      orgEmail:
        type: string
        description: >-
          Email address of the user - maximum of 64 characters, contains a single @ character, 
          @ character not preceded by a dot character, valid characters [a-zA-Z0-9@$'-_.]].
          This email is used for MFA enrollment
        example: alvaria.user@orgname.com
        default: ""
      rdWebAccess:
        type: boolean
        description: >-
          Indicates whether user can have an access to RD Web. Field is ignored for non WFM users.
        example: false
        default: false
  V4RemoveUserRequest:
    type: object
    required:
      - managerToAssignAssets
    properties:
      managerToAssignAssets:
        type: string
        description: >- 
          Email address or unique identifier of a manager user to assign open assets of the deleted user to. 
          The selected manager user must be a different user to the one being deleted.
        example: alvaria.manager@orgname.com
  V4RemoveUserResponse:
    title: V4RemoveUserResponse
    required:
      - message
      - id
      - checkStatusEndpoint
    type: object
    properties:
      message:
        type: string
        description: Delete operation result
        default: User deletion request accepted
        example: User deletion request accepted
      id:
        type: string
        description: ID of the user being removed
        example: user123
      checkStatusEndpoint:
        description: Endpoint where the actual user state can be tracked; returns 404 once deleted
        type: string
        example: /users/user123
parameters:
  authorization:
    name: Authorization
    in: header
    description: >-
      Authentication token with the value: 'Bearer {accessToken}', where
      {accessToken} was returned from a call to the authorization endpoint
    required: true
    type: string
  x-api-key:
    name: x-api-key
    in: header
    description: Alvaria-provided value used to track API endpoint usage.
    required: true
    type: string
  accept:
    name: Accept
    in: header
    description: Indicates which content types, expressed as MIME types, the client is able to understand.
    required: true
    type: string
    default: "application/json"
  orgId:
    name: orgId
    in: path
    description: Name of a customer organization.
    required: true
    type: string
  teamId:
    name: teamId
    in: path
    description: >-
      Alvaria-generated unique identifier for the team instance. The teamId value to use can be resolved 
      through a call to Get Teams endpoint.
    required: true
    type: string
  userId:
    name: userId
    in: path
    description: >-
      Alvaria-generated unique identifier for the user. The userId value to use can be resolved
      through a call to the GET /users endpoint.
    required: true
    type: string
  emailFilterParam:
    name: email
    in: query
    description: Filters the list based on the email of a user - single value, case-insensitive substring match.
    type: string
  lastNameFilterParam:
    name: lastName
    in: query
    description: Filters the list based on the last name of a user - single value, case-insensitive substring match.
    type: string
  phoneNumberFilterParam:
    name: phoneNumber
    in: query
    description: Filters the list based on the phoneNumber of a user - single value, case-insensitive substring match.
    type: string
  telephoneNumberFilterParam:
    name: telephoneNumber
    in: query
    description: Filters the list based on the phoneNumber of a user - single value, case-insensitive substring match.
    type: string
  givenNameFilterParam:
    name: givenName
    in: query
    description: >-
      __[Deprecated]__ Filters the list based on the given name of a user - single value, case-insensitive substring match. 
      The 'firstName' filter parameter should be used instead.
    type: string
  firstNameFilterParam:
    name: firstName
    in: query
    description: Filters the list based on the first name of a user - single value, case-insensitive substring match.
    type: string
  snFilterParam:
    name: sn
    in: query
    description: >-
      __[Deprecated]__ Filters the list based on the surname of a user - single value, case-insensitive substring match. 
      The 'lastName' filter parameter should be used instead.
    type: string
  managerOfFilterParam:
    name: managerOf
    in: query
    description: >- 
      Filters the list based on the names of teams user manages - single value, case-insensitive substring match or 
      * to indicate that user should manage at least one team.
    type: string
  uiStatusFilterParam:
    name: uiStatus
    in: query
    description: Filters the list based on the status of a user - single value, case-insensitive substring match
    type: string
  corpEmailFilterParam:
    name: corpEmail
    in: query
    description: Filters the list based on the organization email of a user - single value, case-insensitive substring match
    type: string
  roleFilterParam:
    name: role
    in: query
    description: Filters the list based on the role of a user - single value, case-insensitive substring match.
    type: string
  teamFilterParam:
    name: team
    in: query
    description: Filters the list based on the team of a user - single value, case-insensitive substring match.
    type: string
  maxResults:
    name: maxResults
    in: query
    description: >-
      Maximum results. This is used to specify the maximum number of records to
      return in the result set. You can use this to set a result set limit that
      is less than the system/API-specific limit.
    type: integer
    default: 50
  startIndex:
    name: startIndex
    in: query
    description: >-
      Index of the starting record. This is used to set the beginning record for
      the result set when multiple GET Collection requests are required due to
      the pagination of a large result set.
    type: integer
    default: 0
  teamNameFilterParam:
    name: name
    in: query
    description: Filters the list based on the name of a team - single value, case-insensitive substring match.
    type: string
  jobId:
    name: jobId
    in: path
    description: >-
      Alvaria-generated unique ID for a Bulk Operation Job.
    required: true
    type: string
  V3CreateTeamRequest:
    in: body
    name: createTeamRequest
    description: The team to create
    required: true
    schema:
      $ref: '#/definitions/V3CreateTeamRequest'
  V3UpdateTeamRequest:
    in: body
    name: updateTeamRequest
    description: The team to create
    required: true
    schema:
      $ref: '#/definitions/V3UpdateTeamRequest'
  V3RemoveUserRequest:
    in: body
    name: v3RemoveUserRequest
    description: The user deletion request
    required: true
    schema:
      $ref: '#/definitions/V3RemoveUserRequest'
  V3UserSuspendRequest:
    in: body
    name: suspendStatusUpdateRequest
    description: The suspend status update request
    required: true
    schema:
      $ref: '#/definitions/V3UserSuspendRequest'
  V3CreateUserRequest:
    in: body
    name: createUserRequest
    description: The create user request
    required: true
    schema:
      $ref: '#/definitions/V3CreateUserRequest'
  V3UpdateUserRequest:
    in: body
    name: updateUserRequest
    description: The update user request
    required: true
    schema:
      $ref: '#/definitions/V3UpdateUserRequest'
  V4RemoveUserRequest:
    in: body
    name: v4RemoveUserRequest
    description: The user deletion request
    required: true
    schema:
      $ref: '#/definitions/V4RemoveUserRequest'
securityDefinitions:
  oauth:
    type: oauth2
    flow: application
    description: |-
      Oauth2 security definition describing client credentials grant. auth_server_domain should be modified in
      a generated client code to match your region and organization name i.e. auth_server_domain should be replaced
      with your regional endpoint and orgId should be replaced with your organization alias. Please, refer to a table
      below in order to pick correct url for access_token endpoint
      
      __Table 2__: access_token endpoints for each region
      | **Cloud Vendor**  | **Region (where applicable)** | **Url** |
      | --- | --- | --- |
      | Amazon Web Service (AWS) | US | https://myaspect.id.aspect-cloud.net/tokenservice/oauth2/access_token?realm=orgId |
      | Amazon Web Service (AWS) | Europe | https://myaspect.eu.id.aspect-cloud.net/tokenservice/oauth2/access_token?realm=orgId |
      | Amazon Web Service (AWS) | UK | https://myaspect.uk.id.aspect-cloud.net/tokenservice/oauth2/access_token?realm=orgId |
      | Amazon Web Service (AWS) | Canada | https://myaspect.ca.id.aspect-cloud.net/tokenservice/oauth2/access_token?realm=orgId |
      | Amazon Web Service (AWS) | US-East (tri) | https://myaccount.tri1.wss.alvaria.cloud/tokenservice/oauth2/access_token?realm=orgId |
      | Microsoft Azure |  | https://myaspect.us-a.id.aspect-cloud.net/tokenservice/oauth2/access_token?realm=orgId |
      | Google Cloud |  | https://myaccount.dsm.sre.alvaria.cloud/tokenservice/oauth2/access_token?realm=orgId |
    tokenUrl: 'https://auth_server_domain/tokenservice/oauth2/access_token?realm=orgId'
    scopes:
      myaccount.users.list: Can list users
      myaccount.users.create: Can create users
      myaccount.users.view: Can view users
      myaccount.users.modify: Can modify users
      myaccount.users.delete: Can delete users
      myaccount.users.suspend: Can suspend users
      myaccount.users.list.managed.teams: Can list teams managed by a user
      myaccount.users.bulk.modify.list: Can export users in csv format
      myaccount.users.bulk.status.list: Can list submitted bulk jobs
      myaccount.users.bulk.create: Can upload users in csv format for them to be created
      myaccount.users.bulk.modify: Can upload users in csv format for them to be modified
      myaccount.users.bulk.delete: Can upload users in csv format for them to be delete
      myaccount.users.bulk.status: Can view status of a particular bulk job
      myaccount.users.bulk.report: Can view report of a particular bulk job
      myaccount.teams.list: Can list teams
      myaccount.teams.create: Can create teams
      myaccount.teams.view: Can view teams
      myaccount.teams.modify: Can modify teams
      myaccount.teams.delete: Can delete teams
      myaccount.teams.list.members: Can list team members
      myaccount.teams.list.managers: Can list team managers
      myaccount.users.view.wfm: Can view Workforce Management security and employee profiles
  apiKey:
    type: apiKey
    in: header
    name: x-api-key
tags:
  - name: Bulk Operations
  - name: Users
  - name: Teams
  - name: Workforce