Update Edge Function
Change an edge function's settings, and optionally its code. This is a partial update: a field you leave out (or send empty / null) keeps its current value.
A settings-only change (name, phase, entry, limits) doesn't touch the build: status, bundle_key and bundle_hash stay as they are. Sending a non-empty source runs the AI security check, saves the code, sets status to building and queues a new build — the same as Upload Edge Function Source. When that build is ready, enabled rules already attached to the function are moved to the new bundle automatically; if it fails, they keep running the previous build. If the build can't be started (the source can't be staged or the build queued), the response carries status: "failed"; save the source again to retry.
Requires the endpoints:write permission on the active account and the edge_functions plan entitlement. A function paused over the plan (disabled_by_plan: true) can't be changed.
Path parameters
uuid, from List Edge Functions.Request body
on_http_request or on_http_response.1–1000 ms.8–256 MiB.Fields not listed are ignored.
Response (200 OK)
{"edge_function": { … }} — the function after the change (fields: the edge function object).
Deprecated: until the sunset this response also carries the legacy integer id and *_id fields. Don't use them; read uuid and the *_uuid fields.
Errors
invalid JSON body, or a field that fails validation (name too long (max 120), phase must be one of: on_http_request, on_http_response, timeout_ms must be 1..1000, memory_mb must be 8..256, …).endpoints:write, the plan doesn't include edge_functions (code entitlement_required), or the account is suspended (code account_suspended).edge function not found — unknown uuid, another account's function, or an application's function.name is taken (An edge function named "…" already exists in this account), or the function is paused over the plan (code quota_paused, with quota_paused_key: "edge_functions").source too large (max 524288 bytes).Content-Type: application/json header.source failed the AI security check (or the check could not run). Nothing was changed.failed to load edge function, failed to check edge function name or failed to update edge function.