---
title: "Update a gateway"
method: PATCH
path: "/gateway/{gateway_topic}"
tags: ["Gateways"]
---

# Update a gateway

`PATCH /gateway/{gateway_topic}`

Updates an existing gateway's configuration.

## Path parameters

- `gateway_topic` string, required

## Request body

- GatewayUpdateRequest
  - `name` string — Updated name of the gateway
  - `description` string — Updated description of the gateway
  - `active` boolean — Whether the gateway is active
  - `middleware` Middleware[] — Updated list of middleware to be applied to the gateway
    - `order` integer — Execution order of the middleware
    - `resource` string — Resource identifier for the middleware function
    - `resource_type` 'function' | 'service' — Type of resource the middleware points to
    - `resource_version` string — Version of the middleware resource to use
    - `type` 'pre-request' | 'post-request' — When the middleware should execute
  - `limit` Limit
    - `request` integer — Maximum number of requests allowed
    - `time` integer — Time window for rate limiting in milliseconds
  - `timeout` integer — Updated timeout in milliseconds for gateway requests

## Response `200`

Gateway updated successfully

- SuccessResponse
  - `message` string

## Other responses

- `400` — Bad request
- `404` — Resource not found

---

[API](https://skmtc.net/quivaworks/apis/quiva-ai-gateway-4.md) · [All operations](https://skmtc.net/quivaworks/apis/quiva-ai-gateway-4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/quivaworks/quiva-ai-gateway-4/versions/c040b7174eb9/schema)
