Skip to contentSkip to page list

Docs

Archive a cache rule

Soft-delete: sets archivedAt. The rule stops matching new requests.

DELETE/api/gateway/v1/cache-rules/{id}
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/gateway/v1/cache-rules/<id>"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,}​response = requests.delete(    origin + path,    headers=headers,)print(response.json())

Success

application/json · Generated from schema

{  "cache_rule": {    "id": "string",    "organization_id": "string",    "name": "string",    "description": "string",    "priority": -9007199254740991,    "enabled": false,    "matchers": {},    "action": {      "mode": "respect",      "ttl": -9007199254740991,      "salt": "string"    },    "mode_enum": "respect",    "archived_at": "string",    "created_at": "string",    "updated_at": "string"  }}
api-reference/gateway-cache-rules/archive-a-cache-rule

Authorization

X-Auth-Tokenstringheaderrequired

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Path parameters

idstringrequired
At least 1 character

Responses

200

Success

application/json

cache_ruleobjectrequired
idstringrequired
organization_idstringrequired
namestringrequired
descriptionstring | nullrequired
priorityintegerrequired
Minimum -9007199254740991Maximum 9007199254740991
enabledbooleanrequired
matchersobjectrequired
actionobjectrequired
mode_enumstringrequired
One of"respect""force""disable"
archived_atstring | nullrequired
created_atstringrequired
updated_atstringrequired
400

Bad Request

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
401

Unauthorized

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
403

Forbidden

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
500

Internal Server Error

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]

Documentation