Management API Reference

Management API

Manage your Supabase organizations and projects programmatically.

Status

The Management API is in beta. It is usable in it's current state, but it's likely that there will be breaking changes.

Authentication

All API requests require a Supabase Personal token to be included in the Authorization header: Authorization Bearer <supabase_personal_token. To generate or manage your API token, visit your account page. Your API tokens carry the same privileges as your user account, so be sure to keep it secret.


_10
curl https://api.supabase.com/v1/projects \
_10
-H "Authorization: Bearer sbp_bdd0••••••••••••••••••••••••••••••••4f23"

All API requests must be authenticated and made over HTTPS.

Rate limits

The rate limit for Management API is 60 requests per one minute per user, and applies cumulatively across all requests made with your personal access tokens.

If you exceed this limit, all Management API calls for the next minute will be blocked, resulting in a HTTP 429 response.

The Management API is subject to our fair-use policy. All resources created via the API are subject to the pricing detailed on our Pricing pages.

List all projects

get/v1/projects

Returns a list of all projects you've previously created.

Responses
{
  "schema": {
    "type": "array",
    "items": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of your project"
        },
        "organization_id": {
          "type": "string",
          "description": "Slug of your organization"
        },
        "name": {
          "type": "string",
          "description": "Name of your project"
        },
        "region": {
          "type": "string",
          "description": "Region of your project",
          "example": "us-east-1"
        },
        "created_at": {
          "type": "string",
          "description": "Creation timestamp",
          "example": "2023-03-29T16:32:59Z"
        },
        "database": {
          "type": "object",
          "properties": {
            "host": {
              "type": "string",
              "description": "Database host"
            },
            "version": {
              "type": "string",
              "description": "Database version"
            }
          },
          "required": [
            "host",
            "version"
          ]
        }
      },
      "required": [
        "id",
        "organization_id",
        "name",
        "region",
        "created_at"
      ]
    }
  }
}

Create a project

post/v1/projects

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id of your project"
      },
      "organization_id": {
        "type": "string",
        "description": "Slug of your organization"
      },
      "name": {
        "type": "string",
        "description": "Name of your project"
      },
      "region": {
        "type": "string",
        "description": "Region of your project",
        "example": "us-east-1"
      },
      "created_at": {
        "type": "string",
        "description": "Creation timestamp",
        "example": "2023-03-29T16:32:59Z"
      },
      "database": {
        "type": "object",
        "properties": {
          "host": {
            "type": "string",
            "description": "Database host"
          },
          "version": {
            "type": "string",
            "description": "Database version"
          }
        },
        "required": [
          "host",
          "version"
        ]
      }
    },
    "required": [
      "id",
      "organization_id",
      "name",
      "region",
      "created_at"
    ]
  }
}

List all organizations

get/v1/organizations

Returns a list of organizations that you currently belong to.

Responses
{
  "schema": {
    "type": "array",
    "items": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ]
    }
  }
}

Create an organization

post/v1/organizations

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      }
    },
    "required": [
      "id",
      "name"
    ]
  }
}

List all secrets

get/v1/projects/{ref}/secrets

Returns all secrets you've previously added to the specified project.

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "array",
    "items": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "value"
      ]
    }
  }
}

Bulk create secrets

post/v1/projects/{ref}/secrets

Creates multiple secrets and adds them to the specified project.

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses

Bulk delete secrets

delete/v1/projects/{ref}/secrets

Deletes all secrets with the given names from the specified project

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "object"
  }
}

Generate TypeScript types

get/v1/projects/{ref}/types/typescript

Returns the TypeScript types of your schema for use with supabase-js.

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Query Parameters
    included_schemas
    Optional
    no type
Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "types": {
        "type": "string"
      }
    },
    "required": [
      "types"
    ]
  }
}

Create a function

post/v1/projects/{ref}/functions

Creates a function and adds it to the specified project.

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Query Parameters
    slug
    Optional
    no type
    name
    Optional
    no type
    verify_jwt
    Optional
    no type
    import_map
    Optional
    no type
    entrypoint_path
    Optional
    no type
    import_map_path
    Optional
    no type
Responses
{
  "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"
      },
      "import_map": {
        "type": "boolean"
      },
      "entrypoint_path": {
        "type": "string"
      },
      "import_map_path": {
        "type": "string"
      }
    },
    "required": [
      "id",
      "slug",
      "name",
      "status",
      "version",
      "created_at",
      "updated_at"
    ]
  }
}

List all functions

get/v1/projects/{ref}/functions

Returns all functions you've previously added to the specified project.

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "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"
        },
        "import_map": {
          "type": "boolean"
        },
        "entrypoint_path": {
          "type": "string"
        },
        "import_map_path": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "slug",
        "name",
        "status",
        "version",
        "created_at",
        "updated_at"
      ]
    }
  }
}

Retrieve a function

get/v1/projects/{ref}/functions/{function_slug}

Retrieves a function with the specified slug and project.

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

    function_slug
    REQUIRED
    no type

    Function slug

Responses
{
  "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"
      },
      "import_map": {
        "type": "boolean"
      },
      "entrypoint_path": {
        "type": "string"
      },
      "import_map_path": {
        "type": "string"
      }
    },
    "required": [
      "id",
      "slug",
      "name",
      "status",
      "version",
      "created_at",
      "updated_at"
    ]
  }
}

Update a function

patch/v1/projects/{ref}/functions/{function_slug}

Updates a function with the specified slug and project.

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

    function_slug
    REQUIRED
    no type

    Function slug

Query Parameters
    slug
    Optional
    no type
    name
    Optional
    no type
    verify_jwt
    Optional
    no type
    import_map
    Optional
    no type
    entrypoint_path
    Optional
    no type
    import_map_path
    Optional
    no type
Responses
{
  "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"
      },
      "import_map": {
        "type": "boolean"
      },
      "entrypoint_path": {
        "type": "string"
      },
      "import_map_path": {
        "type": "string"
      }
    },
    "required": [
      "id",
      "slug",
      "name",
      "status",
      "version",
      "created_at",
      "updated_at"
    ]
  }
}

Delete a function

delete/v1/projects/{ref}/functions/{function_slug}

Deletes a function with the specified slug from the specified project.

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

    function_slug
    REQUIRED
    no type

    Function slug

Responses

Retrieve a function body

get/v1/projects/{ref}/functions/{function_slug}/body

Retrieves a function body for the specified slug and project.

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

    function_slug
    REQUIRED
    no type

    Function slug

Responses

Gets project's custom hostname config

get/v1/projects/{ref}/custom-hostname

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "status": {
        "enum": [
          "1_not_started",
          "2_initiated",
          "3_challenge_verified",
          "4_origin_setup_completed",
          "5_services_reconfigured"
        ],
        "type": "string"
      },
      "custom_hostname": {
        "type": "string"
      },
      "data": {
        "type": "object"
      }
    },
    "required": [
      "status",
      "custom_hostname",
      "data"
    ]
  }
}

Deletes a project's custom hostname configuration

delete/v1/projects/{ref}/custom-hostname

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses

Updates project's custom hostname configuration

post/v1/projects/{ref}/custom-hostname/initialize

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "status": {
        "enum": [
          "1_not_started",
          "2_initiated",
          "3_challenge_verified",
          "4_origin_setup_completed",
          "5_services_reconfigured"
        ],
        "type": "string"
      },
      "custom_hostname": {
        "type": "string"
      },
      "data": {
        "type": "object"
      }
    },
    "required": [
      "status",
      "custom_hostname",
      "data"
    ]
  }
}

Attempts to verify the DNS configuration for project's custom hostname configuration

post/v1/projects/{ref}/custom-hostname/reverify

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "status": {
        "enum": [
          "1_not_started",
          "2_initiated",
          "3_challenge_verified",
          "4_origin_setup_completed",
          "5_services_reconfigured"
        ],
        "type": "string"
      },
      "custom_hostname": {
        "type": "string"
      },
      "data": {
        "type": "object"
      }
    },
    "required": [
      "status",
      "custom_hostname",
      "data"
    ]
  }
}

Activates a custom hostname for a project.

post/v1/projects/{ref}/custom-hostname/activate

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "status": {
        "enum": [
          "1_not_started",
          "2_initiated",
          "3_challenge_verified",
          "4_origin_setup_completed",
          "5_services_reconfigured"
        ],
        "type": "string"
      },
      "custom_hostname": {
        "type": "string"
      },
      "data": {
        "type": "object"
      }
    },
    "required": [
      "status",
      "custom_hostname",
      "data"
    ]
  }
}

Gets project's pgsodium config

get/v1/projects/{ref}/pgsodium

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "root_key": {
        "type": "string"
      }
    },
    "required": [
      "root_key"
    ]
  }
}

Updates project's pgsodium config. Updating the root_key can cause all data encrypted with the older key to become inaccessible.

put/v1/projects/{ref}/pgsodium

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "root_key": {
        "type": "string"
      }
    },
    "required": [
      "root_key"
    ]
  }
}

Gets project's network bans

post/v1/projects/{ref}/network-bans/retrieve

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "banned_ipv4_addresses": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "required": [
      "banned_ipv4_addresses"
    ]
  }
}

Remove network bans.

delete/v1/projects/{ref}/network-bans

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses

Gets project's network restrictions

get/v1/projects/{ref}/network-restrictions

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "entitlement": {
        "enum": [
          "disallowed",
          "allowed"
        ],
        "type": "string"
      },
      "config": {
        "type": "object",
        "properties": {
          "dbAllowedCidrs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "dbAllowedCidrs"
        ]
      },
      "old_config": {
        "type": "object",
        "properties": {
          "dbAllowedCidrs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "dbAllowedCidrs"
        ]
      },
      "status": {
        "enum": [
          "stored",
          "applied"
        ],
        "type": "string"
      }
    },
    "required": [
      "entitlement",
      "config",
      "status"
    ]
  }
}

Updates project's network restrictions

post/v1/projects/{ref}/network-restrictions/apply

Path Parameters
    ref
    REQUIRED
    no type

    Project ref

Responses
{
  "schema": {
    "type": "object",
    "properties": {
      "entitlement": {
        "enum": [
          "disallowed",
          "allowed"
        ],
        "type": "string"
      },
      "config": {
        "type": "object",
        "properties": {
          "dbAllowedCidrs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "dbAllowedCidrs"
        ]
      },
      "old_config": {
        "type": "object",
        "properties": {
          "dbAllowedCidrs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "dbAllowedCidrs"
        ]
      },
      "status": {
        "enum": [
          "stored",
          "applied"
        ],
        "type": "string"
      }
    },
    "required": [
      "entitlement",
      "config",
      "status"
    ]
  }
}