openapi: 3.0.0
info:
  title: Allocations API
  description: REST API for Allocations.
  version: 2.3.13
  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: HealthCheck URL
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/healthResponse'

  /v2/{accountId}/assets:
    post:
      tags:
        - Allocation v2
      summary: Allocate an asset to a managed account.
      description: Allocate an asset to a managed account.
      parameters:
        - name: accountId
          description: Identifies the WatchGuard Cloud Service Provider account to
            allocate assets for.
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/accountId'
      requestBody:
        description: Request body that includes the asset object to allocate to the
          managed account.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/assetObject'
            examples:
              Core Only Term:
                $ref: '#/components/examples/CoreOnlyTerm'
              Core Only Subscription:
                $ref: '#/components/examples/CoreOnlySubscription'
              Core with modules:
                $ref: '#/components/examples/CoreTermwithmodules'
              Linked to License:
                $ref: '#/components/examples/LinkedToLicense'
              Firebox:
                $ref: '#/components/examples/Firebox'
      responses:
        200:
          description: The allocation was created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createUpdateSuccessResponse'
              example:
                success: true
        default:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
    delete:
      summary: Deallocate an asset from a managed account.
      description: Remove an allocated asset from a managed account.
      tags:
        - Allocation v2
      parameters:
        - name: accountId
          description: Identifies the WatchGuard Cloud Service Provider account to
            allocate assets for.
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/accountId'
        - in: query
          name: accountId
          description: Identifies the WatchGuard Cloud account to deallocate an asset
            from.
          required: true
          schema:
            $ref: '#/components/schemas/accountId'
        - in: query
          name: productName
          description: |
            Product name. For Linked to License allocations, specify the name of the core product.
          required: true
          schema:
            $ref: '#/components/schemas/productName'
        - in: query
          name: allocationType
          description: Allocation type. This parameter is required for software products.
          required: false
          schema:
            $ref: '#/components/schemas/allocationType'
        - in: query
          name: serialOrLicense
          description: |
            License key or serial number. This parameter is required for hardware devices and for Linked to License deallocations.
          required: false
          schema:
            $ref: '#/components/schemas/serialOrLicense'
      responses:
        204:
          description: The allocation was deleted successfully.
        default:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
  /v2/{accountId}/assets/productName/{productName}/allocationType/{allocationType}:
    parameters:
      - name: accountId
        description: Identifies the WatchGuard Cloud Service Provider account to update
          allocations for.
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/accountId'
      - name: productName
        description: Product name of the existing asset allocation to update.
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/productName'
      - name: allocationType
        description: Allocation type of the existing asset allocation to update.
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/allocationType'
    put:
      tags:
        - Allocation v2
      summary: |
        Update an existing allocation for a software product.

      description: |
        For software products, you can update the quantity, allocationExpiryDate, allocationExpiryType of an existing allocation.

        accountId, productName, and allocationType are required in the request body.

        Use the same productName and/or allocationType in the request body to update allocationExpiryDate, allocationExpiryType, and quantity.

        Use a new productName and/or allocationType in the request body to update those values. The serialOrLicense is required when allocationType is linked_to_license.

        For WatchGuard Endpoint Security products that support modules, when you update an allocation for a managed Subscriber account or your own Service Provider account, you must include modules in the request.

        For a managed Service Provider account, you can include a single productName or single module to update.
      requestBody:
        description: Request body that includes the allocated asset to update.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/assetUpdateObject'
            examples:
              Core Only Term:
                $ref: '#/components/examples/CoreOnlyTerm'
              Core with modules:
                $ref: '#/components/examples/CoreTermwithmodules'
              Linked to License:
                $ref: '#/components/examples/LinkedToLicense'
      responses:
        200:
          description: The allocation was updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createUpdateSuccessResponse'
              example:
                success: true
        default:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
  /v2/{accountId}/assets/productName/{productName}/serialOrLicense/{serialOrLicense}:
    parameters:
      - name: accountId
        description: Identifies the WatchGuard Cloud Service Provider account to update
          allocations for.
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/accountId'
      - name: productName
        description: Product name of the existing asset allocation to update.
        in: path
        required: true
        schema:
          description: WatchGuard product name.
          type: string
          enum:
            - accessPoint
            - firebox
      - name: serialOrLicense
        description: Serial number or license key of the allocated device to update.
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/serialOrLicense'
    put:
      tags:
        - Allocation v2
      summary: Update an existing allocation for a hardware device.
      description: |
        For hardware devices, you can update the allocationExpiryDate and allocationExpiryType of an existing allocation.
      requestBody:
        description: Request body that includes the allocated asset to update.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/assetUpdateWithSerialObject'
            examples:
              Firebox:
                $ref: '#/components/examples/FireboxUpdate'
      responses:
        200:
          description: The allocation was updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createUpdateSuccessResponse'
              example:
                success: true
        default:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
  /v2/{accountId}/assets/summary/{resourceType}:
    get:
      tags:
        - Allocation v2
      summary: Returns unallocated or allocated assets for a Service Provider account.
      description: |
        Get an inventory summary for a Service Provider account, based on allocation status.
        Pagination is supported for devices only.
      parameters:
        - name: accountId
          description: Identifies the WatchGuard Cloud Service Provider account to
            return allocation information for.
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/accountId'
        - name: resourceType
          description: Type of asset.
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/resourceType'
        - name: allocationStatus
          in: query
          description: |
            For devices, allocation status can be allocated or unallocated.
          required: false
          schema:
            type: string
            default: unallocated
            enum:
              - allocated
              - unallocated
        - name: offset
          in: query
          description: |
            For devices, number of devices or licenses to skip before the API returns results.
          required: false
          schema:
            type: integer
            default: 0
            minimum: 0
        - name: limit
          in: query
          description: |
            For devices, number of records to show on each page. A value of -1 shows all records.
          required: false
          schema:
            type: integer
            minimum: -1
            default: -1
      responses:
        200:
          description: List of assets in the Service Provider inventory.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inventorySumObject'
              examples:
                WES Tier-1 SP:
                  $ref: '#/components/examples/WESInventory1'
                WES Tier-2 SP Capped:
                  $ref: '#/components/examples/WESInventory2'
                WES Tier-2 SP Unlimited:
                  $ref: '#/components/examples/WESInventory3'
                WES Tier-1 SP w/ linked to license:
                  $ref: '#/components/examples/WESInventory4'
                AuthPoint Tier-1 SP w/ linked to license:
                  $ref: '#/components/examples/AUTHInventory1'
                firebox Allocated:
                  $ref: '#/components/examples/fireboxSampleDataAllocated'
                firebox Unallocated:
                  $ref: '#/components/examples/fireboxSampleDataUnallocated'
        default:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
  /v2/{accountId}/assets/allocations/{resourceType}:
    get:
      tags:
        - Allocation v2
      summary: Returns a list of allocated assets (devices and software licenses)
        for a Service Provider's managed accounts.
      description: |
        Get a list of assets allocated to a Service Provider's managed accounts.
      parameters:
        - name: accountId
          in: path
          description: |
            Identifies your WatchGuard Cloud account. Example: WGC-1-123abc456 or ACC-1234567.
          required: true
          schema:
            $ref: '#/components/schemas/accountId'
        - name: resourceType
          in: path
          description: |
            Type of asset.
          required: true
          schema:
            $ref: '#/components/schemas/resourceType'
        - name: accountType
          in: query
          description: |
            Type of managed accounts to return allocations for (1 - Managed Service Provider accounts, 2 - Managed Subscriber accounts).
          required: true
          schema:
            type: integer
            enum:
              - 1
              - 2
        - name: sortBy
          in: query
          description: |
            Specifies how to sort results.
          required: false
          schema:
            type: string
            default: accountName
            enum:
              - accountName
              - licenseType
              - allocationExpiryDate
              - quantity
        - name: sortOrder
          in: query
          description: |
            Specifies how to order results. You can sort results in ascending or descending order.
              - asc - Sort results in ascending order.
              - desc - Sort results in descending order.
          required: false
          schema:
            type: string
            default: asc
            enum:
              - asc
              - desc
        - name: offset
          in: query
          description: Number of devices or licenses to skip before the API returns
            results.
          required: false
          schema:
            type: integer
            default: 0
            minimum: 0
        - name: limit
          in: query
          description: |
            Number of records to show on each page. A value of -1 shows all records.
          required: false
          schema:
            minimum: -1
            type: integer
            default: -1
        - name: filterBy
          in: query
          description: |
            Search string in accountName
          schema:
            type: string
      responses:
        200:
          description: List of assets allocated to the Service Provider's managed
            accounts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/assetAllocationObject'
              examples:
                WES Allocations:
                  $ref: '#/components/examples/WESAssetsAllocation1'
                WES Allocations w/ Linked to License:
                  $ref: '#/components/examples/WESAssetsAllocation2'
                Firebox Allocations:
                  $ref: '#/components/examples/fireboxAssetsAllocation1'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
  /v2/{accountId}/assets/licenses/{resourceType}:
    get:
      tags:
        - Allocation v2
      summary: Returns a list of assets (devices and software licenses) owned by a
        specific account.
      description: Get the list of assets owned by an account.
      parameters:
        - name: accountId
          description: Identifies the WatchGuard Cloud account to return assets for.
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/accountId'
        - name: resourceType
          description: Type of asset.
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/resourceType'
        - name: offset
          in: query
          description: Number of devices or licenses to skip before the API returns
            results.
          required: false
          schema:
            type: integer
            default: 0
            minimum: 0
        - name: limit
          in: query
          description: Number of records to show on each page. A value of -1 shows
            all records.
          schema:
            type: integer
            minimum: -1
            default: -1
        - name: filterBy
          in: query
          description: Filters results by the specified text for friendlyName, serialOrLicense,
            or model for hardware devices.
          schema:
            type: string
      responses:
        200:
          description: List of assets for the account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/licensesDataObject'
              examples:
                WES SP-1:
                  $ref: '#/components/examples/WESLicenses1'
                WES Subscriber:
                  $ref: '#/components/examples/WESLicensesSelfAssignedTerm'
                Firebox Licenses:
                  $ref: '#/components/examples/fireboxSampleDataUnallocated'
        default:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/errorResponse'
  /v2/{accountId}/assets/assigned/{resourceType}:
    get:
      tags:
        - Allocation v2
      summary: Returns a list of assets (devices and software licenses) allocated
        to a specific account.
      description: Get the list of assets allocated to an account.
      parameters:
        - name: accountId
          description: Identifies the WatchGuard Cloud account to return assets for.
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/accountId'
        - name: resourceType
          description: Type of asset.
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/resourceType'
        - name: offset
          in: query
          description: Number of devices or licenses to skip before the API returns
            results.
          required: false
          schema:
            type: integer
            default: 0
            minimum: 0
        - name: limit
          in: query
          description: Number of records to show on each page. A value of -1 shows
            all records.
          schema:
            type: integer
            minimum: -1
            default: -1
        - name: filterBy
          in: query
          description: Filters results by the specified text for friendlyName, serialOrLicense,
            or model for hardware devices.
          schema:
            type: string
      responses:
        200:
          description: List of assets for the account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/licensesDataObject'
              examples:
                WES Self Assigned Term:
                  $ref: '#/components/examples/WESLicensesSelfAssignedTerm'
                WES Self Assigned Subscription:
                  $ref: '#/components/examples/WESLicensesSelfAssignedSubscription'
                WES Self Assigned Linked to License:
                  $ref: '#/components/examples/WESLicensesSelfAssignedLinkedToLicense'
                Firebox Self Assigned:
                  $ref: '#/components/examples/fireboxLicensesSelfAssigned'
        default:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/errorResponse'

components:
  schemas:
    errorResponse:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: An absolute URI that identifies the type of error.
          default: about:blank
        title:
          type: string
          description: A descriptive title for the error.
        status:
          type: integer
          description: The HTTP status code generated by the server.
          minimum: 100
          maximum: 600
          exclusiveMaximum: true
          example: 503
        detail:
          type: string
          description: A description of the error.
          example: Connection to the database timed out.
        instance:
          type: string
          format: uri
          description: An absolute URI that identifies the error.
    healthResponse:
      type: object
      required:
        - healthy
      properties:
        healthy:
          type: boolean
          default: false
        message:
          type: string
    pageControls:
      description: Settings that specify how to paginate search results.
      type: object
      properties:
        limit:
          description: Number of records to show per page. A value of -1 shows all
            records.
          type: integer
        offset:
          description: Number of the first record to include in the results.
          type: integer
        totalItems:
          description: Total number of records available.
          type: integer
    accountId:
      description: The unique identifier of an account.
      type: string
      example: ACC-1234567 or WGC-1234-456
    assetObject:
      description: Asset object to allocate.
      type: object
      properties:
        accountId:
          $ref: '#/components/schemas/accountId'
        productName:
          $ref: '#/components/schemas/productName'
        allocationType:
          description: Type of allocation, one of term, subscription, or linked_to_license.
            Required for software products. Not required for devices.
          type: string
          enum:
            - term
            - subscription
            - linked_to_license
        quantity:
          description: |
            Required for software products, except those with Linked to License allocations.
            Specify a number of allocations greater than 0 OR "unlimited".
          example: 19 | unlimited
          oneOf:
            - type: string
              enum:
                - unlimited
            - type: number
              minimum: 1
        allocationExpiryType:
          type: string
          description: Allocation expiration type, either custom or never.
          enum:
            - never
            - custom
        allocationExpiryDate:
          type: string
          description: |
            Allocation expiration date. Required if allocationExpiryType is custom, otherwise optional.
          example: '2023-12-31'
        modules:
          $ref: '#/components/schemas/modulesObject'
        serialOrLicense:
          $ref: '#/components/schemas/serialOrLicense'
      required:
        - accountId
        - productName
    productName:
      description: |
        WatchGuard product name.
        For Linked to License allocations, this is the core product name.
      type: string
      enum:
        - accessPoint
        - firebox
        - fireboxRetention
        - AuthPoint_MFA
        - AuthPoint_TIS
        - WES_EDR_Core
        - WES_EPP
        - WES_EDR
        - WES_EPDR
        - WES_AEPDR
        - WES_Module_Advanced_Reporting_Tool
        - WES_Module_Data_Control
        - WES_Module_Full_Encryption
        - WES_Module_Patch_Management
        - WES_Module_SIEMFeeder
        - WES_Module_MDR
        - WES_Module_Orion
        - ThreatSyncPlus_NDR
        - ThreatSyncPlus_SaaSDR
        - FireCloud_InternetAccess
        - FireCloud_TotalAccess
        - Compliance_Reporting
        - Total_NDR
        - MDR_CORE_Microsoft
        - Total_MDR
        - Open_MDR
        - NDR_for_Firebox
    allocationType:
      description: |
        Type of allocation, either term, subscription, mixed, or linked_to_license. Required for software products. Not required for devices.
      type: string
      enum:
        - term
        - subscription
        - mixed
        - linked_to_license
    serialOrLicense:
      description: |
        Serial number or license key. Required if productName is firebox, fireboxRetention, or accessPoint, or if allocationType is linked_to_license.
      type: string
      example: ABCD123423-4334
    resourceType:
      description: Type of asset.
      type: string
      enum:
        - accessPoint
        - authPoint
        - endPoint
        - firebox
        - fireboxRetention
        - fireCloud
        - managedServices
        - threatSyncPlus
    modulesObject:
      type: object
      properties:
        WES_Module_Advanced_Reporting_Tool:
          $ref: '#/components/schemas/modulesPropertiesObject'
        WES_Module_Patch_Management:
          $ref: '#/components/schemas/modulesPropertiesObject'
        WES_Module_Full_Encryption:
          $ref: '#/components/schemas/modulesPropertiesObject'
        WES_Module_Data_Control:
          $ref: '#/components/schemas/modulesPropertiesObject'
        WES_Module_SIEMFeeder:
          $ref: '#/components/schemas/modulesPropertiesObject'
        WES_Module_MDR:
          $ref: '#/components/schemas/modulesPropertiesObject'
        WES_Module_Orion:
          $ref: '#/components/schemas/modulesPropertiesObject'
    modulesPropertiesObject:
      type: object
      required:
        - quantity
      properties:
        quantity:
          description: Number of allocations.
          oneOf:
            - type: string
              enum:
                - unlimited
            - type: number
              minimum: 0
    createUpdateSuccessResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          default: true
        message:
          type: string
      example:
        success: true
    inventorySumObject:
      description: Inventory summary allocation data. Pagination is supported for
        devices only.
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            oneOf:
              - $ref: '#/components/schemas/inventoryObject'
              - $ref: '#/components/schemas/v2DeviceInfoObject'
        pageControls:
          $ref: '#/components/schemas/pageControls'
    inventoryObject:
      type: object
      properties:
        productName:
          description: License type of the asset.
          type: string
          example: WES_EDR
        allocationType:
          description: Type of allocation.
          type: string
          example: term
        allocationExpiryDate:
          description: Allocation expiration date.
          type: string
          example: '2024-12-10'
        daysUntilExpiry:
          description: Number of days until expiration date.
          type: integer
          example: 366
        quantityTotal:
          description: |
            Total quantity of term licenses.
          type: integer
          example: 45
        quantityAvailable:
          description: |
            Available quantity for allocation.
            Number of term licenses available for allocation.
          type: integer
          example: 30
        quantityAllocated:
          description: |
            Number of allocated term licenses.
            * Tier-1 and Tier-2 Service Providers do not have quantityAllocated for subscription licenses.
          type: integer
          example: 15
        subscriptionTotal:
          description: |
            The total number of subscription license. Default is unlimited.
            For Tier-2 Service Providers, this can be a number if the allocation is limited (capped).
          type: string
          example: 5
        usage:
          description: Number of users or endpoints used by the account.
          type: integer
          example: 5
        licenses:
          description: List of available term licenses that can be allocated to managed
            accounts as linked to license allocations.
          type: array
          items:
            type: object
            properties:
              serialOrLicense:
                type: string
                description: Serial number.
                example: 888-8888-88888888888-8888
              licenseExpiryDate:
                type: string
                description: License expiration date.
                example: 12-12-2222
              friendlyName:
                type: string
                description: License friendly name.
                example: Endpoint Security license
              quantity:
                type: number
                description: Term license quantity.
                example: 10
              modules:
                type: object
                description: Endpoint Security module information for licenses with
                  modules.
                properties:
                  productName:
                    type: string
                    description: Endpoint Security module product name.
                    example: WES_Module_Patch_Management
                  licenseExpiryDate:
                    type: string
                    description: Module license expiration date.
                    example: 12-12-2222
                  quantity:
                    type: number
                    description: Module license quantity.
                    example: 10
    v2DeviceInfoObject:
      type: object
      properties:
        productName:
          description: Type of license or device.
          type: string
        accountId:
          description: WatchGuard Cloud account ID of the account.
          type: string
        accountName:
          description: WatchGuard Cloud account name of the account.
          type: string
        macAddress:
          description: Mac address of the device.
          type: string
        serialOrLicense:
          description: Serial number or license ID of the device.
          type: string
        friendlyName:
          description: Friendly name of the device.
          type: string
        modelName:
          description: Model name of the device.
          type: string
        daysUntilExpiry:
          description: Number of days until the allocation expires.
          type: string
        allocationExpiryDate:
          description: Allocation expiration date.
          type: string
        allocationExpiryType:
          type: string
          description: Allocation expiration type, either custom or never.
          enum:
            - never
            - custom
        licenseExpiryDate:
          description: Device license expiration date.
          type: string
    licensesDeviceObject:
      type: object
      properties:
        productName:
          description: Type of license or device.
          type: string
        macAddress:
          description: Mac address of the device.
          type: string
        serialOrLicense:
          description: Serial number or license ID of the device.
          type: string
        friendlyName:
          description: Friendly name of the device.
          type: string
        modelName:
          description: Model name of the device.
          type: string
        licenseExpiryDate:
          description: Device license expiration date.
          type: string
    assetAllocationObject:
      type: object
      properties:
        data:
          type: array
          description: A list of total assets under account.
          items:
            $ref: '#/components/schemas/V2GetAssetInfoObject'
        pageControls:
          $ref: '#/components/schemas/pageControls'
      description: The response format object containing keys data and pageControls.
    V2GetAssetInfoObject:
      type: object
      properties:
        allocationExpiryDate:
          description: Allocation expiration date.
          type: string
        allocationExpiryType:
          description: Allocation expiration type, either custom or never.
          type: string
        productName:
          description: License type of the asset.
          type: string
        accountId:
          description: WatchGuard Cloud account ID of the managed account.
          type: string
        accountName:
          description: WatchGuard Cloud account name of the managed account.
          type: string
        quantityTotal:
          description: When allocationType is term, the allocated quantity.
          type: integer
        subscriptionTotal:
          description: When allocationType is subscription, unlimited by default or
            a number if the allocation is limited (capped).
          type: string
        licenseType:
          description: |
            Allocation type, either term, subscription, linked_to_license, or mixed.
          type: string
          example: term
        usage:
          description: Number of users or endpoints used by the account.
          type: integer
          example: 10
    licensesDataObject:
      description: Licenses data object.
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            oneOf:
              - $ref: '#/components/schemas/licensesServiceObject'
              - $ref: '#/components/schemas/licensesDeviceObject'
        pageControls:
          $ref: '#/components/schemas/pageControls'
    licensesServiceObject:
      type: object
      properties:
        friendlyName:
          description: License friendly name, if available.
          type: string
          example: My License 1
        productName:
          description: Product name.
          type: string
          example: WES_EDR
        licenseType:
          description: |
            Type of allocation, either term, subscription, linked_to_license, or mixed.
          type: string
          example: term
        serialOrLicense:
          description: Serial number or license ID of the license, if available.
          type: string
        licenseExpiryDate:
          description: License expiration date.
          type: string
          example: '2024-12-10'
        daysUntilExpiry:
          description: Number of days until expiration date.
          type: integer
          example: 366
        quantityTotal:
          description: |
            Total number of term licenses.
          type: integer
          example: 45
        subscriptionTotal:
          description: |
            Unlimited, or a number if limited for a Tier-2 Service Provider.
          example: 19 | unlimited
          oneOf:
            - type: string
              enum:
                - unlimited
            - type: number
              minimum: 1
    assetUpdateObject:
      description: Asset object for allocation update.
      type: object
      properties:
        accountId:
          $ref: '#/components/schemas/accountId'
        productName:
          $ref: '#/components/schemas/productName'
        allocationType:
          description: Type of allocation, one of term, subscription, or linked_to_license.
            Required for software products
          type: string
          enum:
            - term
            - subscription
            - linked_to_license
        quantity:
          description: Required for software products. Specify a number of allocations
            greater than 0 OR "unlimited".
          oneOf:
            - type: string
              enum:
                - unlimited
            - type: number
              minimum: 1
        allocationExpiryType:
          type: string
          description: Allocation expiration type, either custom or never.
          enum:
            - never
            - custom
        allocationExpiryDate:
          type: string
          description: |
            Allocation expiration date. Required if allocationExpiryType is custom, otherwise optional.
          example: '2023-12-31'
        serialOrLicense:
          type: string
          description: |
            License key of the Linked to License allocation license.
          example: 1232345245345-234234234
        modules:
          $ref: '#/components/schemas/modulesObject'
      required:
        - accountId
        - productName
        - allocationType
    assetUpdateWithSerialObject:
      description: Asset object for allocation update.
      type: object
      properties:
        accountId:
          $ref: '#/components/schemas/accountId'
        allocationExpiryType:
          type: string
          description: Expiration type.
          enum:
            - never
            - custom
        allocationExpiryDate:
          type: string
          description: |
            Allocation expiration date. Required if allocationExpiryType is custom, otherwise optional.
          example: '2023-12-31'
      required:
        - accountId
        - allocationExpiryType

  examples:
    CoreOnlyTerm:
      value:
        accountId: WGC-1234-456
        productName: WES_EDR
        allocationType: term
        allocationExpiryType: custom
        allocationExpiryDate: '2023-12-31'
        quantity: 10
    CoreOnlySubscription:
      value:
        accountId: WGC-1234-456
        productName: WES_EDR
        allocationType: subscription
        quantity: unlimited
    CoreTermwithmodules:
      value:
        accountId: WGC-1234-456
        productName: WES_EDR
        allocationType: term
        allocationExpiryType: custom
        allocationExpiryDate: '2023-12-31'
        quantity: 10
        modules:
          WES_Module_Patch_Management:
            quantity: 0
          WES_Module_Full_Encryption:
            quantity: 10
          WES_Module_Data_Control:
            quantity: 0
          WES_Module_Advanced_Reporting_Tool:
            quantity: 0
          WES_Module_SIEMFeeder:
            quantity: 0
          WES_Module_MDR:
            quantity: 0
          WES_Module_Orion:
            quantity: 0
    Firebox:
      value:
        accountId: WGC-1-f491d578f0c54e5b8d3a
        productName: firebox
        allocationExpiryType: custom
        allocationExpiryDate: '2023-12-31'
        serialOrLicense: FVE5000CFDD71
    WESInventory1:
      value:
        data:
          - productName: WES_EDR
            allocationType: term
            allocationExpiryDate: '2024-12-10'
            daysUntilExpiry: 366
            quantityTotal: 45
            quantityAvailable: 30
            quantityAllocated: 15
            usage: 10
          - productName: WES_EDR
            allocationType: subscription
            allocationExpiryDate: '2024-12-10'
            daysUntilExpiry: 366
            subscriptionTotal: unlimited
            usage: 10
    WESInventory2:
      value:
        data:
          - productName: WES_EDR
            allocationType: term
            allocationExpiryDate: '2024-12-10'
            daysUntilExpiry: 366
            quantityTotal: 45
            quantityAvailable: 30
            quantityAllocated: 15
            usage: 10
          - productName: WES_EDR
            allocationType: subscription
            subscriptionTotal: 50
            usage: 10
    WESInventory3:
      value:
        data:
          - productName: WES_EDR
            allocationType: term
            allocationExpiryDate: '2024-12-10'
            daysUntilExpiry: 366
            quantityTotal: 45
            quantityAvailable: 30
            quantityAllocated: 15
            usage: 10
          - productName: WES_EDR
            allocationType: subscription
            allocationExpiryType: never
            subscriptionTotal: unlimited
            usage: 100
    WESInventory4:
      value:
        data:
          - productName: WES_EDR
            allocationType: term
            allocationExpiryDate: '2024-12-10'
            daysUntilExpiry: 366
            quantityTotal: 45
            quantityAvailable: 30
            quantityAllocated: 15
            usage: 10
            licenses:
              - serialOrLicense: 8888-123453-11111
                licenseExpiryDate: 12-12-2222
                friendlyName: EDRLicenseCustomer1
                quantity: 10
                modules:
                  - productName: WES_Module_Patch_Management
                    licenseExpiryDate: 12-12-2222
                    quantity: 5
          - productName: WES_EDR
            allocationType: subscription
            allocationExpiryDate: '2024-12-10'
            daysUntilExpiry: 366
            subscriptionTotal: unlimited
            usage: 100
    AUTHInventory1:
      value:
        data:
          - productName: AuthPoint_MFA
            allocationType: term
            allocationExpiryDate: '2024-12-10'
            daysUntilExpiry: 366
            quantityTotal: 45
            quantityAvailable: 30
            quantityAllocated: 15
            usage: 10
            licenses:
              - serialOrLicense: 8888-123453-11111
                licenseExpiryDate: 12-12-2222
                friendlyName: My AuthPoint License 88
                quantity: 10
    fireboxSampleDataAllocated:
      value:
        data:
          - productName: firebox
            accountId: WGC-1-123abc456
            accountName: Subscriber1
            macAddress: 00:11:11:11:11:12
            serialOrLicense: ABCD123-EFGH
            friendlyName: Device 1
            modelName: M200
            daysUntilExpiry: 888
            allocationExpiryDate: '2024-06-07'
            allocationExpiryType: custom
            licenseExpiryDate: '2027-12-31'
          - productName: firebox
            accountId: WGC-1-123abc45688
            accountName: Subscriber2
            macAddress: 00:11:11:11:11:12
            serialOrLicense: ABCD123-EFGH
            friendlyName: Device 2
            modelName: M400
            allocationExpiryType: never
            licenseExpiryDate: '2027-12-31'
    fireboxSampleDataUnallocated:
      value:
        data:
          - productName: firebox
            macAddress: 00:11:11:11:11:12
            serialOrLicense: ABCD123-EFGH
            friendlyName: Device 1
            modelName: M200
            licenseExpiryDate: '2027-12-31'
          - productName: firebox
            macAddress: 00:11:11:11:11:12
            serialOrLicense: ABCD123-EFGH
            friendlyName: Device 2
            modelName: M400
            licenseExpiryDate: '2027-12-31'
    WESAssetsAllocation1:
      value:
        data:
          - allocationExpiryDate: '2023-12-12'
            allocationExpiryType: custom
            productName: WES_EDR
            accountId: WGC-1-123abc456
            accountName: Subscriber1
            quantityTotal: 10
            licenseType: term
            usage: 10
          - allocationExpiryDate: '2024-12-12'
            allocationExpiryType: custom
            productName: WES_EDR
            accountId: WGC-1-123abc4567
            accountName: Subscriber2
            subscriptionTotal: unlimited
            licenseType: subscription
            usage: 100
          - allocationExpiryDate: '2023-12-12'
            allocationExpiryType: custom
            productName: WES_EDR
            accountId: WGC-1-123abc4568
            accountName: Subscriber3
            subscriptionTotal: unlimited
            licenseType: mixed
            usage: 20
          - accountId: WGC-1-123abc4569
            accountName: Subscriber4
    WESAssetsAllocation2:
      value:
        data:
          - allocationExpiryDate: '2023-12-12'
            allocationExpiryType: custom
            productName: WES_EDR
            accountId: WGC-1-123abc456
            accountName: Subscriber1
            quantityTotal: 10
            licenseType: term
            usage: 10
          - allocationExpiryDate: '2024-12-12'
            allocationExpiryType: custom
            productName: WES_EDR
            accountId: WGC-1-123abc4567
            accountName: Subscriber2
            subscriptionTotal: unlimited
            licenseType: subscription
            usage: 100
          - allocationExpiryDate: '2023-12-12'
            allocationExpiryType: custom
            productName: WES_EDR
            accountId: WGC-1-123abc456
            accountName: Subscriber3
            quantityTotal: 10
            licenseType: linked_to_license
            usage: 10
          - accountId: WGC-1-123abc4569
            accountName: Subscriber4
    fireboxAssetsAllocation1:
      value:
        data:
          - productName: firebox
            accountId: WGC-1-123abc456
            accountName: Subscriber1
            quantityTotal: 10
          - productName: firebox
            accountId: WGC-1-123abc4567
            accountName: Subscriber2
            quantityTotal: 20
          - accountId: WGC-1-123abc4568
            accountName: Subscriber3
    WESLicenses1:
      value:
        data:
          - friendlyName: My Term License 1
            productName: WES_EDR
            licenseType: term
            serialOrLicense: SKU-123456
            licenseExpiryDate: '2025-05-05'
            daysUntilExpiry: 566
            quantityTotal: 45
          - friendlyName: My Subscription License 1
            productName: WES_EDR
            licenseType: subscription
            serialOrLicense: SKU-123456-SUB
            licenseExpiryDate: '2025-05-05'
            daysUntilExpiry: 566
            subscriptionTotal: unlimited
    WESLicensesSelfAssignedTerm:
      value:
        data:
          - productName: WES_EDR
            licenseType: term
            licenseExpiryDate: '2025-05-05'
            daysUntilExpiry: 566
            quantityTotal: 45
    WESLicensesSelfAssignedSubscription:
      value:
        data:
          - productName: WES_EDR
            licenseType: subscription
            subscriptionTotal: unlimited
    WESLicensesSelfAssignedLinkedToLicense:
      value:
        data:
          - productName: WES_AEPDR
            licenseType: linked_to_license
            licenseExpiryDate: '2025-05-05'
            daysUntilExpiry: 566
            quantityTotal: 45
          - productName: WES_Module_Data_Control
            licenseType: linked_to_license
            licenseExpiryDate: '2025-05-05'
            daysUntilExpiry: 566
            quantityTotal: 45
    fireboxLicensesSelfAssigned:
      value:
        data:
          - productName: firebox
            macAddress: 00:00:11:11:11:11
            serialOrLicense: 123445555-ABCD
            friendlyName: My Device 1
            modelName: M400
            licenseExpiryDate: '2027-12-31'
          - productName: firebox
            macAddress: 00:00:11:11:11:22
            serialOrLicense: 123445555-ABCD
            friendlyName: My Device 2
            modelName: M400
            licenseExpiryDate: '2027-12-31'
    FireboxUpdate:
      value:
        accountId: WGC-1-f491d578f0c54e5b8d3a
        allocationExpiryType: custom
        allocationExpiryDate: '2023-12-31'
    LinkedToLicense:
      value:
        accountId: WGC-1234-456
        productName: WES_EDR
        allocationType: linked_to_license
        serialOrLicense: 1234434-123123
  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/allocation
    description: Prod USA Region
  - url: https://api.deu.cloud.watchguard.com/rest/platform/allocation
    description: Prod DEU region
  - url: https://api.jpn.cloud.watchguard.com/rest/platform/allocation
    description: Prod JPN region
security:
  - ApiKeyAuth: []
    BearerAuth: []
externalDocs:
  description: Additional documentation
  url: https://www.watchguard.com/help/docs/api/Content/en-US/home.html
