Skip to contentSkip to page list

Docs

List cache-control rules

Organization-scoped operator-authored rules, priority-ordered, archived rules excluded.

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

Success

application/json · Generated from schema

{  "data": [    {      "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"    }  ],  "next_cursor": "string"}
api-reference/gateway-cache-rules/list-cache-control-rules

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.

Query parameters

cursorstring
Up to 500 characters
limitinteger
Maximum 200

Responses

200

Success

application/json

dataobject[]required
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
next_cursorstring | nullrequired

Pass back as cursor for the next page. Null means the walk is exhausted.

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