---
number: 33720
slug: 33720-deploy-and-update-edge-functions-using-the-management-api
published: 2025-02-20
discussion: https://github.com/orgs/supabase/discussions/33720
labels:
  - edge functions
page: https://supabase.com/changelog/33720-deploy-and-update-edge-functions-using-the-management-api
---

# Deploy and update Edge Functions using the Management API

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](https://supabase.com/partners) 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](https://github.com/orgs/supabase/discussions/33613) and [writing Edge Functions using AI assistant](https://x.com/kiwicopple/status/1889031271801905543).

### 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:

```shell
curl --request POST \
  --url 'https://api.supabase.com/v1/projects/project-ref/functions/deploy?slug=my-func' \
  --header 'Authorization: Bearer sbp_TOKEN' \
  --header 'content-type: multipart/form-data' \
  --form 'metadata={ "entrypoint_path": "index.ts", "name": "My test" }' \
  --form file=@file
```

After the function is created, you can immediately invoke it:

```shell
curl --request POST 'http://{project-ref}.supabase.co/functions/v1/my-func' \
  --header 'Authorization: Bearer SUPABASE_ANON_KEY' \
  --header 'Content-Type: application/json' \
  --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
