API7 Docs

Delete a Global Rule

DELETE /apisix/admin/global_rules/{id}

DELETE /apisix/admin/global_rules/{id}

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

id*string

Unique identifier of the resource. Can be a string (alphanumeric, -, _, .) or a positive integer.

Query Parameters

force?string

Delete resource by force even if the resource is in use.

Response Body

application/json

application/json

application/json

curl -X DELETE "http://127.0.0.1:9180/apisix/admin/global_rules/my-resource-1?force=true"

Successful response.

{
  "key": "/apisix/global_rules/1",
  "deleted": "1"
}
Complete operation details and schema variants

DELETE /apisix/admin/global_rules/{id}

Delete a Global Rule

Delete a global rule by its ID.

Parameters

  • id (path, string, required): Unique identifier of the resource. Can be a string (alphanumeric, -, _, .) or a positive integer.
  • force (query, string, optional): Delete resource by force even if the resource is in use.

Responses

  • 200: Successful response.
  • key (string, optional): The storage key or path identifier for the global rule.
  • deleted (string, optional): The ID of the successfully deleted global rule.
  • 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.
  • 404: Not Found — The specified resource does not exist.
  • error_msg (string, required): Error message indicating the resource was not found.

cURL

curl -X DELETE 'http://127.0.0.1:9180/apisix/admin/global_rules/{id}'