API7 Docs

Detach Guardrail from a Scope

DELETE /environments/{env_id}/guardrails/{guardrail_id}/attachments/{attachment_id}

DELETE /environments/{env_id}/guardrails/{guardrail_id}/attachments/{attachment_id}

Interactive request editor loads with JavaScript.

Authorization

BearerAdminToken
AuthorizationBearer <token>

Organization-scoped admin token. Read operations require a valid token, and write operations require a token with write permission.

In: header

Path Parameters

env_id*string

Environment ID that scopes the request.

Formatuuid
guardrail_id*string

Guardrail ID within the environment.

Formatuuid
attachment_id*string

Attachment ID within the guardrail.

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "$AISIX_CP/environments/$ENV_ID/guardrails/$GUARDRAIL_ID/attachments/$ATTACHMENT_ID" \  -H "Authorization: Bearer $AISIX_TOKEN"

OK

{
  "deleted": true,
  "id": "string"
}
Complete operation details and schema variants

DELETE /environments/{env_id}/guardrails/{guardrail_id}/attachments/{attachment_id}

Detach Guardrail from a Scope

Delete one scope attachment so it no longer makes the guardrail applicable through that scope. Other attachments are unchanged.

Parameters

  • env_id (path, string, required): Environment ID that scopes the request.
  • guardrail_id (path, string, required): Guardrail ID within the environment.
  • attachment_id (path, string, required): Attachment ID within the guardrail.

Responses

  • 200: OK

  • deleted (boolean, optional): Whether the attachment was deleted.

  • id (string, optional): Deleted attachment ID.

  • 400: Request body or parameters failed validation.

  • error (object, required): Error details.

  • error.code (string, required): Machine-readable identifier. Examples: UNAUTHENTICATED, INVALID_REQUEST, MASTER_KEY_UNSET, INTERNAL.

  • error.message (string, required): Human-readable explanation; safe to surface to operators.

  • 401: Missing or invalid bearer. Response fields (application/json): identical to DELETE /environments/{env_id}/guardrails/{guardrail_id}/attachments/{attachment_id}, response 400 above.

  • 403: Authenticated request is not permitted. Response fields (application/json): identical to DELETE /environments/{env_id}/guardrails/{guardrail_id}/attachments/{attachment_id}, response 400 above.

  • 404: Resource not found. Response fields (application/json): identical to DELETE /environments/{env_id}/guardrails/{guardrail_id}/attachments/{attachment_id}, response 400 above.

cURL

curl -X DELETE '$AISIX_CP/environments/{env_id}/guardrails/{guardrail_id}/attachments/{attachment_id}' -H 'Authorization: Bearer $AISIX_TOKEN'