Skip to main content
PATCH
Update an agent
Partial update. Omitted fields are left as they are. This is where most of an agent’s configuration is set: everything beyond the handful of fields create accepts is applied here. Two changes have effects worth knowing before you make them:
  • status: "paused" refuses the agent’s traffic with 503 agent_not_active on /v1/ai, and JSON-RPC -32603 on /v1/mcp.
  • guardrail_webhook_url is resolved and refused at write time through the SSRF chokepoint, and may not carry credentials in the URL (https://user:pass@host/) — a credential written into a URL is stored in plaintext and leaks into every log line that echoes it.
Setting firewall_policy_id to a policy with action: "block" is what makes the firewall refuse rather than warn — see Prompt firewall. Requires the update capability on ai_gateway. See the control-plane overview for authentication, the {data, meta} envelope, pagination and error types.

Authorizations

Authorization
string
header
required

OAuth 2.1 authentication — recommended for new integrations. Access tokens (kc_ prefix) are minted at the root-host token endpoint https://api.knoxcall.com/oauth/token and passed as Authorization: Bearer <access_token>. Public clients must use PKCE with the authorization_code grant; confidential clients may use client_credentials. The first-party SDKs and the knoxcall login CLI handle token minting, caching, refresh, and DPoP for you.

Path Parameters

id
string<uuid>
required

The AI agent UUID.

Body

application/json

Only the provided fields are changed. Every writable column on an agent appears here — this schema is what the typed SDKs are generated and reviewed against, so a field missing from it becomes a field missing from them (AIGW-161).

name
string
slug
string

RENAMES the agent, which MOVES its data-plane URL: agent_url is computed from the slug rather than stored, so every caller pointed at the old URL gets a 404 from the moment this returns. The new URL is on this response — read it rather than reconstructing it.

description
string | null
primary_route_id
string<uuid> | null
fallback_route_ids
string<uuid>[]
default_model
string | null
model_allowlist
string[]
model_denylist
string[]
model_rewrite
object

Map of requested model → substituted model. Values must be STRINGS (the server validates with a string map) and at most 100 entries.

budget_daily_usd
number | null
budget_monthly_usd
number | null
budget_per_call_max_tokens
integer | null
budget_overage_action
enum<string>

What happens once a budget is exhausted. fallback needs fallback_agent_id; without one it behaves as block.

Available options:
block,
warn,
fallback
fallback_agent_id
string<uuid> | null
streaming_enabled
boolean
firewall_policy_id
string<uuid> | null
pii_redact_policy_id
string<uuid> | null
pii_detokenize_response
boolean
deprecated

AIGW-100 legacy alias for pii_response_mode (true -> detokenize, false -> redact). Still accepted; sending both with contradictory values is a 400.

pii_request_mode
enum<string>

What happens to the PROMPT before it leaves KnoxCall. Default tokenize. Set off only for an agent whose payload must reach the provider byte-for-byte (structured tool-use JSON, for example) — it means prompts are forwarded unscanned.

Available options:
off,
tokenize
pii_response_mode
enum<string>

What happens to the provider's answer. Default detokenize.

Available options:
redact,
detokenize
pii_streaming_holdback_chars
integer

How many characters of a STREAMED answer are held back while a detector decides. Larger catches an entity split across more chunks; smaller is lower latency.

pii_streaming_mode
enum<string>

How a streamed answer is rewritten. holdback releases text behind a sliding window; buffer withholds the whole answer until it is complete; monitor REPORTS detections without rewriting, so the raw value reaches the client — an observability mode, not a redaction one.

Available options:
holdback,
buffer,
monitor
tags
object

FinOps attribution labels (cost_center/team/project/…) echoed onto this agent's usage rows.

cache_mode
enum<string>

semantic additionally needs cache_embedding_model; without one the cache reports itself degraded and serves nothing.

Available options:
off,
exact,
semantic
cache_ttl_seconds
integer
cache_similarity_threshold
number

Cosine floor for a semantic cache hit, 0–1. Lower means more hits, and more wrong ones. NOT nullable: the column is NOT NULL and the validator is non-nullable, so an explicit null is a 400.

Required range: 0 <= x <= 1
cache_embedding_model
string | null
tool_allowlist
string[]
output_schema
object | null

JSON Schema the answer is validated against.

output_validation_action
enum<string>
Available options:
block,
retry,
warn
data_residency_region
string | null
cmek_key_id
string<uuid> | null
routing_policy
object

How this agent retries and spreads load (AIGW-42). An empty object — the default for every agent — means one attempt per route and fail-over to fallback_route_ids on 5xx only, which is the behaviour the gateway has always had.

Every field is clamped server-side. A request parked waiting to retry occupies an API worker, so max_attempts caps at 5, any single delay at 30s, a honoured Retry-After at 60s, and the total sleep for one request at 60s regardless of how the fields combine.

guardrail_webhook_url
string<uri> | null

HTTPS endpoint your own scanner listens on (AIGW-45). Every prompt — and, in response/both mode, every response — is POSTed to it for a verdict before it moves.

What it receives is the REDACTED, post-tokenization body: the same bytes the provider would get, never a resolved provider credential and never your KnoxCall token. Shipping raw PHI to a third party to ask whether it contains PHI would be the leak the gateway exists to prevent.

The destination is resolved and refused at write time AND on every call — a private, loopback, link-local or cloud-metadata address is a 400, because DNS is not a promise.

guardrail_webhook_secret_id
string<uuid> | null

Secret holding the HMAC-SHA256 key deliveries are signed with. The signature covers <timestamp>.<body> and travels in x-knox-guardrail-signature with the timestamp in x-knox-guardrail-timestamp, so a captured delivery is not replayable. Omit to send unsigned — the receiver then cannot prove the call came from KnoxCall.

guardrail_webhook_mode
enum<string>

Which directions are inspected. response and both evaluate the complete buffered response before it is sent, so an agent in those modes REFUSES a streaming request (400 guardrail_streaming_unsupported) rather than serving one past a control that could not run on it.

Available options:
off,
request,
response,
both
guardrail_webhook_timeout_ms
integer

How long to wait for a verdict. Clamped, because a request waiting on your scanner is holding one of the gateway's API workers.

Required range: 100 <= x <= 10000
guardrail_webhook_failure_action
enum<string>

What happens when the hook does not answer. Applies identically to EVERY non-answer — timeout, refused connection, refused destination, non-2xx, unparseable body, an action verb we do not recognise. Defaults to fail_open, which is the posture an agent already has with no hook at all.

A hook responds 200 with {"action":"allow"|"block"|"flag","reason":"…"}. block refuses the request with 400 guardrail_block and your reason in the message; flag serves it and records the outcome.

Available options:
fail_open,
fail_closed

Response

The updated agent.

data
object

An agent under a gateway — the addressable unit an AI SDK points at.

meta
object

Metadata included with every API response.