Disable virtual key
import requests
url = "https://app.langwatch.ai/api/gateway/v1/virtual-keys/{id}/disable"
payload = { "reason": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://app.langwatch.ai/api/gateway/v1/virtual-keys/{id}/disable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/gateway/v1/virtual-keys/{id}/disable \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"reason": "<string>"
}
'{
"virtual_key": {
"id": "<string>",
"organization_id": "<string>",
"name": "<string>",
"description": "<string>",
"display_prefix": "<string>",
"principal_user_id": "<string>",
"trace_project_id": "<string>",
"external_id": "<string>",
"metadata": {},
"scopes": [
{
"scope_id": "<string>"
}
],
"routing_policy_id": "<string>",
"revision": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"last_used_at": "<string>",
"revoked_at": "<string>",
"config": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}Gateway: Virtual Keys
Disable virtual key
Reversible stop: requests on the key are rejected with the distinct virtual_key_disabled error until it is enabled again. Budgets, scopes, key material, and any rotation grace stay intact. The change propagates through the gateway’s change-event feed. Idempotent.
POST
/
api
/
gateway
/
v1
/
virtual-keys
/
{id}
/
disable
Disable virtual key
import requests
url = "https://app.langwatch.ai/api/gateway/v1/virtual-keys/{id}/disable"
payload = { "reason": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://app.langwatch.ai/api/gateway/v1/virtual-keys/{id}/disable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/gateway/v1/virtual-keys/{id}/disable \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"reason": "<string>"
}
'{
"virtual_key": {
"id": "<string>",
"organization_id": "<string>",
"name": "<string>",
"description": "<string>",
"display_prefix": "<string>",
"principal_user_id": "<string>",
"trace_project_id": "<string>",
"external_id": "<string>",
"metadata": {},
"scopes": [
{
"scope_id": "<string>"
}
],
"routing_policy_id": "<string>",
"revision": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"last_used_at": "<string>",
"revoked_at": "<string>",
"config": "<unknown>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}Authorizations
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
Body
application/json
Operator note, audit-logged and shown in the key's detail view.
Maximum string length:
500Response
Disabled
Show child attributes
Show child attributes
Was this page helpful?
⌘I