Upload Edge Function Source
Save new JavaScript source for an edge function and queue its build. The source passes an AI security check first; then it is stored, the function's status becomes building, and a build job compiles it to a WebAssembly bundle. The call returns 202 Accepted as soon as the build is queued — poll Get Edge Function until status is ready (with a new bundle_hash) or failed.
When the build is ready, enabled edge-function rules already attached to the function are moved to the new bundle automatically. If the build fails, those rules keep running the previous build.
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 rebuilt.
Path parameters
uuid, from List Edge Functions.Request body
Response (202 Accepted)
{"edge_function": { … }} — the function with the new source and status: "building" (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 source is required.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.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 or failed to save source.upload to storage failed) and the function's status returns to draft (ready when it has a built bundle); or the build could not be queued (failed to enqueue build, build queue is not configured) and the function's status becomes failed. Retry the upload.object storage is not configured.