openapi: 3.0.1
info:
  title: Operator Management API
  description: The Operator Management API is a REST API that enables you to create,
    manage, and return operators for a WatchGuard account.
  version: 1.1.5
  contact:
    name: API Support
    url: https://www.watchguard.com/wgrd-support/contact-support
  termsOfService: 
    https://www.watchguard.com/help/docs/api/Content/en-US/license_agreement.html?cshid=18007
paths:
  /health:
    get:
      description: Checks the health of the service.
      summary: Checks the health of the service.
      responses:
        '200':    # status code
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Health'
        '500':
          description: Server Error
  /v1/operators:
    post:
      tags:
        - Operator Management
      operationId: OperatorsCreation
      description: Creates new operators in the specified account. In the request
        body, specify the details of the operators to create.
      summary: Creates operators in an account.
      requestBody:
        description: Request body that includes details of the operators to create.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddOperators'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddOperatorsSuccess'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddOperatorsBadRequest'
        '500':
          description: Server Error
    patch:
      tags:
        - Operator Management
      description: Updates existing operators in the specified account. In the request
        body, specify the details of the operators to update.
      summary: Updates operators in an account.
      requestBody:
        description: Request body that includes details of the operators to update.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOperators'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateOperatorsSuccess'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateOperatorsBadRequest'
        '500':
          description: Server Error
  /v1/DeleteOperators:
    post:
      tags:
        - Operator Management
      description: Deletes operators from the specified account. In the request body,
        specify the details of the operators to delete.
      summary: Deletes operators from an account.
      requestBody:
        description: Request body that includes details of the operators to delete.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteOperators'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteOperatorsSuccess'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteOperatorsBadRequest'
        '500':
          description: Server Error
  /v1/TransactionStatus:
    get:
      tags:
        - Get Transaction Status
      operationId: TransactionStatus
      description: To get the status of a transaction, specify the transaction ID
        in the query parameter.
      summary: Returns the status of a transaction.
      parameters:
        - $ref: '#/components/parameters/transaction_id'
      responses:
        '200': # status code
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidSuccessTransactionDetails'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionStatusBadRequest'
        '500':
          description: Server Error
  /v1/OperatorsByAccountId:
    get:
      tags:
        - Get Operators for an Account
      operationId: GetAccountOperators
      description: To get details of all operators for an account, specify the account
        ID in the query parameter.
      summary: Returns operators for an account ID.
      parameters:
        - $ref: '#/components/parameters/account_id'
      responses:
        '200': # status code
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidSuccessOperatorsDetails'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatorDetailsBadRequest'
        '500':
          description: Server Error
components:
  parameters:
    transaction_id:
      name: transaction_id
      in: query
      description: 'Transaction ID. Example: 4eb735c2-7640-4aw2-43a3-f429382b8bax'
      required: true
      schema:
        type: string
    account_id:
      name: account_id
      in: query
      description: 'Account ID to return operators for. Example: ACC-1234567 or WGC-1234-456'
      required: true
      schema:
        type: string
  schemas:
    Health:
      type: object
      properties:
        status:
          type: string
          example: success
        healthy:
          type: boolean
          default: false
    AddOperatorsSuccess:
      type: object
      properties:
        transaction_id:
          type: string
          example: 4eb735c2-7640-4aw2-43a3-f429382b8bax
        status:
          type: string
          example: success
        message:
          type: string
          example: Add operators operation started.
    AddOperatorsBadRequest:
      type: object
      properties:
        message:
          type: string
          example: Invalid request body.
    TransactionStatusBadRequest:
      type: object
      properties:
        message:
          type: string
          example: 'Missing required request parameters: [transaction_id]'
    OperatorDetailsBadRequest:
      type: object
      properties:
        message:
          type: string
          example: 'Missing required request parameters: [account_id]'
    UpdateOperatorsSuccess:
      type: object
      properties:
        transaction_id:
          type: string
          example: 4eb735c2-7640-4aw2-43a3-f429382b8bax
        status:
          type: string
          example: success
        message:
          type: string
          example: Update operators operation started.
    UpdateOperatorsBadRequest:
      type: object
      properties:
        message:
          type: string
          default: Invalid request body.
    DeleteOperatorsSuccess:
      type: object
      properties:
        transaction_id:
          type: string
          example: 4eb735c2-7640-4aw2-43a3-f429382b8bax
        status:
          type: string
          example: success
        message:
          type: string
          example: Delete operators operation started.
    DeleteOperatorsBadRequest:
      type: object
      properties:
        message:
          type: string
          default: Invalid request body.
    Success:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          example: success
    ValidSuccessTransactionDetails:
      type: object
      properties:
        transaction_status:
          type: array
          items:
            $ref: '#/components/schemas/TransactionDetail'
        status:
          type: string
          example: success
    TransactionDetail:
      type: object
      properties:
        status:
          type: string
          example: FAILED
        username:
          type: string
          example: Freeman_Schaefer
        error:
          type: string
          example: Email address already exists.
    OperatorDetail:
      type: object
      properties:
        accountId:
          type: string
          example: WGC-1-f122ac292db84f3as232
          description: Account ID of the account the operator belongs to.
        email:
          type: string
          example: mrodriguez@example.com
          description: Email address of the operator.
        firstName:
          type: string
          example: Maria
          description: First name of the operator.
        lastName:
          type: string
          example: Rodriguez
          description: Last name of the operator.
        phone:
          type: string
          example: '4705196770'
          description: Phone number of the operator.
        mfa:
          type: string
          example: Disabled
          description: MFA status of the operator. This can be Enabled or Disabled.
        username:
          type: string
          example: mrodriguez
          description: User name of the operator.
    ValidSuccessOperatorsDetails:
      type: object
      properties:
        result:
          type: array
          items:
            $ref: '#/components/schemas/OperatorDetail'
        status:
          type: string
          example: success
    AddOperators:
      type: array
      items:
        $ref: '#/components/schemas/AddOperator'
    AddOperator:
      type: object
      required:
        - username
        - accountId
        - firstName
        - lastName
        - email
        - phone
        - role
      properties:
        username:
          type: string
          example: mrodriguez
          description: User name of the operator to delete. This must be between 5
            and 65 characters and can only contain letters, numbers, periods ".",
            hyphens "-", underscores "_" and pluses "+".
        accountId:
          type: string
          example: WGC-1-f122ac292db84f3as232
          description: Account ID of the account to create the operator in.
        firstName:
          type: string
          example: Maria
          description: First name of the operator. This can only contain alphanumeric
            characters.
        lastName:
          type: string
          example: Rodriguez
          description: Last name of the operator. This can only contain alphanumeric
            characters.
        email:
          type: string
          example: mrodriguez@example.com
          description: Email address of the operator.
        password:
          type: string
          example: AbcdAbcd123@
          description: Operator password. The password must be at least 12 characters
            long and include a lowercase letter, uppercase letter, number, and symbol.
            Do not use <, >, emojis, or spaces. If a password is not specified in
            the request body, then WatchGuard sends a password reset email to the
            email address specified in the request body for the operator.
        phone:
          type: string
          example: '4705196770'
          description: Phone number of the operator. This must be between 6 and 40
            characters and can only contain numbers.
        role:
          type: string
          example: NO_ACCESS
          description: Role to assign to the operator for the account.
          enum: [OWNER, AUDITOR, SALES, HELPDESK, ADMINISTRATOR, ANALYST, OBSERVER,
            NO_ACCESS]
    UpdateOperators:
      type: array
      items:
        $ref: '#/components/schemas/UpdateOperator'
    UpdateOperator:
      type: object
      required:
        - username
        - accountId
      properties:
        username:
          type: string
          example: mrodriguez
          description: User name of the operator to update. This must be between 5
            and 65 characters and can only contain letters, numbers, periods ".",
            hyphens "-", underscores "_" and pluses "+".
        accountId:
          type: string
          example: WGC-1-f122ac292db84f3as232
          description: Account ID of the account to update the operator in.
        firstName:
          type: string
          example: Maria
          description: First name of the operator. This can only contain alphanumeric
            characters.
        lastName:
          type: string
          example: Rodriguez
          description: Last name of the operator. This can only contain alphanumeric
            characters.
        phone:
          type: string
          example: '4705196770'
          description: Phone number of the operator. This must be between 6 and 40
            characters and can only contain numbers.
        role:
          type: string
          example: NO_ACCESS
          description: Role to assign to the operator for the account.
          enum: [OWNER, AUDITOR, SALES, HELPDESK, ADMINISTRATOR, ANALYST, OBSERVER,
            NO_ACCESS]
    DeleteOperators:
      type: array
      items:
        $ref: '#/components/schemas/DeleteOperator'
    DeleteOperator:
      type: object
      required:
        - username
        - accountId
      properties:
        username:
          type: string
          default: mrodriguez
          description: User name of the operator to delete. This must be between 5
            and 65 characters and can only contain letters, numbers, periods ".",
            hyphens "-", underscores "_" and pluses "+".
        accountId:
          type: string
          default: WGC-1-f122ac292db84f3as232
          description: Account ID of the account to delete the operator from.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: WatchGuard-API-Key
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
servers:
  - url: https://api.usa.cloud.watchguard.com/rest/platform/operator-mgmt
    description: Prod USA Region
  - url: https://api.deu.cloud.watchguard.com/rest/platform/operator-mgmt
    description: Prod DEU region
  - url: https://api.jpn.cloud.watchguard.com/rest/platform/operator-mgmt
    description: Prod JPN region
security:
  - ApiKeyAuth: []
    BearerAuth: []
externalDocs:
  description: Additional documentation
  url: https://www.watchguard.com/help/docs/api/Content/en-US/home.html
