Download OpenAPI specification:Download
The Apache APISIX Admin API is a RESTful interface for managing all APISIX gateway resources — routes, upstreams, services, consumers, SSL certificates, plugins, and more.
APISIX Admin API allows you to dynamically configure the API gateway without restarts. All changes take effect immediately.
All endpoints require an API key passed via the X-API-KEY request header. The API key is configured in APISIX's config.yaml under deployment.admin.admin_key.
The default Admin API listens on http://127.0.0.1:9180. You can customize the host and port in config.yaml under deployment.admin.admin_listen.
See APISIX Documentation for more information.
A Route defines how client requests are matched and forwarded to upstream services. Routes are the most fundamental resource in APISIX — every incoming request is evaluated against configured routes.
A route must include at least a URI pattern and one of: an inline upstream, an upstream_id, a service_id, or plugins.
Key Features
See Routes documentation for more.
Retrieve all configured routes. Supports filtering by name, label, uri, or filter expression.
Results include full route configuration and metadata (creation/update timestamps).
| name | string Filter list by |
| label | string Example: label=env Filter list to resources with the given label key. |
| uri | string Filter routes by URI (regex match against |
| filter | string Filter expression. Supports |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
curl -i http://127.0.0.1:9180/apisix/admin/routes \ -H 'X-API-KEY: your-api-key'
{- "total": 1,
- "list": [
- {
- "createdIndex": 203,
- "key": "/apisix/routes/1",
- "value": {
- "remote_addrs": [
- "127.0.0.1"
], - "desc": "desc",
- "name": "route-test",
- "priority": 0,
- "vars": [
- [
- "http_user",
- "==",
- "ios"
]
], - "update_time": 1684490006,
- "create_time": 1684490006,
- "id": "1",
- "plugins": {
- "limit-count": {
- "show_limit_quota_header": true,
- "policy": "local",
- "count": 2,
- "allow_degradation": false,
- "rejected_code": 503,
- "time_window": 60,
- "key_type": "var",
- "key": "remote_addr"
}
}, - "status": 1,
- "timeout": {
- "read": 3,
- "connect": 3,
- "send": 3
}, - "uri": "/ip",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "httpbin.org:80": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "methods": [
- "GET",
- "POST"
], - "hosts": [
- "a.com",
- "b.com"
]
}, - "modifiedIndex": 203
}
]
}Create a new route with an auto-generated ID.
A route must include at least a uri and one of: upstream (inline), upstream_id, service_id, or plugins.
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Route configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 100 ] characters Human-readable name for the route. |
| desc | string <= 256 characters Description of what this route does. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
| uri required | string [ 1 .. 4096 ] characters URI path pattern to match. Supports exact match ( |
| uris | Array of strings non-empty unique Multiple URI patterns. Mutually exclusive with |
| host | string Single hostname to match against the request's |
| hosts | Array of strings non-empty unique Multiple hostnames to match. Mutually exclusive with |
| methods | Array of strings unique Items Enum: "GET" "POST" "PUT" "DELETE" "PATCH" "HEAD" "OPTIONS" "CONNECT" "TRACE" "PURGE" HTTP methods allowed on this route. If empty or not set, all methods are allowed. |
| remote_addr | string Single client IP address or CIDR range to match. Mutually exclusive with |
| remote_addrs | Array of strings non-empty unique Multiple client IP addresses or CIDR ranges to match. Mutually exclusive with |
| priority | integer Default: 0 Route priority. When multiple routes match the same request, the one with the highest priority wins. |
| vars | Array of any Custom matching conditions using APISIX expressions. Each condition is an array of |
| filter_func | string >= 10 characters ^function Custom Lua function for advanced request matching. Must start with |
required | object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
String ID (string) or Integer ID (integer) (ResourceId) Reference to a Plugin Config resource. Cannot be used together with | |
Use Upstream Nodes (object) or Use Service Registry (object) (Upstream) | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Upstream resource. | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Service resource. | |
object (Timeout) Timeout settings in seconds for connecting to, sending data to, and reading data from the upstream. | |
| enable_websocket | boolean Enable WebSocket proxying on this route. |
| status | integer Default: 1 Enum: 1 0 Route status. |
| script | string [ 10 .. 102400 ] characters Lua script for plugin orchestration. Cannot be used together with |
String ID (string) or Integer ID (integer) (ResourceId) Script ID (used internally by APISIX Dashboard). |
{- "name": "my-api-route",
- "desc": "Route for user management API",
- "uri": "/api/v1/users/*",
- "hosts": [
- "api.example.com"
], - "methods": [
- "GET",
- "POST",
- "PUT",
- "DELETE"
], - "plugins": {
- "limit-count": {
- "count": 100,
- "time_window": 60,
- "rejected_code": 429,
- "key_type": "var",
- "key": "remote_addr"
}
}, - "upstream": {
- "type": "roundrobin",
- "nodes": {
- "10.0.0.1:8080": 3,
- "10.0.0.2:8080": 2
}, - "retries": 2,
- "timeout": {
- "connect": 6,
- "send": 6,
- "read": 6
}
}
}{- "value": {
- "desc": "desc",
- "name": "route-name",
- "update_time": 1684490245,
- "priority": 0,
- "id": "00000000000000000206",
- "status": 1,
- "create_time": 1684490245,
- "uri": "/ip",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "httpbin.org:80": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "methods": [
- "GET",
- "POST"
], - "hosts": [
- "a.com",
- "b.com"
]
}, - "key": "/apisix/routes/00000000000000000206"
}Create a new route with a specified ID, or fully replace an existing route.
Note: This is a full replacement — all fields must be provided. Use PATCH for partial updates.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Route configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 100 ] characters Human-readable name for the route. |
| desc | string <= 256 characters Description of what this route does. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
| uri required | string [ 1 .. 4096 ] characters URI path pattern to match. Supports exact match ( |
| uris | Array of strings non-empty unique Multiple URI patterns. Mutually exclusive with |
| host | string Single hostname to match against the request's |
| hosts | Array of strings non-empty unique Multiple hostnames to match. Mutually exclusive with |
| methods | Array of strings unique Items Enum: "GET" "POST" "PUT" "DELETE" "PATCH" "HEAD" "OPTIONS" "CONNECT" "TRACE" "PURGE" HTTP methods allowed on this route. If empty or not set, all methods are allowed. |
| remote_addr | string Single client IP address or CIDR range to match. Mutually exclusive with |
| remote_addrs | Array of strings non-empty unique Multiple client IP addresses or CIDR ranges to match. Mutually exclusive with |
| priority | integer Default: 0 Route priority. When multiple routes match the same request, the one with the highest priority wins. |
| vars | Array of any Custom matching conditions using APISIX expressions. Each condition is an array of |
| filter_func | string >= 10 characters ^function Custom Lua function for advanced request matching. Must start with |
required | object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
String ID (string) or Integer ID (integer) (ResourceId) Reference to a Plugin Config resource. Cannot be used together with | |
Use Upstream Nodes (object) or Use Service Registry (object) (Upstream) | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Upstream resource. | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Service resource. | |
object (Timeout) Timeout settings in seconds for connecting to, sending data to, and reading data from the upstream. | |
| enable_websocket | boolean Enable WebSocket proxying on this route. |
| status | integer Default: 1 Enum: 1 0 Route status. |
| script | string [ 10 .. 102400 ] characters Lua script for plugin orchestration. Cannot be used together with |
String ID (string) or Integer ID (integer) (ResourceId) Script ID (used internally by APISIX Dashboard). |
{- "name": "payments-route",
- "desc": "Route for payment processing API",
- "uri": "/api/v1/payments",
- "methods": [
- "POST"
], - "plugins": {
- "key-auth": { },
- "limit-count": {
- "count": 10,
- "time_window": 60,
- "rejected_code": 429,
- "key_type": "var",
- "key": "consumer_name"
}
}, - "upstream": {
- "type": "roundrobin",
- "nodes": {
- "payments-service:8080": 1
}
}, - "timeout": {
- "connect": 10,
- "send": 10,
- "read": 30
}
}{- "value": {
- "remote_addrs": [
- "127.0.0.1"
], - "desc": "desc",
- "name": "route-test",
- "priority": 0,
- "plugins": {
- "limit-count": {
- "show_limit_quota_header": true,
- "policy": "local",
- "count": 2,
- "key": "remote_addr",
- "rejected_code": 503,
- "time_window": 60,
- "key_type": "var",
- "allow_degradation": false
}
}, - "vars": [
- [
- "http_user",
- "==",
- "ios"
]
], - "id": "1",
- "status": 1,
- "uri": "/ip",
- "timeout": {
- "connect": 3,
- "read": 3,
- "send": 3
}, - "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "httpbin.org:80": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "methods": [
- "GET",
- "POST"
], - "hosts": [
- "a.com",
- "b.com"
]
}, - "key": "/apisix/routes/1"
}Retrieve a single route by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
curl -i http://127.0.0.1:9180/apisix/admin/routes/1 \ -H 'X-API-KEY: your-api-key'
{- "createdIndex": 203,
- "key": "/apisix/routes/1",
- "value": {
- "remote_addrs": [
- "127.0.0.1"
], - "desc": "desc",
- "name": "route-test",
- "priority": 0,
- "vars": [
- [
- "http_user",
- "==",
- "ios"
]
], - "update_time": 1684490006,
- "create_time": 1684490006,
- "id": "1",
- "plugins": {
- "limit-count": {
- "show_limit_quota_header": true,
- "policy": "local",
- "count": 2,
- "allow_degradation": false,
- "rejected_code": 503,
- "time_window": 60,
- "key_type": "var",
- "key": "remote_addr"
}
}, - "status": 1,
- "timeout": {
- "read": 3,
- "connect": 3,
- "send": 3
}, - "uri": "/ip",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "httpbin.org:80": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "methods": [
- "GET",
- "POST"
], - "hosts": [
- "a.com",
- "b.com"
]
}, - "modifiedIndex": 203
}Partially update a route's configuration. Only the fields included in the request body are modified; all other fields remain unchanged.
Tip: Use this to update a single field (e.g., change the upstream) without resending the entire route configuration.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Route configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 100 ] characters Human-readable name for the route. |
| desc | string <= 256 characters Description of what this route does. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
| uri required | string [ 1 .. 4096 ] characters URI path pattern to match. Supports exact match ( |
| uris | Array of strings non-empty unique Multiple URI patterns. Mutually exclusive with |
| host | string Single hostname to match against the request's |
| hosts | Array of strings non-empty unique Multiple hostnames to match. Mutually exclusive with |
| methods | Array of strings unique Items Enum: "GET" "POST" "PUT" "DELETE" "PATCH" "HEAD" "OPTIONS" "CONNECT" "TRACE" "PURGE" HTTP methods allowed on this route. If empty or not set, all methods are allowed. |
| remote_addr | string Single client IP address or CIDR range to match. Mutually exclusive with |
| remote_addrs | Array of strings non-empty unique Multiple client IP addresses or CIDR ranges to match. Mutually exclusive with |
| priority | integer Default: 0 Route priority. When multiple routes match the same request, the one with the highest priority wins. |
| vars | Array of any Custom matching conditions using APISIX expressions. Each condition is an array of |
| filter_func | string >= 10 characters ^function Custom Lua function for advanced request matching. Must start with |
required | object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
String ID (string) or Integer ID (integer) (ResourceId) Reference to a Plugin Config resource. Cannot be used together with | |
Use Upstream Nodes (object) or Use Service Registry (object) (Upstream) | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Upstream resource. | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Service resource. | |
object (Timeout) Timeout settings in seconds for connecting to, sending data to, and reading data from the upstream. | |
| enable_websocket | boolean Enable WebSocket proxying on this route. |
| status | integer Default: 1 Enum: 1 0 Route status. |
| script | string [ 10 .. 102400 ] characters Lua script for plugin orchestration. Cannot be used together with |
String ID (string) or Integer ID (integer) (ResourceId) Script ID (used internally by APISIX Dashboard). |
{- "id": "my-route-1",
- "name": "string",
- "desc": "string",
- "labels": {
- "env": "production",
- "team": "platform",
- "version": "v2"
}, - "uri": "/api/v1/users/*",
- "uris": [
- "string"
], - "host": "api.example.com",
- "hosts": [
- "string"
], - "methods": [
- "GET",
- "POST"
], - "remote_addr": "192.168.1.0/24",
- "remote_addrs": [
- "string"
], - "priority": 0,
- "vars": [
- [
- "http_user_agent",
- "~*",
- "curl"
]
], - "filter_func": "stringstri",
- "plugins": {
- "limit-count": {
- "count": 100,
- "time_window": 60,
- "rejected_code": 429,
- "key_type": "var",
- "key": "remote_addr"
}
}, - "plugin_config_id": "my-route-1",
- "upstream": {
- "id": "my-route-1",
- "name": "string",
- "desc": "string",
- "labels": {
- "env": "production",
- "team": "platform",
- "version": "v2"
}, - "nodes": {
- "httpbin.org:80": 1,
- "10.0.0.1:8080": 2
}, - "retries": 0,
- "retry_timeout": 0,
- "timeout": {
- "connect": 6,
- "send": 6,
- "read": 6
}, - "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "scheme": "grpc",
- "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}, - "tls": {
- "client_cert_id": "my-route-1",
- "client_cert": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "client_key": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "verify": false
}, - "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "pass_host": "pass",
- "upstream_host": "string",
- "discovery_type": "string",
- "discovery_args": {
- "namespace_id": "string",
- "group_name": "string"
}, - "service_name": "string"
}, - "upstream_id": "my-route-1",
- "service_id": "my-route-1",
- "timeout": {
- "connect": 6,
- "send": 6,
- "read": 6
}, - "enable_websocket": true,
- "status": 1,
- "script": "stringstri",
- "script_id": "my-route-1"
}{- "value": {
- "remote_addrs": [
- "127.0.0.1"
], - "desc": "desc",
- "name": "route-test",
- "priority": 0,
- "vars": [
- [
- "http_user",
- "==",
- "ios"
]
], - "update_time": 1684490363,
- "create_time": 1684490006,
- "id": "1",
- "plugins": {
- "limit-count": {
- "show_limit_quota_header": true,
- "policy": "local",
- "count": 2,
- "allow_degradation": false,
- "rejected_code": 503,
- "time_window": 60,
- "key_type": "var",
- "key": "remote_addr"
}
}, - "status": 1,
- "timeout": {
- "read": 3,
- "connect": 3,
- "send": 3
}, - "uri": "/ip",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "httpbin.org:80": 1,
- "127.0.0.1:1981": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "methods": [
- "GET",
- "POST"
], - "hosts": [
- "a.com",
- "b.com"
]
}, - "key": "/apisix/routes/1"
}Delete a route by its ID. This action is irreversible.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
curl -i http://127.0.0.1:9180/apisix/admin/routes/1 \ -H 'X-API-KEY: your-api-key' -X DELETE
{- "deleted": "1",
- "key": "/apisix/routes/1"
}Replaces the value at sub_path (slash-separated nested key path within the route document, e.g. upstream/nodes) with the request body. The body is any valid JSON value, not necessarily an object.
required | String ID (string) or Integer ID (integer) (ResourceId) Example: r1 Resource identifier. |
| sub_path required | string Example: upstream/nodes Slash-separated nested key path within the resource document. |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
null{- "error_msg": "invalid configuration: property \"uri\" is required"
}An Upstream is a virtual host abstraction over a pool of backend service nodes. It defines how APISIX distributes traffic to your backend servers.
Load Balancing Algorithms
roundrobin — Weighted round-robin (default)chash — Consistent hashing for session affinityewma — Latency-based selection (exponentially weighted moving average)least_conn — Fewest active connectionsHealth Checks Upstreams support active and passive health checks to automatically remove unhealthy nodes from the load balancing pool.
See Upstreams documentation for more.
Retrieve all configured upstreams.
| name | string Filter list by |
| label | string Example: label=env Filter list to resources with the given label key. |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "list": [
- {
- "value": {
- "timeout": {
- "send": 15,
- "read": 15,
- "connect": 15
}, - "desc": "desc",
- "id": "1",
- "create_time": 1684290697,
- "retries": 1,
- "pass_host": "pass",
- "update_time": 1684291419,
- "type": "roundrobin",
- "name": "upstream-for-test",
- "hash_on": "vars",
- "nodes": {
- "httpbin.org:443": 1
}, - "scheme": "https"
}, - "key": "/apisix/upstreams/1",
- "modifiedIndex": 126,
- "createdIndex": 121
}, - {
- "value": {
- "timeout": {
- "send": 15,
- "read": 15,
- "connect": 15
}, - "desc": "desc",
- "id": "2",
- "create_time": 1684291436,
- "retries": 1,
- "pass_host": "pass",
- "update_time": 1684291436,
- "type": "roundrobin",
- "name": "upstream-for-test",
- "hash_on": "vars",
- "nodes": {
- "mock.api7.ai:443": 1
}, - "scheme": "https"
}, - "key": "/apisix/upstreams/2",
- "modifiedIndex": 127,
- "createdIndex": 127
}
], - "total": 2
}Create a new upstream with an auto-generated ID.
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Upstream configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name for the upstream. |
| desc | string <= 256 characters Description of the upstream. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
required | Weight Mapping (object) or Array of Node Objects (objects) The upstream endpoints. |
| retries | integer >= 0 Number of retry attempts when a request to the upstream fails. |
| retry_timeout | number >= 0 Maximum time in seconds for retry attempts. |
object (Timeout) Timeout settings in seconds for connecting to, sending data to, and reading data from the upstream. | |
| type | string Default: "roundrobin" Enum: "roundrobin" "chash" "ewma" "least_conn" Load balancing algorithm.
|
| hash_on | string Default: "vars" Enum: "vars" "header" "cookie" "consumer" "vars_combinations" What to hash on when
|
| key | string The hash key used when |
| scheme | string Default: "http" Enum: "grpc" "grpcs" "http" "https" "tcp" "tls" "udp" "kafka" Protocol for communicating with upstream nodes.
|
Active Check (object) or Passive Check (object) (HealthCheck) Health check configuration for monitoring upstream node availability. Active checks require at least the | |
object (UpstreamTLS) TLS configuration for connecting to upstream nodes over HTTPS/gRPCS. | |
object (KeepalivePool) Connection pool configuration for keepalive connections to upstream nodes. | |
| pass_host | string Default: "pass" Enum: "pass" "node" "rewrite" How to set the
|
| upstream_host | string Custom |
| discovery_type | string Service discovery type (e.g., |
object Additional arguments for service discovery. | |
| service_name | string [ 1 .. 256 ] characters Service name for service discovery. Required when |
{- "name": "upstream-for-test",
- "desc": "desc",
- "scheme": "http",
- "retries": 1,
- "type": "roundrobin",
- "nodes": {
- "127.0.0.1:1980": 1
}, - "timeout": {
- "connect": 15,
- "send": 15,
- "read": 15
}
}{- "key": "/apisix/upstreams/00000000000000000128",
- "value": {
- "timeout": {
- "send": 15,
- "read": 15,
- "connect": 15
}, - "desc": "desc",
- "id": "00000000000000000128",
- "create_time": 1684291897,
- "retries": 1,
- "pass_host": "pass",
- "update_time": 1684291897,
- "type": "roundrobin",
- "name": "upstream-for-test",
- "hash_on": "vars",
- "nodes": {
- "127.0.0.1:1980": 1
}, - "scheme": "http"
}
}Create a new upstream with a specified ID, or fully replace an existing upstream.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Upstream configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name for the upstream. |
| desc | string <= 256 characters Description of the upstream. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
required | Weight Mapping (object) or Array of Node Objects (objects) The upstream endpoints. |
| retries | integer >= 0 Number of retry attempts when a request to the upstream fails. |
| retry_timeout | number >= 0 Maximum time in seconds for retry attempts. |
object (Timeout) Timeout settings in seconds for connecting to, sending data to, and reading data from the upstream. | |
| type | string Default: "roundrobin" Enum: "roundrobin" "chash" "ewma" "least_conn" Load balancing algorithm.
|
| hash_on | string Default: "vars" Enum: "vars" "header" "cookie" "consumer" "vars_combinations" What to hash on when
|
| key | string The hash key used when |
| scheme | string Default: "http" Enum: "grpc" "grpcs" "http" "https" "tcp" "tls" "udp" "kafka" Protocol for communicating with upstream nodes.
|
Active Check (object) or Passive Check (object) (HealthCheck) Health check configuration for monitoring upstream node availability. Active checks require at least the | |
object (UpstreamTLS) TLS configuration for connecting to upstream nodes over HTTPS/gRPCS. | |
object (KeepalivePool) Connection pool configuration for keepalive connections to upstream nodes. | |
| pass_host | string Default: "pass" Enum: "pass" "node" "rewrite" How to set the
|
| upstream_host | string Custom |
| discovery_type | string Service discovery type (e.g., |
object Additional arguments for service discovery. | |
| service_name | string [ 1 .. 256 ] characters Service name for service discovery. Required when |
{- "name": "backend-cluster",
- "desc": "Primary backend service cluster",
- "type": "roundrobin",
- "nodes": {
- "10.0.0.1:8080": 3,
- "10.0.0.2:8080": 2,
- "10.0.0.3:8080": 1
}, - "retries": 3,
- "retry_timeout": 5,
- "timeout": {
- "connect": 6,
- "send": 6,
- "read": 6
}, - "checks": {
- "active": {
- "type": "http",
- "http_path": "/health",
- "healthy": {
- "interval": 5,
- "successes": 2
}, - "unhealthy": {
- "interval": 3,
- "http_failures": 3,
- "tcp_failures": 2
}
}
}, - "scheme": "http",
- "pass_host": "pass"
}{- "key": "/apisix/upstreams/1",
- "value": {
- "timeout": {
- "send": 15,
- "read": 15,
- "connect": 15
}, - "desc": "desc",
- "id": "1",
- "create_time": 1684290697,
- "retries": 1,
- "pass_host": "pass",
- "update_time": 1684290697,
- "type": "roundrobin",
- "name": "upstream-for-test",
- "hash_on": "vars",
- "nodes": {
- "127.0.0.1:1980": 1
}, - "scheme": "http"
}
}Partially update an upstream's configuration.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Upstream configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name for the upstream. |
| desc | string <= 256 characters Description of the upstream. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
required | Weight Mapping (object) or Array of Node Objects (objects) The upstream endpoints. |
| retries | integer >= 0 Number of retry attempts when a request to the upstream fails. |
| retry_timeout | number >= 0 Maximum time in seconds for retry attempts. |
object (Timeout) Timeout settings in seconds for connecting to, sending data to, and reading data from the upstream. | |
| type | string Default: "roundrobin" Enum: "roundrobin" "chash" "ewma" "least_conn" Load balancing algorithm.
|
| hash_on | string Default: "vars" Enum: "vars" "header" "cookie" "consumer" "vars_combinations" What to hash on when
|
| key | string The hash key used when |
| scheme | string Default: "http" Enum: "grpc" "grpcs" "http" "https" "tcp" "tls" "udp" "kafka" Protocol for communicating with upstream nodes.
|
Active Check (object) or Passive Check (object) (HealthCheck) Health check configuration for monitoring upstream node availability. Active checks require at least the | |
object (UpstreamTLS) TLS configuration for connecting to upstream nodes over HTTPS/gRPCS. | |
object (KeepalivePool) Connection pool configuration for keepalive connections to upstream nodes. | |
| pass_host | string Default: "pass" Enum: "pass" "node" "rewrite" How to set the
|
| upstream_host | string Custom |
| discovery_type | string Service discovery type (e.g., |
object Additional arguments for service discovery. | |
| service_name | string [ 1 .. 256 ] characters Service name for service discovery. Required when |
{- "id": "my-route-1",
- "name": "string",
- "desc": "string",
- "labels": {
- "env": "production",
- "team": "platform",
- "version": "v2"
}, - "nodes": {
- "httpbin.org:80": 1,
- "10.0.0.1:8080": 2
}, - "retries": 0,
- "retry_timeout": 0,
- "timeout": {
- "connect": 6,
- "send": 6,
- "read": 6
}, - "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "scheme": "grpc",
- "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}, - "tls": {
- "client_cert_id": "my-route-1",
- "client_cert": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "client_key": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "verify": false
}, - "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "pass_host": "pass",
- "upstream_host": "string",
- "discovery_type": "string",
- "discovery_args": {
- "namespace_id": "string",
- "group_name": "string"
}, - "service_name": "string"
}{- "key": "/apisix/upstreams/1",
- "value": {
- "timeout": {
- "send": 15,
- "read": 15,
- "connect": 15
}, - "desc": "desc",
- "id": "1",
- "create_time": 1684290697,
- "retries": 1,
- "pass_host": "pass",
- "update_time": 1684291001,
- "type": "roundrobin",
- "name": "upstream-for-test",
- "hash_on": "vars",
- "nodes": {
- "127.0.0.1:1981": 1,
- "127.0.0.1:1980": 1
}, - "scheme": "http"
}
}Retrieve a single upstream by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
{- "value": {
- "timeout": {
- "send": 15,
- "read": 15,
- "connect": 15
}, - "desc": "desc",
- "id": "1",
- "create_time": 1684290697,
- "retries": 1,
- "pass_host": "pass",
- "update_time": 1684291419,
- "type": "roundrobin",
- "name": "upstream-for-test",
- "hash_on": "vars",
- "nodes": {
- "httpbin.org:443": 1
}, - "scheme": "https"
}, - "key": "/apisix/upstreams/1",
- "modifiedIndex": 126,
- "createdIndex": 121
}Delete an upstream by its ID. Fails if the upstream is still referenced by a route or service.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "key": "/apisix/upstreams/1",
- "deleted": "1"
}Replaces the value at sub_path (slash-separated nested key path within the upstream document, e.g. upstream/nodes) with the request body. The body is any valid JSON value, not necessarily an object.
required | String ID (string) or Integer ID (integer) (ResourceId) Example: r1 Resource identifier. |
| sub_path required | string Example: upstream/nodes Slash-separated nested key path within the resource document. |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
null{- "error_msg": "invalid configuration: property \"uri\" is required"
}A Service is a reusable abstraction that groups an upstream and a set of plugins. Multiple routes can reference the same service, reducing configuration duplication.
When a route references a service via service_id, the service's upstream and plugins are merged with the route's own configuration. Route-level settings take precedence.
See Services documentation for more.
Retrieve all configured services.
| name | string Filter list by |
| label | string Example: label=env Filter list to resources with the given label key. |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "total": 1,
- "list": [
- {
- "createdIndex": 117,
- "key": "/apisix/services/1",
- "value": {
- "enable_websocket": true,
- "name": "service-test",
- "update_time": 1684288908,
- "create_time": 1684287870,
- "id": "1",
- "desc": "hello world",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "127.0.0.1:1980": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "plugins": {
- "limit-count": {
- "show_limit_quota_header": true,
- "policy": "local",
- "count": 2,
- "key": "remote_addr",
- "rejected_code": 503,
- "time_window": 60,
- "key_type": "var",
- "allow_degradation": false
}
}, - "hosts": [
- "foo.com"
]
}, - "modifiedIndex": 118
}
]
}Create a new service with an auto-generated ID.
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Service configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name. |
| desc | string <= 256 characters Description of this service. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. | |
Use Upstream Nodes (object) or Use Service Registry (object) (Upstream) | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Upstream resource. | |
| script | string [ 10 .. 102400 ] characters Lua script for plugin orchestration. |
| enable_websocket | boolean Enable WebSocket proxying for routes using this service. |
| hosts | Array of strings non-empty unique Hostnames associated with this service. |
{- "plugins": { },
- "upstream": {
- "type": "roundrobin",
- "nodes": {
- "127.0.0.1:1980": 1
}
}, - "name": "service-test",
- "desc": "hello world",
- "enable_websocket": true,
- "hosts": [
- "foo.com"
]
}{- "value": {
- "enable_websocket": true,
- "name": "service-test",
- "update_time": 1684491069,
- "create_time": 1684491069,
- "plugins": { },
- "id": "00000000000000000218",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "127.0.0.1:1980": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "desc": "hello world",
- "hosts": [
- "foo.com"
]
}, - "key": "/apisix/services/00000000000000000218"
}Retrieve a single service by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
{- "createdIndex": 117,
- "key": "/apisix/services/1",
- "value": {
- "enable_websocket": true,
- "name": "service-test",
- "update_time": 1684490934,
- "create_time": 1684287870,
- "plugins": {
- "limit-count": {
- "show_limit_quota_header": true,
- "policy": "local",
- "count": 2,
- "allow_degradation": false,
- "rejected_code": 503,
- "time_window": 60,
- "key_type": "var",
- "key": "remote_addr"
}
}, - "desc": "hello world",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "127.0.0.1:1980": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "id": "1",
- "hosts": [
- "foo.com"
]
}, - "modifiedIndex": 216
}Create a new service with a specified ID, or fully replace an existing service.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Service configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name. |
| desc | string <= 256 characters Description of this service. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. | |
Use Upstream Nodes (object) or Use Service Registry (object) (Upstream) | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Upstream resource. | |
| script | string [ 10 .. 102400 ] characters Lua script for plugin orchestration. |
| enable_websocket | boolean Enable WebSocket proxying for routes using this service. |
| hosts | Array of strings non-empty unique Hostnames associated with this service. |
{- "name": "user-service",
- "desc": "User management microservice",
- "upstream": {
- "type": "roundrobin",
- "nodes": {
- "user-svc:8080": 1
}
}, - "plugins": {
- "limit-count": {
- "count": 200,
- "time_window": 60,
- "rejected_code": 429,
- "key_type": "var",
- "key": "remote_addr"
}
}
}{- "value": {
- "desc": "hello world",
- "name": "service-test",
- "update_time": 1684491005,
- "create_time": 1684287870,
- "plugins": {
- "limit-count": {
- "show_limit_quota_header": true,
- "policy": "local",
- "count": 2,
- "key": "remote_addr",
- "rejected_code": 503,
- "time_window": 60,
- "key_type": "var",
- "allow_degradation": false
}
}, - "id": "1",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "127.0.0.1:1980": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "enable_websocket": true,
- "hosts": [
- "foo.com"
]
}, - "key": "/apisix/services/1"
}Partially update a service's configuration.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Service configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name. |
| desc | string <= 256 characters Description of this service. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. | |
Use Upstream Nodes (object) or Use Service Registry (object) (Upstream) | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Upstream resource. | |
| script | string [ 10 .. 102400 ] characters Lua script for plugin orchestration. |
| enable_websocket | boolean Enable WebSocket proxying for routes using this service. |
| hosts | Array of strings non-empty unique Hostnames associated with this service. |
{- "id": "my-route-1",
- "name": "string",
- "desc": "string",
- "labels": {
- "env": "production",
- "team": "platform",
- "version": "v2"
}, - "plugins": {
- "limit-count": {
- "count": 100,
- "time_window": 60,
- "rejected_code": 429,
- "key_type": "var",
- "key": "remote_addr"
}
}, - "upstream": {
- "id": "my-route-1",
- "name": "string",
- "desc": "string",
- "labels": {
- "env": "production",
- "team": "platform",
- "version": "v2"
}, - "nodes": {
- "httpbin.org:80": 1,
- "10.0.0.1:8080": 2
}, - "retries": 0,
- "retry_timeout": 0,
- "timeout": {
- "connect": 6,
- "send": 6,
- "read": 6
}, - "type": "roundrobin",
- "hash_on": "vars",
- "key": "string",
- "scheme": "grpc",
- "checks": {
- "active": {
- "type": "http",
- "timeout": 1,
- "concurrency": 10,
- "host": "string",
- "port": 1,
- "http_path": "/",
- "https_verify_certificate": true,
- "req_headers": [
- "string"
], - "healthy": {
- "interval": 1,
- "http_statuses": [
- 200,
- 302
], - "successes": 2
}, - "unhealthy": {
- "interval": 1,
- "http_statuses": [
- 429,
- 404,
- 500,
- 501,
- 502,
- 503,
- 504,
- 505
], - "http_failures": 5,
- "tcp_failures": 2,
- "timeouts": 3
}
}, - "passive": {
- "type": "http",
- "healthy": {
- "http_statuses": [
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 226,
- 300,
- 301,
- 302,
- 303,
- 304,
- 305,
- 306,
- 307,
- 308
], - "successes": 5
}, - "unhealthy": {
- "http_statuses": [
- 429,
- 500,
- 503
], - "tcp_failures": 2,
- "timeouts": 7,
- "http_failures": 5
}
}
}, - "tls": {
- "client_cert_id": "my-route-1",
- "client_cert": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "client_key": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringst",
- "verify": false
}, - "keepalive_pool": {
- "size": 320,
- "idle_timeout": 60,
- "requests": 1000
}, - "pass_host": "pass",
- "upstream_host": "string",
- "discovery_type": "string",
- "discovery_args": {
- "namespace_id": "string",
- "group_name": "string"
}, - "service_name": "string"
}, - "upstream_id": "my-route-1",
- "script": "stringstri",
- "enable_websocket": true,
- "hosts": [
- "string"
]
}{- "value": {
- "upstream": {
- "scheme": "http",
- "nodes": {
- "127.0.0.1:1981": 1,
- "127.0.0.1:1980": 1
}, - "type": "roundrobin",
- "hash_on": "vars",
- "pass_host": "pass"
}, - "create_time": 1684142130,
- "enable_websocket": true,
- "id": "1",
- "update_time": 1684142459,
- "hosts": [
- "foo.com"
], - "name": "service-test",
- "plugins": { },
- "desc": "hello world"
}, - "key": "/apisix/services/1"
}Delete a service by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "deleted": "1",
- "key": "/apisix/services/1"
}Replaces the value at sub_path (slash-separated nested key path within the service document, e.g. upstream/nodes) with the request body. The body is any valid JSON value, not necessarily an object.
required | String ID (string) or Integer ID (integer) (ResourceId) Example: r1 Resource identifier. |
| sub_path required | string Example: upstream/nodes Slash-separated nested key path within the resource document. |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
null{- "error_msg": "invalid configuration: property \"uri\" is required"
}A Consumer represents an API user, application, or host that consumes your APIs. Consumers are typically used with authentication plugins (e.g., key-auth, jwt-auth) to identify callers and apply per-consumer rate limits or access controls.
Each consumer is uniquely identified by a username and can belong to a consumer group.
See Consumers documentation for more.
Create a new consumer or update an existing one. The consumer is identified by username in the request body.
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Consumer configuration body for create / replace / patch.
| username required | string [ 1 .. 256 ] characters ^[a-zA-Z0-9_\-]+$ Unique username for the consumer. Only alphanumeric characters, hyphens, and underscores are allowed. |
| desc | string <= 256 characters Description of this consumer. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to a Consumer Group for shared plugin configurations. | |
object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
{- "username": "my-app",
- "desc": "Mobile application consumer",
- "labels": {
- "team": "mobile",
- "env": "production"
}, - "plugins": {
- "key-auth": {
- "key": "app-secret-key-123"
}
}
}{- "key": "/apisix/consumers/jack",
- "value": {
- "plugins": {
- "limit-count": {
- "time_window": 60,
- "rejected_code": 503,
- "key": "remote_addr",
- "key_type": "var",
- "count": 2,
- "show_limit_quota_header": true,
- "allow_degradation": false,
- "policy": "local"
}
}, - "username": "jack",
- "create_time": 1683164776,
- "update_time": 1684289832
}
}Retrieve all configured consumers.
| label | string Example: label=env Filter list to resources with the given label key. |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "list": [
- {
- "value": {
- "plugins": {
- "limit-count": {
- "rejected_code": 503,
- "time_window": 60,
- "key": "remote_addr",
- "key_type": "var",
- "count": 2,
- "allow_degradation": false,
- "show_limit_quota_header": true,
- "policy": "local"
}
}, - "username": "jack",
- "create_time": 1683164776,
- "update_time": 1684289832
}, - "key": "/apisix/consumers/jack",
- "modifiedIndex": 119,
- "createdIndex": 17
}
], - "total": 1
}Retrieve a single consumer by username.
| username required | string [ 1 .. 256 ] characters ^[a-zA-Z0-9_\-]+$ Example: jack Consumer username. |
{- "value": {
- "plugins": {
- "limit-count": {
- "rejected_code": 503,
- "time_window": 60,
- "key": "remote_addr",
- "key_type": "var",
- "count": 2,
- "allow_degradation": false,
- "show_limit_quota_header": true,
- "policy": "local"
}
}, - "username": "jack",
- "create_time": 1683164776,
- "update_time": 1684289832
}, - "key": "/apisix/consumers/jack",
- "modifiedIndex": 119,
- "createdIndex": 17
}Delete a consumer by username. This also deletes all associated credentials.
| username required | string [ 1 .. 256 ] characters ^[a-zA-Z0-9_\-]+$ Example: jack Consumer username. |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "key": "/apisix/consumers/jack",
- "deleted": "1"
}A Consumer Group allows you to define shared plugin configurations that apply to multiple consumers. Instead of duplicating plugin settings across consumers, assign them to a group.
Consumers reference a group via the group_id field. Group-level plugins are merged with consumer-level plugins, with consumer-level taking precedence.
See Consumer Groups documentation for more.
Retrieve all configured consumer groups.
| name | string Filter list by |
| label | string Example: label=env Filter list to resources with the given label key. |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "list": [
- {
- "value": {
- "plugins": {
- "limit-count": {
- "allow_degradation": false,
- "count": 2,
- "group": "consumer_group_name",
- "time_window": 60,
- "show_limit_quota_header": true,
- "key": "remote_addr",
- "rejected_code": 503,
- "key_type": "var",
- "policy": "local"
}
}, - "desc": "desc",
- "id": "company_a",
- "create_time": 1684377809,
- "update_time": 1684378459
}, - "key": "/apisix/consumer_groups/company_a",
- "modifiedIndex": 144,
- "createdIndex": 143
}
], - "total": 1
}Create a new consumer group with a specified ID, or fully replace an existing one.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
ConsumerGroup configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name. |
| desc | string <= 256 characters Description of this group. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
required | object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
{- "plugins": {
- "limit-count": {
- "count": 200,
- "time_window": 60,
- "rejected_code": 429,
- "key_type": "var",
- "key": "consumer_name"
}
}
}{- "key": "/apisix/consumer_groups/company_a",
- "value": {
- "plugins": {
- "limit-count": {
- "allow_degradation": false,
- "count": 2,
- "group": "company_a",
- "time_window": 60,
- "key": "remote_addr",
- "key_type": "var",
- "show_limit_quota_header": true,
- "rejected_code": 503,
- "policy": "local"
}
}, - "desc": "desc",
- "id": "company_a",
- "create_time": 1684377809,
- "update_time": 1684378459
}
}Retrieve a single consumer group by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
{- "value": {
- "plugins": {
- "limit-count": {
- "allow_degradation": false,
- "count": 2,
- "group": "consumer_group_name",
- "time_window": 60,
- "show_limit_quota_header": true,
- "key": "remote_addr",
- "rejected_code": 503,
- "key_type": "var",
- "policy": "local"
}
}, - "desc": "desc",
- "id": "company_a",
- "create_time": 1684377809,
- "update_time": 1684378459
}, - "key": "/apisix/consumer_groups/company_a",
- "modifiedIndex": 144,
- "createdIndex": 143
}Partially update a consumer group's configuration.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
ConsumerGroup configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name. |
| desc | string <= 256 characters Description of this group. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
required | object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
{- "plugins": {
- "limit-count": {
- "count": 200,
- "time_window": 60,
- "rejected_code": 429,
- "key_type": "var",
- "key": "consumer_name"
}
}
}{- "key": "/apisix/consumer_groups/company_a",
- "value": {
- "plugins": {
- "limit-count": {
- "allow_degradation": false,
- "count": 2,
- "group": "consumer_group_name",
- "time_window": 60,
- "show_limit_quota_header": true,
- "key": "remote_addr",
- "rejected_code": 503,
- "key_type": "var",
- "policy": "local"
}, - "prometheus": {
- "prefer_name": false
}
}, - "desc": "desc",
- "id": "company_a",
- "create_time": 1684377809,
- "update_time": 1684379208
}
}Delete a consumer group by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "key": "/apisix/consumer_groups/company_a",
- "deleted": "1"
}Replaces the value at sub_path (slash-separated nested key path within the consumer group document, e.g. upstream/nodes) with the request body. The body is any valid JSON value, not necessarily an object.
required | String ID (string) or Integer ID (integer) (ResourceId) Example: r1 Resource identifier. |
| sub_path required | string Example: upstream/nodes Slash-separated nested key path within the resource document. |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
null{- "error_msg": "invalid configuration: property \"uri\" is required"
}A Credential stores authentication configuration associated with a consumer. Each credential holds exactly one authentication plugin (e.g., key-auth, basic-auth, jwt-auth).
Credentials are sub-resources of consumers. A consumer can have multiple credentials, each for a different authentication method.
See Credentials documentation for more.
Retrieve all credentials for a specific consumer.
| username required | string [ 1 .. 256 ] characters ^[a-zA-Z0-9_\-]+$ Example: jack Consumer username. |
| name | string Filter list by |
| label | string Example: label=env Filter list to resources with the given label key. |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "total": 2,
- "list": [
- {
- "key": "/apisix/consumers/john/credentials/cred-john-basic-auth",
- "value": {
- "update_time": 1725991703,
- "id": "cred-john-basic-auth",
- "plugins": {
- "basic-auth": {
- "password": "john-pass",
- "username": "john-key"
}
}, - "create_time": 1725991529
}, - "createdIndex": 42,
- "modifiedIndex": 44
}, - {
- "key": "/apisix/consumers/john/credentials/cred-john-key-auth",
- "value": {
- "update_time": 1725991703,
- "id": "cred-john-key-auth",
- "plugins": {
- "key-auth": {
- "key": "john-key"
}
}, - "create_time": 1725991703
}, - "createdIndex": 43,
- "modifiedIndex": 43
}
]
}Retrieve a specific credential for a consumer.
| username required | string [ 1 .. 256 ] characters ^[a-zA-Z0-9_\-]+$ Example: jack Consumer username. |
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
{- "total": 1,
- "list": [
- {
- "key": "/apisix/consumers/john/credentials/cred-john-basic-auth",
- "value": {
- "update_time": 1725991529,
- "id": "cred-john-basic-auth",
- "plugins": {
- "basic-auth": {
- "password": "john-pass",
- "username": "john-key"
}
}, - "create_time": 1725991529
}, - "createdIndex": 42,
- "modifiedIndex": 42
}
]
}Create a new credential for a consumer with a specified ID, or replace an existing one.
Each credential holds exactly one authentication plugin.
| username required | string [ 1 .. 256 ] characters ^[a-zA-Z0-9_\-]+$ Example: jack Consumer username. |
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Credential configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name. |
| desc | string <= 256 characters Description of this credential. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
| plugins | object <= 1 properties Exactly one authentication plugin configuration (e.g., |
{- "plugins": {
- "key-auth": {
- "key": "credential-secret-key-456"
}
}
}{- "key": "/apisix/consumers/john/credentials/cred-john-key-auth",
- "value": {
- "create_time": 1725991703,
- "id": "cred-john-key-auth",
- "plugins": {
- "key-auth": {
- "key": "john-key"
}
}, - "update_time": 1725991703
}
}Delete a specific credential from a consumer.
| username required | string [ 1 .. 256 ] characters ^[a-zA-Z0-9_\-]+$ Example: jack Consumer username. |
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Value: "true" Example: force=true When |
{- "key": "/apisix/consumers/john/credentials/cred-john-key-auth",
- "deleted": "1"
}Plugins extend APISIX's core functionality with middleware capabilities such as authentication, traffic control, observability, and request/response transformation.
Use these endpoints to query available plugins and their JSON schemas, or to hot-reload plugins without restarting APISIX.
Plugins are attached to routes, services, consumers, or global rules via the plugins object.
See Plugin Hub for the full list of available plugins.
Get a list of all available plugin names, optionally filtered by subsystem (http or stream).
| subsystem | string Default: "http" Enum: "http" "stream" Plugin subsystem. |
[- "real-ip",
- "ai",
- "client-control",
- "proxy-control",
- "request-id",
- "zipkin",
- "ext-plugin-pre-req",
- "fault-injection",
- "mocking",
- "serverless-pre-function",
- "cors",
- "ip-restriction",
- "ua-restriction",
- "referer-restriction",
- "csrf",
- "uri-blocker",
- "request-validation",
- "openid-connect",
- "cas-auth",
- "authz-casbin",
- "authz-casdoor",
- "wolf-rbac",
- "ldap-auth",
- "hmac-auth",
- "basic-auth",
- "jwt-auth",
- "key-auth",
- "consumer-restriction",
- "forward-auth",
- "opa",
- "authz-keycloak",
- "body-transformer",
- "proxy-mirror",
- "proxy-cache",
- "proxy-rewrite",
- "workflow",
- "api-breaker",
- "limit-conn",
- "limit-count",
- "limit-req",
- "gzip",
- "server-info",
- "traffic-split",
- "redirect",
- "response-rewrite",
- "degraphql",
- "kafka-proxy",
- "grpc-transcode",
- "grpc-web",
- "public-api",
- "prometheus",
- "datadog",
- "elasticsearch-logger",
- "echo",
- "loggly",
- "http-logger",
- "splunk-hec-logging",
- "skywalking-logger",
- "google-cloud-logging",
- "sls-logger",
- "tcp-logger",
- "kafka-logger",
- "rocketmq-logger",
- "syslog",
- "udp-logger",
- "file-logger",
- "clickhouse-logger",
- "tencent-cloud-cls",
- "inspect",
- "example-plugin",
- "aws-lambda",
- "azure-functions",
- "openwhisk",
- "openfunction",
- "serverless-post-function",
- "ext-plugin-post-req",
- "ext-plugin-post-resp"
]Retrieve the JSON Schema definition for a specific plugin. This is useful for validating plugin configurations before applying them.
| plugin_name required | string non-empty Example: limit-count Plugin name. |
| subsystem | string Default: "http" Enum: "http" "stream" Plugin subsystem. |
{- "$comment": "this is a mark for our injected plugin schema.",
- "type": "object",
- "required": [
- "count",
- "time_window"
], - "properties": {
- "_meta": {
- "description": "Metadata configuration for the plugin.",
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "disable": {
- "description": "If set to true, disables the plugin execution.",
- "type": "boolean"
}, - "error_response": {
- "description": "Custom error response when the plugin rejects a request.",
- "oneOf": [
- {
- "type": "string"
}, - {
- "type": "object"
}
]
}, - "filter": {
- "description": "Filter determines whether the plugin needs to be executed at runtime.",
- "type": "array",
- "items": { }
}, - "pre_function": {
- "description": "Function to be executed before plugin execution with access to conf and ctx parameters.",
- "type": "string"
}, - "priority": {
- "description": "Priority of plugins by customized order.",
- "type": "integer"
}
}
}, - "allow_degradation": {
- "description": "If set to true, enables degradation when the rate limiting backend is unavailable.",
- "type": "boolean",
- "default": false
}, - "count": {
- "description": "Maximum number of requests allowed within the time window.",
- "type": "integer",
- "exclusiveMinimum": 0
}, - "group": {
- "description": "Group identifier for the rate limiting configuration.",
- "type": "string"
}, - "key": {
- "description": "Key to use for rate limiting identification.",
- "type": "string",
- "default": "remote_addr"
}, - "key_type": {
- "description": "Type of the key used for rate limiting.",
- "type": "string",
- "enum": [
- "var",
- "var_combination",
- "constant"
], - "default": "var"
}, - "policy": {
- "description": "Policy for rate limiting behavior.",
- "type": "string",
- "enum": [
- "local",
- "redis",
- "redis-cluster"
], - "default": "local"
}, - "rejected_code": {
- "description": "HTTP status code returned when requests exceed the limit.",
- "type": "integer",
- "default": 503,
- "minimum": 200,
- "maximum": 599
}, - "rejected_msg": {
- "description": "Custom message returned when requests exceed the limit.",
- "type": "string",
- "minLength": 1
}, - "show_limit_quota_header": {
- "description": "If set to true, adds X-RateLimit-Limit and X-RateLimit-Remaining headers to responses.",
- "type": "boolean",
- "default": true
}, - "time_window": {
- "description": "Time window in seconds for rate limiting.",
- "type": "integer",
- "exclusiveMinimum": 0
}
}, - "if": {
- "properties": {
- "policy": {
- "enum": [
- "redis"
]
}
}
}, - "then": {
- "properties": {
- "redis_database": {
- "description": "Redis database index.",
- "type": "integer",
- "default": 0,
- "minimum": 0
}, - "redis_host": {
- "description": "Redis server host address.",
- "type": "string",
- "minLength": 2
}, - "redis_password": {
- "description": "Password for Redis authentication.",
- "type": "string",
- "minLength": 0
}, - "redis_port": {
- "description": "Redis server port.",
- "type": "integer",
- "default": 6379,
- "minimum": 1
}, - "redis_ssl": {
- "description": "If set to true, enables SSL encryption for Redis connections.",
- "type": "boolean",
- "default": false
}, - "redis_ssl_verify": {
- "description": "If set to true, verifies SSL certificates for Redis connections.",
- "type": "boolean",
- "default": false
}, - "redis_timeout": {
- "description": "Timeout in milliseconds for Redis operations.",
- "type": "integer",
- "default": 1000,
- "minimum": 1
}, - "redis_username": {
- "description": "Username for Redis authentication.",
- "type": "string",
- "minLength": 1
}
}, - "required": [
- "redis_host"
]
}, - "else": {
- "if": {
- "properties": {
- "policy": {
- "enum": [
- "redis-cluster"
]
}
}
}, - "then": {
- "properties": {
- "redis_cluster_name": {
- "description": "Name of the Redis cluster.",
- "type": "string"
}, - "redis_cluster_nodes": {
- "description": "List of Redis cluster node addresses.",
- "type": "array",
- "minItems": 1,
- "items": {
- "type": "string",
- "minLength": 2,
- "maxLength": 100
}
}, - "redis_cluster_ssl": {
- "description": "If set to true, enables SSL encryption for Redis cluster connections.",
- "type": "boolean",
- "default": false
}, - "redis_cluster_ssl_verify": {
- "description": "If set to true, verifies SSL certificates for Redis cluster connections.",
- "type": "boolean",
- "default": false
}, - "redis_password": {
- "description": "Password for Redis cluster authentication.",
- "type": "string",
- "minLength": 0
}, - "redis_timeout": {
- "description": "Timeout in milliseconds for Redis cluster operations.",
- "type": "integer",
- "default": 1000,
- "minimum": 1
}
}, - "required": [
- "redis_cluster_nodes",
- "redis_cluster_name"
]
}
}
}Get attributes of all plugins configured on the APISIX instance.
Deprecated: This endpoint is being replaced. Use
GET /plugins/listandGET /plugins/{plugin_name}instead.
| all | string Deprecated Value: "true" Deprecated. When |
| subsystem | string Default: "http" Enum: "http" "stream" Plugin subsystem. |
{- "limit-conn": {
- "priority": 1003,
- "version": 0.1,
- "schema": {
- "type": "object",
- "$comment": "this is a mark for our injected plugin schema",
- "required": [
- "conn",
- "burst",
- "default_conn_delay",
- "key"
], - "properties": {
- "only_use_default_delay": {
- "type": "boolean",
- "default": false
}, - "conn": {
- "type": "integer",
- "exclusiveMinimum": 0
}, - "burst": {
- "type": "integer",
- "minimum": 0
}, - "key_type": {
- "type": "string",
- "enum": [
- "var",
- "var_combination"
], - "default": "var"
}, - "_meta": {
- "type": "object",
- "properties": {
- "filter": {
- "type": "array",
- "description": "filter determines whether the plugin needs to be executed at runtime",
- "items": { }
}, - "error_response": {
- "oneOf": [
- {
- "type": "string"
}, - {
- "type": "object"
}
]
}, - "priority": {
- "type": "integer",
- "description": "priority of plugins by customized order"
}, - "disable": {
- "type": "boolean"
}
}
}, - "key": {
- "type": "string"
}, - "default_conn_delay": {
- "type": "number",
- "exclusiveMinimum": 0
}
}
}
}, - "syslog": {
- "schema": {
- "type": "object",
- "$comment": "this is a mark for our injected plugin schema",
- "required": [
- "host",
- "port"
], - "properties": {
- "_meta": {
- "type": "object",
- "properties": {
- "filter": {
- "type": "array",
- "description": "filter determines whether the plugin needs to be executed at runtime",
- "items": { }
}, - "error_response": {
- "oneOf": [
- {
- "type": "string"
}, - {
- "type": "object"
}
]
}, - "priority": {
- "type": "integer",
- "description": "priority of plugins by customized order"
}, - "disable": {
- "type": "boolean"
}
}
}, - "host": {
- "type": "string"
}, - "max_retry_count": {
- "type": "integer",
- "default": 0,
- "minimum": 0
}, - "drop_limit": {
- "type": "integer",
- "default": 1048576
}, - "flush_limit": {
- "type": "integer",
- "default": 4096,
- "minimum": 1
}, - "pool_size": {
- "type": "integer",
- "default": 5,
- "minimum": 5
}, - "sock_type": {
- "type": "string",
- "default": "tcp",
- "enum": [
- "tcp",
- "udp"
]
}, - "buffer_duration": {
- "type": "integer",
- "default": 60,
- "minimum": 1
}, - "retry_delay": {
- "type": "integer",
- "default": 1,
- "minimum": 0
}, - "tls": {
- "type": "boolean",
- "default": false
}, - "name": {
- "type": "string",
- "default": "stream sys logger"
}, - "log_format": {
- "type": "object"
}, - "batch_max_size": {
- "type": "integer",
- "default": 1000,
- "minimum": 1
}, - "timeout": {
- "type": "integer",
- "default": 3000,
- "minimum": 1
}, - "inactive_timeout": {
- "type": "integer",
- "default": 5,
- "minimum": 1
}, - "port": {
- "type": "integer"
}
}
}, - "priority": 401,
- "version": 0.1,
- "metadata_schema": {
- "type": "object",
- "properties": {
- "log_format": {
- "type": "object",
- "default": {
- "@timestamp": "$time_iso8601",
- "host": "$host",
- "client_ip": "$remote_addr"
}
}
}
}
}, - "ip-restriction": {
- "priority": 3000,
- "version": 0.1,
- "schema": {
- "type": "object",
- "oneOf": [
- {
- "required": [
- "whitelist"
]
}, - {
- "required": [
- "blacklist"
]
}
], - "$comment": "this is a mark for our injected plugin schema",
- "properties": {
- "message": {
- "type": "string",
- "minLength": 1,
- "maxLength": 1024,
- "default": "Your IP address is not allowed"
}, - "_meta": {
- "type": "object",
- "properties": {
- "filter": {
- "type": "array",
- "description": "filter determines whether the plugin needs to be executed at runtime",
- "items": { }
}, - "error_response": {
- "oneOf": [
- {
- "type": "string"
}, - {
- "type": "object"
}
]
}, - "priority": {
- "type": "integer",
- "description": "priority of plugins by customized order"
}, - "disable": {
- "type": "boolean"
}
}
}, - "blacklist": {
- "type": "array",
- "minItems": 1,
- "items": {
- "anyOf": [
- {
- "type": "string",
- "format": "ipv4",
- "title": "IPv4"
}, - {
- "type": "string",
- "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$",
- "title": "IPv4/CIDR"
}, - {
- "type": "string",
- "format": "ipv6",
- "title": "IPv6"
}, - {
- "type": "string",
- "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$",
- "title": "IPv6/CIDR"
}
]
}
}, - "whitelist": {
- "type": "array",
- "minItems": 1,
- "items": {
- "anyOf": [
- {
- "type": "string",
- "format": "ipv4",
- "title": "IPv4"
}, - {
- "type": "string",
- "pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])/([12]?[0-9]|3[0-2])$",
- "title": "IPv4/CIDR"
}, - {
- "type": "string",
- "format": "ipv6",
- "title": "IPv6"
}, - {
- "type": "string",
- "pattern": "^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?/[0-9]{1,3}$",
- "title": "IPv6/CIDR"
}
]
}
}
}
}
}, - "mqtt-proxy": {
- "priority": 1000,
- "version": 0.1,
- "schema": {
- "type": "object",
- "$comment": "this is a mark for our injected plugin schema",
- "required": [
- "protocol_name",
- "protocol_level"
], - "properties": {
- "_meta": {
- "type": "object",
- "properties": {
- "filter": {
- "type": "array",
- "description": "filter determines whether the plugin needs to be executed at runtime",
- "items": { }
}, - "error_response": {
- "oneOf": [
- {
- "type": "string"
}, - {
- "type": "object"
}
]
}, - "priority": {
- "type": "integer",
- "description": "priority of plugins by customized order"
}, - "disable": {
- "type": "boolean"
}
}
}, - "protocol_name": {
- "type": "string"
}, - "protocol_level": {
- "type": "integer"
}
}
}
}
}Trigger a hot reload of all plugins. This re-reads plugin configurations from etcd without restarting APISIX.
Important: Only the PUT method is accepted.
curl -i http://127.0.0.1:9180/apisix/admin/plugins/reload \ -H 'X-API-KEY: your-api-key' -X PUT
"done"A Plugin Config is a reusable set of plugin configurations that can be shared across multiple routes. Instead of duplicating plugin settings in each route, create a plugin config and reference it via plugin_config_id.
Route-level plugins are merged with plugin config plugins, with route-level taking precedence.
See Plugin Configs documentation for more.
Retrieve all configured plugin configs.
| name | string Filter list by |
| label | string Example: label=env Filter list to resources with the given label key. |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "list": [
- {
- "value": {
- "plugins": {
- "limit-count": {
- "rejected_code": 503,
- "time_window": 60,
- "key": "remote_addr",
- "key_type": "var",
- "count": 2,
- "allow_degradation": false,
- "show_limit_quota_header": true,
- "policy": "local"
}
}, - "desc": "desc",
- "id": "1",
- "create_time": 1684380007,
- "update_time": 1684380034
}, - "key": "/apisix/plugin_configs/1",
- "modifiedIndex": 151,
- "createdIndex": 150
}
], - "total": 1
}Create a new plugin config with a specified ID, or fully replace an existing one.
| id required | integer Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
PluginConfig configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string Human-readable name. |
| desc | string <= 256 characters Description. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
required | object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
{- "plugins": {
- "limit-count": {
- "count": 100,
- "time_window": 60,
- "rejected_code": 429,
- "key_type": "var",
- "key": "remote_addr"
}, - "proxy-rewrite": {
- "uri": "/backend$uri"
}
}
}{- "key": "/apisix/plugin_configs/1",
- "value": {
- "plugins": {
- "limit-count": {
- "time_window": 60,
- "rejected_code": 503,
- "key": "remote_addr",
- "key_type": "var",
- "count": 2,
- "show_limit_quota_header": true,
- "allow_degradation": false,
- "policy": "local"
}
}, - "desc": "desc",
- "id": "1",
- "create_time": 1684380007,
- "update_time": 1684380034
}
}Retrieve a single plugin config by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
{- "value": {
- "plugins": {
- "limit-count": {
- "rejected_code": 503,
- "time_window": 60,
- "key": "remote_addr",
- "key_type": "var",
- "count": 2,
- "allow_degradation": false,
- "show_limit_quota_header": true,
- "policy": "local"
}
}, - "desc": "desc",
- "id": "1",
- "create_time": 1684380007,
- "update_time": 1684380034
}, - "key": "/apisix/plugin_configs/1",
- "modifiedIndex": 151,
- "createdIndex": 150
}Partially update a plugin config's configuration.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
PluginConfig configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string Human-readable name. |
| desc | string <= 256 characters Description. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
required | object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
{- "plugins": {
- "limit-count": {
- "count": 100,
- "time_window": 60,
- "rejected_code": 429,
- "key_type": "var",
- "key": "remote_addr"
}, - "proxy-rewrite": {
- "uri": "/backend$uri"
}
}
}{- "key": "/apisix/plugin_configs/1",
- "value": {
- "plugins": {
- "limit-count": {
- "rejected_code": 503,
- "time_window": 60,
- "key": "remote_addr",
- "key_type": "var",
- "count": 2,
- "allow_degradation": false,
- "show_limit_quota_header": true,
- "policy": "local"
}, - "prometheus": {
- "prefer_name": false
}
}, - "desc": "desc",
- "id": "1",
- "create_time": 1684380007,
- "update_time": 1684380472
}
}Delete a plugin config by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "key": "/apisix/plugin_configs/1",
- "deleted": "1"
}Replaces the value at sub_path (slash-separated nested key path within the plugin config document, e.g. upstream/nodes) with the request body. The body is any valid JSON value, not necessarily an object.
required | String ID (string) or Integer ID (integer) (ResourceId) Example: r1 Resource identifier. |
| sub_path required | string Example: upstream/nodes Slash-separated nested key path within the resource document. |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
null{- "error_msg": "invalid configuration: property \"uri\" is required"
}Plugin Metadata configures shared settings that apply to all instances of a specific plugin across the entire APISIX cluster. This is useful for plugins that need global configuration, such as log format templates.
For example, setting metadata for http-logger will affect every route that uses http-logger.
See Plugin Metadata documentation for more.
Retrieve metadata for all plugins that have metadata configured.
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "list": [
- {
- "value": {
- "log_format": {
- "host": "$host",
- "@timestamp": "$time_iso8601",
- "client_ip": "$remote_addr"
}
}, - "key": "/apisix/plugin_metadata/syslog",
- "modifiedIndex": 283,
- "createdIndex": 283
}
], - "total": 1
}Set metadata for a specific plugin. This applies to all instances of the plugin across the cluster.
| plugin_name required | string non-empty Example: limit-count Plugin name. |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Plugin metadata. The body schema is plugin-specific (the plugin's metadata_schema). Fetch via GET /apisix/admin/schema/plugins/{plugin_name}.
| property name* additional property | any |
{ }{- "key": "/apisix/plugin_metadata/syslog",
- "value": {
- "log_format": {
- "host": "$host",
- "@timestamp": "$time_iso8601",
- "client_ip": "$remote_addr"
}
}
}Retrieve metadata for a specific plugin by plugin name.
| plugin_name required | string non-empty Example: limit-count Plugin name. |
{- "value": {
- "log_format": {
- "host": "$host",
- "@timestamp": "$time_iso8601",
- "client_ip": "$remote_addr"
}
}, - "key": "/apisix/plugin_metadata/syslog",
- "modifiedIndex": 156,
- "createdIndex": 156
}Delete metadata for a specific plugin.
| plugin_name required | string non-empty Example: limit-count Plugin name. |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "key": "/apisix/plugin_metadata/syslog",
- "deleted": "1"
}A Global Rule defines plugins that are executed on every incoming request, before any route-specific plugins run. Use global rules for cross-cutting concerns like IP allowlists, request logging, or metrics collection.
Global rules are evaluated in order of their id. Plugin execution order within a global rule follows standard APISIX plugin priority.
See Global Rules documentation for more.
Retrieve all configured global rules.
| name | string Filter list by |
| label | string Example: label=env Filter list to resources with the given label key. |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "list": [
- {
- "value": {
- "plugins": {
- "limit-count": {
- "rejected_code": 503,
- "time_window": 60,
- "key": "remote_addr",
- "key_type": "var",
- "count": 2,
- "allow_degradation": false,
- "show_limit_quota_header": true,
- "policy": "local"
}
}, - "update_time": 1684375502,
- "create_time": 1684375502,
- "id": "1"
}, - "key": "/apisix/global_rules/1",
- "modifiedIndex": 137,
- "createdIndex": 137
}
], - "total": 1
}Create a new global rule with a specified ID, or fully replace an existing one.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
GlobalRule configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
required | object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
{- "plugins": {
- "prometheus": { },
- "ip-restriction": {
- "whitelist": [
- "10.0.0.0/8",
- "172.16.0.0/12"
]
}
}
}{- "key": "/apisix/global_rules/1",
- "value": {
- "plugins": {
- "limit-count": {
- "time_window": 60,
- "rejected_code": 503,
- "key": "remote_addr",
- "key_type": "var",
- "count": 2,
- "show_limit_quota_header": true,
- "allow_degradation": false,
- "policy": "local"
}
}, - "id": "1",
- "create_time": 1684375502,
- "update_time": 1684375502
}
}Retrieve a single global rule by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
{- "value": {
- "plugins": {
- "limit-count": {
- "rejected_code": 503,
- "time_window": 60,
- "key": "remote_addr",
- "key_type": "var",
- "count": 2,
- "allow_degradation": false,
- "show_limit_quota_header": true,
- "policy": "local"
}
}, - "update_time": 1684375502,
- "create_time": 1684375502,
- "id": "1"
}, - "key": "/apisix/global_rules/1",
- "modifiedIndex": 137,
- "createdIndex": 137
}Partially update a global rule's configuration.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
GlobalRule configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
required | object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
{- "plugins": {
- "prometheus": { },
- "ip-restriction": {
- "whitelist": [
- "10.0.0.0/8",
- "172.16.0.0/12"
]
}
}
}{- "key": "/apisix/global_rules/1",
- "value": {
- "plugins": {
- "limit-count": {
- "rejected_code": 503,
- "time_window": 60,
- "key": "remote_addr",
- "key_type": "var",
- "count": 3,
- "allow_degradation": false,
- "show_limit_quota_header": true,
- "policy": "local"
}
}, - "update_time": 1684376614,
- "create_time": 1684375502,
- "id": "1"
}
}Delete a global rule by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "key": "/apisix/global_rules/1",
- "deleted": "1"
}Replaces the value at sub_path (slash-separated nested key path within the global rule document, e.g. upstream/nodes) with the request body. The body is any valid JSON value, not necessarily an object.
required | String ID (string) or Integer ID (integer) (ResourceId) Example: r1 Resource identifier. |
| sub_path required | string Example: upstream/nodes Slash-separated nested key path within the resource document. |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
null{- "error_msg": "invalid configuration: property \"uri\" is required"
}A Stream Route defines TCP/UDP layer (L4) proxying rules. Unlike HTTP routes, stream routes operate at the transport layer and can proxy raw TCP and UDP connections.
Stream routes match traffic by remote_addr, server_addr, server_port, or sni (for TLS connections).
Note: Stream mode must be enabled in config.yaml (apisix.proxy_mode: stream or http&stream) before creating stream routes.
See Stream Routes documentation for more.
Retrieve all configured stream (L4) routes.
Prerequisite: Stream mode must be enabled in config.yaml.
| name | string Filter list by |
| label | string Example: label=env Filter list to resources with the given label key. |
| filter | string Filter expression. Supports |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "total": 1,
- "list": [
- {
- "createdIndex": 173,
- "key": "/apisix/stream_routes/1",
- "value": {
- "id": "1",
- "create_time": 1684392990,
- "server_addr": "127.0.0.1",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "127.0.0.1:1995": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "update_time": 1684392990,
- "server_port": 2000
}, - "modifiedIndex": 173
}
]
}Create a new stream route with an auto-generated ID.
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
StreamRoute configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name. |
| desc | string <= 256 characters Description. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
| remote_addr | string Client IP address or CIDR range to match. |
| server_addr | string Server IP address to match. |
| server_port | integer [ 1 .. 65535 ] Server port to match. |
| sni | string SNI hostname to match (for TLS connections). |
Use Upstream Nodes (object) or Use Service Registry (object) (Upstream) | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Upstream. | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Service. | |
object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
{- "server_addr": "127.0.0.1",
- "server_port": 2000,
- "upstream": {
- "nodes": {
- "127.0.0.1:1995": 1
}, - "type": "roundrobin"
}
}{- "value": {
- "id": "00000000000000000176",
- "create_time": 1684393167,
- "server_addr": "127.0.0.1",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "127.0.0.1:1995": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "update_time": 1684393167,
- "server_port": 2000
}, - "key": "/apisix/stream_routes/00000000000000000176"
}Get stream route by ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
{- "id": "1",
- "create_time": 1684392990,
- "server_addr": "127.0.0.1",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "127.0.0.1:1995": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "update_time": 1684392990,
- "server_port": 2000
}Create a stream route with a specified ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
StreamRoute configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name. |
| desc | string <= 256 characters Description. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
| remote_addr | string Client IP address or CIDR range to match. |
| server_addr | string Server IP address to match. |
| server_port | integer [ 1 .. 65535 ] Server port to match. |
| sni | string SNI hostname to match (for TLS connections). |
Use Upstream Nodes (object) or Use Service Registry (object) (Upstream) | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Upstream. | |
String ID (string) or Integer ID (integer) (ResourceId) Reference to an existing Service. | |
object (Plugins) Plugin configurations as a JSON object. Each key is a plugin name, and the value is that plugin's configuration object. Example:
See the Plugin Hub for available plugins and their schemas. |
{- "server_addr": "127.0.0.1",
- "server_port": 2000,
- "upstream": {
- "nodes": {
- "127.0.0.1:1995": 1
}, - "type": "roundrobin"
}
}{- "value": {
- "id": "00000000000000000176",
- "create_time": 1684393167,
- "server_addr": "127.0.0.1",
- "upstream": {
- "hash_on": "vars",
- "pass_host": "pass",
- "nodes": {
- "127.0.0.1:1995": 1
}, - "type": "roundrobin",
- "scheme": "http"
}, - "update_time": 1684393167,
- "server_port": 2000
}, - "key": "/apisix/stream_routes/00000000000000000176"
}Delete a stream route by ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "deleted": "1",
- "key": "/apisix/stream_routes/1"
}The SSL resource manages TLS certificates for HTTPS termination and mTLS authentication.
Certificate Types
server — Server certificate for HTTPS termination (matched by SNI)client — Client certificate for mTLS with upstream servicesAPISIX dynamically selects the correct certificate based on the SNI (Server Name Indication) in the TLS handshake. Certificates can be rotated without restart.
See SSL documentation for more.
Retrieve all configured SSL certificates. Private keys are not included in the response for security.
| label | string Example: label=env Filter list to resources with the given label key. |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "list": [
- {
- "value": {
- "type": "server",
- "key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDh5cAWYXAMPLEbe\nfakekeyForOpenAPISpecPlaceholderOnlyDoNotUseForRealKeysNopeNopeNo\npeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNo\npeNopeNopeNopeNopeNopeNope==\n-----END PRIVATE KEY-----\n",
- "snis": [
- "test.com"
], - "id": "1",
- "create_time": 1684373523,
- "status": 1,
- "cert": "-----BEGIN CERTIFICATE-----\nMIIDazCCAlOgAwIBAgIUJ9hQk3kXgZeZpY/m/0V6RmH1AbcwDQYJKoZIhvcNAQEL\nBQAwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM\nGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMB4XDTI1MDEwMTAwMDAwMFoXDTM1\nMDEwMTAwMDAwMFowRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUx\nITAfBgNVBAoMGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4eXAMPLEcaPUBLIcfakeforopeNAPIspecON\nLYexampleCAcontentsoExpandedFakeKeyMaterial==\n-----END CERTIFICATE-----\n",
- "update_time": 1684373523
}, - "key": "/apisix/ssls/1",
- "modifiedIndex": 133,
- "createdIndex": 133
}
], - "total": 1
}Upload a new SSL certificate with an auto-generated ID.
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
SSL configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| desc | string <= 256 characters Description. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
| type | string Default: "server" Enum: "server" "client" Certificate type.
|
| sni required | string Server Name Indication (SNI) to match. Supports wildcard prefix ( |
| snis | Array of strings non-empty Multiple SNI hostnames. Mutually exclusive with |
| cert required | string [ 128 .. 65536 ] characters PEM-encoded server certificate. Can also be a secret reference ( |
| key required | string [ 128 .. 65536 ] characters PEM-encoded private key. Can also be a secret reference ( |
| certs | Array of strings Additional certificates for certificate chain or alternative key types. |
| keys | Array of strings Additional private keys corresponding to |
object mTLS client verification settings. | |
| status | integer Default: 1 Enum: 1 0 SSL status. |
| ssl_protocols | Array of strings <= 3 items unique Items Enum: "TLSv1.1" "TLSv1.2" "TLSv1.3" Allowed TLS protocol versions. |
{- "type": "server",
- "sni": "test.com",
- "cert": "-----BEGIN CERTIFICATE-----\nMIIDazCCAlOgAwIBAgIUJ9hQk3kXgZeZpY/m/0V6RmH1AbcwDQYJKoZIhvcNAQEL\nBQAwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM\nGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMB4XDTI1MDEwMTAwMDAwMFoXDTM1\nMDEwMTAwMDAwMFowRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUx\nITAfBgNVBAoMGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4eXAMPLEcaPUBLIcfakeforopeNAPIspecON\nLYexampleCAcontentsoExpandedFakeKeyMaterial==\n-----END CERTIFICATE-----\n",
- "key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDh5cAWYXAMPLEbe\nfakekeyForOpenAPISpecPlaceholderOnlyDoNotUseForRealKeysNopeNopeNo\npeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNo\npeNopeNopeNopeNopeNopeNope==\n-----END PRIVATE KEY-----\n"
}{- "key": "/apisix/ssls/00000000000000000134",
- "value": {
- "type": "server",
- "cert": "-----BEGIN CERTIFICATE-----\nMIIDazCCAlOgAwIBAgIUJ9hQk3kXgZeZpY/m/0V6RmH1AbcwDQYJKoZIhvcNAQEL\nBQAwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM\nGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMB4XDTI1MDEwMTAwMDAwMFoXDTM1\nMDEwMTAwMDAwMFowRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUx\nITAfBgNVBAoMGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4eXAMPLEcaPUBLIcfakeforopeNAPIspecON\nLYexampleCAcontentsoExpandedFakeKeyMaterial==\n-----END CERTIFICATE-----\n",
- "key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDh5cAWYXAMPLEbe\nfakekeyForOpenAPISpecPlaceholderOnlyDoNotUseForRealKeysNopeNopeNo\npeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNo\npeNopeNopeNopeNopeNopeNope==\n-----END PRIVATE KEY-----\n",
- "id": "00000000000000000134",
- "create_time": 1684374944,
- "status": 1,
- "snis": [
- "test.com"
], - "update_time": 1684374944
}
}Upload a new SSL certificate with a specified ID, or replace an existing one.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
SSL configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| desc | string <= 256 characters Description. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
| type | string Default: "server" Enum: "server" "client" Certificate type.
|
| sni required | string Server Name Indication (SNI) to match. Supports wildcard prefix ( |
| snis | Array of strings non-empty Multiple SNI hostnames. Mutually exclusive with |
| cert required | string [ 128 .. 65536 ] characters PEM-encoded server certificate. Can also be a secret reference ( |
| key required | string [ 128 .. 65536 ] characters PEM-encoded private key. Can also be a secret reference ( |
| certs | Array of strings Additional certificates for certificate chain or alternative key types. |
| keys | Array of strings Additional private keys corresponding to |
object mTLS client verification settings. | |
| status | integer Default: 1 Enum: 1 0 SSL status. |
| ssl_protocols | Array of strings <= 3 items unique Items Enum: "TLSv1.1" "TLSv1.2" "TLSv1.3" Allowed TLS protocol versions. |
{- "type": "server",
- "sni": "api.example.com",
- "cert": "-----BEGIN CERTIFICATE-----\nMIIDazCCAlOgAwIBAgIUJ9hQk3kXgZeZpY/m/0V6RmH1AbcwDQYJKoZIhvcNAQEL\nBQAwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM\nGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMB4XDTI1MDEwMTAwMDAwMFoXDTM1\nMDEwMTAwMDAwMFowRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUx\nITAfBgNVBAoMGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4eXAMPLEcaPUBLIcfakeforopeNAPIspecON\nLYexampleCAcontentsoExpandedFakeKeyMaterial==\n-----END CERTIFICATE-----\n",
- "key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDh5cAWYXAMPLEbe\nfakekeyForOpenAPISpecPlaceholderOnlyDoNotUseForRealKeysNopeNopeNo\npeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNo\npeNopeNopeNopeNopeNopeNope==\n-----END PRIVATE KEY-----\n"
}{- "key": "/apisix/ssls/1",
- "value": {
- "type": "server",
- "key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDh5cAWYXAMPLEbe\nfakekeyForOpenAPISpecPlaceholderOnlyDoNotUseForRealKeysNopeNopeNo\npeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNopeNo\npeNopeNopeNopeNopeNopeNope==\n-----END PRIVATE KEY-----\n",
- "snis": [
- "test.com"
], - "id": "1",
- "create_time": 1684373523,
- "status": 1,
- "cert": "-----BEGIN CERTIFICATE-----\nMIIDazCCAlOgAwIBAgIUJ9hQk3kXgZeZpY/m/0V6RmH1AbcwDQYJKoZIhvcNAQEL\nBQAwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM\nGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMB4XDTI1MDEwMTAwMDAwMFoXDTM1\nMDEwMTAwMDAwMFowRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUx\nITAfBgNVBAoMGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4eXAMPLEcaPUBLIcfakeforopeNAPIspecON\nLYexampleCAcontentsoExpandedFakeKeyMaterial==\n-----END CERTIFICATE-----\n",
- "update_time": 1684373523
}
}Retrieve a single SSL certificate by its ID. The private key is not included in the response.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
{- "value": {
- "type": "server",
- "snis": [
- "test.com"
], - "id": "1",
- "create_time": 1684373523,
- "status": 1,
- "cert": "-----BEGIN CERTIFICATE-----\nMIIDazCCAlOgAwIBAgIUJ9hQk3kXgZeZpY/m/0V6RmH1AbcwDQYJKoZIhvcNAQEL\nBQAwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM\nGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMB4XDTI1MDEwMTAwMDAwMFoXDTM1\nMDEwMTAwMDAwMFowRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUx\nITAfBgNVBAoMGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4eXAMPLEcaPUBLIcfakeforopeNAPIspecON\nLYexampleCAcontentsoExpandedFakeKeyMaterial==\n-----END CERTIFICATE-----\n",
- "update_time": 1684373523
}, - "key": "/apisix/ssls/1",
- "modifiedIndex": 133,
- "createdIndex": 133
}Delete an SSL certificate by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "key": "/apisix/ssls/00000000000000000134",
- "deleted": "1"
}Replaces the value at sub_path (slash-separated nested key path within the SSL document, e.g. upstream/nodes) with the request body. The body is any valid JSON value, not necessarily an object.
required | String ID (string) or Integer ID (integer) (ResourceId) Example: r1 Resource identifier. |
| sub_path required | string Example: upstream/nodes Slash-separated nested key path within the resource document. |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
null{- "error_msg": "invalid configuration: property \"uri\" is required"
}The Secret resource integrates APISIX with external secret managers (e.g., HashiCorp Vault, AWS Secrets Manager) for dynamic secret retrieval at runtime.
Once configured, you can reference secrets in plugin configurations using the URI format: $secret://vault/my-secret/key.
See Secrets documentation for more.
Retrieve all configured secret manager integrations.
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "total": 1,
- "list": [
- {
- "createdIndex": 179,
- "key": "/apisix/secrets/vault/1",
- "value": {
- "token": "343effad",
- "id": "vault/1",
- "prefix": "/apisix/kv",
- "update_time": 1684395392,
- "create_time": 1684395392
}, - "modifiedIndex": 179
}
]
}Retrieve a specific secret manager configuration.
| secret_type required | string Enum: "vault" "aws" "gcp" Example: vault Type of secret manager (e.g., |
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
{- "createdIndex": 179,
- "key": "/apisix/secrets/vault/1",
- "value": {
- "token": "343effad",
- "id": "vault/1",
- "prefix": "/apisix/kv",
- "update_time": 1684395392,
- "create_time": 1684395392
}, - "modifiedIndex": 179
}Configure a secret manager integration with a specified ID.
| secret_type required | string Enum: "vault" "aws" "gcp" Example: vault Type of secret manager (e.g., |
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Secret manager configuration (schema depends on secret_type).
| property name* additional property | any |
{ }{- "value": {
- "prefix": "/apisix/kv",
- "token": "343effad",
- "namespace": "apisix",
- "id": "vault/1",
- "update_time": 1684395392,
- "create_time": 1684395392
}, - "key": "/apisix/secrets/vault/1"
}Partially update a secret manager configuration.
| secret_type required | string Enum: "vault" "aws" "gcp" Example: vault Type of secret manager (e.g., |
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Secret manager configuration (schema depends on secret_type).
| property name* additional property | any |
{ }{- "value": {
- "token": "apisix",
- "id": "vault/1",
- "prefix": "/apisix/kv",
- "update_time": 1684396605,
- "create_time": 1684395392
}, - "key": "/apisix/secrets/vault/1"
}Delete a secret manager configuration.
| secret_type required | string Enum: "vault" "aws" "gcp" Example: vault Type of secret manager (e.g., |
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "deleted": "1",
- "key": "/apisix/secrets/vault/1"
}Returns secrets registered under the given manager (vault, aws, or gcp). For listing across all managers, use GET /apisix/admin/secrets.
| secret_type required | string Enum: "vault" "aws" "gcp" Example: vault Secret manager backend. |
{- "total": 0,
- "list": [
- { }
]
}Replaces the value at sub_path within a secret object.
| secret_type required | string Enum: "vault" "aws" "gcp" Example: vault Secret manager backend. |
required | String ID (string) or Integer ID (integer) (ResourceId) Example: r1 Resource identifier. |
| sub_path required | string Example: upstream/nodes Slash-separated nested key path within the resource document. |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
null{- "error_msg": "failed to check token",
- "description": "missing apikey"
}The Proto resource stores Protocol Buffer (protobuf) .proto file content used by the grpc-transcode plugin to convert between HTTP/JSON and gRPC.
Upload your .proto definitions here, then reference them by ID in the grpc-transcode plugin configuration.
See gRPC Transcode plugin for more.
Upload a protobuf definition with a specified ID, or replace an existing one.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Proto configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name. |
| desc | string <= 256 characters Description. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
| content required | string [ 1 .. 1048576 ] characters Protobuf |
{- "content": "syntax = \"proto3\";\n\npackage helloworld;\n\nservice Greeter {\n rpc SayHello (HelloRequest) returns (HelloReply) {}\n}\n\nmessage HelloRequest {\n string name = 1;\n}\n\nmessage HelloReply {\n string message = 1;\n}"
}{- "key": "/apisix/protos/1",
- "value": {
- "id": "1",
- "create_time": 1684752213,
- "update_time": 1684752213,
- "content": "syntax = \"proto3\";\n package helloworld;\n service Greeter {\n rpc GetErrResp (HelloRequest) returns (HelloReply) {}\n }\n message HelloRequest {\n string name = 1;\n repeated string items = 2;\n }\n message HelloReply {\n string message = 1;\n repeated string items = 2;\n }\n message ErrorDetail {\n int64 code = 1;\n string message = 2;\n string type = 3;\n }"
}
}Retrieve a single protobuf definition by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
{- "value": {
- "id": "1",
- "content": "syntax = \"proto3\";\n package helloworld;\n service Greeter {\n rpc GetErrResp (HelloRequest) returns (HelloReply) {}\n }\n message HelloRequest {\n string name = 1;\n repeated string items = 2;\n }\n message HelloReply {\n string message = 1;\n repeated string items = 2;\n }\n message ErrorDetail {\n int64 code = 1;\n string message = 2;\n string type = 3;\n }",
- "update_time": 1684752213,
- "create_time": 1684752213
}, - "key": "/apisix/protos/1",
- "modifiedIndex": 292,
- "createdIndex": 292
}Delete a protobuf definition by its ID.
| id required | string Example: my-resource-1 Unique identifier of the resource. Can be a string (alphanumeric, |
| force | string Example: force=true Delete resource by force even if the resource is in use. |
{- "key": "/apisix/protos/1",
- "deleted": "1"
}Retrieve all stored protobuf definitions.
| name | string Filter list by |
| label | string Example: label=env Filter list to resources with the given label key. |
| page | integer >= 1 Default: 1 Example: page=1 Page number (1-based). |
| page_size | integer [ 10 .. 500 ] Example: page_size=20 Items per page (10–500). When omitted, no pagination is applied and the full list is returned. |
{- "list": [
- {
- "value": {
- "id": "1",
- "content": "syntax = \"proto3\";\n package helloworld;\n service Greeter {\n rpc GetErrResp (HelloRequest) returns (HelloReply) {}\n }\n message HelloRequest {\n string name = 1;\n repeated string items = 2;\n }\n message HelloReply {\n string message = 1;\n repeated string items = 2;\n }\n message ErrorDetail {\n int64 code = 1;\n string message = 2;\n string type = 3;\n }",
- "update_time": 1684752213,
- "create_time": 1684752213
}, - "key": "/apisix/protos/1",
- "modifiedIndex": 292,
- "createdIndex": 292
}
], - "total": 1
}Upload a new protobuf definition with an auto-generated ID.
| ttl | integer >= 1 Example: ttl=3600 Time-to-live in seconds. The resource is automatically removed when it expires. |
Proto configuration body for create / replace / patch.
String ID (string) or Integer ID (integer) (ResourceId) Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with | |
| name | string [ 1 .. 256 ] characters Human-readable name. |
| desc | string <= 256 characters Description. |
object (Labels) Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters). | |
| content required | string [ 1 .. 1048576 ] characters Protobuf |
{- "content": "syntax = \"proto3\";\n\npackage helloworld;\n\nservice Greeter {\n rpc SayHello (HelloRequest) returns (HelloReply) {}\n}\n\nmessage HelloRequest {\n string name = 1;\n}\n\nmessage HelloReply {\n string message = 1;\n}"
}{- "key": "/apisix/protos/00000000000000000293",
- "value": {
- "create_time": 1684752743,
- "update_time": 1684752743,
- "content": "syntax = \"proto3\";\n package helloworld;\n service Greeter {\n rpc GetErrResp (HelloRequest) returns (HelloReply) {}\n }\n message HelloRequest {\n string name = 1;\n repeated string items = 2;\n }\n message HelloReply {\n string message = 1;\n repeated string items = 2;\n }\n message ErrorDetail {\n int64 code = 1;\n string message = 2;\n string type = 3;\n }",
- "id": "00000000000000000293"
}
}The Schema Validation endpoint lets you validate a resource configuration against APISIX's JSON Schema without actually creating the resource.
Use this for dry-run validation in CI/CD pipelines or configuration management tools.
Validate a resource configuration against APISIX's JSON Schema without creating the resource. Useful for dry-run validation in CI/CD pipelines.
The {resource} path parameter specifies the resource type (e.g., routes, upstreams, services, etc.).
| resource required | string Enum: "routes" "services" "upstreams" "consumers" "ssls" "plugin_configs" "global_rules" "stream_routes" "protos" "consumer_groups" "credentials" Example: routes Resource kind. |
| property name* additional property | any |
{- "uri": "/api/v1/*",
- "upstream": {
- "scheme": "https",
- "type": "roundrobin",
- "nodes": {
- "httpbin.org:443": 1
}
}
}{- "error_msg": "invalid configuration: property \"uri\" is required"
}Returns the JSON Schema document used internally by APISIX to validate the named resource type.
| resource required | string Enum: "routes" "services" "upstreams" "consumers" "ssls" "plugin_configs" "global_rules" "stream_routes" "protos" "consumer_groups" "credentials" Example: routes Resource kind. |
{ }Equivalent to GET /apisix/admin/plugins/{plugin_name}. Provided for symmetry with GET /apisix/admin/schema/{resource}.
| plugin_name required | string non-empty Example: limit-count Plugin name. |
{ }Endpoints exposed when the deployment uses the YAML config provider (deployment.config_provider: yaml).
Replaces the entire current configuration. Available only when deployment.config_provider is yaml.
{ }{- "error_msg": "invalid configuration: property \"uri\" is required"
}Returns 200 OK if the deployment is in YAML provider mode and the configuration endpoint is reachable.
{- "error_msg": "failed to check token",
- "description": "missing apikey"
}Validates the supplied configuration document. The current configuration is not modified.
{ }{- "error_msg": "invalid configuration: property \"uri\" is required"
}