---
id: usage
slug: /usage
title: Usage
toc_max_heading_level: 3
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
## Organizations {#organizations}
Organization endpoints
### List all organizations {#list-all-organizations}
```
GET https://api.supabase.com/v1/organizations
```
#### Responses
```json
{
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": ["id", "name"]
}
}
}
```
Unexpected error listing organizations
### Create an organization {#create-an-organization}
```
POST https://api.supabase.com/v1/organizations
```
#### Body Parameters
```json
{
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"]
}
}
```
#### Responses
```json
{
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": ["id", "name"]
}
}
```
Unexpected error creating an organization
## Projects {#projects}
Project endpoints
### List all projects {#list-all-projects}
```
GET https://api.supabase.com/v1/projects
```
#### Responses
```json
{
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"organization_id": {
"type": "string"
},
"name": {
"type": "string"
},
"region": {
"type": "string"
},
"created_at": {
"type": "string"
}
},
"required": ["id", "organization_id", "name", "region", "created_at"]
}
}
}
```
### Create a project {#create-a-project}
```
POST https://api.supabase.com/v1/projects
```
#### Body Parameters
```json
{
"schema": {
"type": "object",
"properties": {
"db_pass": {
"type": "string"
},
"name": {
"type": "string"
},
"organization_id": {
"type": "string"
},
"plan": {
"type": "string",
"enum": ["free", "pro"]
},
"region": {
"type": "string",
"enum": [
"us-east-1",
"us-west-1",
"ap-southeast-1",
"ap-northeast-1",
"ap-northeast-2",
"ap-southeast-2",
"eu-west-1",
"eu-west-2",
"eu-central-1",
"ca-central-1",
"ap-south-1",
"sa-east-1"
]
},
"kps_enabled": {
"type": "boolean"
}
},
"required": ["db_pass", "name", "organization_id", "plan", "region"]
}
}
```
#### Responses
```json
{
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"organization_id": {
"type": "string"
},
"name": {
"type": "string"
},
"region": {
"type": "string"
},
"created_at": {
"type": "string"
}
},
"required": ["id", "organization_id", "name", "region", "created_at"]
}
}
```
### List all functions {#list-all-functions}
```
GET https://api.supabase.com/v1/projects/{ref}/functions
```
#### Path Parameters
#### Responses
```json
{
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"slug": {
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"enum": ["ACTIVE", "REMOVED", "THROTTLED"],
"type": "string"
},
"version": {
"type": "number"
},
"created_at": {
"type": "number"
},
"updated_at": {
"type": "number"
},
"verify_jwt": {
"type": "boolean"
}
},
"required": [
"id",
"slug",
"name",
"status",
"version",
"created_at",
"updated_at"
]
}
}
}
```
Failed to retrieve project's functions
### Create a function {#create-a-function}
```
POST https://api.supabase.com/v1/projects/{ref}/functions
```
#### Path Parameters
#### Body Parameters
```json
{
"schema": {
"type": "object",
"properties": {
"slug": {
"type": "string",
"pattern": "/^[A-Za-z0-9_-]+$/"
},
"name": {
"type": "string"
},
"body": {
"type": "string"
},
"verify_jwt": {
"type": "boolean"
}
},
"required": ["slug", "name", "body"]
}
}
```
#### Responses
```json
{
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"slug": {
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"enum": ["ACTIVE", "REMOVED", "THROTTLED"],
"type": "string"
},
"version": {
"type": "number"
},
"created_at": {
"type": "number"
},
"updated_at": {
"type": "number"
},
"verify_jwt": {
"type": "boolean"
}
},
"required": [
"id",
"slug",
"name",
"status",
"version",
"created_at",
"updated_at"
]
}
}
```
Failed to create project's function
### Retrieve a function {#retrieve-a-function}
```
GET https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
```
#### Path Parameters
-
ref
required
Project ref
-
function_slug
required
Function slug
#### Responses
```json
{
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"slug": {
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"enum": ["ACTIVE", "REMOVED", "THROTTLED"],
"type": "string"
},
"version": {
"type": "number"
},
"created_at": {
"type": "number"
},
"updated_at": {
"type": "number"
},
"verify_jwt": {
"type": "boolean"
},
"body": {
"type": "string"
}
},
"required": [
"id",
"slug",
"name",
"status",
"version",
"created_at",
"updated_at"
]
}
}
```
Failed to retrieve function with given slug
### Update a function {#update-a-function}
```
PATCH https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
```
#### Path Parameters
-
ref
required
Project ref
-
function_slug
required
Function slug
#### Body Parameters
```json
{
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"body": {
"type": "string"
},
"verify_jwt": {
"type": "boolean"
}
}
}
}
```
#### Responses
```json
{
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"slug": {
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"enum": ["ACTIVE", "REMOVED", "THROTTLED"],
"type": "string"
},
"version": {
"type": "number"
},
"created_at": {
"type": "number"
},
"updated_at": {
"type": "number"
},
"verify_jwt": {
"type": "boolean"
}
},
"required": [
"id",
"slug",
"name",
"status",
"version",
"created_at",
"updated_at"
]
}
}
```
Failed to update function with given slug
### Delete a function {#delete-a-function}
```
DELETE https://api.supabase.com/v1/projects/{ref}/functions/{function_slug}
```
#### Path Parameters
-
ref
required
Project ref
-
function_slug
required
Function slug
#### Responses
Failed to delete function with given slug
### List all secrets {#list-all-secrets}
```
GET https://api.supabase.com/v1/projects/{ref}/secrets
```
#### Path Parameters
#### Responses
```json
{
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["name", "value"]
}
}
}
```
Failed to retrieve project's secrets
### Bulk create secrets {#bulk-create-secrets}
```
POST https://api.supabase.com/v1/projects/{ref}/secrets
```
#### Path Parameters
#### Body Parameters
```json
{
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string",
"pattern": "/^(?!SUPABASE_).*/"
}
},
"required": ["name", "value"]
}
}
}
```
#### Responses
Failed to create project's secrets
### Bulk delete secrets {#bulk-delete-secrets}
```
DELETE https://api.supabase.com/v1/projects/{ref}/secrets
```
#### Path Parameters
#### Body Parameters
```json
{
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
```
#### Responses
```json
{
"schema": {
"type": "object"
}
}
```
Failed to delete secrets with given names