Deleting a Guardrail Configuration#

  • Send a DELETE request to the /v1/guardrail/configs/{namespace}/{config_name} endpoint.

    curl -X DELETE "${GUARDRAILS_BASE_URL}/v1/guardrail/configs/default/demo-self-check-input-output" \
      -H 'Accept: application/json' | jq
    
    import json
    import requests
    
    url = f"{os.environ['GUARDRAILS_BASE_URL']}/v1/guardrail/configs/default/demo-self-check-input-output"
    
    headers = {"Accept": "application/json", "Content-Type": "application/json"}
    
    response = requests.delete(url, headers=headers)
    print(json.dumps(response.json(), indent=2))
    
    Example Output
    {
      "message": "Resource deleted successfully.",
      "id": "guardrail-GTtdc5KmFwWapFc2B6qKWi",
      "deleted_at": null
    }