ControlUp License Usage API

The License Usage API from ControlUp — 1 operation(s) for license usage.

OpenAPI Specification

controlup-license-usage-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Dex License Usage API
  version: 1.0.0
  description: Dex API Description
  contact: {}
servers:
- url: https://api.controlup.com/v1
tags:
- name: License Usage
paths:
  /organizations/{orgId}/license/usage:
    get:
      operationId: OrgLicensePublicController_getLicenseUsage
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_LicenseUsageOverTimeResponse_'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody_ErrorType_BadRequestErrorMessages.HttpStatusCode.BAD_REQUEST.BadRequestErrorCodes__'
        '401':
          description: 'Unauthorized: Access is denied'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody_ErrorType_ErrorMessage.Unauthorized.HttpStatusCode.UNAUTHORIZED.ErrorCode.Unauthorized__'
        '403':
          description: 'Forbidden: Access to this resource is denied'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody_ErrorType_ErrorMessage.Forbidden.HttpStatusCode.FORBIDDEN.ErrorCode.Forbidden__'
        '404':
          description: 'Not Found: The requested resource could not be found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody_ErrorType_ErrorMessage.NotFound.HttpStatusCode.NOT_FOUND.ErrorCode.NotFound__'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody_ErrorType_ErrorMessage.InternalServerError.HttpStatusCode.INTERNAL_SERVER_ERROR.ErrorCode.InternalServerError__'
      description: 'Returns license usage data for your organization over a specified time range.

        For managed organizations, returns usage for that organization.

        For MSP organizations, returns aggregated usage across all managed organizations.'
      summary: Retrieve license usage in time range
      tags:
      - License Usage
      security:
      - apiKey: []
      parameters:
      - description: ID of your ControlUp organization. You can find your organization ID on the [API Key Management page](how-to-make-api-requests#how-to-find-your-controlup-organization-id) in the DEX platform.
        in: path
        name: orgId
        required: true
        schema:
          $ref: '#/components/schemas/UUID'
      - description: Start date and time for the usage data range in ISO string format (UTC).
        in: query
        name: timeFrom
        required: true
        schema:
          $ref: '#/components/schemas/ISOString'
        style: form
      - description: End date and time for the usage data range in ISO string format (UTC).
        in: query
        name: timeTo
        required: true
        schema:
          $ref: '#/components/schemas/ISOString'
        style: form
      - description: Array of organization IDs to filter the usage data by.
        in: query
        name: childOrgsIds
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/NonEmptyString'
        example:
        - 123e4567-e89b-12d3-a456-426614174000
        - 987fcdeb-1234-5678-9abc-111111111111
        style: form
components:
  schemas:
    ? ErrorResponseBody_ErrorType_ErrorMessage.InternalServerError.HttpStatusCode.INTERNAL_SERVER_ERROR.ErrorCode.InternalServerError__
    : properties:
        metadata:
          $ref: '#/components/schemas/ErrorResponseMetadata'
        error:
          $ref: '#/components/schemas/ErrorType_ErrorMessage.InternalServerError.HttpStatusCode.INTERNAL_SERVER_ERROR.ErrorCode.InternalServerError_'
      required:
      - error
      - metadata
      type: object
    ErrorCode.NotFound:
      enum:
      - 5
      type: number
    HttpStatusCode.INTERNAL_SERVER_ERROR:
      enum:
      - 500
      type: number
    ProductLicenseUsageOverTime:
      properties:
        product:
          type: string
          description: Product name
        amount:
          $ref: '#/components/schemas/PositiveInteger'
          description: Total amount of licenses
        usage:
          items:
            $ref: '#/components/schemas/LicenseUsageEntry'
          type: array
          description: Licenses usage over days
      required:
      - product
      type: object
    LicenseUsageEntry:
      properties:
        usage:
          $ref: '#/components/schemas/PositiveInteger'
          description: Licenses usage at specific day
        date:
          $ref: '#/components/schemas/ISOString'
          description: Reported date of licenses usage
        percentage:
          $ref: '#/components/schemas/PositiveInteger'
          description: Percentage of licenses usage from total amount
      required:
      - percentage
      - date
      - usage
      type: object
    ErrorMessage.Unauthorized:
      enum:
      - Unauthorized
      type: string
    APIResponse_LicenseUsageOverTimeResponse_:
      properties:
        data:
          allOf:
          - $ref: '#/components/schemas/LicenseUsageOverTimeResponse'
      required:
      - data
      type: object
    ErrorCode.Unauthorized:
      enum:
      - 3
      type: number
    BadRequestErrorMessages:
      enum:
      - Bad Request
      - Invalid Params
      - Unique Field Violation
      type: string
    PositiveInteger:
      type: integer
      format: int32
      minimum: 1
    ErrorResponseBody_ErrorType_ErrorMessage.Unauthorized.HttpStatusCode.UNAUTHORIZED.ErrorCode.Unauthorized__:
      properties:
        metadata:
          $ref: '#/components/schemas/ErrorResponseMetadata'
        error:
          $ref: '#/components/schemas/ErrorType_ErrorMessage.Unauthorized.HttpStatusCode.UNAUTHORIZED.ErrorCode.Unauthorized_'
      required:
      - error
      - metadata
      type: object
    ErrorType_ErrorMessage.Forbidden.HttpStatusCode.FORBIDDEN.ErrorCode.Forbidden_:
      properties:
        message:
          $ref: '#/components/schemas/ErrorMessage.Forbidden'
        code:
          $ref: '#/components/schemas/ErrorCode.Forbidden'
        status:
          $ref: '#/components/schemas/HttpStatusCode.FORBIDDEN'
        data:
          additionalProperties: true
          type: object
      required:
      - status
      - code
      - message
      type: object
    HttpStatusCode.UNAUTHORIZED:
      enum:
      - 401
      type: number
    BadRequestErrorCodes:
      enum:
      - 2
      - 14
      - 50
      type: number
    ErrorMessage.InternalServerError:
      enum:
      - Internal Server Error
      type: string
    ErrorResponseMetadata:
      properties:
        cuRequestId:
          type: string
        orgId:
          type: string
        userId:
          type: string
        userIp:
          type: string
      required:
      - userIp
      - userId
      - orgId
      - cuRequestId
      type: object
    ErrorMessage.Forbidden:
      enum:
      - Forbidden
      type: string
    ErrorMessage.NotFound:
      enum:
      - Not Found
      type: string
    ErrorCode.InternalServerError:
      enum:
      - 6
      type: number
    ErrorType_ErrorMessage.Unauthorized.HttpStatusCode.UNAUTHORIZED.ErrorCode.Unauthorized_:
      properties:
        message:
          $ref: '#/components/schemas/ErrorMessage.Unauthorized'
        code:
          $ref: '#/components/schemas/ErrorCode.Unauthorized'
        status:
          $ref: '#/components/schemas/HttpStatusCode.UNAUTHORIZED'
        data:
          additionalProperties: true
          type: object
      required:
      - status
      - code
      - message
      type: object
    HttpStatusCode.FORBIDDEN:
      enum:
      - 403
      type: number
    ErrorCode.Forbidden:
      enum:
      - 4
      type: number
    LicenseUsageOverTimeResponse:
      items:
        $ref: '#/components/schemas/ProductLicenseUsageOverTime'
      type: array
      description: Response type for license usage endpoint.
    ErrorResponseBody_ErrorType_ErrorMessage.NotFound.HttpStatusCode.NOT_FOUND.ErrorCode.NotFound__:
      properties:
        metadata:
          $ref: '#/components/schemas/ErrorResponseMetadata'
        error:
          $ref: '#/components/schemas/ErrorType_ErrorMessage.NotFound.HttpStatusCode.NOT_FOUND.ErrorCode.NotFound_'
      required:
      - error
      - metadata
      type: object
    HttpStatusCode.BAD_REQUEST:
      enum:
      - 400
      type: number
    ISOString:
      type: string
      example: '2022-12-22T18:43:55.483Z'
      format: ISO String YYYY-MM-DDTHH:mm:ss.sssZ
      description: Valid ISO string
      pattern: ^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.\d{3})?Z$
    ErrorResponseBody_ErrorType_BadRequestErrorMessages.HttpStatusCode.BAD_REQUEST.BadRequestErrorCodes__:
      properties:
        metadata:
          $ref: '#/components/schemas/ErrorResponseMetadata'
        error:
          $ref: '#/components/schemas/ErrorType_BadRequestErrorMessages.HttpStatusCode.BAD_REQUEST.BadRequestErrorCodes_'
      required:
      - error
      - metadata
      type: object
    ErrorType_ErrorMessage.NotFound.HttpStatusCode.NOT_FOUND.ErrorCode.NotFound_:
      properties:
        message:
          $ref: '#/components/schemas/ErrorMessage.NotFound'
        code:
          $ref: '#/components/schemas/ErrorCode.NotFound'
        status:
          $ref: '#/components/schemas/HttpStatusCode.NOT_FOUND'
        data:
          additionalProperties: true
          type: object
      required:
      - status
      - code
      - message
      type: object
    ErrorType_ErrorMessage.InternalServerError.HttpStatusCode.INTERNAL_SERVER_ERROR.ErrorCode.InternalServerError_:
      properties:
        message:
          $ref: '#/components/schemas/ErrorMessage.InternalServerError'
        code:
          $ref: '#/components/schemas/ErrorCode.InternalServerError'
        status:
          $ref: '#/components/schemas/HttpStatusCode.INTERNAL_SERVER_ERROR'
        data:
          additionalProperties: true
          type: object
      required:
      - status
      - code
      - message
      type: object
    NonEmptyString:
      type: string
      minLength: 1
    ErrorResponseBody_ErrorType_ErrorMessage.Forbidden.HttpStatusCode.FORBIDDEN.ErrorCode.Forbidden__:
      properties:
        metadata:
          $ref: '#/components/schemas/ErrorResponseMetadata'
        error:
          $ref: '#/components/schemas/ErrorType_ErrorMessage.Forbidden.HttpStatusCode.FORBIDDEN.ErrorCode.Forbidden_'
      required:
      - error
      - metadata
      type: object
    HttpStatusCode.NOT_FOUND:
      enum:
      - 404
      type: number
    ErrorType_BadRequestErrorMessages.HttpStatusCode.BAD_REQUEST.BadRequestErrorCodes_:
      properties:
        message:
          $ref: '#/components/schemas/BadRequestErrorMessages'
        code:
          $ref: '#/components/schemas/BadRequestErrorCodes'
        status:
          $ref: '#/components/schemas/HttpStatusCode.BAD_REQUEST'
        data:
          additionalProperties: true
          type: object
      required:
      - status
      - code
      - message
      type: object
    UUID:
      type: string
      format: uuid
      description: 'Stringified UUIDv4.

        See [RFC 4112](https://tools.ietf.org/html/rfc4122)'
      pattern: ^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
x-readme:
  explorer-enabled: true
  proxy-enabled: false
  samples-languages:
  - shell
  - powershell
  - node
  - javascript
  - python
  - c
  - clojure
  - cplusplus
  - csharp
  - http
  - go
  - java
  - json
  - kotlin
  - objectivec
  - ocaml
  - php
  - r
  - ruby
  - shell
  - swift