Files
supabase/spec/transforms/api_v0_openapi_deparsed.json
2022-10-05 20:31:31 +08:00

1216 lines
31 KiB
JSON

{
"openapi": "3.0.0",
"paths": {
"/v1/projects": {
"get": {
"operationId": "getProjects",
"summary": "List all projects",
"description": "Returns a list of all projects you've previously created.",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/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"]
}
}
}
}
}
},
"tags": ["projects"],
"security": [
{
"bearer": []
}
]
},
"post": {
"operationId": "createProject",
"summary": "Create a project",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/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": {
"201": {
"description": "",
"content": {
"application/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"]
}
}
}
}
},
"tags": ["projects"],
"security": [
{
"bearer": []
}
]
}
},
"/v1/organizations": {
"get": {
"operationId": "getOrganizations",
"summary": "List all organizations",
"description": "Returns a list of organizations that you currently belong to.",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": ["id", "name"]
}
}
}
}
},
"500": {
"description": "Unexpected error listing organizations"
}
},
"tags": ["organizations"],
"security": [
{
"bearer": []
}
]
},
"post": {
"operationId": "createOrganization",
"summary": "Create an organization",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"]
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": ["id", "name"]
}
}
}
},
"500": {
"description": "Unexpected error creating an organization"
}
},
"tags": ["organizations"],
"security": [
{
"bearer": []
}
]
}
},
"/v1/projects/{ref}/functions": {
"get": {
"operationId": "getFunctions",
"summary": "List all functions",
"description": "Returns all functions you've previously added to the specified project.",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/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"
]
}
}
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to retrieve project's functions"
}
},
"tags": ["projects"],
"security": [
{
"apiKeyHeader": [],
"apiKeyParam": []
},
{
"bearer": []
}
]
},
"post": {
"operationId": "createFunction",
"summary": "Create a function",
"description": "Creates a function and adds it to the specified project.",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/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": {
"201": {
"description": "",
"content": {
"application/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"
]
}
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to create project's function"
}
},
"tags": ["projects"],
"security": [
{
"apiKeyHeader": [],
"apiKeyParam": []
},
{
"bearer": []
}
]
}
},
"/v1/projects/{ref}/functions/{function_slug}": {
"get": {
"operationId": "getFunction",
"summary": "Retrieve a function",
"description": "Retrieves a function with the specified slug and project.",
"parameters": [
{
"name": "include_body",
"required": false,
"in": "query",
"schema": {
"type": "boolean"
}
},
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
},
{
"name": "function_slug",
"required": true,
"in": "path",
"description": "Function slug",
"schema": {
"pattern": "/^[A-Za-z0-9_-]+$/",
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/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"
]
}
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to retrieve function with given slug"
}
},
"tags": ["projects"],
"security": [
{
"apiKeyHeader": [],
"apiKeyParam": []
},
{
"bearer": []
}
]
},
"patch": {
"operationId": "updateFunction",
"summary": "Update a function",
"description": "Updates a function with the specified slug and project.",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
},
{
"name": "function_slug",
"required": true,
"in": "path",
"description": "Function slug",
"schema": {
"pattern": "/^[A-Za-z0-9_-]+$/",
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"body": {
"type": "string"
},
"verify_jwt": {
"type": "boolean"
}
}
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/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"
]
}
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to update function with given slug"
}
},
"tags": ["projects"],
"security": [
{
"apiKeyHeader": [],
"apiKeyParam": []
},
{
"bearer": []
}
]
},
"delete": {
"operationId": "deleteFunction",
"summary": "Delete a function",
"description": "Deletes a function with the specified slug from the specified project.",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
},
{
"name": "function_slug",
"required": true,
"in": "path",
"description": "Function slug",
"schema": {
"pattern": "/^[A-Za-z0-9_-]+$/",
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
},
"403": {
"description": ""
},
"500": {
"description": "Failed to delete function with given slug"
}
},
"tags": ["projects"],
"security": [
{
"apiKeyHeader": [],
"apiKeyParam": []
},
{
"bearer": []
}
]
}
},
"/v1/projects/{ref}/secrets": {
"get": {
"operationId": "getSecrets",
"summary": "List all secrets",
"description": "Returns all secrets you've previously added to the specified project.",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["name", "value"]
}
}
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to retrieve project's secrets"
}
},
"tags": ["projects"],
"security": [
{
"apiKeyHeader": [],
"apiKeyParam": []
},
{
"bearer": []
}
]
},
"post": {
"operationId": "createSecrets",
"summary": "Bulk create secrets",
"description": "Creates multiple secrets and adds them to the specified project.",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string",
"pattern": "/^(?!SUPABASE_).*/"
}
},
"required": ["name", "value"]
}
}
}
}
},
"responses": {
"201": {
"description": ""
},
"403": {
"description": ""
},
"500": {
"description": "Failed to create project's secrets"
}
},
"tags": ["projects"],
"security": [
{
"apiKeyHeader": [],
"apiKeyParam": []
},
{
"bearer": []
}
]
},
"delete": {
"operationId": "deleteSecrets",
"summary": "Bulk delete secrets",
"description": "Deletes all secrets with the given names from the specified project",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to delete secrets with given names"
}
},
"tags": ["projects"],
"security": [
{
"apiKeyHeader": [],
"apiKeyParam": []
},
{
"bearer": []
}
]
}
},
"/v1/projects/{ref}/pgsodium": {
"get": {
"operationId": "getConfig",
"summary": "Gets project's pgsodium config",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to retrieve project's pgsodium config"
}
},
"tags": ["pgsodium (beta)"],
"security": [
{
"bearer": []
}
]
},
"put": {
"operationId": "updateConfig",
"summary": "Updates project's pgsodium config. Updating the root_key can cause all data encrypted with the older key to become inaccessible.",
"parameters": [
{
"name": "ref",
"required": true,
"in": "path",
"description": "Project ref",
"schema": {
"minLength": 20,
"maxLength": 20,
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"root_key": {
"type": "string"
}
},
"required": ["root_key"]
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
},
"403": {
"description": ""
},
"500": {
"description": "Failed to update project's pgsodium config"
}
},
"tags": ["pgsodium (beta)"],
"security": [
{
"bearer": []
}
]
}
}
},
"info": {
"title": "Supabase API (v1)",
"description": "",
"version": "1.0.0",
"contact": {}
},
"tags": [
{
"name": "organizations",
"description": "Organization endpoints"
},
{
"name": "projects",
"description": "Project endpoints"
}
],
"servers": [],
"components": {
"securitySchemes": {
"bearer": {
"scheme": "bearer",
"bearerFormat": "JWT",
"type": "http"
}
},
"schemas": {
"ProjectResponse": {
"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"]
},
"CreateProjectBody": {
"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"]
},
"OrganizationResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": ["id", "name"]
},
"CreateOrganizationBody": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"]
},
"FunctionResponse": {
"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"]
},
"CreateFunctionBody": {
"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"]
},
"FunctionSlugResponse": {
"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"]
},
"UpdateFunctionBody": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"body": {
"type": "string"
},
"verify_jwt": {
"type": "boolean"
}
}
},
"SecretResponse": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["name", "value"]
},
"CreateSecretBody": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string",
"pattern": "/^(?!SUPABASE_).*/"
}
},
"required": ["name", "value"]
},
"UpdatePgsodiumConfigBody": {
"type": "object",
"properties": {
"root_key": {
"type": "string"
}
},
"required": ["root_key"]
}
}
}
}