Files
supabase/apps/docs/spec/api_v2_openapi.json
Hieu 4ff4cdc62d feat: expose mgmt api v2 spec on official document (#46605)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Include the v2 mgmt API spec in the official docs. This PR merges the v1
and v2 specs when generating the reference, with v2 taking precedence on
conflicts.

Fixes API-1215

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Docs now include API v2 reference: log-drain management
(list/create/update/delete) and project transfer (preview/transfer).

* **Documentation**
* Generated API reference now merges v1 and v2 specs so both appear in
the docs and section listings.
* New v2 operations added to Analytics and Projects documentation
sections.

* **Chores**
* Docs generation pipeline updated to accept and process multiple API
spec inputs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-04 14:53:26 +07:00

900 lines
34 KiB
JSON

{
"openapi": "3.0.0",
"paths": {
"/v2/projects/{ref}/analytics/log-drains": {
"get": {
"operationId": "v2-list-log-drains",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"pattern": "^[a-z]+$",
"example": "abcdefghijklmnopqrst",
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ListLogDrainsResponse" }
}
}
},
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden action" },
"429": { "description": "Rate limit exceeded" },
"500": { "description": "Failed to fetch log drains" }
},
"security": [{ "bearer": [] }, { "fga_permissions": ["analytics_config_read"] }],
"summary": "List project log drains",
"tags": ["Analytics"],
"x-badges": [{ "name": "OAuth scope: analytics_config:read", "position": "after" }],
"x-endpoint-owners": ["analytics"],
"x-oauth-scope": "analytics_config:read"
},
"post": {
"operationId": "v2-create-log-drain",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"pattern": "^[a-z]+$",
"example": "abcdefghijklmnopqrst",
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/CreateLogDrainRequestOpenApi" }
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/LogDrainResponse" } }
}
},
"401": { "description": "Unauthorized" },
"402": {
"description": "This feature requires the Pro, Team, or Enterprise organization plan."
},
"403": { "description": "Forbidden action" },
"429": { "description": "Rate limit exceeded" },
"500": { "description": "Failed to create a log drain" }
},
"security": [{ "bearer": [] }, { "fga_permissions": ["analytics_config_write"] }],
"summary": "Create a log drain for a project",
"tags": ["Analytics"],
"x-allowed-plans": ["Pro", "Team", "Enterprise"],
"x-badges": [
{ "name": "Only available on Pro, Team, Enterprise", "position": "before" },
{ "name": "OAuth scope: analytics_config:write", "position": "after" }
],
"x-endpoint-owners": ["analytics"],
"x-oauth-scope": "analytics_config:write"
}
},
"/v2/projects/{ref}/analytics/log-drains/{id}": {
"put": {
"operationId": "v2-update-log-drain",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"pattern": "^[a-z]+$",
"example": "abcdefghijklmnopqrst",
"type": "string"
}
},
{
"name": "id",
"required": true,
"in": "path",
"description": "Log drains identifier",
"schema": { "format": "uuid", "type": "string" }
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/UpdateLogDrainRequestOpenApi" }
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/LogDrainResponse" } }
}
},
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden action" },
"429": { "description": "Rate limit exceeded" },
"500": { "description": "Failed to update log drain" }
},
"security": [{ "bearer": [] }, { "fga_permissions": ["analytics_config_write"] }],
"summary": "Update a project log drain",
"tags": ["Analytics"],
"x-badges": [{ "name": "OAuth scope: analytics_config:write", "position": "after" }],
"x-endpoint-owners": ["analytics"],
"x-oauth-scope": "analytics_config:write"
},
"delete": {
"operationId": "v2-delete-log-drain",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"pattern": "^[a-z]+$",
"example": "abcdefghijklmnopqrst",
"type": "string"
}
},
{
"name": "id",
"required": true,
"in": "path",
"description": "Log drains identifier",
"schema": { "format": "uuid", "type": "string" }
}
],
"responses": {
"204": { "description": "" },
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden action" },
"429": { "description": "Rate limit exceeded" },
"500": { "description": "Failed to delete a log drain" }
},
"security": [{ "bearer": [] }, { "fga_permissions": ["analytics_config_write"] }],
"summary": "Delete a project log drain",
"tags": ["Analytics"],
"x-badges": [{ "name": "OAuth scope: analytics_config:write", "position": "after" }],
"x-endpoint-owners": ["analytics"],
"x-oauth-scope": "analytics_config:write"
}
},
"/v2/projects/{ref}/transfers/previews": {
"post": {
"operationId": "v2-preview-a-project-transfer",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"pattern": "^[a-z]+$",
"example": "abcdefghijklmnopqrst",
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/V2TransferProjectBody" }
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/V2PreviewProjectTransferResponse" }
}
}
},
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden action" },
"429": { "description": "Rate limit exceeded" }
},
"security": [{ "bearer": [] }, { "fga_permissions": ["project_admin_read"] }],
"summary": "Previews transferring a project to a different organizations, shows eligibility and impact",
"tags": ["Projects"],
"x-endpoint-owners": ["management-api"]
}
},
"/v2/projects/{ref}/transfers": {
"post": {
"operationId": "v2-transfer-a-project",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"pattern": "^[a-z]+$",
"example": "abcdefghijklmnopqrst",
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/V2TransferProjectBody" }
}
}
},
"responses": {
"200": { "description": "" },
"401": { "description": "Unauthorized" },
"403": { "description": "Forbidden action" },
"429": { "description": "Rate limit exceeded" }
},
"security": [{ "bearer": [] }, { "fga_permissions": ["organization_admin_write"] }],
"summary": "Transfers a project to a different organization",
"tags": ["Projects"],
"x-endpoint-owners": ["management-api"]
}
}
},
"info": {
"title": "Supabase API (v2)",
"description": "Supabase API generated from the OpenAPI specification.<br>Visit [https://supabase.com/docs](https://supabase.com/docs) for a complete documentation.",
"version": "1.0.0",
"contact": {}
},
"tags": [],
"servers": [],
"components": {
"securitySchemes": { "bearer": { "scheme": "bearer", "bearerFormat": "JWT", "type": "http" } },
"schemas": {
"ListLogDrainsResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["log_drain"],
"description": "Resource type."
},
"id": { "type": "string" },
"attributes": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"config": {
"oneOf": [
{
"type": "object",
"properties": {
"url": { "type": "string", "nullable": true },
"schema": { "type": "string" },
"username": { "type": "string", "nullable": true },
"password": { "type": "string", "nullable": true },
"port": { "type": "number", "nullable": true },
"hostname": { "type": "string" }
},
"additionalProperties": false,
"title": "postgres"
},
{
"type": "object",
"properties": {
"url": { "type": "string" },
"http": { "type": "string", "enum": ["http1", "http2"] },
"gzip": { "type": "boolean" },
"headers": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"additionalProperties": false,
"title": "webhook"
},
{
"type": "object",
"properties": {
"project_id": { "type": "string" },
"dataset_id": { "type": "string" }
},
"additionalProperties": false,
"title": "bigquery"
},
{
"type": "object",
"properties": {
"api_key": { "type": "string" },
"region": { "type": "string" }
},
"additionalProperties": false,
"title": "datadog"
},
{
"type": "object",
"properties": {
"url": { "type": "string" },
"username": { "type": "string", "nullable": true },
"password": { "type": "string", "nullable": true },
"headers": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"additionalProperties": false,
"title": "loki"
},
{
"type": "object",
"properties": { "dsn": { "type": "string" } },
"additionalProperties": false,
"title": "sentry"
},
{
"type": "object",
"properties": {
"domain": { "type": "string" },
"api_token": { "type": "string" },
"dataset_name": { "type": "string" }
},
"additionalProperties": false,
"title": "axiom"
},
{
"type": "object",
"properties": {
"host": { "type": "string" },
"port": { "type": "integer", "minimum": 0, "maximum": 65535 },
"tls": { "default": false, "type": "boolean" },
"structured_data": { "type": "string" },
"cipher_key": { "type": "string" },
"ca_cert": { "type": "string" },
"client_cert": { "type": "string" },
"client_key": { "type": "string" }
},
"additionalProperties": false,
"title": "syslog"
}
]
},
"backend_type": {
"type": "string",
"enum": [
"postgres",
"bigquery",
"clickhouse",
"webhook",
"datadog",
"loki",
"sentry",
"s3",
"axiom",
"last9",
"otlp",
"syslog"
]
}
},
"required": ["name", "config", "backend_type"]
}
},
"required": ["type", "id", "attributes"]
}
}
},
"required": ["data"]
},
"CreateLogDrainRequestOpenApi": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["log_drain"], "description": "Resource type." },
"attributes": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"config": {
"oneOf": [
{
"type": "object",
"properties": {
"url": { "type": "string", "nullable": true },
"schema": { "type": "string" },
"username": { "type": "string", "nullable": true },
"password": { "type": "string", "nullable": true },
"port": { "type": "number", "nullable": true },
"hostname": { "type": "string" }
},
"additionalProperties": false,
"title": "postgres"
},
{
"type": "object",
"properties": {
"url": { "type": "string" },
"http": { "type": "string", "enum": ["http1", "http2"] },
"gzip": { "type": "boolean" },
"headers": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"additionalProperties": false,
"title": "webhook"
},
{
"type": "object",
"properties": {
"project_id": { "type": "string" },
"dataset_id": { "type": "string" }
},
"additionalProperties": false,
"title": "bigquery"
},
{
"type": "object",
"properties": {
"api_key": { "type": "string" },
"region": { "type": "string" }
},
"additionalProperties": false,
"title": "datadog"
},
{
"type": "object",
"properties": {
"url": { "type": "string" },
"username": { "type": "string", "nullable": true },
"password": { "type": "string", "nullable": true },
"headers": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"additionalProperties": false,
"title": "loki"
},
{
"type": "object",
"properties": { "dsn": { "type": "string" } },
"additionalProperties": false,
"title": "sentry"
},
{
"type": "object",
"properties": {
"domain": { "type": "string" },
"api_token": { "type": "string" },
"dataset_name": { "type": "string" }
},
"additionalProperties": false,
"title": "axiom"
},
{
"type": "object",
"properties": {
"host": { "type": "string" },
"port": { "type": "integer", "minimum": 0, "maximum": 65535 },
"tls": { "default": false, "type": "boolean" },
"structured_data": { "type": "string" },
"cipher_key": { "type": "string" },
"ca_cert": { "type": "string" },
"client_cert": { "type": "string" },
"client_key": { "type": "string" }
},
"additionalProperties": false,
"title": "syslog"
}
]
},
"backend_type": {
"type": "string",
"enum": [
"postgres",
"bigquery",
"clickhouse",
"webhook",
"datadog",
"loki",
"sentry",
"s3",
"axiom",
"last9",
"otlp",
"syslog"
]
}
},
"required": ["name", "config", "backend_type"]
}
},
"required": ["type", "attributes"]
}
},
"required": ["data"]
},
"LogDrainResponse": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["log_drain"], "description": "Resource type." },
"id": { "type": "string" },
"attributes": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"config": {
"oneOf": [
{
"type": "object",
"properties": {
"url": { "type": "string", "nullable": true },
"schema": { "type": "string" },
"username": { "type": "string", "nullable": true },
"password": { "type": "string", "nullable": true },
"port": { "type": "number", "nullable": true },
"hostname": { "type": "string" }
},
"additionalProperties": false,
"title": "postgres"
},
{
"type": "object",
"properties": {
"url": { "type": "string" },
"http": { "type": "string", "enum": ["http1", "http2"] },
"gzip": { "type": "boolean" },
"headers": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"additionalProperties": false,
"title": "webhook"
},
{
"type": "object",
"properties": {
"project_id": { "type": "string" },
"dataset_id": { "type": "string" }
},
"additionalProperties": false,
"title": "bigquery"
},
{
"type": "object",
"properties": {
"api_key": { "type": "string" },
"region": { "type": "string" }
},
"additionalProperties": false,
"title": "datadog"
},
{
"type": "object",
"properties": {
"url": { "type": "string" },
"username": { "type": "string", "nullable": true },
"password": { "type": "string", "nullable": true },
"headers": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"additionalProperties": false,
"title": "loki"
},
{
"type": "object",
"properties": { "dsn": { "type": "string" } },
"additionalProperties": false,
"title": "sentry"
},
{
"type": "object",
"properties": {
"domain": { "type": "string" },
"api_token": { "type": "string" },
"dataset_name": { "type": "string" }
},
"additionalProperties": false,
"title": "axiom"
},
{
"type": "object",
"properties": {
"host": { "type": "string" },
"port": { "type": "integer", "minimum": 0, "maximum": 65535 },
"tls": { "default": false, "type": "boolean" },
"structured_data": { "type": "string" },
"cipher_key": { "type": "string" },
"ca_cert": { "type": "string" },
"client_cert": { "type": "string" },
"client_key": { "type": "string" }
},
"additionalProperties": false,
"title": "syslog"
}
]
},
"backend_type": {
"type": "string",
"enum": [
"postgres",
"bigquery",
"clickhouse",
"webhook",
"datadog",
"loki",
"sentry",
"s3",
"axiom",
"last9",
"otlp",
"syslog"
]
}
},
"required": ["name", "config", "backend_type"]
}
},
"required": ["type", "id", "attributes"]
}
},
"required": ["data"]
},
"UpdateLogDrainRequestOpenApi": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["log_drain"], "description": "Resource type." },
"attributes": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"config": {
"oneOf": [
{
"type": "object",
"properties": {
"url": { "type": "string", "nullable": true },
"schema": { "type": "string" },
"username": { "type": "string", "nullable": true },
"password": { "type": "string", "nullable": true },
"port": { "type": "number", "nullable": true },
"hostname": { "type": "string" }
},
"additionalProperties": false,
"title": "postgres"
},
{
"type": "object",
"properties": {
"url": { "type": "string" },
"http": { "type": "string", "enum": ["http1", "http2"] },
"gzip": { "type": "boolean" },
"headers": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"additionalProperties": false,
"title": "webhook"
},
{
"type": "object",
"properties": {
"project_id": { "type": "string" },
"dataset_id": { "type": "string" }
},
"additionalProperties": false,
"title": "bigquery"
},
{
"type": "object",
"properties": {
"api_key": { "type": "string" },
"region": { "type": "string" }
},
"additionalProperties": false,
"title": "datadog"
},
{
"type": "object",
"properties": {
"url": { "type": "string" },
"username": { "type": "string", "nullable": true },
"password": { "type": "string", "nullable": true },
"headers": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"additionalProperties": false,
"title": "loki"
},
{
"type": "object",
"properties": { "dsn": { "type": "string" } },
"additionalProperties": false,
"title": "sentry"
},
{
"type": "object",
"properties": {
"domain": { "type": "string" },
"api_token": { "type": "string" },
"dataset_name": { "type": "string" }
},
"additionalProperties": false,
"title": "axiom"
},
{
"type": "object",
"properties": {
"host": { "type": "string" },
"port": { "type": "integer", "minimum": 0, "maximum": 65535 },
"tls": { "default": false, "type": "boolean" },
"structured_data": { "type": "string" },
"cipher_key": { "type": "string" },
"ca_cert": { "type": "string" },
"client_cert": { "type": "string" },
"client_key": { "type": "string" }
},
"additionalProperties": false,
"title": "syslog"
}
]
},
"backend_type": {
"type": "string",
"enum": [
"postgres",
"bigquery",
"clickhouse",
"webhook",
"datadog",
"loki",
"sentry",
"s3",
"axiom",
"last9",
"otlp",
"syslog"
]
}
},
"required": ["backend_type"]
}
},
"required": ["type", "attributes"]
}
},
"required": ["data"]
},
"V2TransferProjectBody": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["project_transfer_input"],
"description": "Resource type."
},
"attributes": {
"type": "object",
"properties": { "target_organization_slug": { "type": "string" } },
"required": ["target_organization_slug"]
}
},
"required": ["type", "attributes"]
}
},
"required": ["data"]
},
"V2PreviewProjectTransferResponse": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["project_transfer_result"],
"description": "Resource type."
},
"attributes": {
"type": "object",
"properties": {
"valid": { "type": "boolean" },
"warnings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": { "type": "string" },
"message": { "type": "string" }
},
"required": ["key", "message"]
}
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": { "type": "string" },
"message": { "type": "string" }
},
"required": ["key", "message"]
}
},
"info": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": { "type": "string" },
"message": { "type": "string" }
},
"required": ["key", "message"]
}
}
},
"required": ["valid", "warnings", "errors", "info"]
}
},
"required": ["type", "attributes"]
}
},
"required": ["data"]
}
}
}
}