Apache APISIX Control API

The Apache APISIX Control API provides internal status and health check endpoints for monitoring and introspecting a running APISIX instance. It listens by default on port 9090, is accessible only from localhost, and exposes endpoints for health checking, schema retrieval, and runtime diagnostics.

OpenAPI Specification

apache-apisix-control-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Apache APISIX Control API
  description: >-
    The Apache APISIX Control API provides internal status and health check
    endpoints for monitoring and introspecting the running APISIX instance.
    By default, the Control API listens on port 9090 and is only accessible
    from localhost. It exposes endpoints for health checking, schema retrieval,
    and runtime diagnostics.
  version: 3.14.0
  contact:
    name: Apache APISIX
    url: https://apisix.apache.org
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: http://127.0.0.1:9090
  description: Default local Control API server
paths:
  /v1/healthcheck:
    get:
      operationId: getHealthCheck
      summary: Apache APISIX Get All Health Check Statuses
      description: >-
        Returns the health check status of all upstreams that have health
        checking enabled.
      tags:
      - Health Check
      responses:
        '200':
          description: Successful response with health check information.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/HealthCheckStatus'
  /v1/healthcheck/upstreams/{upstream_id}:
    get:
      operationId: getUpstreamHealthCheck
      summary: Apache APISIX Get Health Check for a Specific Upstream
      description: Returns the health check status for a specific upstream by its ID.
      tags:
      - Health Check
      parameters:
      - name: upstream_id
        in: path
        required: true
        description: The ID of the upstream resource.
        schema:
          type: string
      responses:
        '200':
          description: Successful response with upstream health status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthCheckStatus'
        '404':
          description: Upstream not found or health check not configured.
  /v1/healthcheck/routes/{route_id}:
    get:
      operationId: getRouteHealthCheck
      summary: Apache APISIX Get Health Check for a Specific Route
      description: Returns the health check status for a specific route by its ID.
      tags:
      - Health Check
      parameters:
      - name: route_id
        in: path
        required: true
        description: The ID of the route resource.
        schema:
          type: string
      responses:
        '200':
          description: Successful response with route health status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthCheckStatus'
        '404':
          description: Route not found or health check not configured.
  /v1/healthcheck/services/{service_id}:
    get:
      operationId: getServiceHealthCheck
      summary: Apache APISIX Get Health Check for a Specific Service
      description: Returns the health check status for a specific service by its ID.
      tags:
      - Health Check
      parameters:
      - name: service_id
        in: path
        required: true
        description: The ID of the service resource.
        schema:
          type: string
      responses:
        '200':
          description: Successful response with service health status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthCheckStatus'
        '404':
          description: Service not found or health check not configured.
  /v1/schema:
    get:
      operationId: getSchema
      summary: Apache APISIX Get APISIX JSON Schema
      description: >-
        Returns the full JSON schema used by the APISIX instance, including
        main configuration schemas and all plugin schemas.
      tags:
      - Schema
      responses:
        '200':
          description: Successful response with the complete JSON schema.
          content:
            application/json:
              schema:
                type: object
                properties:
                  main:
                    type: object
                    description: Main configuration schemas for routes, upstreams, etc.
                  plugins:
                    type: object
                    description: Schemas for all enabled plugins.
  /v1/schema/plugins/{plugin_name}:
    get:
      operationId: getPluginSchema
      summary: Apache APISIX Get a Specific Plugin Schema
      description: Returns the JSON schema for the specified plugin.
      tags:
      - Schema
      parameters:
      - name: plugin_name
        in: path
        required: true
        description: The name of the plugin.
        schema:
          type: string
      responses:
        '200':
          description: Successful response with the plugin schema.
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Plugin not found.
  /v1/gc:
    post:
      operationId: triggerGC
      summary: Apache APISIX Trigger Garbage Collection
      description: Triggers a full garbage collection cycle in the Lua VM.
      tags:
      - Diagnostics
      responses:
        '200':
          description: GC triggered successfully.
  /v1/routes:
    get:
      operationId: getControlRoutes
      summary: Apache APISIX Get All Configured Routes
      description: Returns a list of all routes with their complete runtime configuration.
      tags:
      - Introspection
      responses:
        '200':
          description: Successful response with list of routes.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /v1/services:
    get:
      operationId: getControlServices
      summary: Apache APISIX Get All Configured Services
      description: Returns a list of all services with their complete runtime configuration.
      tags:
      - Introspection
      responses:
        '200':
          description: Successful response with list of services.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /v1/upstreams:
    get:
      operationId: getControlUpstreams
      summary: Apache APISIX Get All Configured Upstreams
      description: Returns a list of all upstreams with their complete runtime configuration.
      tags:
      - Introspection
      responses:
        '200':
          description: Successful response with list of upstreams.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /v1/discovery/{discovery_type}/dump:
    get:
      operationId: dumpDiscoveryNodes
      summary: Apache APISIX Dump Service Discovery Nodes
      description: Returns the nodes discovered by the specified service discovery type.
      tags:
      - Introspection
      parameters:
      - name: discovery_type
        in: path
        required: true
        description: The type of service discovery (e.g. dns, consul, nacos).
        schema:
          type: string
      responses:
        '200':
          description: Successful response with discovered nodes.
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Discovery type not found.
components:
  schemas:
    HealthCheckStatus:
      type: object
      description: Health check status for an upstream or route.
      properties:
        name:
          type: string
          description: Identifier of the health-checked resource.
        type:
          type: string
          description: The source type (upstreams, routes, services).
        nodes:
          type: array
          items:
            type: object
            properties:
              ip:
                type: string
                description: IP address of the node.
              port:
                type: integer
                description: Port number of the node.
              status:
                type: string
                enum:
                - healthy
                - unhealthy
                description: Current health status of the node.
              counter:
                type: object
                properties:
                  success:
                    type: integer
                    description: Number of successful health checks.
                  http_failure:
                    type: integer
                    description: Number of HTTP health check failures.
                  tcp_failure:
                    type: integer
                    description: Number of TCP health check failures.
                  timeout_failure:
                    type: integer
                    description: Number of timeout failures.
tags:
- name: Diagnostics
  description: Runtime diagnostic operations.
- name: Health Check
  description: Monitor the health status of upstream nodes.
- name: Introspection
  description: Inspect the runtime configuration of the APISIX instance.
- name: Schema
  description: Retrieve JSON schemas used by the APISIX instance.