Prepare for the PgBouncer and IPv4 deprecations on 26th January 2024

Management API Reference

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"
    ]
  }
}