openapi: 3.0.0
info:
  description: An API to manage product licenses within Sophos Central.
  version: 1.1.0
  contact:
    name: Sophos Central APIs
    email: apis@sophos.com
    url: 'https://developer.sophos.com'
  title: Licensing API
tags:
  - name: Licensing
    description: Manage tenant and firewall licenses.
servers:
  - url: 'https://api.central.sophos.com/licenses/v1'
    description: Global service in the production environment.
security:
  - bearerAuth: []
paths:
  /licenses:
    get:
      x-soph-permissions: 'account_management:read'
      summary: Get licenses
      description: Get tenant licenses.
      operationId: getLicensesWithUsage
      tags:
        - Licensing
      parameters:
        - name: X-Tenant-ID
          in: header
          description: Tenant ID.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Tenant licenses.
          content:
            application/json:
              schema:
                type: object
                description: Set of licenses.
                required:
                  - organization
                  - licenses
                properties:
                  organization:
                    type: object
                    description: Tenant's organization.
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        description: Organization ID.
                        format: uuid
                  partner:
                    type: object
                    description: Tenant's partner.
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        description: Partner ID.
                        format: uuid
                  tenant:
                    type: object
                    description: Linked tenant.
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        description: Tenant ID.
                        format: uuid
                  licenses:
                    type: array
                    uniqueItems: true
                    items:
                      type: object
                      description: License object.
                      required:
                        - id
                        - product
                        - startDate
                        - licenseIdentifier
                        - perpetual
                        - type
                        - unlimited
                      properties:
                        id:
                          type: string
                          description: License ID.
                        licenseIdentifier:
                          type: string
                          description: License identifier.
                        product:
                          description: Licensed product.
                          type: object
                          required:
                            - code
                          properties:
                            code:
                              type: string
                              description: Product code.
                            name:
                              type: string
                              description: Product name.
                            genericCode:
                              description: Generic product code.
                              type: string
                        startDate:
                          type: string
                          description: >-
                            License start date. The license is valid from the
                            start of the day in the UTC timezone.
                          format: date
                        endDate:
                          type: string
                          description: >-
                            License end date. The license is valid until the end
                            of the day in the UTC timezone. Not present for
                            perpetual licenses.
                          format: date
                        perpetual:
                          type: boolean
                          description: Whether the license is perpetual or not.
                        type:
                          type: string
                          description: License type.
                          enum:
                            - trial
                            - term
                            - usage
                            - ordered
                            - enterprise
                            - perpetual
                          x-enum-varnames:
                            - TRIAL
                            - TERM
                            - USAGE
                            - ORDERED
                            - ENTERPRISE
                            - PERPETUAL
                        quantity:
                          description: Assigned quantity.
                          type: integer
                        unlimited:
                          description: True if `quantity` is missing.
                          type: boolean
                        usage:
                          type: object
                          description: License usage records.
                          required:
                            - current
                          properties:
                            current:
                              type: object
                              description: License usage count for a specific date.
                              required:
                                - count
                                - date
                                - collectedAt
                              properties:
                                count:
                                  type: integer
                                  description: License usage count.
                                date:
                                  type: string
                                  format: date
                                  description: License usage date.
                                collectedAt:
                                  type: string
                                  format: date-time
                                  description: Date and time when the usage was collected.
        '500':
          description: Unexpected error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  correlationId:
                    type: string
                    format: uuid
                  code:
                    type: string
                  createdAt:
                    type: string
                    format: datetime
                  requestId:
                    type: string
                    format: uuid
                  docUrl:
                    type: string
                    format: uri
  /licenses/firewalls:
    get:
      x-soph-permissions: 'firewall-license:read'
      summary: Get firewalls
      description: Get firewalls claimed by tenant or managed by the partner.
      operationId: getFirewalls
      tags:
        - Licensing
      parameters:
        - name: X-Tenant-ID
          in: header
          description: >-
            The unique identifier (UUID) of the Tenant. Provide either this
            header or `X-Partner-ID`, but not both. Required when the request
            context belongs to a Tenant.
          required: false
          schema:
            type: string
            format: uuid
        - name: X-Partner-ID
          in: header
          description: >-
            The unique identifier (UUID) of the Partner. Provide either this
            header or `X-Tenant-ID`, but not both. Required when the request
            context belongs to a Partner.
          required: false
          schema:
            type: string
            format: uuid
        - in: query
          name: page
          required: false
          schema:
            type: integer
            default: 1
          description: 'The page number to fetch, starting with 1.'
        - in: query
          name: pageSize
          required: false
          schema:
            type: integer
            default: 50
          description: The size of the page requested.
        - in: query
          name: pageTotal
          required: false
          schema:
            type: boolean
            default: false
          description: >-
            Whether the number of pages should be calculated and returned in the
            response.
        - in: query
          name: sort
          required: false
          description: Sort the list based on the column.
          schema:
            type: string
            pattern: '(^[^:]+$)|(^[^:]+:(asc|desc)$)'
      responses:
        '200':
          description: Firewalls.
          content:
            application/json:
              schema:
                type: object
                description: Page of firewalls.
                required:
                  - items
                  - pages
                properties:
                  items:
                    type: array
                    description: List of firewalls.
                    items:
                      type: object
                      description: Firewall object.
                      required:
                        - serialNumber
                        - owner
                        - model
                        - modelType
                        - licenses
                      properties:
                        serialNumber:
                          type: string
                          description: Firewall serial number.
                        owner:
                          type: object
                          description: License owner.
                          required:
                            - id
                            - type
                          properties:
                            id:
                              type: string
                              description: Owner ID.
                              format: uuid
                            type:
                              type: string
                              description: Owner type.
                              enum:
                                - partner
                                - organization
                        organization:
                          type: object
                          description: Tenant's organization.
                          required:
                            - id
                          properties:
                            id:
                              type: string
                              description: Organization ID.
                              format: uuid
                        partner:
                          type: object
                          description: Tenant's partner.
                          required:
                            - id
                          properties:
                            id:
                              type: string
                              description: Partner ID.
                              format: uuid
                        tenant:
                          type: object
                          description: Linked tenant.
                          required:
                            - id
                          properties:
                            id:
                              type: string
                              description: Tenant ID.
                              format: uuid
                        billingTenant:
                          type: object
                          description: Linked tenant.
                          required:
                            - id
                          properties:
                            id:
                              type: string
                              description: Tenant ID.
                              format: uuid
                        model:
                          type: string
                          description: Firewall model.
                        modelType:
                          type: string
                          description: Firewall model type.
                          enum:
                            - virtual
                            - hardware
                        lastSeenAt:
                          type: string
                          pattern: date-time
                          description: >-
                            Date and time the firewall last checked for
                            licenses.
                        licenses:
                          type: array
                          items:
                            type: object
                            description: License object.
                            required:
                              - id
                              - product
                              - startDate
                              - licenseIdentifier
                              - perpetual
                              - type
                              - unlimited
                            properties:
                              id:
                                type: string
                                description: License ID.
                              licenseIdentifier:
                                type: string
                                description: License identifier.
                              product:
                                description: Licensed product.
                                type: object
                                required:
                                  - code
                                properties:
                                  code:
                                    type: string
                                    description: Product code.
                                  name:
                                    type: string
                                    description: Product name.
                                  genericCode:
                                    description: Generic product code.
                                    type: string
                              startDate:
                                type: string
                                description: >-
                                  License start date. The license is valid from
                                  the start of the day in the UTC timezone.
                                format: date
                              endDate:
                                type: string
                                description: >-
                                  License end date. The license is valid until
                                  the end of the day in the UTC timezone. Not
                                  present for perpetual licenses.
                                format: date
                              perpetual:
                                type: boolean
                                description: Whether the license is perpetual or not.
                              type:
                                type: string
                                description: License type.
                                enum:
                                  - trial
                                  - term
                                  - usage
                                  - ordered
                                  - enterprise
                                  - perpetual
                                x-enum-varnames:
                                  - TRIAL
                                  - TERM
                                  - USAGE
                                  - ORDERED
                                  - ENTERPRISE
                                  - PERPETUAL
                              quantity:
                                description: Assigned quantity.
                                type: integer
                              unlimited:
                                description: True if `quantity` is missing.
                                type: boolean
                              usage:
                                type: object
                                description: License usage records.
                                required:
                                  - current
                                properties:
                                  current:
                                    type: object
                                    description: License usage count for a specific date.
                                    required:
                                      - count
                                      - date
                                      - collectedAt
                                    properties:
                                      count:
                                        type: integer
                                        description: License usage count.
                                      date:
                                        type: string
                                        format: date
                                        description: License usage date.
                                      collectedAt:
                                        type: string
                                        format: date-time
                                        description: >-
                                          Date and time when the usage was
                                          collected.
                  pages:
                    type: object
                    required:
                      - current
                      - size
                      - maxSize
                    properties:
                      current:
                        type: integer
                        description: The 1-based page number being returned.
                      size:
                        type: integer
                        description: The size of the page being returned.
                      total:
                        type: integer
                        description: >-
                          (Optional) The total number of pages that exist, if
                          pageTotal=true in the request.
                      items:
                        type: integer
                        description: (Optional) The total number of items across all pages.
                      maxSize:
                        type: integer
                        description: The maximum page size that can be requested.
        '500':
          description: Unexpected error.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  correlationId:
                    type: string
                    format: uuid
                  code:
                    type: string
                  createdAt:
                    type: string
                    format: datetime
                  requestId:
                    type: string
                    format: uuid
                  docUrl:
                    type: string
                    format: uri
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
