API7 Docs

Validate Resource Configuration

POST /apisix/admin/schema/validate/{resource}

POST /apisix/admin/schema/validate/{resource}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

Admin API key configured in config.yaml under deployment.admin.admin_key. You can also pass the key as a query parameter api_key or cookie x_api_key.

In: header

Path Parameters

resource*string

Resource kind.

Value in

  • "routes"
  • "services"
  • "upstreams"
  • "consumers"
  • "ssls"
  • "plugin_configs"
  • "global_rules"
  • "stream_routes"
  • "protos"
  • "consumer_groups"
  • "credentials"

Request Body

application/json

The resource configuration to validate. The structure depends on the resource type specified in the path parameter.

Response Body

application/json

application/json

curl -X POST "http://127.0.0.1:9180/apisix/admin/schema/validate/routes" \  -H "Content-Type: application/json" \  -d '{    "uri": "/api/v1/*",    "upstream": {      "scheme": "https",      "type": "roundrobin",      "nodes": {        "httpbin.org:443": 1      }    }  }'

Successful response.

Complete operation details and schema variants

POST /apisix/admin/schema/validate/{resource}

Validate Resource Configuration

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.).

Parameters

  • resource (path, string, required): Resource kind.

Request body

Content type: application/json

Responses

  • 200: Successful response.
  • 400: Bad Request — The request body is invalid or missing required fields.
  • error_msg (string, required): Human-readable error message describing what went wrong.
  • 401: Unauthorized — The API key is missing, invalid, or lacks permission.
  • error_msg (string, required): Authentication error message.
  • description (string, optional): Detailed reason for the authentication failure.

cURL

curl -X POST 'http://127.0.0.1:9180/apisix/admin/schema/validate/{resource}'