Hanzo
OpenapiGateway

Write updates one policy scope and returns the policy in force after the write.

Write updates one policy scope and returns the policy in force after the write.

PUT /v1/gateway/config

Addresshttps://api.hanzo.ai/v1/gateway/config
MethodPUT
Operationput_gateway_config
AuthAuthorization: Bearer $HANZO_API_KEY

Write updates one policy scope and returns the policy in force after the write. A body carrying any PLATFORM field (cors_origins, per_ip_rpm, window_sec) is a platform write and requires SuperAdmin; otherwise it is a per-org write (org_rpm, cache_ttl_sec, cache_paths, methods) scoped to the caller's own org — or, for a SuperAdmin, the tenant named by ?org=<slug>. A body that sets nothing is a 400. The abuse gate's mode is an OPERATOR field: setting it requires SuperAdmin, whichever organization it lands on. updated_at and updated_by are server-stamped; a client-supplied value is ignored.

Request

11 fields, body application/json (required).

FieldInTypeRequiredDescription
cache_pathsbodyobjectCachePaths overrides CacheTTLSec per path PREFIX (key "/v1/models" → seconds).
cache_paths.*bodyinteger
cache_ttl_secbodyintegerCacheTTLSec is the org's default edge-cache TTL for its responses, in seconds; 0 means no caching.
cors_originsbodystring[]CORSOrigins is the PLATFORM-scope CORS allowlist EdgeCORS admits: an exact origin, a bare host, or a "*.host" wildcard.
methodsbodystring[]Methods is the allowlist of HTTP methods the edge accepts for this org.
modebodystringMode is the abuse gate's posture for THIS scope: "shadow" scores traffic and records the verdict without acting on it, "live" enforces it. Unset means shadow.
org_rpmbodyintegerOrgRPM is the org's OWN authenticated rate ceiling, requests per minute, as ScopeRateLimit enforces it.
per_ip_rpmbodyintegerPerIPRPM is the PLATFORM-scope pre-auth flood cap: requests EdgeRateLimit admits per WindowSec from one client IP.
updated_atbodyintegerUpdatedAt is the unix second this policy row was last written.
updated_bybodystringUpdatedBy is the validated user id that wrote this policy row.
window_secbodyintegerWindowSec is the window PerIPRPM is counted over, in seconds.

Response

StatusBodyMeaning
200Policyok

200 body — 11 fields.

FieldInTypeAlwaysDescription
cache_pathsbodyobjectCachePaths overrides CacheTTLSec per path PREFIX (key "/v1/models" → seconds).
cache_paths.*bodyinteger
cache_ttl_secbodyintegerCacheTTLSec is the org's default edge-cache TTL for its responses, in seconds; 0 means no caching.
cors_originsbodystring[]CORSOrigins is the PLATFORM-scope CORS allowlist EdgeCORS admits: an exact origin, a bare host, or a "*.host" wildcard.
methodsbodystring[]Methods is the allowlist of HTTP methods the edge accepts for this org.
modebodystringMode is the abuse gate's posture for THIS scope: "shadow" scores traffic and records the verdict without acting on it, "live" enforces it. Unset means shadow.
org_rpmbodyintegerOrgRPM is the org's OWN authenticated rate ceiling, requests per minute, as ScopeRateLimit enforces it.
per_ip_rpmbodyintegerPerIPRPM is the PLATFORM-scope pre-auth flood cap: requests EdgeRateLimit admits per WindowSec from one client IP.
updated_atbodyintegerUpdatedAt is the unix second this policy row was last written.
updated_bybodystringUpdatedBy is the validated user id that wrote this policy row.
window_secbodyintegerWindowSec is the window PerIPRPM is counted over, in seconds.

Failure carries the platform error shape — see Errors.

Examples

hanzo gateway config replace

Gateway API · All Hanzo APIs · Interactive reference

How is this guide?

On this page