Deploy and update Edge Functions using the Management API

Feb 20, 2025

We have introduced two new API endpoints that allow you to deploy and update Edge Functions programmatically. This will be handy if you're building a Supabase integration or want to create an internal workflow without relying on Supabase CLI.

These are the same endpoints we use internally for Deploying Edge Functions from CLI without needing Docker and writing Edge Functions using AI assistant.

Deploy an Edge Function#

This endpoint allows you to deploy a function by providing source files and metadata in a multipart/form-data body. You can also provide a function slug as the query parameter. If an existing function for the same slug exists, it will be updated; otherwise, a new function will be created.

You can pass the bundleOnly=1 query parameter to return the response metadata to the bundled function without persisting it. This is useful if you want to bulk update multiple functions atomically. Check the next section for the new bulk update endpoint.

API reference: https://supabase.com/docs/reference/api/v1-deploy-a-function

Example:


_10
curl --request POST \
_10
--url 'https://api.supabase.com/v1/projects/project-ref/functions/deploy?slug=my-func' \
_10
--header 'Authorization: Bearer sbp_TOKEN' \
_10
--header 'content-type: multipart/form-data' \
_10
--form 'metadata={ "entrypoint_path": "index.ts", "name": "My test" }' \
_10
--form file=@file

After the function is created, you can immediately invoke it:


_10
curl --request POST 'http://{project-ref}.supabase.co/functions/v1/my-func' \
_10
--header 'Authorization: Bearer SUPABASE_ANON_KEY' \
_10
--header 'Content-Type: application/json' \
_10
--data '{ "name":"Functions" }'

Bulk update Edge Functions#

This endpoint allows you to update multiple Edge Functions atomically.

When deploying multiple edge functions, we recommend calling the deploy endpoint with the bundleOnly=1 query parameter, collecting the responses and then calling bulk update endpoint to update them atomically.

API reference: https://supabase.com/docs/reference/api/v1-bulk-update-functions

Build in a weekend, scale to millions