---
title: "Create a function"
method: POST
path: "/v1/projects/{ref}/functions"
tags: ["Edge Functions"]
deprecated: true
---

# Create a function

`POST /v1/projects/{ref}/functions`

> **Deprecated.**

This endpoint is deprecated - use the deploy endpoint. Creates a function and adds it to the specified project.

## Path parameters

- `ref` string, required

## Query parameters

- `slug` string
- `name` string
- `verify_jwt` boolean
- `import_map` boolean
- `entrypoint_path` string
- `import_map_path` string
- `ezbr_sha256` string

## Request body

- V1CreateFunctionBody
  - `slug` string, required
  - `name` string, required
  - `body` string, required
  - `verify_jwt` boolean

## Response `201`

- FunctionResponse
  - `id` string, required
  - `slug` string, required
  - `name` string, required
  - `status` 'ACTIVE' | 'REMOVED' | 'THROTTLED', required
  - `version` integer, required
  - `created_at` integer, required
  - `updated_at` integer, required
  - `verify_jwt` boolean
  - `import_map` boolean
  - `entrypoint_path` string
  - `import_map_path` string
  - `ezbr_sha256` string

## Other responses

- `401` — Unauthorized
- `402` — Maximum number of functions reached for Plan
- `403` — Forbidden action
- `429` — Rate limit exceeded
- `500` — Failed to create project's function

---

[API](https://skmtc.dev/supabase/apis/management-api.md) · [All operations](https://skmtc.dev/supabase/apis/management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/supabase/management-api/revisions/a7cb39418064/schema)
