Choreo Usage API

API usage statistics and request metrics.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

choreo-usage-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Choreo API Management Alerts Usage API
  description: The Choreo API Management API provides programmatic access to manage the full lifecycle of APIs on the WSO2 Choreo platform. It allows API creators to create, publish, version, and manage APIs, configure rate limiting policies, and manage API documentation. Choreo is an AI-native internal developer platform that simplifies building, deploying, and managing cloud-native applications.
  version: 1.0.0
  contact:
    name: WSO2 Choreo
    url: https://choreo.dev/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  x-provider-slug: choreo
  x-api-slug: api-management
servers:
- url: https://console.choreo.dev/api/v1
  description: Choreo Console API
security:
- bearerAuth: []
- oauth2:
  - read
  - write
tags:
- name: Usage
  description: API usage statistics and request metrics.
paths:
  /usage:
    get:
      operationId: getAPIUsage
      summary: Choreo Get API usage statistics
      description: Retrieve API usage statistics including request counts, success rates, and error rates for a given time range.
      tags:
      - Usage
      parameters:
      - name: orgId
        in: query
        required: true
        schema:
          type: string
        description: Organization identifier.
      - name: apiId
        in: query
        schema:
          type: string
        description: Filter by specific API identifier.
      - name: componentId
        in: query
        schema:
          type: string
        description: Filter by specific component identifier.
      - name: environmentId
        in: query
        schema:
          type: string
        description: Filter by environment identifier.
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date-time
        description: Start time for the query range.
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date-time
        description: End time for the query range.
      - name: granularity
        in: query
        schema:
          type: string
          enum:
          - 1m
          - 5m
          - 1h
          - 1d
          default: 1h
        description: Time granularity for aggregation.
      responses:
        '200':
          description: Successful response with usage statistics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponse'
        '400':
          description: Bad request.
        '401':
          description: Unauthorized.
components:
  schemas:
    UsageResponse:
      type: object
      properties:
        totalRequests:
          type: integer
          description: Total number of requests in the time range.
        successCount:
          type: integer
          description: Number of successful requests.
        errorCount:
          type: integer
          description: Number of failed requests.
        successRate:
          type: number
          format: float
          description: Success rate as a percentage.
        timeSeries:
          type: array
          items:
            type: object
            properties:
              timestamp:
                type: string
                format: date-time
              requests:
                type: integer
              successes:
                type: integer
              errors:
                type: integer
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://console.choreo.dev/oauth2/authorize
          tokenUrl: https://console.choreo.dev/oauth2/token
          scopes:
            read: Read access
            write: Write access
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT