Apache APISIX Consumers API

Manage API consumers and their credentials.

Operations 9

GET /consumers Apache APISIX List All Consumers #
GET /consumers/{username} Apache APISIX Get a Consumer #
PUT /consumers/{username} Apache APISIX Create or Update a Consumer #
DELETE /consumers/{username} Apache APISIX Delete a Consumer #
GET /consumers/{username}/credentials Apache APISIX List Consumer Credentials #
GET /consumers/{username}/credentials/{credential_id} Apache APISIX Get a Consumer Credential #
PUT /consumers/{username}/credentials/{credential_id} Apache APISIX Create or Update a Consumer Credential #
PATCH /consumers/{username}/credentials/{credential_id} Apache APISIX Patch a Consumer Credential #
DELETE /consumers/{username}/credentials/{credential_id} Apache APISIX Delete a Consumer Credential #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/apache-apisix-consumers-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

apache-apisix-consumers-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Apache APISIX Admin Consumer Groups Consumers API
  description: The Apache APISIX Admin API provides a RESTful interface to dynamically control and configure your deployed Apache APISIX instance. It allows management of routes, services, upstreams, consumers, SSL certificates, global rules, plugin configurations, consumer groups, secrets, and more. By default, the Admin API listens on port 9180 and requires API key authentication via the X-API-KEY header.
  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:9180/apisix/admin
  description: Default local Admin API server
security:
- apiKey: []
tags:
- name: Consumers
  description: Manage API consumers and their credentials.
paths:
  /consumers:
    get:
      operationId: listConsumers
      summary: Apache APISIX List All Consumers
      description: Fetches a list of all configured consumers.
      tags:
      - Consumers
      responses:
        '200':
          description: Successful response with list of consumers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceList'
  /consumers/{username}:
    get:
      operationId: getConsumer
      summary: Apache APISIX Get a Consumer
      description: Fetches the specified consumer by username.
      tags:
      - Consumers
      parameters:
      - $ref: '#/components/parameters/ConsumerUsername'
      responses:
        '200':
          description: Successful response with consumer details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceResponse'
        '404':
          description: Consumer not found.
    put:
      operationId: createOrUpdateConsumer
      summary: Apache APISIX Create or Update a Consumer
      description: Creates a consumer with the specified username, or updates it if it already exists.
      tags:
      - Consumers
      parameters:
      - $ref: '#/components/parameters/ConsumerUsername'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Consumer'
      responses:
        '200':
          description: Consumer updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceResponse'
        '201':
          description: Consumer created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceCreated'
    delete:
      operationId: deleteConsumer
      summary: Apache APISIX Delete a Consumer
      description: Removes the specified consumer.
      tags:
      - Consumers
      parameters:
      - $ref: '#/components/parameters/ConsumerUsername'
      responses:
        '200':
          description: Consumer deleted successfully.
        '404':
          description: Consumer not found.
  /consumers/{username}/credentials:
    get:
      operationId: listConsumerCredentials
      summary: Apache APISIX List Consumer Credentials
      description: Fetches all credentials for the specified consumer.
      tags:
      - Consumers
      parameters:
      - $ref: '#/components/parameters/ConsumerUsername'
      responses:
        '200':
          description: Successful response with list of credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceList'
  /consumers/{username}/credentials/{credential_id}:
    get:
      operationId: getConsumerCredential
      summary: Apache APISIX Get a Consumer Credential
      description: Fetches a specific credential for the specified consumer.
      tags:
      - Consumers
      parameters:
      - $ref: '#/components/parameters/ConsumerUsername'
      - $ref: '#/components/parameters/CredentialId'
      responses:
        '200':
          description: Successful response with credential details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceResponse'
        '404':
          description: Credential not found.
    put:
      operationId: createOrUpdateConsumerCredential
      summary: Apache APISIX Create or Update a Consumer Credential
      description: Creates or updates a credential for the specified consumer.
      tags:
      - Consumers
      parameters:
      - $ref: '#/components/parameters/ConsumerUsername'
      - $ref: '#/components/parameters/CredentialId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Credential'
      responses:
        '200':
          description: Credential updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceResponse'
        '201':
          description: Credential created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceCreated'
    patch:
      operationId: patchConsumerCredential
      summary: Apache APISIX Patch a Consumer Credential
      description: Updates partial attributes of a credential for the specified consumer.
      tags:
      - Consumers
      parameters:
      - $ref: '#/components/parameters/ConsumerUsername'
      - $ref: '#/components/parameters/CredentialId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Credential'
      responses:
        '200':
          description: Credential patched successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceResponse'
    delete:
      operationId: deleteConsumerCredential
      summary: Apache APISIX Delete a Consumer Credential
      description: Removes a specific credential for the specified consumer.
      tags:
      - Consumers
      parameters:
      - $ref: '#/components/parameters/ConsumerUsername'
      - $ref: '#/components/parameters/CredentialId'
      responses:
        '200':
          description: Credential deleted successfully.
        '404':
          description: Credential not found.
components:
  parameters:
    ConsumerUsername:
      name: username
      in: path
      required: true
      description: Username of the consumer.
      schema:
        type: string
    CredentialId:
      name: credential_id
      in: path
      required: true
      description: Unique identifier of the credential.
      schema:
        type: string
  schemas:
    ResourceResponse:
      type: object
      description: Standard response wrapper for a single resource.
      properties:
        key:
          type: string
          description: The etcd key path for the resource.
        value:
          type: object
          description: The resource configuration.
        modifiedIndex:
          type: integer
          description: The etcd modification index.
        createdIndex:
          type: integer
          description: The etcd creation index.
    Credential:
      type: object
      description: A Credential contains authentication plugin configurations bound to a consumer.
      properties:
        desc:
          type: string
          description: Description of the credential.
        plugins:
          type: object
          description: Authentication plugin configuration.
        labels:
          type: object
          additionalProperties:
            type: string
          description: Key-value pairs for categorization.
    ResourceList:
      type: object
      description: Standard response wrapper for a list of resources.
      properties:
        list:
          type: array
          items:
            $ref: '#/components/schemas/ResourceResponse'
          description: Array of resource entries.
        total:
          type: integer
          description: Total count of resources.
    Consumer:
      type: object
      description: A Consumer is an entity that consumes API services and is identified by a username.
      required:
      - username
      properties:
        username:
          type: string
          description: Unique username for the consumer.
        desc:
          type: string
          description: Description of the consumer.
        plugins:
          type: object
          description: Plugin configuration bound to this consumer.
        labels:
          type: object
          additionalProperties:
            type: string
          description: Key-value pairs for categorization.
        group_id:
          type: string
          description: ID of a consumer group this consumer belongs to.
    ResourceCreated:
      type: object
      description: Response wrapper for a newly created resource.
      properties:
        key:
          type: string
          description: The etcd key path for the created resource.
        value:
          type: object
          description: The created resource configuration.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Admin API key for authentication.