{
  "components": {
    "responses": {
      "Error": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Refused; see code."
      }
    },
    "schemas": {
      "APISettings": {
        "properties": {
          "defaults": {
            "properties": {
              "jwt_expiry_seconds": {
                "format": "int64",
                "type": "integer"
              },
              "max_rows": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "max_rows",
              "jwt_expiry_seconds"
            ],
            "type": "object"
          },
          "jwt_expiry_seconds": {
            "format": "int64",
            "type": "integer"
          },
          "max_rows": {
            "format": "int64",
            "type": "integer"
          },
          "max_rows_limit": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "max_rows",
          "jwt_expiry_seconds",
          "max_rows_limit",
          "defaults"
        ],
        "type": "object"
      },
      "Action": {
        "properties": {
          "command": {
            "enum": [
              "create",
              "pause",
              "resume",
              "suspend",
              "unsuspend",
              "delete"
            ],
            "type": "string"
          },
          "error": {
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "type": [
              "object",
              "null"
            ]
          },
          "finished_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "progress": {
            "format": "int64",
            "maximum": 100,
            "minimum": 0,
            "type": "integer"
          },
          "project_id": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "started_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "enum": [
              "running",
              "success",
              "error"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "region",
          "command",
          "state",
          "progress",
          "project_id",
          "error",
          "started_at",
          "finished_at"
        ],
        "type": "object"
      },
      "Advisors": {
        "properties": {
          "counts": {
            "description": "category -\u003e level -\u003e count",
            "properties": {},
            "type": "object"
          },
          "lints": {
            "items": {
              "$ref": "#/components/schemas/Lint"
            },
            "type": "array"
          },
          "run": {
            "properties": {
              "error_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "finished_at": {
                "description": "RFC 3339 time, UTC.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "id": {
                "format": "int64",
                "type": "integer"
              },
              "started_at": {
                "description": "RFC 3339 time, UTC.",
                "format": "date-time",
                "type": "string"
              },
              "status": {
                "enum": [
                  "ok",
                  "failed"
                ],
                "type": "string"
              },
              "trigger": {
                "enum": [
                  "manual",
                  "daily"
                ],
                "type": "string"
              }
            },
            "required": [
              "id",
              "trigger",
              "status",
              "error_code",
              "started_at",
              "finished_at"
            ],
            "type": [
              "object",
              "null"
            ]
          }
        },
        "required": [
          "run",
          "counts",
          "lints"
        ],
        "type": "object"
      },
      "AuthSettings": {
        "properties": {
          "anonymous_enabled": {
            "type": "boolean"
          },
          "app_name": {
            "maxLength": 64,
            "type": "string"
          },
          "captcha": {
            "description": "Its secret is the secret captcha.",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "provider": {
                "enum": [
                  "hcaptcha",
                  "turnstile"
                ],
                "type": "string"
              },
              "site_key": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "disable_signup": {
            "type": "boolean"
          },
          "email_confirm_required": {
            "type": "boolean"
          },
          "email_enabled": {
            "type": "boolean"
          },
          "hooks": {
            "additionalProperties": {
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "uri": {
                  "description": "pg-functions://postgres/\u003cschema\u003e/\u003cfunction\u003e or https://...",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "description": "By kind: custom_access_token, send_email, send_sms, mfa_verification_attempt, password_verification_attempt; an https hook's signing secret is the secret hook:\u003ckind\u003e.",
            "properties": {},
            "type": "object"
          },
          "jwt_expiry_seconds": {
            "format": "int64",
            "maximum": 604800,
            "minimum": 300,
            "type": "integer"
          },
          "language": {
            "enum": [
              "fa",
              "en"
            ],
            "type": "string"
          },
          "leaked_password_protection": {
            "description": "Refuse passwords found in the offline leaked-password list.",
            "type": "boolean"
          },
          "manual_linking_enabled": {
            "description": "Signed-in users may link and unlink identities.",
            "type": "boolean"
          },
          "mfa": {
            "properties": {
              "max_enrolled_factors": {
                "format": "int64",
                "maximum": 20,
                "minimum": 1,
                "type": "integer"
              },
              "phone_enroll": {
                "type": "boolean"
              },
              "phone_verify": {
                "type": "boolean"
              },
              "totp_enroll": {
                "type": "boolean"
              },
              "totp_verify": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "otp_expiry_seconds": {
            "format": "int64",
            "maximum": 86400,
            "minimum": 60,
            "type": "integer"
          },
          "otp_length": {
            "format": "int64",
            "maximum": 10,
            "minimum": 6,
            "type": "integer"
          },
          "password_min_length": {
            "format": "int64",
            "maximum": 72,
            "minimum": 6,
            "type": "integer"
          },
          "password_required_characters": {
            "enum": [
              "",
              "letters_digits",
              "lower_upper_digits",
              "lower_upper_digits_symbols"
            ],
            "type": "string"
          },
          "phone_confirm_required": {
            "type": "boolean"
          },
          "phone_enabled": {
            "type": "boolean"
          },
          "providers": {
            "additionalProperties": {
              "properties": {
                "additional_client_ids": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "client_id": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "scopes": {
                  "type": "string"
                },
                "skip_nonce_check": {
                  "type": "boolean"
                },
                "url": {
                  "description": "The issuer (custom), GitLab base or Azure tenant URL.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "description": "By provider (google github gitlab azure apple discord bitbucket linkedin_oidc twitter, or custom:\u003cname\u003e); the client secret is the secret provider:\u003cname\u003e.",
            "properties": {},
            "type": "object"
          },
          "rate_limits": {
            "properties": {
              "anonymous_per_hour": {
                "description": "0: the plan's value; at most the plan's.",
                "format": "int64",
                "type": "integer"
              },
              "emails_per_hour": {
                "description": "0: the plan's value; at most the plan's.",
                "format": "int64",
                "type": "integer"
              },
              "sign_in_per_5min": {
                "description": "0: the plan's value; at most the plan's.",
                "format": "int64",
                "type": "integer"
              },
              "sms_per_hour": {
                "description": "0: the plan's value; at most the plan's.",
                "format": "int64",
                "type": "integer"
              },
              "token_refresh_per_5min": {
                "description": "0: the plan's value; at most the plan's.",
                "format": "int64",
                "type": "integer"
              },
              "verify_per_5min": {
                "description": "0: the plan's value; at most the plan's.",
                "format": "int64",
                "type": "integer"
              }
            },
            "type": "object"
          },
          "redirect_allowlist": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "secure_email_change": {
            "description": "An email change is confirmed from both the current and the new address.",
            "type": "boolean"
          },
          "secure_password_change": {
            "description": "A password change from a session older than 24 h needs a reauthentication code.",
            "type": "boolean"
          },
          "sessions": {
            "properties": {
              "inactivity_timeout_seconds": {
                "description": "0: no limit; else 300-31536000.",
                "format": "int64",
                "type": "integer"
              },
              "single_per_user": {
                "type": "boolean"
              },
              "timebox_seconds": {
                "description": "0: no limit; else 300-31536000.",
                "format": "int64",
                "type": "integer"
              }
            },
            "type": "object"
          },
          "site_url": {
            "format": "uri",
            "type": "string"
          },
          "sms_enabled": {
            "description": "Phone sign-in and codes by SMS (plans with SMS).",
            "type": "boolean"
          },
          "smtp": {
            "description": "The project's own mail server; its password is the secret smtp.",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "host": {
                "type": "string"
              },
              "port": {
                "format": "int64",
                "type": "integer"
              },
              "sender_email": {
                "type": "string"
              },
              "sender_name": {
                "type": "string"
              },
              "user": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "site_url",
          "redirect_allowlist",
          "email_enabled",
          "phone_enabled",
          "anonymous_enabled",
          "disable_signup",
          "email_confirm_required",
          "phone_confirm_required",
          "password_min_length",
          "otp_length",
          "otp_expiry_seconds",
          "sms_enabled"
        ],
        "type": "object"
      },
      "AuthUser": {
        "properties": {
          "app_metadata": {
            "properties": {},
            "type": "object"
          },
          "banned_until": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "confirmed_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "email_confirmed_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invited_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "is_anonymous": {
            "type": "boolean"
          },
          "last_sign_in_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "new_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "new_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": "string"
          },
          "phone_confirmed_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "providers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "role": {
            "type": "string"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "user_metadata": {
            "properties": {},
            "type": "object"
          }
        },
        "required": [
          "id",
          "email",
          "phone",
          "created_at",
          "providers"
        ],
        "type": "object"
      },
      "AuthUserInput": {
        "additionalProperties": false,
        "properties": {
          "app_metadata": {
            "properties": {},
            "type": "object"
          },
          "ban_duration": {
            "description": "24h, 876000h (a ban) or none (unban).",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "email_confirm": {
            "type": "boolean"
          },
          "password": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "phone_confirm": {
            "type": "boolean"
          },
          "user_metadata": {
            "properties": {},
            "type": "object"
          }
        },
        "type": "object"
      },
      "Backup": {
        "properties": {
          "bytes": {
            "format": "int64",
            "type": "integer"
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "finished_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "daily",
              "manual",
              "pre_restore"
            ],
            "type": "string"
          },
          "started_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "running",
              "ready",
              "failed",
              "expired"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "bytes",
          "started_at"
        ],
        "type": "object"
      },
      "BackupPolicy": {
        "properties": {
          "available": {
            "type": "boolean"
          },
          "daily_at_utc": {
            "description": "HH:MM",
            "type": "string"
          },
          "max_manual": {
            "format": "int64",
            "type": "integer"
          },
          "pitr": {
            "properties": {
              "available": {
                "type": "boolean"
              },
              "days": {
                "format": "int64",
                "type": "integer"
              },
              "earliest": {
                "description": "RFC 3339 time, UTC.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "latest": {
                "description": "RFC 3339 time, UTC.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": "object"
          },
          "retention_days": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Bucket": {
        "properties": {
          "allowed_mime_types": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "file_size_limit": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "public": {
            "type": "boolean"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "public"
        ],
        "type": "object"
      },
      "BucketInput": {
        "additionalProperties": false,
        "properties": {
          "allowed_mime_types": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "file_size_limit": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "public": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Column": {
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "description": "SQL type name.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type"
        ],
        "type": "object"
      },
      "ColumnSpec": {
        "additionalProperties": false,
        "properties": {
          "check": {
            "description": "A CHECK constraint on the column (SQL expression).",
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "default": {
            "description": "SQL expression: now(), gen_random_uuid(), 'draft'.",
            "type": "string"
          },
          "identity": {
            "enum": [
              "",
              "always",
              "by_default"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "nullable": {
            "type": "boolean"
          },
          "primary_key": {
            "type": "boolean"
          },
          "references": {
            "properties": {
              "column": {
                "type": "string"
              },
              "on_delete": {
                "enum": [
                  "no_action",
                  "restrict",
                  "cascade",
                  "set_null",
                  "set_default"
                ],
                "type": "string"
              },
              "on_update": {
                "enum": [
                  "no_action",
                  "restrict",
                  "cascade",
                  "set_null",
                  "set_default"
                ],
                "type": "string"
              },
              "schema": {
                "type": "string"
              },
              "table": {
                "type": "string"
              }
            },
            "required": [
              "table",
              "column"
            ],
            "type": "object"
          },
          "type": {
            "description": "A built-in type (text, bigint, numeric(10,2), timestamptz, uuid, jsonb, text[]...) or your own (schema.type).",
            "type": "string"
          },
          "unique": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "type"
        ],
        "type": "object"
      },
      "Connect": {
        "properties": {
          "auth_url": {
            "type": "string"
          },
          "database": {
            "properties": {
              "available": {
                "description": "false while the database is not reachable from outside the platform.",
                "type": "boolean"
              },
              "database": {
                "type": "string"
              },
              "host": {
                "type": "string"
              },
              "password_reveal": {
                "description": "The reveal kind of the password: POST /projects/{id}/keys/database/reveal.",
                "type": "string"
              },
              "pool_mode": {
                "enum": [
                  "transaction",
                  "session"
                ],
                "type": "string"
              },
              "port": {
                "format": "int64",
                "type": "integer"
              },
              "sslmode": {
                "type": "string"
              },
              "uri": {
                "description": "{{DB_PASSWORD}} in place of the password.",
                "type": "string"
              },
              "user": {
                "type": "string"
              }
            },
            "required": [
              "available"
            ],
            "type": "object"
          },
          "endpoint": {
            "format": "uri",
            "type": "string"
          },
          "keys": {
            "description": "Previews; reveal the key itself with POST /projects/{id}/keys/{kind}/reveal.",
            "properties": {
              "anon": {
                "properties": {
                  "kid": {
                    "type": "string"
                  },
                  "preview": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "publishable": {
                "properties": {
                  "kid": {
                    "type": "string"
                  },
                  "preview": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "rest_url": {
            "type": "string"
          },
          "snippets": {
            "items": {
              "properties": {
                "code": {
                  "type": "string"
                },
                "language": {
                  "type": "string"
                },
                "placeholders": {
                  "description": "What the panel fills in: {{CLIENT_PACKAGE}}, {{CLIENT_CLASS}}, {{CLIENT_FACTORY}} from its runtime configuration; {{ANON_KEY}}, {{DB_PASSWORD}} after a reveal.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "language",
                "title",
                "code",
                "placeholders"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "storage_url": {
            "type": "string"
          }
        },
        "required": [
          "endpoint",
          "rest_url",
          "auth_url",
          "storage_url",
          "keys",
          "database",
          "snippets"
        ],
        "type": "object"
      },
      "ConstraintSpec": {
        "additionalProperties": false,
        "properties": {
          "check": {
            "description": "SQL expression.",
            "type": "string"
          },
          "columns": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "description": "Optional: the database names it.",
            "type": "string"
          },
          "not_valid": {
            "description": "Skip checking the rows already there (foreign_key, check).",
            "type": "boolean"
          },
          "references": {
            "additionalProperties": false,
            "properties": {
              "columns": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "on_delete": {
                "enum": [
                  "no_action",
                  "restrict",
                  "cascade",
                  "set_null",
                  "set_default"
                ],
                "type": "string"
              },
              "on_update": {
                "enum": [
                  "no_action",
                  "restrict",
                  "cascade",
                  "set_null",
                  "set_default"
                ],
                "type": "string"
              },
              "schema": {
                "type": "string"
              },
              "table": {
                "type": "string"
              }
            },
            "required": [
              "table",
              "columns"
            ],
            "type": "object"
          },
          "type": {
            "enum": [
              "foreign_key",
              "unique",
              "check",
              "primary_key"
            ],
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "CronHTTP": {
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "properties": {},
            "type": "object"
          },
          "method": {
            "enum": [
              "GET",
              "POST",
              "PUT",
              "PATCH",
              "DELETE"
            ],
            "type": "string"
          },
          "timeout_ms": {
            "format": "int64",
            "maximum": 10000,
            "minimum": 1000,
            "type": "integer"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CronInput": {
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "http": {
            "$ref": "#/components/schemas/CronHTTP"
          },
          "kind": {
            "enum": [
              "sql",
              "http"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 63,
            "type": "string"
          },
          "schedule": {
            "type": "string"
          },
          "sql": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "schedule",
          "kind"
        ],
        "type": "object"
      },
      "CronJob": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "http": {
            "$ref": "#/components/schemas/CronHTTP"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "sql",
              "http"
            ],
            "type": "string"
          },
          "last_run": {
            "properties": {
              "duration_ms": {
                "format": "int64",
                "type": "integer"
              },
              "started_at": {
                "description": "RFC 3339 time, UTC.",
                "format": "date-time",
                "type": "string"
              },
              "status": {
                "type": "string"
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "next_run_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "schedule": {
            "description": "Five-field cron (UTC) or \"N seconds\".",
            "type": "string"
          },
          "sql": {
            "type": "string"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "schedule",
          "kind",
          "enabled"
        ],
        "type": "object"
      },
      "CronRun": {
        "properties": {
          "duration_ms": {
            "format": "int64",
            "type": "integer"
          },
          "finished_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "started_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "running",
              "success",
              "failed"
            ],
            "type": "string"
          },
          "trigger": {
            "enum": [
              "schedule",
              "manual"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomDomain": {
        "properties": {
          "active_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "dns": {
            "description": "Who sets the records (#1432): auto when Arianet wrote them into the customer's Arianet DNS or connected Cloudflare zone, manual otherwise.",
            "properties": {
              "available": {
                "description": "Whether this region writes records automatically.",
                "type": "boolean"
              },
              "conflicts": {
                "items": {
                  "properties": {
                    "content": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "wanted_type": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "name",
                    "content",
                    "wanted_type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "message": {
                "description": "Core's Persian explanation (a conflict, missing rights, nameservers not delegated).",
                "type": [
                  "string",
                  "null"
                ]
              },
              "mode": {
                "enum": [
                  "auto",
                  "manual"
                ],
                "type": "string"
              },
              "provider": {
                "enum": [
                  "arianet",
                  "cloudflare"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "provider_label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "state": {
                "description": "What core did; null: never asked.",
                "enum": [
                  "configured",
                  "none",
                  "conflict",
                  "forbidden",
                  "not_delegated",
                  "failed"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "zone": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "mode",
              "state",
              "available",
              "provider",
              "provider_label",
              "zone",
              "message",
              "conflicts"
            ],
            "type": "object"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "hostname": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_checked_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "records": {
            "items": {
              "properties": {
                "name": {
                  "type": "string"
                },
                "ok": {
                  "type": "boolean"
                },
                "type": {
                  "enum": [
                    "CNAME",
                    "TXT"
                  ],
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "name",
                "value",
                "ok"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "site": {
            "description": "The site the domain serves (#1373); null: the project's endpoint.",
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "enum": [
              "pending",
              "issuing",
              "active",
              "failed"
            ],
            "type": "string"
          },
          "verified_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "hostname",
          "state",
          "records",
          "dns",
          "verified_at",
          "active_at",
          "last_checked_at",
          "error",
          "created_at"
        ],
        "type": "object"
      },
      "DDLResult": {
        "properties": {
          "sql": {
            "description": "The statements that ran, in order.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "sql"
        ],
        "type": "object"
      },
      "DatabaseEndpoint": {
        "properties": {
          "available": {
            "type": "boolean"
          },
          "database": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "pool_mode": {
            "type": "string"
          },
          "port": {
            "format": "int64",
            "type": "integer"
          },
          "sslmode": {
            "type": "string"
          },
          "uri": {
            "description": "With {{DB_PASSWORD}} for the password.",
            "type": "string"
          },
          "user": {
            "type": "string"
          }
        },
        "required": [
          "available"
        ],
        "type": "object"
      },
      "DatabaseSettings": {
        "properties": {
          "connection": {
            "properties": {
              "direct": {
                "$ref": "#/components/schemas/DatabaseEndpoint"
              },
              "pooler": {
                "$ref": "#/components/schemas/DatabaseEndpoint"
              }
            },
            "type": "object"
          },
          "max_connections": {
            "format": "int64",
            "type": "integer"
          },
          "network": {
            "properties": {
              "allowed_cidrs": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "restricted": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "plan": {
            "type": "string"
          },
          "size": {
            "properties": {
              "limit_bytes": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "measured_at": {
                "description": "RFC 3339 time, UTC.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "read_only": {
                "type": "boolean"
              },
              "used_bytes": {
                "format": "int64",
                "type": "integer"
              }
            },
            "type": "object"
          },
          "ssl_enforced": {
            "type": "boolean"
          },
          "statement_timeout_ms": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Delivery": {
        "properties": {
          "attempts": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "duration_ms": {
            "format": "int64",
            "type": "integer"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "event": {
            "type": "string"
          },
          "finished_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "http_status": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "retrying",
              "success",
              "failed"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Error": {
        "properties": {
          "code": {
            "description": "Stable machine code.",
            "enum": [
              "action_failed",
              "action_in_progress",
              "auto_dns_unavailable",
              "backup_corrupt",
              "backup_missing",
              "backup_not_ready",
              "backups_unavailable",
              "blocked_address",
              "branch_not_found",
              "confirmation_mismatch",
              "conflict",
              "console_unavailable",
              "core_unavailable",
              "create_failed",
              "custom_domains_unavailable",
              "database_ops_unavailable",
              "database_unavailable",
              "delete_failed",
              "deployment_expired",
              "deployment_failed",
              "deployment_finished",
              "deployment_live",
              "deployment_not_ready",
              "deployment_not_uploaded",
              "deployment_running",
              "dns_cleanup_unavailable",
              "domain_limit",
              "domain_taken",
              "duplicate_batch",
              "extension_managed",
              "extension_unavailable",
              "feature_preparing",
              "forbidden",
              "function_limit",
              "functions_unavailable",
              "git_account_in_use",
              "git_account_not_found",
              "git_connected",
              "git_host_error",
              "git_host_not_allowed",
              "git_host_unavailable",
              "git_not_connected",
              "git_oauth_unavailable",
              "git_reauth_required",
              "git_unavailable",
              "identity_hold",
              "identity_needed",
              "import_limit",
              "index_backs_constraint",
              "insufficient_balance",
              "internal_error",
              "interval_too_short",
              "invalid_function_name",
              "invalid_input",
              "invalid_secret_name",
              "invalid_site_name",
              "key_unavailable",
              "method_not_allowed",
              "migration_changed",
              "name_taken",
              "no_address",
              "no_primary_key",
              "not_a_preview",
              "not_for_sale",
              "not_found",
              "oauth_denied",
              "oauth_exchange_failed",
              "oauth_state_invalid",
              "over_plan_limit",
              "path_not_found",
              "pause_failed",
              "pitr_unavailable",
              "plan_feature",
              "plan_has_no_pitr",
              "plan_has_no_sms",
              "plan_limit",
              "plan_required",
              "platform_schema",
              "project_active",
              "project_busy",
              "project_deleting",
              "project_limit",
              "project_missing",
              "project_not_active",
              "project_paused",
              "project_provisioning",
              "project_suspended",
              "protected_schema",
              "query_limit",
              "query_too_large",
              "quota_exceeded",
              "rate_limit_exceeded",
              "repository_empty",
              "repository_permission",
              "repository_token_permission",
              "repository_token_refused",
              "repository_unreachable",
              "reserved_name",
              "reserved_secret_name",
              "resume_failed",
              "row_not_found",
              "same_account",
              "same_plan",
              "same_workspace",
              "secret_limit",
              "secret_too_large",
              "site_limit",
              "site_name_taken",
              "site_storage_limit",
              "sites_unavailable",
              "snippet_limit",
              "sold_out",
              "sql_error",
              "suspend_failed",
              "table_not_found",
              "template_invalid",
              "too_large",
              "too_many_uploads",
              "transaction_control",
              "transfer_closed",
              "transfer_pending",
              "unauthorized",
              "unavailable",
              "unknown_command",
              "unsuspend_failed",
              "upstream_refused"
            ],
            "type": "string"
          },
          "error": {
            "description": "English, for people. Branch on code.",
            "type": "string"
          },
          "label": {
            "description": "quota_exceeded: the resource's name in Persian (absent when the service refused under its own count).",
            "type": "string"
          },
          "limit": {
            "description": "quota_exceeded: the account's quota of it.",
            "format": "int64",
            "type": "integer"
          },
          "requested": {
            "description": "quota_exceeded: what the request adds.",
            "format": "int64",
            "type": "integer"
          },
          "resource": {
            "description": "quota_exceeded: the quota resource (see Quota).",
            "type": "string"
          },
          "used": {
            "description": "quota_exceeded: what the account holds of it.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "error",
          "code"
        ],
        "type": "object"
      },
      "ForeignKey": {
        "properties": {
          "columns": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "on_delete": {
            "enum": [
              "no_action",
              "restrict",
              "cascade",
              "set_null",
              "set_default"
            ],
            "type": "string"
          },
          "on_update": {
            "enum": [
              "no_action",
              "restrict",
              "cascade",
              "set_null",
              "set_default"
            ],
            "type": "string"
          },
          "ref_columns": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "ref_schema": {
            "type": "string"
          },
          "ref_table": {
            "type": "string"
          },
          "schema": {
            "type": "string"
          },
          "table": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "schema",
          "table",
          "columns",
          "ref_schema",
          "ref_table",
          "ref_columns",
          "on_delete",
          "on_update"
        ],
        "type": "object"
      },
      "Function": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "deployed_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "entrypoint": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "size_bytes": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "Where the function answers: \u003cendpoint\u003e/functions/v1/\u003cname\u003e.",
            "format": "uri",
            "type": "string"
          },
          "verify_jwt": {
            "description": "Calls need a valid project JWT (the anon key, the service key or a user's token).",
            "type": "boolean"
          },
          "version": {
            "description": "The active version (0 before the first deploy).",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "verify_jwt",
          "version",
          "url",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "FunctionLimits": {
        "properties": {
          "bundle_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "cpu_millis": {
            "format": "int64",
            "type": "integer"
          },
          "hard": {
            "description": "A free plan: beyond the monthly invocations calls are refused (402) until the month ends.",
            "type": "boolean"
          },
          "invocations_month": {
            "format": "int64",
            "type": "integer"
          },
          "max_functions": {
            "format": "int64",
            "type": "integer"
          },
          "max_secrets": {
            "format": "int64",
            "type": "integer"
          },
          "memory_mb": {
            "format": "int64",
            "type": "integer"
          },
          "wall_clock_ms": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "max_functions",
          "bundle_bytes",
          "wall_clock_ms",
          "memory_mb",
          "cpu_millis",
          "invocations_month",
          "max_secrets",
          "hard"
        ],
        "type": "object"
      },
      "FunctionLog": {
        "properties": {
          "at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "duration_ms": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "log",
              "invocation"
            ],
            "type": "string"
          },
          "level": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "status": {
            "format": "int64",
            "type": "integer"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "at",
          "kind",
          "request_id",
          "version"
        ],
        "type": "object"
      },
      "FunctionSecret": {
        "properties": {
          "digest": {
            "description": "SHA-256 of the value, hex.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "name",
          "digest",
          "updated_at"
        ],
        "type": "object"
      },
      "FunctionVersion": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "entrypoint": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "sha256",
          "size_bytes",
          "entrypoint",
          "active",
          "created_at"
        ],
        "type": "object"
      },
      "FunctionsConfig": {
        "properties": {
          "expose_service_key": {
            "description": "Give the functions ARIANET_BAAS_SERVICE_ROLE_KEY.",
            "type": "boolean"
          }
        },
        "required": [
          "expose_service_key"
        ],
        "type": "object"
      },
      "GitAccount": {
        "properties": {
          "avatar_url": {
            "type": "string"
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "login": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "enum": [
              "github",
              "gitlab"
            ],
            "type": "string"
          },
          "status": {
            "description": "needs_reauth: revoked or expired; link it again.",
            "enum": [
              "active",
              "needs_reauth"
            ],
            "type": "string"
          },
          "used_by": {
            "description": "Projects whose connection deploys with it (it cannot be unlinked while any does).",
            "items": {
              "properties": {
                "project_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "project_name": {
                  "type": "string"
                }
              },
              "required": [
                "project_id",
                "project_name"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "provider",
          "login",
          "name",
          "avatar_url",
          "status",
          "created_at",
          "used_by"
        ],
        "type": "object"
      },
      "GitConnection": {
        "properties": {
          "auth": {
            "description": "oauth: a linked git account (git_account); token: a repository token.",
            "enum": [
              "oauth",
              "token"
            ],
            "type": "string"
          },
          "base_url": {
            "description": "The git host's API base.",
            "format": "uri",
            "type": "string"
          },
          "config_path": {
            "type": "string"
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "functions_dir": {
            "type": "string"
          },
          "git_account": {
            "properties": {
              "avatar_url": {
                "type": "string"
              },
              "id": {
                "format": "int64",
                "type": "integer"
              },
              "login": {
                "type": "string"
              },
              "provider": {
                "enum": [
                  "github",
                  "gitlab"
                ],
                "type": "string"
              },
              "status": {
                "enum": [
                  "active",
                  "needs_reauth"
                ],
                "type": "string"
              }
            },
            "required": [
              "id",
              "provider",
              "login",
              "avatar_url",
              "status"
            ],
            "type": [
              "object",
              "null"
            ]
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "migrations_dir": {
            "type": "string"
          },
          "permissions": {
            "description": "What deploys may do: the connecting member's permissions at the time.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "previews": {
            "description": "Other branches and pull/merge requests get preview deployments.",
            "type": "boolean"
          },
          "production_branch": {
            "type": "string"
          },
          "provider": {
            "enum": [
              "github",
              "gitlab"
            ],
            "type": "string"
          },
          "repo": {
            "description": "owner/name (GitHub) or group[/subgroup]/name (GitLab).",
            "type": "string"
          },
          "root_dir": {
            "description": "The app's directory in the repository (\"\" the root); a push touching nothing under it deploys nothing.",
            "type": "string"
          },
          "site": {
            "properties": {
              "build_command": {
                "maxLength": 1024,
                "type": "string"
              },
              "env": {
                "additionalProperties": {
                  "maxLength": 4096,
                  "type": "string"
                },
                "description": "The build's environment (not secret; at most 50).",
                "properties": {},
                "type": "object"
              },
              "install_command": {
                "maxLength": 1024,
                "type": "string"
              },
              "name": {
                "description": "The site the builds deploy to (made when missing).",
                "type": "string"
              },
              "output_dir": {
                "description": "Relative to root_dir; empty: the first of dist, build, out, public.",
                "type": "string"
              },
              "package_manager": {
                "enum": [
                  "auto",
                  "npm",
                  "pnpm",
                  "yarn"
                ],
                "type": "string"
              },
              "url": {
                "format": "uri",
                "type": "string"
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "status": {
            "description": "needs_reauth: the linked git account was revoked or expired; deploys fail with git_reauth_required.",
            "enum": [
              "active",
              "error",
              "needs_reauth"
            ],
            "type": "string"
          },
          "token_hint": {
            "description": "The token's last characters; the token itself is never returned.",
            "type": "string"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "webhook": {
            "properties": {
              "registered": {
                "type": "boolean"
              },
              "url": {
                "format": "uri",
                "type": "string"
              }
            },
            "required": [
              "url",
              "registered"
            ],
            "type": "object"
          }
        },
        "required": [
          "auth",
          "git_account",
          "provider",
          "base_url",
          "repo",
          "production_branch",
          "root_dir",
          "site",
          "functions_dir",
          "migrations_dir",
          "config_path",
          "previews",
          "status",
          "last_error",
          "token_hint",
          "webhook",
          "permissions",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "GitDeployment": {
        "properties": {
          "branch": {
            "type": "string"
          },
          "build_seconds": {
            "format": "int64",
            "type": "integer"
          },
          "cancel_requested": {
            "type": "boolean"
          },
          "commit": {
            "properties": {
              "author": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "message": {
                "type": "string"
              },
              "sha": {
                "type": "string"
              }
            },
            "required": [
              "sha",
              "message",
              "author"
            ],
            "type": "object"
          },
          "console_url": {
            "format": "uri",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "finished_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "production",
              "preview"
            ],
            "type": "string"
          },
          "pr_number": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "preview_url": {
            "format": "uri",
            "type": [
              "string",
              "null"
            ]
          },
          "site": {
            "type": [
              "string",
              "null"
            ]
          },
          "site_deployment_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "stage": {
            "enum": [
              "source",
              "check",
              "build",
              "preview",
              "migrations",
              "config",
              "functions",
              "promote"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "started_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "queued",
              "building",
              "deploying",
              "ready",
              "failed",
              "canceled",
              "superseded"
            ],
            "type": "string"
          },
          "steps": {
            "additionalProperties": true,
            "description": "Only on GET of one deployment: source, migrations (pending/applied), config (changes/applied), functions, site, rolled_back.",
            "properties": {},
            "type": "object"
          },
          "trigger": {
            "enum": [
              "push",
              "pull_request",
              "manual",
              "redeploy",
              "promote"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "stage",
          "branch",
          "commit",
          "pr_number",
          "trigger",
          "site",
          "site_deployment_id",
          "preview_url",
          "error_code",
          "error",
          "build_seconds",
          "cancel_requested",
          "created_by",
          "created_at",
          "started_at",
          "finished_at"
        ],
        "type": "object"
      },
      "GitPreview": {
        "properties": {
          "alias": {
            "type": "string"
          },
          "branch": {
            "type": "string"
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "git_deployment_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "pr_number": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "site": {
            "type": "string"
          },
          "site_deployment_id": {
            "format": "int64",
            "type": "integer"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "site",
          "alias",
          "url",
          "branch",
          "pr_number",
          "site_deployment_id",
          "git_deployment_id",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "GitRepo": {
        "properties": {
          "can_connect": {
            "description": "GitHub: admin or maintain role; GitLab lists Maintainer and above only.",
            "type": "boolean"
          },
          "default_branch": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "private": {
            "type": "boolean"
          },
          "repo": {
            "description": "owner/name or group[/subgroup]/name.",
            "type": "string"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "web_url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "repo",
          "name",
          "private",
          "default_branch",
          "updated_at",
          "web_url",
          "can_connect"
        ],
        "type": "object"
      },
      "Index": {
        "properties": {
          "columns": {
            "description": "Key columns or expressions, in order.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "constraint": {
            "description": "The constraint the index backs: drop that instead.",
            "type": [
              "string",
              "null"
            ]
          },
          "definition": {
            "type": "string"
          },
          "method": {
            "enum": [
              "btree",
              "hash",
              "gin",
              "gist",
              "brin",
              "spgist"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "predicate": {
            "description": "A partial index's WHERE.",
            "type": [
              "string",
              "null"
            ]
          },
          "primary": {
            "type": "boolean"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "unique": {
            "type": "boolean"
          },
          "valid": {
            "description": "false after a concurrent build that failed: drop it and build it again.",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "unique",
          "primary",
          "definition",
          "method",
          "valid",
          "columns",
          "predicate",
          "size_bytes",
          "constraint"
        ],
        "type": "object"
      },
      "IndexSpec": {
        "additionalProperties": false,
        "properties": {
          "columns": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "desc": {
                  "description": "btree only.",
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "opclass": {
                  "description": "gin_trgm_ops, jsonb_path_ops...",
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "concurrently": {
            "description": "Build without blocking writes; runs alone, outside a transaction.",
            "type": "boolean"
          },
          "method": {
            "enum": [
              "btree",
              "hash",
              "gin",
              "gist",
              "brin",
              "spgist"
            ],
            "type": "string"
          },
          "name": {
            "description": "Optional: the database names it.",
            "type": "string"
          },
          "unique": {
            "description": "btree only.",
            "type": "boolean"
          },
          "where": {
            "description": "A partial index's predicate (SQL expression).",
            "type": "string"
          }
        },
        "required": [
          "columns"
        ],
        "type": "object"
      },
      "Key": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "kid": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "anon",
              "service",
              "publishable",
              "secret"
            ],
            "type": "string"
          },
          "preview": {
            "description": "Enough to tell keys apart; never the key.",
            "type": "string"
          },
          "rotated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "enum": [
              "active",
              "retiring",
              "revoked"
            ],
            "type": "string"
          }
        },
        "required": [
          "kind",
          "kid",
          "preview",
          "state",
          "created_at",
          "rotated_at"
        ],
        "type": "object"
      },
      "Limits": {
        "properties": {
          "db_bytes": {
            "description": "Database size.",
            "format": "int64",
            "type": "integer"
          },
          "egress_bytes_month": {
            "description": "Egress a month.",
            "format": "int64",
            "type": "integer"
          },
          "mau": {
            "description": "Monthly active users of the project's auth.",
            "format": "int64",
            "type": "integer"
          },
          "max_connections": {
            "description": "Database connections the project's direct user may hold.",
            "format": "int64",
            "type": "integer"
          },
          "max_projects_per_account": {
            "description": "Projects on this plan one account may have.",
            "format": "int64",
            "type": "integer"
          },
          "pause_after_idle_seconds": {
            "description": "A project without a request for this long is paused; 0 never.",
            "format": "int64",
            "type": "integer"
          },
          "rate_limit_rps": {
            "description": "Requests a second the project's endpoint serves; 0 is the tier default.",
            "format": "int64",
            "type": "integer"
          },
          "sms_otp_month": {
            "description": "Phone OTP messages a month.",
            "format": "int64",
            "type": "integer"
          },
          "statement_timeout_ms": {
            "description": "The longest a statement may run before the database cancels it.",
            "format": "int64",
            "type": "integer"
          },
          "storage_bytes": {
            "description": "File storage.",
            "format": "int64",
            "type": "integer"
          },
          "storage_image_transform": {
            "description": "The plan includes image transformation (/storage/v1/render/image).",
            "type": "boolean"
          },
          "storage_max_file_bytes": {
            "description": "The largest single file; 0 is the storage default.",
            "format": "int64",
            "type": "integer"
          },
          "storage_s3_keys": {
            "description": "How many live S3 access keys a project may hold (0: no S3 protocol access).",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "db_bytes",
          "storage_bytes",
          "egress_bytes_month",
          "mau",
          "max_projects_per_account",
          "pause_after_idle_seconds",
          "sms_otp_month",
          "max_connections",
          "rate_limit_rps",
          "statement_timeout_ms",
          "storage_max_file_bytes"
        ],
        "type": "object"
      },
      "Lint": {
        "properties": {
          "cache_key": {
            "type": "string"
          },
          "category": {
            "enum": [
              "security",
              "performance"
            ],
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "first_seen_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "level": {
            "enum": [
              "ERROR",
              "WARN",
              "INFO"
            ],
            "type": "string"
          },
          "name": {
            "description": "Stable lint id.",
            "type": "string"
          },
          "object": {
            "properties": {
              "name": {
                "type": "string"
              },
              "schema": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "name"
            ],
            "type": "object"
          },
          "remediation": {
            "type": "string"
          },
          "sql": {
            "description": "SQL that fixes it.",
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "title",
          "level",
          "category",
          "description",
          "detail",
          "object",
          "remediation",
          "sql",
          "cache_key"
        ],
        "type": "object"
      },
      "LogEntry": {
        "properties": {
          "at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "browser": {
            "description": "The request carried an Origin header.",
            "type": "boolean"
          },
          "duration_ms": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "ip": {
            "description": "Masked: 185.126.7.x.",
            "type": "string"
          },
          "key_role": {
            "enum": [
              "anon",
              "service_role"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "level": {
            "enum": [
              "info",
              "warning",
              "error"
            ],
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "path": {
            "description": "A template: ids and values replaced, no query string.",
            "type": "string"
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "enum": [
              "gateway",
              "auth",
              "storage",
              "rest",
              "sql",
              "functions",
              "realtime"
            ],
            "type": "string"
          },
          "status": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "at",
          "source",
          "method",
          "path",
          "status",
          "duration_ms",
          "ip",
          "request_id"
        ],
        "type": "object"
      },
      "ObjectEntry": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "folder": {
            "type": "boolean"
          },
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "mimetype": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "size": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "id",
          "folder"
        ],
        "type": "object"
      },
      "Plan": {
        "properties": {
          "code": {
            "type": "string"
          },
          "currency": {
            "description": "The currency of the prices (IRR).",
            "type": "string"
          },
          "free": {
            "description": "Priced at zero: its limits are hard (beyond them uploads, the month's traffic and new users are refused); a paid plan's overage is metered instead.",
            "type": "boolean"
          },
          "limits": {
            "$ref": "#/components/schemas/Limits"
          },
          "name": {
            "type": "string"
          },
          "name_fa": {
            "description": "Display name in the customer's language.",
            "type": "string"
          },
          "price_hourly": {
            "description": "The plan's price per hour as core sells it (display only), when it has one.",
            "type": [
              "number",
              "null"
            ]
          },
          "price_monthly": {
            "description": "The plan's price per month as core sells it (display only); absent when core does not price the plan.",
            "type": [
              "number",
              "null"
            ]
          },
          "sku": {
            "description": "The accounting SKU, baas.plan.\u003ccode\u003e.monthly.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "name",
          "name_fa",
          "sku",
          "limits",
          "free"
        ],
        "type": "object"
      },
      "Project": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "endpoint": {
            "description": "The project's public endpoint for client libraries.",
            "format": "uri",
            "type": "string"
          },
          "id": {
            "description": "Region-unique id (a decimal string).",
            "type": "string"
          },
          "last_request_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "paused_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "plan": {
            "description": "Plan code.",
            "type": "string"
          },
          "ref": {
            "description": "20 lowercase letters and digits; the endpoint's first label.",
            "pattern": "^[a-z][a-z0-9]{19}$",
            "type": "string"
          },
          "region": {
            "description": "The install's region code.",
            "type": "string"
          },
          "running_action": {
            "properties": {
              "command": {
                "type": "string"
              },
              "id": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "id",
              "command"
            ],
            "type": [
              "object",
              "null"
            ]
          },
          "state": {
            "enum": [
              "provisioning",
              "active",
              "paused",
              "suspended",
              "deleting"
            ],
            "type": "string"
          },
          "suspension_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "workspace_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "ref",
          "name",
          "region",
          "plan",
          "state",
          "endpoint",
          "workspace_id",
          "suspension_reason",
          "paused_at",
          "last_request_at",
          "created_at",
          "running_action"
        ],
        "type": "object"
      },
      "Queue": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "length": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "newest_age_seconds": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "oldest_age_seconds": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "total_messages": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "QueueMessage": {
        "properties": {
          "archived_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "enqueued_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "message": {},
          "msg_id": {
            "format": "int64",
            "type": "integer"
          },
          "read_ct": {
            "format": "int64",
            "type": "integer"
          },
          "vt": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Quota": {
        "properties": {
          "label": {
            "description": "Its name in Persian.",
            "type": "string"
          },
          "limit": {
            "description": "The account's quota; null is unlimited.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "resource": {
            "description": "The quota resource.",
            "enum": [
              "baas_project",
              "baas_paid_project",
              "baas_db_gb",
              "baas_storage_gb",
              "baas_egress_gb_month",
              "baas_site"
            ],
            "type": "string"
          },
          "unit": {
            "description": "count, or gib for the sums of the projects' plan limits.",
            "enum": [
              "count",
              "gib"
            ],
            "type": "string"
          },
          "unlimited": {
            "type": "boolean"
          },
          "used": {
            "description": "Live projects (one being created counts), those on a paid plan, the sums of their plans' limits in GiB rounded up, or the sites of every project.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "resource",
          "label",
          "unit",
          "used",
          "limit",
          "unlimited"
        ],
        "type": "object"
      },
      "RowPage": {
        "properties": {
          "columns": {
            "items": {
              "$ref": "#/components/schemas/Column"
            },
            "type": "array"
          },
          "count": {
            "description": "Matching rows, exact up to 10000.",
            "format": "int64",
            "type": "integer"
          },
          "count_capped": {
            "type": "boolean"
          },
          "primary_key": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "rows": {
            "items": {
              "items": {
                "description": "A column value: boolean, number, JSON (json/jsonb), or the database's text form."
              },
              "type": "array"
            },
            "type": "array"
          }
        },
        "required": [
          "columns",
          "primary_key",
          "rows",
          "count",
          "count_capped"
        ],
        "type": "object"
      },
      "RowsResult": {
        "properties": {
          "affected": {
            "format": "int64",
            "type": "integer"
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/Column"
            },
            "type": "array"
          },
          "rows": {
            "items": {
              "items": {
                "description": "A column value: boolean, number, JSON (json/jsonb), or the database's text form."
              },
              "type": "array"
            },
            "type": "array"
          }
        },
        "required": [
          "columns",
          "rows",
          "affected"
        ],
        "type": "object"
      },
      "SQLError": {
        "properties": {
          "detail": {
            "type": "string"
          },
          "hint": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "position": {
            "description": "1-based character position in the submitted text.",
            "format": "int64",
            "type": "integer"
          },
          "sqlstate": {
            "description": "PostgreSQL SQLSTATE (57014: the statement timeout).",
            "type": "string"
          },
          "statement": {
            "description": "0-based index of the failing statement; -1 unknown.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "sqlstate",
          "message",
          "statement"
        ],
        "type": "object"
      },
      "SQLResult": {
        "properties": {
          "duration_ms": {
            "format": "int64",
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "result": {
            "properties": {
              "columns": {
                "items": {
                  "$ref": "#/components/schemas/Column"
                },
                "type": "array"
              },
              "row_count": {
                "description": "Rows the statement returned.",
                "format": "int64",
                "type": "integer"
              },
              "rows": {
                "items": {
                  "items": {
                    "description": "A column value: boolean, number, JSON (json/jsonb), or the database's text form."
                  },
                  "type": "array"
                },
                "type": "array"
              },
              "truncated": {
                "description": "More rows (or bytes) than the editor returns: at most 1000 rows / 5 MB.",
                "type": "boolean"
              }
            },
            "required": [
              "columns",
              "rows",
              "row_count",
              "truncated"
            ],
            "type": [
              "object",
              "null"
            ]
          },
          "statements": {
            "items": {
              "properties": {
                "command": {
                  "description": "INSERT, CREATE TABLE, SELECT...",
                  "type": "string"
                },
                "index": {
                  "format": "int64",
                  "type": "integer"
                },
                "returned_rows": {
                  "type": "boolean"
                },
                "rows_affected": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "index",
                "command",
                "rows_affected",
                "returned_rows"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "statements",
          "result",
          "duration_ms",
          "read_only"
        ],
        "type": "object"
      },
      "SavedLogQuery": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "filters": {
            "description": "query parameter -\u003e value",
            "properties": {},
            "type": "object"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "filters",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "Schema": {
        "properties": {
          "name": {
            "type": "string"
          },
          "owned": {
            "description": "Your database login owns it.",
            "type": "boolean"
          },
          "platform": {
            "description": "The platform's (auth, storage...): read-only in the table editor.",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "owned",
          "platform"
        ],
        "type": "object"
      },
      "Secret": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SecretInput": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "maxLength": 1024,
            "type": "string"
          },
          "name": {
            "maxLength": 64,
            "type": "string"
          },
          "value": {
            "description": "Never shown again.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Site": {
        "properties": {
          "clean_urls": {
            "description": "/about serves /about.html; /about.html redirects to /about.",
            "type": "boolean"
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "headers": {
            "items": {
              "properties": {
                "name": {
                  "type": "string"
                },
                "path": {
                  "description": "An exact path from /, or a prefix ending in * (/assets/*).",
                  "type": "string"
                },
                "value": {
                  "maxLength": 1024,
                  "type": "string"
                }
              },
              "required": [
                "path",
                "name",
                "value"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "hostname": {
            "type": "string"
          },
          "live_deployment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SiteDeployment"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "redirects": {
            "items": {
              "properties": {
                "from": {
                  "description": "An exact path from /, or a prefix ending in *.",
                  "type": "string"
                },
                "status": {
                  "enum": [
                    301,
                    302,
                    307,
                    308
                  ],
                  "format": "int64",
                  "type": "integer"
                },
                "to": {
                  "description": "A path from / or an http(s) URL; :splat is what the * matched.",
                  "type": "string"
                }
              },
              "required": [
                "from",
                "to"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "spa_fallback": {
            "description": "A path without a file (and no extension, or a browser navigation) answers /index.html.",
            "type": "boolean"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "Where the site answers: https://\u003cname\u003e.\u003csites domain\u003e.",
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "name",
          "url",
          "hostname",
          "spa_fallback",
          "clean_urls",
          "headers",
          "redirects",
          "live_deployment",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SiteDeployment": {
        "properties": {
          "bytes": {
            "description": "The files' bytes together (uncompressed).",
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_count": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "live": {
            "description": "The deployment the site serves.",
            "type": "boolean"
          },
          "ready_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "enum": [
              "cli",
              "console",
              "git"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "uploading",
              "ready",
              "failed"
            ],
            "type": "string"
          },
          "upload_expires_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "source",
          "file_count",
          "bytes",
          "error",
          "live",
          "created_by",
          "created_at",
          "upload_expires_at",
          "ready_at"
        ],
        "type": "object"
      },
      "SiteLimits": {
        "properties": {
          "deployment_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "deployment_files": {
            "format": "int64",
            "type": "integer"
          },
          "egress_bytes_month": {
            "format": "int64",
            "type": "integer"
          },
          "hard": {
            "description": "A free plan: past storage_bytes deployments are refused (413), past egress_bytes_month the sites answer 402 until the month ends; a paid plan's overage is metered.",
            "type": "boolean"
          },
          "max_sites": {
            "format": "int64",
            "type": "integer"
          },
          "storage_bytes": {
            "description": "Every kept deployment together.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "max_sites",
          "deployment_bytes",
          "deployment_files",
          "storage_bytes",
          "egress_bytes_month",
          "hard"
        ],
        "type": "object"
      },
      "Snippet": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "query",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "Table": {
        "properties": {
          "comment": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "enum": [
              "table",
              "partitioned_table",
              "view",
              "materialized_view",
              "foreign_table"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "realtime": {
            "description": "In the realtime publication: its changes reach Postgres Changes subscribers.",
            "type": "boolean"
          },
          "rls_enabled": {
            "type": "boolean"
          },
          "rls_forced": {
            "type": "boolean"
          },
          "row_estimate": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "schema": {
            "type": "string"
          },
          "size_bytes": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "schema",
          "name",
          "kind",
          "rls_enabled",
          "rls_forced",
          "row_estimate",
          "size_bytes",
          "comment",
          "realtime"
        ],
        "type": "object"
      },
      "TableDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Table"
          },
          {
            "properties": {
              "columns": {
                "items": {
                  "properties": {
                    "comment": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "default": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "generated": {
                      "type": "boolean"
                    },
                    "identity": {
                      "enum": [
                        "always",
                        "by_default"
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "nullable": {
                      "type": "boolean"
                    },
                    "position": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "primary_key": {
                      "type": "boolean"
                    },
                    "references": {
                      "description": "schema.table(column)",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string"
                    },
                    "unique": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "constraints": {
                "items": {
                  "properties": {
                    "columns": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "definition": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "foreign_keys": {
                "description": "Foreign keys from this table.",
                "items": {
                  "$ref": "#/components/schemas/ForeignKey"
                },
                "type": "array"
              },
              "indexes": {
                "items": {
                  "$ref": "#/components/schemas/Index"
                },
                "type": "array"
              },
              "policies": {
                "items": {
                  "properties": {
                    "command": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "permissive": {
                      "type": "boolean"
                    },
                    "roles": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "using": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "with_check": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "primary_key": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "referenced_by": {
                "description": "Foreign keys from other tables to this one.",
                "items": {
                  "$ref": "#/components/schemas/ForeignKey"
                },
                "type": "array"
              },
              "triggers": {
                "items": {
                  "properties": {
                    "definition": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": [
              "columns",
              "primary_key",
              "constraints",
              "indexes",
              "policies",
              "triggers",
              "foreign_keys",
              "referenced_by"
            ],
            "type": "object"
          }
        ]
      },
      "Transfer": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "decided_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "from_account_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "plan": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "project_name": {
            "type": "string"
          },
          "project_ref": {
            "type": "string"
          },
          "state": {
            "enum": [
              "pending",
              "accepted",
              "declined",
              "cancelled",
              "expired"
            ],
            "type": "string"
          },
          "to_account_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "project_id",
          "from_account_id",
          "to_account_id",
          "state",
          "created_at",
          "expires_at",
          "decided_at"
        ],
        "type": "object"
      },
      "Usage": {
        "properties": {
          "daily": {
            "additionalProperties": {
              "items": {
                "properties": {
                  "day": {
                    "format": "date",
                    "type": "string"
                  },
                  "quantity": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "day",
                  "quantity"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "description": "Per metric: [{day, quantity}] for the days of the period so far.",
            "properties": {},
            "type": "object"
          },
          "metrics": {
            "properties": {
              "build_seconds": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              },
              "db_bytes": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              },
              "egress_bytes": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              },
              "mau": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              },
              "realtime_messages": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              },
              "realtime_peak_connections": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              },
              "requests": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              },
              "site_egress_bytes": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              },
              "site_storage_bytes": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              },
              "sms_otp": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              },
              "storage_bytes": {
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "used",
                  "limit"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "period_end": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "period_start": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "plan": {
            "type": "string"
          }
        },
        "required": [
          "plan",
          "period_start",
          "period_end",
          "metrics",
          "daily"
        ],
        "type": "object"
      },
      "Webhook": {
        "properties": {
          "created_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "events": {
            "items": {
              "enum": [
                "INSERT",
                "UPDATE",
                "DELETE"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "properties": {},
            "type": "object"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "method": {
            "enum": [
              "POST"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "schema": {
            "type": "string"
          },
          "stats": {
            "properties": {
              "delivered_24h": {
                "format": "int64",
                "type": "integer"
              },
              "failed_24h": {
                "format": "int64",
                "type": "integer"
              }
            },
            "type": "object"
          },
          "table": {
            "type": "string"
          },
          "timeout_ms": {
            "format": "int64",
            "type": "integer"
          },
          "trigger_name": {
            "type": "string"
          },
          "updated_at": {
            "description": "RFC 3339 time, UTC.",
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "schema",
          "table",
          "events",
          "url"
        ],
        "type": "object"
      },
      "WebhookInput": {
        "additionalProperties": false,
        "properties": {
          "dry_run": {
            "description": "Answer the trigger's SQL only; nothing is saved.",
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "events": {
            "items": {
              "enum": [
                "INSERT",
                "UPDATE",
                "DELETE"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "properties": {},
            "type": "object"
          },
          "name": {
            "maxLength": 63,
            "type": "string"
          },
          "schema": {
            "type": "string"
          },
          "table": {
            "type": "string"
          },
          "timeout_ms": {
            "format": "int64",
            "maximum": 10000,
            "minimum": 1000,
            "type": "integer"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "table",
          "events",
          "url"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "session": {
        "description": "A session from POST /auth/exchange with core's handoff assertion.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Arianet Backend As A Service: projects (a managed database with its endpoint and keys) in one region. Every region serves the same API at its own base URL; ids are unique across regions. Long operations answer 202 with an action to poll. Errors carry a stable `code`. Requests are rate limited per caller (RateLimit-* headers, 429 rate_limit_exceeded). An account held until its identity is verified may only read: every other operation answers 403 identity_hold.",
    "title": "Arianet BaaS API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/actions": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listActions",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Action"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your latest operations",
        "x-permission": "baas:view"
      }
    },
    "/actions/{id}": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getAction",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One operation; poll it until state is success or error",
        "x-permission": "baas:view"
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenAPI",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document."
          }
        },
        "security": [],
        "summary": "This document"
      }
    },
    "/plans": {
      "get": {
        "operationId": "listPlans",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Plan"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Plans for sale, with their limits"
      }
    },
    "/projects": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listProjects",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Project"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your projects",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "createProject",
        "parameters": [
          {
            "description": "A repeat with the same key answers with the first project.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "maxLength": 64,
              "minLength": 8,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "description": "1-64 English letters, digits, dashes or underscores, no spaces.",
                    "maxLength": 64,
                    "type": "string"
                  },
                  "plan": {
                    "description": "Plan code.",
                    "type": "string"
                  },
                  "workspace_id": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "name",
                  "plan"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "action": {
                      "$ref": "#/components/schemas/Action"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    }
                  },
                  "required": [
                    "data",
                    "action"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Accepted: follow the action. The project is metered from the moment its database exists."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a project: a database with its endpoint and keys. Provisioning is an action to follow",
        "x-codes": [
          "insufficient_balance (402)",
          "identity_needed",
          "identity_hold",
          "project_limit",
          "quota_exceeded (403, with resource, label, used, requested, limit)",
          "sold_out",
          "not_for_sale",
          "core_unavailable"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}": {
      "delete": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "deleteProject",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "action": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "action"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Accepted: follow the action."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete the project and its data. What it cost so far is settled by accounting",
        "x-codes": [
          "action_in_progress",
          "project_provisioning",
          "project_deleting",
          "identity_hold"
        ],
        "x-permission": "baas:projects:manage"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProject",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One project",
        "x-permission": "baas:view"
      },
      "patch": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "renameProject",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "maxLength": 64,
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Rename the project",
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/actions": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listProjectActions",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Action"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's operations",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/advisors": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectAdvisors",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "security",
                "performance"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Advisors"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The newest advisor run: security and performance lints with fixes",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/advisors/run": {
      "post": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "runProjectAdvisors",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "security",
                "performance"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Advisors"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Run every security and performance lint now",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/auth/audit": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listAuthAudit",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "action",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "actor_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Part of the user's email.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ip",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "entries": {
                          "items": {
                            "properties": {
                              "created_at": {
                                "description": "RFC 3339 time, UTC.",
                                "format": "date-time",
                                "type": "string"
                              },
                              "id": {
                                "type": "string"
                              },
                              "ip_address": {
                                "type": "string"
                              },
                              "payload": {
                                "properties": {},
                                "type": "object"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "page": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "per_page": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "total": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "entries",
                        "total"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's auth events, newest first",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/auth/secrets/{name}": {
      "delete": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "deleteAuthSecret",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "provider:\u003cname\u003e, smtp, captcha or hook:\u003ckind\u003e.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Remove a secret",
        "x-permission": "baas:projects:manage"
      },
      "put": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "setAuthSecret",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "provider:\u003cname\u003e, smtp, captcha or hook:\u003ckind\u003e.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "generate": {
                    "type": "boolean"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "set": {
                          "type": "boolean"
                        },
                        "value": {
                          "description": "Only for a generated secret.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "set"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Set a secret of the auth configuration (sealed; never shown again). generate makes a hook's signing secret and shows it once",
        "x-codes": [
          "identity_hold"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/auth/settings": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getAuthSettings",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AuthSettings"
                    },
                    "meta": {
                      "properties": {
                        "callback_url": {
                          "type": "string"
                        },
                        "hook_kinds": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "plan_limits": {
                          "properties": {},
                          "type": "object"
                        },
                        "plan_sms": {
                          "type": "boolean"
                        },
                        "providers": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "secrets_set": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "site_redirect_urls": {
                          "description": "Allowed redirect targets the platform adds itself: the project's sites and their custom domains.",
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "template_kinds": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "template_variables": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "How the project's auth treats its users, with the meta the console needs (secrets set, the plan's auth limits, the callback URL)",
        "x-permission": "baas:view"
      },
      "put": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "updateAuthSettings",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "anonymous_enabled": {
                    "type": "boolean"
                  },
                  "app_name": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "captcha": {
                    "description": "Its secret is the secret captcha.",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "provider": {
                        "enum": [
                          "hcaptcha",
                          "turnstile"
                        ],
                        "type": "string"
                      },
                      "site_key": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "disable_signup": {
                    "type": "boolean"
                  },
                  "email_confirm_required": {
                    "type": "boolean"
                  },
                  "email_enabled": {
                    "type": "boolean"
                  },
                  "hooks": {
                    "additionalProperties": {
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "uri": {
                          "description": "pg-functions://postgres/\u003cschema\u003e/\u003cfunction\u003e or https://...",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "description": "By kind: custom_access_token, send_email, send_sms, mfa_verification_attempt, password_verification_attempt; an https hook's signing secret is the secret hook:\u003ckind\u003e.",
                    "properties": {},
                    "type": "object"
                  },
                  "jwt_expiry_seconds": {
                    "format": "int64",
                    "maximum": 604800,
                    "minimum": 300,
                    "type": "integer"
                  },
                  "language": {
                    "enum": [
                      "fa",
                      "en"
                    ],
                    "type": "string"
                  },
                  "leaked_password_protection": {
                    "description": "Refuse passwords found in the offline leaked-password list.",
                    "type": "boolean"
                  },
                  "manual_linking_enabled": {
                    "description": "Signed-in users may link and unlink identities.",
                    "type": "boolean"
                  },
                  "mfa": {
                    "properties": {
                      "max_enrolled_factors": {
                        "format": "int64",
                        "maximum": 20,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "phone_enroll": {
                        "type": "boolean"
                      },
                      "phone_verify": {
                        "type": "boolean"
                      },
                      "totp_enroll": {
                        "type": "boolean"
                      },
                      "totp_verify": {
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  },
                  "otp_expiry_seconds": {
                    "format": "int64",
                    "maximum": 86400,
                    "minimum": 60,
                    "type": "integer"
                  },
                  "otp_length": {
                    "format": "int64",
                    "maximum": 10,
                    "minimum": 6,
                    "type": "integer"
                  },
                  "password_min_length": {
                    "format": "int64",
                    "maximum": 72,
                    "minimum": 6,
                    "type": "integer"
                  },
                  "password_required_characters": {
                    "enum": [
                      "",
                      "letters_digits",
                      "lower_upper_digits",
                      "lower_upper_digits_symbols"
                    ],
                    "type": "string"
                  },
                  "phone_confirm_required": {
                    "type": "boolean"
                  },
                  "phone_enabled": {
                    "type": "boolean"
                  },
                  "providers": {
                    "additionalProperties": {
                      "properties": {
                        "additional_client_ids": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "client_id": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "name": {
                          "type": "string"
                        },
                        "scopes": {
                          "type": "string"
                        },
                        "skip_nonce_check": {
                          "type": "boolean"
                        },
                        "url": {
                          "description": "The issuer (custom), GitLab base or Azure tenant URL.",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "description": "By provider (google github gitlab azure apple discord bitbucket linkedin_oidc twitter, or custom:\u003cname\u003e); the client secret is the secret provider:\u003cname\u003e.",
                    "properties": {},
                    "type": "object"
                  },
                  "rate_limits": {
                    "properties": {
                      "anonymous_per_hour": {
                        "description": "0: the plan's value; at most the plan's.",
                        "format": "int64",
                        "type": "integer"
                      },
                      "emails_per_hour": {
                        "description": "0: the plan's value; at most the plan's.",
                        "format": "int64",
                        "type": "integer"
                      },
                      "sign_in_per_5min": {
                        "description": "0: the plan's value; at most the plan's.",
                        "format": "int64",
                        "type": "integer"
                      },
                      "sms_per_hour": {
                        "description": "0: the plan's value; at most the plan's.",
                        "format": "int64",
                        "type": "integer"
                      },
                      "token_refresh_per_5min": {
                        "description": "0: the plan's value; at most the plan's.",
                        "format": "int64",
                        "type": "integer"
                      },
                      "verify_per_5min": {
                        "description": "0: the plan's value; at most the plan's.",
                        "format": "int64",
                        "type": "integer"
                      }
                    },
                    "type": "object"
                  },
                  "redirect_allowlist": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "secure_email_change": {
                    "description": "An email change is confirmed from both the current and the new address.",
                    "type": "boolean"
                  },
                  "secure_password_change": {
                    "description": "A password change from a session older than 24 h needs a reauthentication code.",
                    "type": "boolean"
                  },
                  "sessions": {
                    "properties": {
                      "inactivity_timeout_seconds": {
                        "description": "0: no limit; else 300-31536000.",
                        "format": "int64",
                        "type": "integer"
                      },
                      "single_per_user": {
                        "type": "boolean"
                      },
                      "timebox_seconds": {
                        "description": "0: no limit; else 300-31536000.",
                        "format": "int64",
                        "type": "integer"
                      }
                    },
                    "type": "object"
                  },
                  "site_url": {
                    "format": "uri",
                    "type": "string"
                  },
                  "sms_enabled": {
                    "description": "Phone sign-in and codes by SMS (plans with SMS).",
                    "type": "boolean"
                  },
                  "smtp": {
                    "description": "The project's own mail server; its password is the secret smtp.",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "host": {
                        "type": "string"
                      },
                      "port": {
                        "format": "int64",
                        "type": "integer"
                      },
                      "sender_email": {
                        "type": "string"
                      },
                      "sender_name": {
                        "type": "string"
                      },
                      "user": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AuthSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change the project's auth settings (the fields sent); the data plane follows at once",
        "x-codes": [
          "plan_has_no_sms",
          "over_plan_limit",
          "plan_feature",
          "identity_hold"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/auth/sms": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listAuthSMS",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Part of the number; 09… is read as +98.",
            "in": "query",
            "name": "phone",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "entries": {
                          "items": {
                            "properties": {
                              "code_hint": {
                                "description": "The code's last two digits, e.g. ••••56.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "created_at": {
                                "description": "RFC 3339 time, UTC.",
                                "format": "date-time",
                                "type": "string"
                              },
                              "delivered_at": {
                                "description": "RFC 3339 time, UTC.",
                                "format": "date-time",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "error": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "id": {
                                "format": "int64",
                                "type": "integer"
                              },
                              "kind": {
                                "description": "sms, phone_change, mfa, ...",
                                "type": "string"
                              },
                              "message_id": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "phone": {
                                "description": "+E.164",
                                "type": "string"
                              },
                              "provider": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sender": {
                                "description": "The line it went out on.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "status": {
                                "description": "sent, failed, sent_to_hook, or the gateway's state: delivered, failed_telecom, ...",
                                "type": "string"
                              },
                              "user_id": {
                                "format": "uuid",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "page": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "per_page": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "total": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "entries",
                        "total"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's SMS log: each code sent, its delivery state, line and operator (the code's last two digits only)",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/auth/smtp/test": {
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "testAuthSMTP",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "host": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "port": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "sender_email": {
                    "type": "string"
                  },
                  "sender_name": {
                    "type": "string"
                  },
                  "to": {
                    "format": "email",
                    "type": "string"
                  },
                  "user": {
                    "type": "string"
                  }
                },
                "required": [
                  "to"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "error": {
                          "type": "string"
                        },
                        "sent": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "sent"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Send a test message through the project's SMTP server (the fields given over the stored ones)",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/auth/templates": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listAuthTemplates",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "body": {
                            "type": "string"
                          },
                          "custom": {
                            "type": "boolean"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "updated_at": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "custom",
                          "subject",
                          "body"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Every email template, with the project's own text where it has one",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/auth/templates/{kind}": {
      "delete": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "resetAuthTemplate",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "signup",
                "invite",
                "magiclink",
                "recovery",
                "email_change",
                "reauthentication"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Go back to the platform's message",
        "x-permission": "baas:projects:manage"
      },
      "put": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "setAuthTemplate",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "signup",
                "invite",
                "magiclink",
                "recovery",
                "email_change",
                "reauthentication"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "body": {
                    "description": "Go template text: {{ .ConfirmationURL }}, {{ .Token }}, {{ .TokenHash }}, {{ .SiteURL }}, {{ .RedirectTo }}, {{ .Email }}, {{ .NewEmail }}, {{ .Phone }}, {{ .Data }}.",
                    "type": "string"
                  },
                  "subject": {
                    "maxLength": 255,
                    "type": "string"
                  }
                },
                "required": [
                  "subject",
                  "body"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "custom": {
                          "type": "boolean"
                        },
                        "kind": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "custom"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Use the project's own template (checked: variables, size, rendering)",
        "x-codes": [
          "template_invalid",
          "identity_hold"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/auth/templates/{kind}/preview": {
      "post": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "previewAuthTemplate",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "signup",
                "invite",
                "magiclink",
                "recovery",
                "email_change",
                "reauthentication"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "body": {
                    "description": "Go template text: {{ .ConfirmationURL }}, {{ .Token }}, {{ .TokenHash }}, {{ .SiteURL }}, {{ .RedirectTo }}, {{ .Email }}, {{ .NewEmail }}, {{ .Phone }}, {{ .Data }}.",
                    "type": "string"
                  },
                  "subject": {
                    "maxLength": 255,
                    "type": "string"
                  }
                },
                "required": [
                  "subject",
                  "body"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "html": {
                          "type": "string"
                        },
                        "subject": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "subject",
                        "html"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Render a template with example data (nothing is stored or sent)",
        "x-codes": [
          "template_invalid"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/auth/users": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listAuthUsers",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Search the email, phone or id.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AuthUser"
                      },
                      "type": "array"
                    },
                    "page": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "per_page": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "total": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "data",
                    "total",
                    "page",
                    "per_page"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's users",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:auth-users:manage` permission.",
        "operationId": "createAuthUser",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthUserInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AuthUser"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a user",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:auth-users:manage"
      }
    },
    "/projects/{id}/auth/users/{user}": {
      "delete": {
        "description": "Requires the `baas:auth-users:manage` permission.",
        "operationId": "deleteAuthUser",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The user's id.",
            "in": "path",
            "name": "user",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a user",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:auth-users:manage"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getAuthUser",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The user's id.",
            "in": "path",
            "name": "user",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AuthUser"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One user",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      },
      "put": {
        "description": "Requires the `baas:auth-users:manage` permission.",
        "operationId": "updateAuthUser",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The user's id.",
            "in": "path",
            "name": "user",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthUserInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AuthUser"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a user: metadata, confirm the email, ban (ban_duration) or unban (none)",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:auth-users:manage"
      }
    },
    "/projects/{id}/auth/users/{user}/factors": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listAuthUserFactors",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The user's id.",
            "in": "path",
            "name": "user",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "created_at": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": "string"
                          },
                          "factor_type": {
                            "enum": [
                              "totp",
                              "phone"
                            ],
                            "type": "string"
                          },
                          "friendly_name": {
                            "type": "string"
                          },
                          "id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "phone": {
                            "type": "string"
                          },
                          "status": {
                            "enum": [
                              "unverified",
                              "verified"
                            ],
                            "type": "string"
                          },
                          "updated_at": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "factor_type",
                          "status"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The user's MFA factors",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/auth/users/{user}/factors/{factor}": {
      "delete": {
        "description": "Requires the `baas:auth-users:manage` permission.",
        "operationId": "deleteAuthUserFactor",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The user's id.",
            "in": "path",
            "name": "user",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "factor",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Remove an MFA factor (its sessions go back to aal1)",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:auth-users:manage"
      }
    },
    "/projects/{id}/auth/users/{user}/send": {
      "post": {
        "description": "Requires the `baas:auth-users:manage` permission.",
        "operationId": "sendAuthUserLink",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The user's id.",
            "in": "path",
            "name": "user",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "enum": [
                      "magiclink",
                      "recovery"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "type"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "sent": {
                          "type": "boolean"
                        },
                        "type": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "sent",
                        "type"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Send the user a magic link (or code) or a password recovery message",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold",
          "no_address"
        ],
        "x-permission": "baas:auth-users:manage"
      }
    },
    "/projects/{id}/auth/users/{user}/sessions": {
      "delete": {
        "description": "Requires the `baas:auth-users:manage` permission.",
        "operationId": "revokeAuthUserSessions",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The user's id.",
            "in": "path",
            "name": "user",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "End every session of the user",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:auth-users:manage"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listAuthUserSessions",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The user's id.",
            "in": "path",
            "name": "user",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "aal": {
                            "enum": [
                              "aal1",
                              "aal2"
                            ],
                            "type": "string"
                          },
                          "created_at": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": "string"
                          },
                          "factor_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "id": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "ip": {
                            "type": "string"
                          },
                          "not_after": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "refreshed_at": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updated_at": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": "string"
                          },
                          "user_agent": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "created_at",
                          "aal"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The user's sessions",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/auth/users/{user}/sessions/{session}": {
      "delete": {
        "description": "Requires the `baas:auth-users:manage` permission.",
        "operationId": "revokeAuthUserSession",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The user's id.",
            "in": "path",
            "name": "user",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "session",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "End one session",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:auth-users:manage"
      }
    },
    "/projects/{id}/backups": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listBackups",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Backup"
                      },
                      "type": "array"
                    },
                    "policy": {
                      "$ref": "#/components/schemas/BackupPolicy"
                    }
                  },
                  "required": [
                    "data",
                    "policy"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Backups of the project and its plan's policy",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "createBackup",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "action": {
                      "$ref": "#/components/schemas/Action"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Backup"
                    }
                  },
                  "required": [
                    "action",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Accepted: follow the action."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Make a manual backup (an action)",
        "x-codes": [
          "plan_limit (409, with limit and used)",
          "identity_hold",
          "project_paused",
          "database_ops_unavailable"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/backups/pitr": {
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "restorePointInTime",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "confirm": {
                    "description": "The project's ref.",
                    "type": "string"
                  },
                  "target_time": {
                    "description": "RFC 3339 time, UTC.",
                    "format": "date-time",
                    "type": "string"
                  }
                },
                "required": [
                  "target_time",
                  "confirm"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "action": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "action"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Accepted: follow the action."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Restore the project to a point in time (paid plans): traffic paused, a safety backup, the restore, traffic resumed",
        "x-codes": [
          "plan_has_no_pitr",
          "pitr_unavailable",
          "confirmation_mismatch",
          "action_in_progress"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/backups/{backup}/download": {
      "get": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "downloadBackup",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Backup id.",
            "in": "path",
            "name": "backup",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Download a ready backup (a custom-format dump pg_restore reads); also needs baas:sql:execute",
        "x-codes": [
          "backup_not_ready"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/backups/{backup}/restore": {
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "restoreBackup",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Backup id.",
            "in": "path",
            "name": "backup",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "confirm": {
                    "description": "The project's ref.",
                    "type": "string"
                  }
                },
                "required": [
                  "confirm"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "action": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "action"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Accepted: follow the action."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Restore a backup into the project: traffic paused, a safety backup, the restore, traffic resumed",
        "x-codes": [
          "confirmation_mismatch",
          "backup_not_ready",
          "action_in_progress"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/column-types": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listColumnTypes",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "enums": {
                          "items": {
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "schema": {
                                "type": "string"
                              },
                              "values": {
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              }
                            },
                            "required": [
                              "schema",
                              "name",
                              "values"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "enums"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your enum types, for a column's type",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/connect": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getConnectInfo",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Connect"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The API page: endpoint, key previews, direct database connection, snippets",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/cron/jobs": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listCronJobs",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CronJob"
                      },
                      "type": "array"
                    },
                    "limits": {
                      "properties": {
                        "max": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "min_interval_seconds": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "used": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Cron jobs",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createCronJob",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CronInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronJob"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a Cron job",
        "x-codes": [
          "plan_limit",
          "interval_too_short (422, with min_interval_seconds)",
          "blocked_address",
          "name_taken"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/cron/jobs/{job}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "deleteCronJob",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Cron job id.",
            "in": "path",
            "name": "job",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a Cron job",
        "x-permission": "baas:sql:execute"
      },
      "put": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "updateCronJob",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Cron job id.",
            "in": "path",
            "name": "job",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CronInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronJob"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a Cron job",
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/cron/jobs/{job}/enabled": {
      "put": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "setCronJobEnabled",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Cron job id.",
            "in": "path",
            "name": "job",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronJob"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Turn a Cron job on or off",
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/cron/jobs/{job}/run": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "runCronJob",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Cron job id.",
            "in": "path",
            "name": "job",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CronRun"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Run a Cron job once, now",
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/cron/jobs/{job}/runs": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listCronRuns",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Cron job id.",
            "in": "path",
            "name": "job",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CronRun"
                      },
                      "type": "array"
                    },
                    "next": {
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A Cron job's run history (7 days)",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/cron/preview": {
      "post": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "previewCronSchedule",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "schedule": {
                    "type": "string"
                  }
                },
                "required": [
                  "schedule"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "error": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "interval_seconds": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "next_runs": {
                          "items": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "valid": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "What a schedule means: valid, its shortest interval and next five runs",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/database/api-docs": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getAPIDocs",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "endpoint": {
                          "type": "string"
                        },
                        "functions": {
                          "items": {
                            "properties": {
                              "anon_execute": {
                                "type": "boolean"
                              },
                              "args": {
                                "items": {
                                  "properties": {
                                    "mode": {
                                      "enum": [
                                        "in",
                                        "out",
                                        "inout",
                                        "variadic",
                                        "table"
                                      ],
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string"
                                    }
                                  },
                                  "type": "object"
                                },
                                "type": "array"
                              },
                              "authenticated_execute": {
                                "type": "boolean"
                              },
                              "comment": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "defaults": {
                                "description": "How many of the last input arguments have defaults.",
                                "format": "int64",
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "returns": {
                                "type": "string"
                              },
                              "returns_set": {
                                "type": "boolean"
                              },
                              "schema": {
                                "type": "string"
                              },
                              "volatility": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "graphql": {
                          "properties": {
                            "available": {
                              "description": "false: not served yet (answers 501 graphql_unavailable).",
                              "type": "boolean"
                            },
                            "url": {
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "relations": {
                          "items": {
                            "properties": {
                              "anon": {
                                "properties": {
                                  "delete": {
                                    "type": "boolean"
                                  },
                                  "insert": {
                                    "type": "boolean"
                                  },
                                  "select": {
                                    "type": "boolean"
                                  },
                                  "update": {
                                    "type": "boolean"
                                  }
                                },
                                "type": "object"
                              },
                              "authenticated": {
                                "properties": {
                                  "delete": {
                                    "type": "boolean"
                                  },
                                  "insert": {
                                    "type": "boolean"
                                  },
                                  "select": {
                                    "type": "boolean"
                                  },
                                  "update": {
                                    "type": "boolean"
                                  }
                                },
                                "type": "object"
                              },
                              "columns": {
                                "items": {
                                  "properties": {
                                    "comment": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "default": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "generated": {
                                      "type": "boolean"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "nullable": {
                                      "type": "boolean"
                                    },
                                    "primary_key": {
                                      "type": "boolean"
                                    },
                                    "type": {
                                      "type": "string"
                                    }
                                  },
                                  "type": "object"
                                },
                                "type": "array"
                              },
                              "comment": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "kind": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "rls_enabled": {
                                "type": "boolean"
                              },
                              "schema": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "rest_url": {
                          "type": "string"
                        },
                        "schemas": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "endpoint",
                        "rest_url",
                        "graphql",
                        "schemas",
                        "relations",
                        "functions"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The API reference: every table, view and function the REST API serves, with real column names and types and what anon and authenticated may do",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/database/api-settings": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getAPISettings",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "exposed_schemas": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "max_exposed_schemas": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "rest_url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "exposed_schemas"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The schemas the REST API serves, the default first",
        "x-permission": "baas:view"
      },
      "put": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "putAPISettings",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "exposed_schemas": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "exposed_schemas"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "exposed_schemas": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "without_api_usage": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "exposed_schemas",
                        "without_api_usage"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Set the schemas the REST API serves (1-20, the default first; letters, digits and _ only). The REST runtime restarts with them. without_api_usage names those anon and authenticated cannot use yet",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded",
          "protected_schema"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/database/diagram": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getSchemaDiagram",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Default public.",
            "in": "query",
            "name": "schema",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "relations": {
                          "items": {
                            "properties": {
                              "from_columns": {
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              },
                              "from_schema": {
                                "type": "string"
                              },
                              "from_table": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "to_columns": {
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              },
                              "to_schema": {
                                "type": "string"
                              },
                              "to_table": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "tables": {
                          "items": {
                            "properties": {
                              "columns": {
                                "items": {
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "nullable": {
                                      "type": "boolean"
                                    },
                                    "primary_key": {
                                      "type": "boolean"
                                    },
                                    "type": {
                                      "type": "string"
                                    }
                                  },
                                  "type": "object"
                                },
                                "type": "array"
                              },
                              "kind": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "schema": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "tables",
                        "relations"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A schema's tables, columns and foreign keys (at most 200 tables)",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/database/enums": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listEnums",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Default public.",
            "in": "query",
            "name": "schema",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "comment": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "owned": {
                            "type": "boolean"
                          },
                          "schema": {
                            "type": "string"
                          },
                          "values": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          }
                        },
                        "required": [
                          "schema",
                          "name",
                          "values"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A schema's enumerated types",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createEnum",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "comment": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "schema": {
                    "type": "string"
                  },
                  "values": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "name",
                  "values"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create an enumerated type. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/enums/{type}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "dropEnum",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.name of the enum.",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Also drop what depends on it.",
            "in": "query",
            "name": "cascade",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop an enumerated type. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/enums/{type}/values": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "addEnumValue",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.name of the enum.",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "after": {
                    "type": "string"
                  },
                  "before": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "required": [
                  "value"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Add a value, at the end or before / after another. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/enums/{type}/values/{value}": {
      "put": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "renameEnumValue",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.name of the enum.",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "value",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Rename a value. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/export": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "exportTableCSV",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table",
            "in": "query",
            "name": "table",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "description": "A header row, then one row per record; NULL is an empty field.",
                  "type": "string"
                }
              }
            },
            "description": "The CSV, streamed. A query the database refuses answers 422 before anything is sent."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Download a table as CSV, streamed",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "exportQueryCSV",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "description": "The file name.",
                    "type": "string"
                  },
                  "query": {
                    "maxLength": 262144,
                    "type": "string"
                  }
                },
                "required": [
                  "query"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "description": "A header row, then one row per record; NULL is an empty field.",
                  "type": "string"
                }
              }
            },
            "description": "The CSV, streamed. A query the database refuses answers 422 before anything is sent."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Download the rows of one SELECT as CSV, streamed, read-only",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/extensions": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listExtensions",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "available": {
                            "description": "The region's database has it.",
                            "type": "boolean"
                          },
                          "category": {
                            "type": "string"
                          },
                          "default_version": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "description": {
                            "type": "string"
                          },
                          "description_fa": {
                            "type": "string"
                          },
                          "docs_url": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "installed_version": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "offered": {
                            "description": "The catalog offers it.",
                            "type": "boolean"
                          },
                          "removable": {
                            "description": "It can be turned off here (not one every project has).",
                            "type": "boolean"
                          },
                          "schema": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "name",
                          "available",
                          "enabled"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The extensions on offer and installed, with their state in this database",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/database/extensions/{name}/disable": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "disableExtension",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Extension name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Also drop what depends on it.",
            "in": "query",
            "name": "cascade",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Disable an extension (not one every project has). Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/extensions/{name}/enable": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "enableExtension",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Extension name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Enable an extension on offer (into the extensions schema). Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/functions": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listDatabaseFunctions",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Default public.",
            "in": "query",
            "name": "schema",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "api_execute": {
                            "description": "anon or authenticated may call it (rpc).",
                            "type": "boolean"
                          },
                          "arguments": {
                            "type": "string"
                          },
                          "comment": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "config": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "definition": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "identity_arguments": {
                            "type": "string"
                          },
                          "kind": {
                            "enum": [
                              "function",
                              "procedure",
                              "aggregate",
                              "window"
                            ],
                            "type": "string"
                          },
                          "language": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "oid": {
                            "format": "int64",
                            "type": "integer"
                          },
                          "owned": {
                            "type": "boolean"
                          },
                          "returns": {
                            "type": "string"
                          },
                          "returns_set": {
                            "type": "boolean"
                          },
                          "schema": {
                            "type": "string"
                          },
                          "security_definer": {
                            "type": "boolean"
                          },
                          "volatility": {
                            "enum": [
                              "volatile",
                              "stable",
                              "immutable"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "oid",
                          "schema",
                          "name",
                          "kind"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A schema's functions (not those of extensions), with arguments, return type, language and security",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createDatabaseFunction",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "args": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "default": {
                          "description": "SQL expression.",
                          "type": "string"
                        },
                        "mode": {
                          "enum": [
                            "",
                            "in",
                            "out",
                            "inout",
                            "variadic"
                          ],
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "behavior": {
                    "enum": [
                      "volatile",
                      "stable",
                      "immutable"
                    ],
                    "type": "string"
                  },
                  "body": {
                    "type": "string"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "language": {
                    "enum": [
                      "sql",
                      "plpgsql"
                    ],
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "or_replace": {
                    "type": "boolean"
                  },
                  "returns": {
                    "description": "A type, or void, trigger, record.",
                    "type": "string"
                  },
                  "returns_set": {
                    "type": "boolean"
                  },
                  "schema": {
                    "type": "string"
                  },
                  "search_path": {
                    "description": "[] pins it empty; null leaves it unset.",
                    "items": {
                      "type": "string"
                    },
                    "type": [
                      "array",
                      "null"
                    ]
                  },
                  "security_definer": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "returns",
                  "language",
                  "body"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a function in sql or plpgsql. Callable through the REST API at /rest/v1/rpc/\u003cname\u003e when its schema is served. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/functions/{oid}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "dropDatabaseFunction",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "oid",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Also drop what depends on it.",
            "in": "query",
            "name": "cascade",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop a function, named by its oid (from the list). Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/import": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getImportLimits",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "max_bytes": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "max_rows": {
                          "description": "null: no row cap.",
                          "format": "int64",
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "max_rows",
                        "max_bytes"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "How much one CSV import takes on the project's plan",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "importCSV",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "columns": {
                    "description": "Each CSV column's table column, in order; \"\" skips it.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "create": {
                    "additionalProperties": false,
                    "properties": {
                      "columns": {
                        "items": {
                          "$ref": "#/components/schemas/ColumnSpec"
                        },
                        "type": "array"
                      },
                      "comment": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "rls_enabled": {
                        "type": "boolean"
                      },
                      "schema": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "columns"
                    ],
                    "type": "object"
                  },
                  "csv": {
                    "type": "string"
                  },
                  "delimiter": {
                    "maxLength": 4,
                    "type": "string"
                  },
                  "header": {
                    "type": "boolean"
                  },
                  "schema": {
                    "type": "string"
                  },
                  "table": {
                    "type": "string"
                  }
                },
                "required": [
                  "columns",
                  "csv"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "rows": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "sql": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "sql",
                        "rows"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Import a CSV file into a table, or into one created first (create), in one transaction: a row the table refuses rolls everything back. An empty field is NULL",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded",
          "import_limit",
          "too_large"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/network": {
      "put": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "setDatabaseNetwork",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "allowed_cidrs": {
                    "description": "At most 50 IPv4 or IPv6 CIDRs.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "allowed_cidrs"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DatabaseSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The networks allowed to reach the external database endpoint ([]: every address)",
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/database/password/reset": {
      "post": {
        "description": "Requires the `baas:keys:manage` permission.",
        "operationId": "resetDatabasePassword",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "confirm": {
                    "description": "The project's ref.",
                    "type": "string"
                  }
                },
                "required": [
                  "confirm"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "password": {
                          "type": "string"
                        },
                        "user": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Give the database login a new password, shown once",
        "x-codes": [
          "confirmation_mismatch"
        ],
        "x-permission": "baas:keys:manage"
      }
    },
    "/projects/{id}/database/roles": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listDatabaseRoles",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "bypass_rls": {
                            "type": "boolean"
                          },
                          "can_login": {
                            "type": "boolean"
                          },
                          "config": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "connection_limit": {
                            "format": "int64",
                            "type": "integer"
                          },
                          "current": {
                            "type": "boolean"
                          },
                          "inherit": {
                            "type": "boolean"
                          },
                          "member_of": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "name": {
                            "type": "string"
                          },
                          "purpose": {
                            "enum": [
                              "anon",
                              "authenticated",
                              "service_role",
                              "owner",
                              "rest",
                              "admin",
                              "services",
                              "storage_policies"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "purpose"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The API roles and the project's own database roles, read-only",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/database/schemas": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listDatabaseSchemas",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "api_usage": {
                            "description": "anon or authenticated holds USAGE.",
                            "type": "boolean"
                          },
                          "comment": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "exposed": {
                            "description": "The REST API serves it.",
                            "type": "boolean"
                          },
                          "functions": {
                            "format": "int64",
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "owned": {
                            "type": "boolean"
                          },
                          "owner": {
                            "type": "string"
                          },
                          "platform": {
                            "type": "boolean"
                          },
                          "protected": {
                            "description": "public and the platform's schemas are never dropped here.",
                            "type": "boolean"
                          },
                          "tables": {
                            "format": "int64",
                            "type": "integer"
                          },
                          "views": {
                            "format": "int64",
                            "type": "integer"
                          }
                        },
                        "required": [
                          "name",
                          "owned",
                          "platform",
                          "protected",
                          "exposed",
                          "api_usage"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The database's schemas with counts, which the REST API serves and which are protected",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createSchema",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "comment": {
                    "type": "string"
                  },
                  "grant_api_roles": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a schema; grant_api_roles gives anon, authenticated and service_role USAGE and, by default privileges, what they have in public on what you create in it. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/schemas/{schema}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "dropSchema",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "schema",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Also drop what depends on it.",
            "in": "query",
            "name": "cascade",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop a schema (public and the platform's are protected); it also leaves the REST API's schemas. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/settings": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getDatabaseSettings",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DatabaseSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Connection strings, SSL, network restrictions, timeout and size",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/database/ssl": {
      "put": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "setDatabaseSSL",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "enforced": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enforced"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DatabaseSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Require SSL on the external database endpoint",
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/database/triggers": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listTriggers",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Default public.",
            "in": "query",
            "name": "schema",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "definition": {
                            "type": "string"
                          },
                          "enabled": {
                            "enum": [
                              "origin",
                              "always",
                              "replica",
                              "disabled"
                            ],
                            "type": "string"
                          },
                          "events": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "function_name": {
                            "type": "string"
                          },
                          "function_schema": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "orientation": {
                            "enum": [
                              "ROW",
                              "STATEMENT"
                            ],
                            "type": "string"
                          },
                          "schema": {
                            "type": "string"
                          },
                          "table": {
                            "type": "string"
                          },
                          "timing": {
                            "enum": [
                              "BEFORE",
                              "AFTER",
                              "INSTEAD OF"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "schema",
                          "table",
                          "name",
                          "enabled"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The triggers on a schema's tables",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createTrigger",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "events": {
                    "items": {
                      "enum": [
                        "INSERT",
                        "UPDATE",
                        "DELETE",
                        "TRUNCATE"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "function_name": {
                    "description": "A function returning trigger.",
                    "type": "string"
                  },
                  "function_schema": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "orientation": {
                    "enum": [
                      "ROW",
                      "STATEMENT"
                    ],
                    "type": "string"
                  },
                  "schema": {
                    "type": "string"
                  },
                  "table": {
                    "type": "string"
                  },
                  "timing": {
                    "enum": [
                      "BEFORE",
                      "AFTER",
                      "INSTEAD OF"
                    ],
                    "type": "string"
                  },
                  "update_columns": {
                    "description": "UPDATE OF these columns.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "when": {
                    "description": "SQL condition on OLD / NEW.",
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "table",
                  "timing",
                  "events",
                  "function_name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a trigger on a table (or a view, INSTEAD OF); auth.users takes triggers too. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/triggers/{table}/{trigger}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "dropTrigger",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "trigger",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop a trigger. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      },
      "put": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "setTriggerState",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "trigger",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Enable or disable a trigger. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/views": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listViews",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Default public.",
            "in": "query",
            "name": "schema",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "columns": {
                            "format": "int64",
                            "type": "integer"
                          },
                          "comment": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "definition": {
                            "type": "string"
                          },
                          "kind": {
                            "enum": [
                              "view",
                              "materialized_view"
                            ],
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "owned": {
                            "type": "boolean"
                          },
                          "populated": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "schema": {
                            "type": "string"
                          },
                          "security_invoker": {
                            "type": "boolean"
                          },
                          "size_bytes": {
                            "format": "int64",
                            "type": [
                              "integer",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "schema",
                          "name",
                          "kind",
                          "definition"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A schema's views and materialized views",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createView",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "comment": {
                    "type": "string"
                  },
                  "materialized": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "or_replace": {
                    "type": "boolean"
                  },
                  "query": {
                    "maxLength": 262144,
                    "type": "string"
                  },
                  "schema": {
                    "type": "string"
                  },
                  "security_invoker": {
                    "description": "Views only: check the caller's privileges and row level security.",
                    "type": "boolean"
                  },
                  "with_data": {
                    "description": "Materialized: fill it now (default).",
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "query"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a view or a materialized view from one SELECT. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/views/preview": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "previewQuery",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "query": {
                    "maxLength": 262144,
                    "type": "string"
                  }
                },
                "required": [
                  "query"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SQLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Run one SELECT read-only and answer its first 20 rows (the view wizard's preview)",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/views/{view}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "dropView",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.name.",
            "in": "path",
            "name": "view",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "materialized",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Also drop what depends on it.",
            "in": "query",
            "name": "cascade",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop a view or (materialized=true) a materialized view. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/views/{view}/refresh": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "refreshView",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.name.",
            "in": "path",
            "name": "view",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "concurrently": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Refresh a materialized view (concurrently: it stays readable; needs a unique index). Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/database/views/{view}/security": {
      "put": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "setViewSecurity",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.name.",
            "in": "path",
            "name": "view",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "security_invoker": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "security_invoker"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Turn a view's security_invoker on or off. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/delete": {
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "deleteProjectConfirmed",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "confirm": {
                    "description": "The project's ref.",
                    "type": "string"
                  }
                },
                "required": [
                  "confirm"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "action": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "action"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Accepted: follow the action."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete the project, confirmed by typing its ref (the settings page)",
        "x-codes": [
          "confirmation_mismatch",
          "action_in_progress",
          "identity_hold"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/domains": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listProjectDomains",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "domains": {
                          "items": {
                            "$ref": "#/components/schemas/CustomDomain"
                          },
                          "type": "array"
                        },
                        "limit": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "plan_allows": {
                          "type": "boolean"
                        },
                        "target": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "limit",
                        "plan_allows",
                        "target",
                        "domains"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's custom domains and its plan's allowance",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "addProjectDomain",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "hostname": {
                    "type": "string"
                  },
                  "site": {
                    "description": "A site of the project the domain serves (its CNAME then points at \u003csite\u003e.\u003csites domain\u003e); absent: the project's endpoint.",
                    "type": "string"
                  }
                },
                "required": [
                  "hostname"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomDomain"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Add a custom domain (paid plans); then create its CNAME and TXT records",
        "x-codes": [
          "plan_required",
          "domain_limit",
          "domain_taken",
          "custom_domains_unavailable",
          "sites_unavailable"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/domains/{domain}": {
      "delete": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "removeProjectDomain",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Custom domain id.",
            "in": "path",
            "name": "domain",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Remove a custom domain",
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/domains/{domain}/check": {
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "checkProjectDomain",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Custom domain id.",
            "in": "path",
            "name": "domain",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomDomain"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Check a custom domain's DNS now and request its certificate once right",
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/domains/{domain}/dns/auto": {
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "autoProjectDomainDNS",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Custom domain id.",
            "in": "path",
            "name": "domain",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomDomain"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Ask Arianet to write a custom domain's DNS records now (its zone on Arianet DNS or a connected Cloudflare account)",
        "x-codes": [
          "auto_dns_unavailable"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/functions": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listFunctions",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "config": {
                      "$ref": "#/components/schemas/FunctionsConfig"
                    },
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Function"
                      },
                      "type": "array"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "endpoint": {
                      "format": "uri",
                      "type": "string"
                    },
                    "limits": {
                      "$ref": "#/components/schemas/FunctionLimits"
                    },
                    "usage": {
                      "properties": {
                        "invocations_month": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "invocations_month"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data",
                    "limits",
                    "usage",
                    "config",
                    "endpoint",
                    "enabled"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's Edge Functions with the plan's limits and this month's invocations",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/functions/config": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getFunctionsConfig",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FunctionsConfig"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's functions settings",
        "x-permission": "baas:view"
      },
      "put": {
        "description": "Requires the `baas:functions:manage` permission.",
        "operationId": "updateFunctionsConfig",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FunctionsConfig"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FunctionsConfig"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change the project's functions settings",
        "x-codes": [
          "functions_unavailable",
          "identity_hold"
        ],
        "x-permission": "baas:functions:manage"
      }
    },
    "/projects/{id}/functions/secrets": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listFunctionSecrets",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/FunctionSecret"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The functions' secrets: names and digests, never values",
        "x-permission": "baas:view"
      },
      "put": {
        "description": "Requires the `baas:functions:manage` permission.",
        "operationId": "setFunctionSecrets",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "secrets": {
                    "additionalProperties": {
                      "maxLength": 65536,
                      "type": "string"
                    },
                    "properties": {},
                    "type": "object"
                  }
                },
                "required": [
                  "secrets"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/FunctionSecret"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create or replace secrets (1-100 at once); running functions get them within a minute",
        "x-codes": [
          "invalid_secret_name",
          "reserved_secret_name",
          "secret_too_large",
          "secret_limit",
          "functions_unavailable"
        ],
        "x-permission": "baas:functions:manage"
      }
    },
    "/projects/{id}/functions/secrets/{secret}": {
      "delete": {
        "description": "Requires the `baas:functions:manage` permission.",
        "operationId": "deleteFunctionSecret",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "secret",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a secret",
        "x-codes": [
          "functions_unavailable",
          "identity_hold"
        ],
        "x-permission": "baas:functions:manage"
      }
    },
    "/projects/{id}/functions/{name}": {
      "delete": {
        "description": "Requires the `baas:functions:manage` permission.",
        "operationId": "deleteFunction",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The function's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a function and its versions",
        "x-codes": [
          "functions_unavailable",
          "identity_hold"
        ],
        "x-permission": "baas:functions:manage"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getFunction",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The function's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "created_at": {
                          "description": "RFC 3339 time, UTC.",
                          "format": "date-time",
                          "type": "string"
                        },
                        "deployed_at": {
                          "description": "RFC 3339 time, UTC.",
                          "format": "date-time",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "entrypoint": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "sha256": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "size_bytes": {
                          "format": "int64",
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "updated_at": {
                          "description": "RFC 3339 time, UTC.",
                          "format": "date-time",
                          "type": "string"
                        },
                        "url": {
                          "description": "Where the function answers: \u003cendpoint\u003e/functions/v1/\u003cname\u003e.",
                          "format": "uri",
                          "type": "string"
                        },
                        "verify_jwt": {
                          "description": "Calls need a valid project JWT (the anon key, the service key or a user's token).",
                          "type": "boolean"
                        },
                        "version": {
                          "description": "The active version (0 before the first deploy).",
                          "format": "int64",
                          "type": "integer"
                        },
                        "versions": {
                          "items": {
                            "$ref": "#/components/schemas/FunctionVersion"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One function with its newest versions",
        "x-permission": "baas:view"
      },
      "patch": {
        "description": "Requires the `baas:functions:manage` permission.",
        "operationId": "updateFunction",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The function's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "verify_jwt": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "verify_jwt"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Function"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a function's settings",
        "x-codes": [
          "functions_unavailable",
          "identity_hold"
        ],
        "x-permission": "baas:functions:manage"
      }
    },
    "/projects/{id}/functions/{name}/body": {
      "get": {
        "description": "Requires the `baas:functions:manage` permission.",
        "operationId": "downloadFunction",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The function's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
              "type": "string"
            }
          },
          {
            "description": "Default: the active one.",
            "in": "query",
            "name": "version",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The bundle."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A version's bundle (zip)",
        "x-permission": "baas:functions:manage"
      }
    },
    "/projects/{id}/functions/{name}/deploy": {
      "post": {
        "description": "Requires the `baas:functions:manage` permission.",
        "operationId": "deployFunction",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The function's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
              "type": "string"
            }
          },
          {
            "description": "The entrypoint inside the zip (default index.ts).",
            "in": "query",
            "name": "entrypoint",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The function's JWT setting from now on (a new function: true).",
            "in": "query",
            "name": "verify_jwt",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "entrypoint": {
                    "type": "string"
                  },
                  "files": {
                    "items": {
                      "properties": {
                        "content": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "path",
                        "content"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "verify_jwt": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "files"
                ],
                "type": "object"
              }
            },
            "application/zip": {
              "schema": {
                "format": "binary",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Function"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Deploy a bundle as the function's new active version (created when missing): a zip, or the editor's files",
        "x-codes": [
          "invalid_function_name",
          "reserved_name",
          "invalid_bundle",
          "bundle_too_large",
          "function_limit",
          "unsupported_media_type",
          "functions_unavailable"
        ],
        "x-permission": "baas:functions:manage"
      }
    },
    "/projects/{id}/functions/{name}/invoke": {
      "post": {
        "description": "Requires the `baas:functions:manage` permission.",
        "operationId": "invokeFunction",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The function's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "body": {
                    "type": "string"
                  },
                  "headers": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "properties": {},
                    "type": "object"
                  },
                  "method": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string"
                  },
                  "role": {
                    "enum": [
                      "anon",
                      "service_role",
                      "none"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "body": {
                          "type": "string"
                        },
                        "body_base64": {
                          "type": "boolean"
                        },
                        "duration_ms": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "headers": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "properties": {},
                          "type": "object"
                        },
                        "status": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "status",
                        "headers",
                        "body",
                        "body_base64",
                        "truncated",
                        "duration_ms"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Call the function from the console, as anon, service_role or nobody, and see its answer",
        "x-codes": [
          "console_unavailable",
          "unavailable",
          "functions_unavailable"
        ],
        "x-permission": "baas:functions:manage"
      }
    },
    "/projects/{id}/functions/{name}/logs": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getFunctionLogs",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The function's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "log",
                "invocation"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "description": "RFC 3339 time, UTC.",
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/FunctionLog"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The function's invocations and console lines of the last 7 days, newest first",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/functions/{name}/source": {
      "get": {
        "description": "Requires the `baas:functions:manage` permission.",
        "operationId": "getFunctionSource",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The function's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "version",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "binary_files": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "entrypoint": {
                          "type": "string"
                        },
                        "files": {
                          "items": {
                            "properties": {
                              "content": {
                                "type": "string"
                              },
                              "path": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "content"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "version": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "version",
                        "entrypoint",
                        "files",
                        "binary_files"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A version's text files, for the editor",
        "x-permission": "baas:functions:manage"
      }
    },
    "/projects/{id}/functions/{name}/stats": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getFunctionStats",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The function's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "enum": [
                "24h",
                "7d"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "avg_duration_ms": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "bucket_seconds": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "errors": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "invocations": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "points": {
                          "items": {
                            "properties": {
                              "at": {
                                "description": "RFC 3339 time, UTC.",
                                "format": "date-time",
                                "type": "string"
                              },
                              "avg_duration_ms": {
                                "format": "int64",
                                "type": "integer"
                              },
                              "errors": {
                                "format": "int64",
                                "type": "integer"
                              },
                              "invocations": {
                                "format": "int64",
                                "type": "integer"
                              }
                            },
                            "required": [
                              "at",
                              "invocations",
                              "errors",
                              "avg_duration_ms"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "range": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "range",
                        "bucket_seconds",
                        "invocations",
                        "errors",
                        "avg_duration_ms",
                        "points"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Invocations, errors and the average duration per hour (24h) or per 6 hours (7d)",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/functions/{name}/versions/{version}/activate": {
      "post": {
        "description": "Requires the `baas:functions:manage` permission.",
        "operationId": "activateFunctionVersion",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The function's name.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Function"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Make an earlier version active again (rollback)",
        "x-codes": [
          "functions_unavailable",
          "identity_hold"
        ],
        "x-permission": "baas:functions:manage"
      }
    },
    "/projects/{id}/git": {
      "delete": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "disconnectGit",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "webhook_removed": {
                          "description": "The git host took the webhook's removal.",
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "webhook_removed"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Disconnect the repository: its webhook is removed, its queued deployments canceled, its previews removed",
        "x-codes": [
          "git_unavailable",
          "git_not_connected",
          "identity_hold"
        ],
        "x-permission": "baas:git:manage"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getGit",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "builds": {
                      "description": "Builds run in this region.",
                      "type": "boolean"
                    },
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/GitConnection"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "limits": {
                      "properties": {
                        "build_minutes_month": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "cpu_millis": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "hard": {
                          "description": "A free plan: past build_minutes_month builds are refused; a paid plan's overage is metered (baas.usage.build_minutes).",
                          "type": "boolean"
                        },
                        "max_concurrent": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "max_previews": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "memory_mb": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "timeout_seconds": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "usage": {
                      "properties": {
                        "build_seconds_month": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "enabled",
                    "builds",
                    "limits",
                    "usage"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's connected repository (null when none), the plan's build limits and this month's build time",
        "x-permission": "baas:view"
      },
      "put": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "connectGit",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "base_url": {
                    "description": "Empty: https://api.github.com or https://gitlab.com.",
                    "type": "string"
                  },
                  "config_path": {
                    "type": "string"
                  },
                  "functions_dir": {
                    "type": "string"
                  },
                  "git_account_id": {
                    "description": "One of your linked git accounts (one-click connect) instead of a token.",
                    "format": "int64",
                    "type": "integer"
                  },
                  "migrations_dir": {
                    "type": "string"
                  },
                  "no_site": {
                    "description": "Build no site (the backend only).",
                    "type": "boolean"
                  },
                  "previews": {
                    "type": "boolean"
                  },
                  "production_branch": {
                    "description": "Empty: the repository's default branch.",
                    "type": "string"
                  },
                  "provider": {
                    "enum": [
                      "github",
                      "gitlab"
                    ],
                    "type": "string"
                  },
                  "repo": {
                    "type": "string"
                  },
                  "root_dir": {
                    "type": "string"
                  },
                  "site": {
                    "additionalProperties": false,
                    "properties": {
                      "build_command": {
                        "maxLength": 1024,
                        "type": "string"
                      },
                      "env": {
                        "additionalProperties": {
                          "maxLength": 4096,
                          "type": "string"
                        },
                        "description": "The build's environment (not secret; at most 50).",
                        "properties": {},
                        "type": "object"
                      },
                      "install_command": {
                        "maxLength": 1024,
                        "type": "string"
                      },
                      "name": {
                        "description": "The site the builds deploy to (made when missing).",
                        "type": "string"
                      },
                      "output_dir": {
                        "description": "Relative to root_dir; empty: the first of dist, build, out, public.",
                        "type": "string"
                      },
                      "package_manager": {
                        "enum": [
                          "auto",
                          "npm",
                          "pnpm",
                          "yarn"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "type": "object"
                  },
                  "token": {
                    "description": "GitHub fine-grained token (Contents read, Webhooks and Commit statuses read and write) or GitLab project access token (api, read_repository; Maintainer). Sealed, never returned. Exactly one of token and git_account_id to connect.",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GitConnection"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GitConnection"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Connected."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Connect a repository (201) or change the connection (200): the token is checked against the repository and branch, the webhook registered with a new secret; deploys act with your permissions",
        "x-codes": [
          "repository_unreachable",
          "repository_token_refused",
          "repository_token_permission",
          "branch_not_found",
          "git_host_unavailable",
          "git_host_not_allowed",
          "git_connected",
          "invalid_site_name",
          "site_limit",
          "sites_unavailable",
          "git_unavailable",
          "rate_limit_exceeded",
          "git_account_not_found",
          "git_reauth_required",
          "repository_permission"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/accounts": {
      "get": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "listGitAccounts",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "accounts": {
                      "items": {
                        "$ref": "#/components/schemas/GitAccount"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "accounts"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your linked git accounts in this account",
        "x-codes": [
          "git_unavailable",
          "git_oauth_unavailable",
          "git_account_not_found",
          "git_reauth_required",
          "git_host_unavailable",
          "identity_hold"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/accounts/{account}": {
      "delete": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "unlinkGitAccount",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Linked git account id (the caller's own).",
            "in": "path",
            "name": "account",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Unlink one of your git accounts (its token is revoked at the host)",
        "x-codes": [
          "git_account_not_found",
          "git_account_in_use",
          "identity_hold"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/accounts/{account}/branches": {
      "get": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "listGitAccountBranches",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Linked git account id (the caller's own).",
            "in": "path",
            "name": "account",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "repo",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "branches": {
                      "items": {
                        "properties": {
                          "default": {
                            "type": "boolean"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "default"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "branches"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A repository's branches, the default one marked",
        "x-codes": [
          "git_unavailable",
          "git_oauth_unavailable",
          "git_account_not_found",
          "git_reauth_required",
          "git_host_unavailable",
          "identity_hold"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/accounts/{account}/detect": {
      "get": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "detectGitSettings",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Linked git account id (the caller's own).",
            "in": "path",
            "name": "account",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "repo",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "branch",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "root_dir",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "build_command": {
                      "type": "string"
                    },
                    "framework": {
                      "enum": [
                        "vite",
                        "next-static",
                        "static",
                        "nuxt-static",
                        "astro",
                        "cra",
                        "none"
                      ],
                      "type": "string"
                    },
                    "has_config": {
                      "type": "boolean"
                    },
                    "has_functions": {
                      "type": "boolean"
                    },
                    "has_migrations": {
                      "type": "boolean"
                    },
                    "has_package_json": {
                      "type": "boolean"
                    },
                    "install_command": {
                      "type": "string"
                    },
                    "output_dir": {
                      "type": "string"
                    },
                    "package_manager": {
                      "enum": [
                        "npm",
                        "pnpm",
                        "yarn",
                        "bun",
                        ""
                      ],
                      "type": "string"
                    },
                    "site_name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "framework",
                    "package_manager",
                    "install_command",
                    "build_command",
                    "output_dir",
                    "has_package_json",
                    "has_migrations",
                    "has_functions",
                    "has_config",
                    "site_name"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The settings proposed for a repository from its package.json, lock files and arianet/ directory, with a site name free in this region",
        "x-codes": [
          "git_unavailable",
          "git_oauth_unavailable",
          "git_account_not_found",
          "git_reauth_required",
          "git_host_unavailable",
          "identity_hold",
          "path_not_found"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/accounts/{account}/repos": {
      "get": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "listGitAccountRepos",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Linked git account id (the caller's own).",
            "in": "path",
            "name": "account",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "next_page": {
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "repos": {
                      "items": {
                        "$ref": "#/components/schemas/GitRepo"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "repos",
                    "next_page"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Repositories your linked account may connect, most recently active first (30 a page)",
        "x-codes": [
          "git_unavailable",
          "git_oauth_unavailable",
          "git_account_not_found",
          "git_reauth_required",
          "git_host_unavailable",
          "identity_hold"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/deployments": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listGitDeployments",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "production",
                "preview"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "branch",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "queued",
                "building",
                "deploying",
                "ready",
                "failed",
                "canceled",
                "superseded"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "description": "Deployments older than this id.",
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/GitDeployment"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Deployments from git, newest first",
        "x-codes": [
          "git_unavailable",
          "git_not_connected",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "createGitDeployment",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "branch": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GitDeployment"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Deploy a branch's head now (the production branch when none): production for it, else a preview",
        "x-codes": [
          "git_not_connected",
          "branch_not_found",
          "git_host_unavailable",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/deployments/{deployment}": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getGitDeployment",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Git deployment id.",
            "in": "path",
            "name": "deployment",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GitDeployment"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One deployment with what each step did",
        "x-codes": [
          "git_unavailable",
          "git_not_connected",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/git/deployments/{deployment}/cancel": {
      "post": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "cancelGitDeployment",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Git deployment id.",
            "in": "path",
            "name": "deployment",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GitDeployment"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Cancel a deployment: a queued one at once, a running one at its next step (its build is stopped)",
        "x-codes": [
          "deployment_finished"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/deployments/{deployment}/logs": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getGitDeploymentLogs",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Git deployment id.",
            "in": "path",
            "name": "deployment",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "done": {
                          "type": "boolean"
                        },
                        "next_offset": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "offset": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "reset": {
                          "type": "boolean"
                        },
                        "text": {
                          "type": "string"
                        },
                        "truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "text",
                        "offset",
                        "next_offset",
                        "reset",
                        "truncated",
                        "done"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The deployment's log (the pipeline's steps and the build's output, credentials removed) from offset; read again from next_offset until done. reset: the log was cut, text is from its start",
        "x-codes": [
          "git_unavailable",
          "git_not_connected",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/git/deployments/{deployment}/promote": {
      "post": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "promoteGitDeployment",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Git deployment id.",
            "in": "path",
            "name": "deployment",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GitDeployment"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Make a ready preview production: a production deployment of its commit that reuses its site build and applies its backend",
        "x-codes": [
          "not_a_preview",
          "git_not_connected",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/deployments/{deployment}/redeploy": {
      "post": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "redeployGit",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Git deployment id.",
            "in": "path",
            "name": "deployment",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GitDeployment"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Deploy the same commit again (a new deployment)",
        "x-codes": [
          "deployment_running",
          "git_not_connected",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/oauth/complete": {
      "post": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "completeGitOAuth",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "error": {
                    "description": "The host's refusal (access_denied).",
                    "type": "string"
                  },
                  "error_description": {
                    "type": "string"
                  },
                  "installation_id": {
                    "type": "string"
                  },
                  "setup_action": {
                    "enum": [
                      "install",
                      "update",
                      "request"
                    ],
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  }
                },
                "required": [
                  "state"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "account": {
                      "$ref": "#/components/schemas/GitAccount"
                    }
                  },
                  "required": [
                    "account"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Finish linking with what the host sent the callback page: the account is linked (or refreshed) and is yours alone inside this account",
        "x-codes": [
          "oauth_state_invalid",
          "oauth_denied",
          "oauth_exchange_failed",
          "git_host_unavailable",
          "git_oauth_unavailable",
          "identity_hold"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/oauth/start": {
      "post": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "startGitOAuth",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "intent": {
                    "description": "install: GitHub's app installation page (then authorization); authorize: sign in only.",
                    "enum": [
                      "authorize",
                      "install"
                    ],
                    "type": "string"
                  },
                  "provider": {
                    "enum": [
                      "github",
                      "gitlab"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "provider"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "authorize_url": {
                      "format": "uri",
                      "type": "string"
                    },
                    "expires_in": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "state": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "authorize_url",
                    "state",
                    "expires_in"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Start linking your GitHub or GitLab account: send the browser to authorize_url; the host comes back to the panel's callback page with code and state (one-time, 10 minutes, bound to you and this project)",
        "x-codes": [
          "git_oauth_unavailable",
          "git_unavailable",
          "rate_limit_exceeded",
          "identity_hold"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/previews": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listGitPreviews",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/GitPreview"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The previews of the project's sites: \u003calias\u003e--\u003csite\u003e hostnames, each serving a branch's latest build",
        "x-codes": [
          "git_unavailable",
          "git_not_connected",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/git/previews/{alias}": {
      "delete": {
        "description": "Requires the `baas:git:manage` permission.",
        "operationId": "deleteGitPreview",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The preview's alias.",
            "in": "path",
            "name": "alias",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Remove a preview (the branch's next push makes it again)",
        "x-codes": [
          "git_unavailable",
          "git_not_connected",
          "identity_hold"
        ],
        "x-permission": "baas:git:manage"
      }
    },
    "/projects/{id}/git/providers": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listGitProviders",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "providers": {
                      "items": {
                        "properties": {
                          "install_url": {
                            "description": "GitHub: the app's installation page.",
                            "format": "uri",
                            "type": "string"
                          },
                          "oauth": {
                            "type": "boolean"
                          },
                          "provider": {
                            "enum": [
                              "github",
                              "gitlab"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "provider",
                          "oauth"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "providers"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The git hosts and whether each connects with one click in this region (oauth false: the token form only)",
        "x-codes": [
          "git_unavailable",
          "git_not_connected",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/keys": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listProjectKeys",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Key"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's keys, as previews",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/keys/rotate": {
      "post": {
        "description": "Requires the `baas:keys:manage` permission.",
        "operationId": "rotateProjectKeys",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Key"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Rotate the signing key: new anon and service keys are issued, the previous ones keep working for the overlap (72 hours by default) and are then revoked. Rotating again during the overlap revokes the previous keys at once. The publishable and secret keys do not change. Recorded in your activity log",
        "x-codes": [
          "key_unavailable",
          "project_provisioning",
          "project_suspended",
          "project_deleting",
          "identity_hold"
        ],
        "x-permission": "baas:keys:manage"
      }
    },
    "/projects/{id}/keys/{kind}/reveal": {
      "post": {
        "description": "Requires the `baas:keys:manage` permission.",
        "operationId": "revealProjectKey",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "anon",
                "service",
                "publishable",
                "secret",
                "database"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "key": {
                          "description": "The key itself. Keep the service and secret keys server-side.",
                          "type": "string"
                        },
                        "kid": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "kid",
                        "key"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Show one key. Never cached; every reveal is recorded in your activity log. database: the password of the direct database login",
        "x-codes": [
          "key_unavailable",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:keys:manage"
      }
    },
    "/projects/{id}/logs": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectLogs",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Comma-separated: gateway, auth, storage, rest, sql, functions, realtime (empty: all).",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "level",
            "required": false,
            "schema": {
              "enum": [
                "error",
                "warning",
                "info"
              ],
              "type": "string"
            }
          },
          {
            "description": "GET, POST, ... or SQL.",
            "in": "query",
            "name": "method",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "description": "RFC 3339 time, UTC.",
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "description": "RFC 3339 time, UTC.",
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "A path substring or an exact request id.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A status class (2-5) or an exact code.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 599,
              "minimum": 2,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/LogEntry"
                      },
                      "type": "array"
                    },
                    "next": {
                      "description": "Pass as before= for the next page.",
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "next"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Request logs of the last 7 days: the endpoint's requests (gateway, or one component) and SQL editor runs",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/logs/queries": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listLogQueries",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SavedLogQuery"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's saved logs explorer queries",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "createLogQuery",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "filters": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "properties": {},
                    "type": "object"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SavedLogQuery"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Save a logs explorer query",
        "x-codes": [
          "query_limit"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/logs/queries/{query}": {
      "delete": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "deleteLogQuery",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Saved query id.",
            "in": "path",
            "name": "query",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a saved query",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/logs/{log}": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectLog",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Log record id.",
            "in": "path",
            "name": "log",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogEntry"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One request log record",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/migrations": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listProjectMigrations",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "applied_at": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": "string"
                          },
                          "checksum": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "checksum",
                          "applied_at"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The migrations recorded as applied in the project",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "pushProjectMigrations",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "dry_run": {
                    "type": "boolean"
                  },
                  "migrations": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "sql": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "sql"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "migrations"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "applied": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "dry_run": {
                          "type": "boolean"
                        },
                        "pending": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "skipped": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "dry_run",
                        "applied",
                        "skipped",
                        "pending"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Apply the migration files not applied yet, all in one transaction",
        "x-codes": [
          "migration_changed",
          "sql_error"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/pause": {
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "pauseProject",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "action": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "action"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Accepted: follow the action."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Pause the project: its database refuses connections, its data is kept",
        "x-codes": [
          "action_in_progress",
          "project_paused",
          "project_suspended",
          "identity_hold"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/plan": {
      "put": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "changeProjectPlan",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "plan": {
                    "description": "Plan code.",
                    "type": "string"
                  }
                },
                "required": [
                  "plan"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Move the project to another plan. The new plan is billed from now",
        "x-codes": [
          "insufficient_balance (402)",
          "same_plan",
          "project_limit",
          "quota_exceeded (403)",
          "identity_hold"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/queues": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listQueues",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Queue"
                      },
                      "type": "array"
                    },
                    "limits": {
                      "properties": {
                        "max": {
                          "description": "The plan's limit.",
                          "format": "int64",
                          "type": "integer"
                        },
                        "used": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "max",
                        "used"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Queues",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createQueue",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "pattern": "^[a-z_][a-z0-9_]{0,47}$",
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Queue"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a queue",
        "x-codes": [
          "plan_limit",
          "name_taken",
          "feature_preparing"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/queues/{queue}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "deleteQueue",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Queue name.",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "pattern": "^[a-z_][a-z0-9_]{0,47}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a queue and its messages",
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/queues/{queue}/messages": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listQueueMessages",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Queue name.",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "pattern": "^[a-z_][a-z0-9_]{0,47}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "archived",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/QueueMessage"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A queue's messages (or its archive)",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "sendQueueMessage",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Queue name.",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "pattern": "^[a-z_][a-z0-9_]{0,47}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "delay_seconds": {
                    "format": "int64",
                    "maximum": 604800,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "message": {}
                },
                "required": [
                  "message"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "msg_id": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Send a message",
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/queues/{queue}/messages/{msg}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "deleteQueueMessage",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Queue name.",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "pattern": "^[a-z_][a-z0-9_]{0,47}$",
              "type": "string"
            }
          },
          {
            "description": "Message id.",
            "in": "path",
            "name": "msg",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a message",
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/queues/{queue}/purge": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "purgeQueue",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Queue name.",
            "in": "path",
            "name": "queue",
            "required": true,
            "schema": {
              "pattern": "^[a-z_][a-z0-9_]{0,47}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "purged": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete every message of a queue (the archive stays)",
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/realtime": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectRealtime",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "broadcast_url": {
                          "type": "string"
                        },
                        "limits": {
                          "properties": {
                            "max_channels_per_connection": {
                              "format": "int64",
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "max_connections": {
                              "format": "int64",
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "max_payload_bytes": {
                              "format": "int64",
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "messages_per_second": {
                              "format": "int64",
                              "type": [
                                "integer",
                                "null"
                              ]
                            }
                          },
                          "type": "object"
                        },
                        "publication": {
                          "type": "string"
                        },
                        "tables": {
                          "items": {
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "replica_identity": {
                                "enum": [
                                  "default",
                                  "full",
                                  "index",
                                  "nothing"
                                ],
                                "type": "string"
                              },
                              "rls_enabled": {
                                "type": "boolean"
                              },
                              "schema": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "schema",
                              "name",
                              "replica_identity",
                              "rls_enabled"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "url": {
                          "type": "string"
                        },
                        "websocket_url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "url",
                        "websocket_url",
                        "broadcast_url",
                        "publication",
                        "tables",
                        "limits"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The realtime endpoint, the plan's realtime limits and the tables enabled for Postgres Changes",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/reports": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectReports",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "enum": [
                "1h",
                "24h",
                "7d",
                "30d"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {},
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Charts of API requests, auth, storage and the database over a range",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/resume": {
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "resumeProject",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "action": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "action"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Accepted: follow the action."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Resume a paused project",
        "x-codes": [
          "action_in_progress",
          "project_active",
          "project_suspended",
          "identity_hold"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/schema": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectSchema",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Comma-separated schemas (default public).",
            "in": "query",
            "name": "schemas",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "checksum": {
                          "type": "string"
                        },
                        "generated_at": {
                          "description": "RFC 3339 time, UTC.",
                          "format": "date-time",
                          "type": "string"
                        },
                        "schemas": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "sql": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "schemas",
                        "sql",
                        "checksum",
                        "generated_at"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The schema as SQL (tables, views, functions, types, policies; no data)",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/schemas": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listSchemas",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Schema"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The database's schemas",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/settings/api": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectAPISettings",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/APISettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The REST max rows and the access token lifetime",
        "x-permission": "baas:view"
      },
      "put": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "putProjectAPISettings",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "jwt_expiry_seconds": {
                    "format": "int64",
                    "maximum": 604800,
                    "minimum": 300,
                    "type": "integer"
                  },
                  "max_rows": {
                    "format": "int64",
                    "maximum": 100000,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/APISettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change the REST max rows or the access token lifetime",
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/settings/pause": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectPauseSchedule",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "after_idle_seconds": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "last_request_at": {
                          "description": "RFC 3339 time, UTC.",
                          "format": "date-time",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "pauses_at": {
                          "description": "RFC 3339 time, UTC.",
                          "format": "date-time",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "pauses_when_idle": {
                          "type": "boolean"
                        },
                        "state": {
                          "enum": [
                            "provisioning",
                            "active",
                            "paused",
                            "suspended",
                            "deleting"
                          ],
                          "type": "string"
                        },
                        "wakeable": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "pauses_when_idle",
                        "after_idle_seconds",
                        "last_request_at",
                        "pauses_at",
                        "state",
                        "wakeable"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "When an idle project pauses",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/sites": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listSites",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Site"
                      },
                      "type": "array"
                    },
                    "domain": {
                      "description": "The parent of every site's hostname.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "limits": {
                      "$ref": "#/components/schemas/SiteLimits"
                    },
                    "usage": {
                      "properties": {
                        "egress_bytes_month": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "storage_bytes": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "storage_bytes",
                        "egress_bytes_month"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data",
                    "limits",
                    "usage",
                    "domain",
                    "enabled"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's sites with the plan's sites limits and this month's use",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sites:manage` permission.",
        "operationId": "createSite",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "clean_urls": {
                    "type": "boolean"
                  },
                  "headers": {
                    "description": "At most 50.",
                    "items": {
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "path": {
                          "description": "An exact path from /, or a prefix ending in * (/assets/*).",
                          "type": "string"
                        },
                        "value": {
                          "maxLength": 1024,
                          "type": "string"
                        }
                      },
                      "required": [
                        "path",
                        "name",
                        "value"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "name": {
                    "type": "string"
                  },
                  "redirects": {
                    "description": "At most 100, first match wins.",
                    "items": {
                      "properties": {
                        "from": {
                          "description": "An exact path from /, or a prefix ending in *.",
                          "type": "string"
                        },
                        "status": {
                          "enum": [
                            301,
                            302,
                            307,
                            308
                          ],
                          "format": "int64",
                          "type": "integer"
                        },
                        "to": {
                          "description": "A path from / or an http(s) URL; :splat is what the * matched.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "from",
                        "to"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "spa_fallback": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Site"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a site; its URL becomes an allowed auth redirect at once",
        "x-codes": [
          "invalid_site_name",
          "reserved_name",
          "site_name_taken",
          "site_limit",
          "quota_exceeded (403, the account's sites)",
          "sites_unavailable",
          "core_unavailable"
        ],
        "x-permission": "baas:sites:manage"
      }
    },
    "/projects/{id}/sites/{site}": {
      "delete": {
        "description": "Requires the `baas:sites:manage` permission.",
        "operationId": "deleteSite",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The site's name (its hostname label).",
            "in": "path",
            "name": "site",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a site: its deployments, their files and the custom domains that serve it",
        "x-codes": [
          "sites_unavailable",
          "identity_hold"
        ],
        "x-permission": "baas:sites:manage"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getSite",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The site's name (its hostname label).",
            "in": "path",
            "name": "site",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "clean_urls": {
                          "description": "/about serves /about.html; /about.html redirects to /about.",
                          "type": "boolean"
                        },
                        "created_at": {
                          "description": "RFC 3339 time, UTC.",
                          "format": "date-time",
                          "type": "string"
                        },
                        "deployments": {
                          "items": {
                            "$ref": "#/components/schemas/SiteDeployment"
                          },
                          "type": "array"
                        },
                        "domains": {
                          "items": {
                            "$ref": "#/components/schemas/CustomDomain"
                          },
                          "type": "array"
                        },
                        "headers": {
                          "items": {
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "path": {
                                "description": "An exact path from /, or a prefix ending in * (/assets/*).",
                                "type": "string"
                              },
                              "value": {
                                "maxLength": 1024,
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "name",
                              "value"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "hostname": {
                          "type": "string"
                        },
                        "live_deployment": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/SiteDeployment"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "redirects": {
                          "items": {
                            "properties": {
                              "from": {
                                "description": "An exact path from /, or a prefix ending in *.",
                                "type": "string"
                              },
                              "status": {
                                "enum": [
                                  301,
                                  302,
                                  307,
                                  308
                                ],
                                "format": "int64",
                                "type": "integer"
                              },
                              "to": {
                                "description": "A path from / or an http(s) URL; :splat is what the * matched.",
                                "type": "string"
                              }
                            },
                            "required": [
                              "from",
                              "to"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "spa_fallback": {
                          "description": "A path without a file (and no extension, or a browser navigation) answers /index.html.",
                          "type": "boolean"
                        },
                        "updated_at": {
                          "description": "RFC 3339 time, UTC.",
                          "format": "date-time",
                          "type": "string"
                        },
                        "url": {
                          "description": "Where the site answers: https://\u003cname\u003e.\u003csites domain\u003e.",
                          "format": "uri",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One site with its newest deployments and the custom domains that serve it",
        "x-permission": "baas:view"
      },
      "patch": {
        "description": "Requires the `baas:sites:manage` permission.",
        "operationId": "updateSite",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The site's name (its hostname label).",
            "in": "path",
            "name": "site",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "clean_urls": {
                    "type": "boolean"
                  },
                  "headers": {
                    "description": "At most 50.",
                    "items": {
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "path": {
                          "description": "An exact path from /, or a prefix ending in * (/assets/*).",
                          "type": "string"
                        },
                        "value": {
                          "maxLength": 1024,
                          "type": "string"
                        }
                      },
                      "required": [
                        "path",
                        "name",
                        "value"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "name": {
                    "type": "string"
                  },
                  "redirects": {
                    "description": "At most 100, first match wins.",
                    "items": {
                      "properties": {
                        "from": {
                          "description": "An exact path from /, or a prefix ending in *.",
                          "type": "string"
                        },
                        "status": {
                          "enum": [
                            301,
                            302,
                            307,
                            308
                          ],
                          "format": "int64",
                          "type": "integer"
                        },
                        "to": {
                          "description": "A path from / or an http(s) URL; :splat is what the * matched.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "from",
                        "to"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "spa_fallback": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Site"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Rename a site or change its serving settings (the fields sent)",
        "x-codes": [
          "invalid_site_name",
          "reserved_name",
          "site_name_taken",
          "sites_unavailable"
        ],
        "x-permission": "baas:sites:manage"
      }
    },
    "/projects/{id}/sites/{site}/deployments": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listSiteDeployments",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The site's name (its hostname label).",
            "in": "path",
            "name": "site",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SiteDeployment"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A site's deployments, newest first",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sites:manage` permission.",
        "operationId": "createSiteDeployment",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The site's name (its hostname label).",
            "in": "path",
            "name": "site",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "source": {
                    "enum": [
                      "cli",
                      "console",
                      "git"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "deployment": {
                          "$ref": "#/components/schemas/SiteDeployment"
                        },
                        "upload": {
                          "properties": {
                            "expires_at": {
                              "description": "RFC 3339 time, UTC.",
                              "format": "date-time",
                              "type": "string"
                            },
                            "headers": {
                              "additionalProperties": {
                                "type": "string"
                              },
                              "properties": {},
                              "type": "object"
                            },
                            "max_bytes": {
                              "format": "int64",
                              "type": "integer"
                            },
                            "max_files": {
                              "format": "int64",
                              "type": "integer"
                            },
                            "method": {
                              "enum": [
                                "PUT"
                              ],
                              "type": "string"
                            },
                            "url": {
                              "description": "The upload URL; its token is the only authorization it needs.",
                              "format": "uri",
                              "type": "string"
                            }
                          },
                          "required": [
                            "url",
                            "method",
                            "headers",
                            "expires_at",
                            "max_bytes",
                            "max_files"
                          ],
                          "type": "object"
                        }
                      },
                      "required": [
                        "deployment",
                        "upload"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Open a deployment: PUT its tar.gz to upload.url (on the project's endpoint, no API key, within the hour), then finalize",
        "x-codes": [
          "too_many_uploads",
          "site_storage_limit",
          "rate_limit_exceeded",
          "sites_unavailable"
        ],
        "x-permission": "baas:sites:manage"
      }
    },
    "/projects/{id}/sites/{site}/deployments/{deployment}": {
      "delete": {
        "description": "Requires the `baas:sites:manage` permission.",
        "operationId": "deleteSiteDeployment",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The site's name (its hostname label).",
            "in": "path",
            "name": "site",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
              "type": "string"
            }
          },
          {
            "description": "Deployment id.",
            "in": "path",
            "name": "deployment",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a deployment that is not live, with its files",
        "x-codes": [
          "deployment_live",
          "sites_unavailable"
        ],
        "x-permission": "baas:sites:manage"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getSiteDeployment",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The site's name (its hostname label).",
            "in": "path",
            "name": "site",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
              "type": "string"
            }
          },
          {
            "description": "Deployment id.",
            "in": "path",
            "name": "deployment",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteDeployment"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One deployment",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/sites/{site}/deployments/{deployment}/finalize": {
      "post": {
        "description": "Requires the `baas:sites:manage` permission.",
        "operationId": "finalizeSiteDeployment",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The site's name (its hostname label).",
            "in": "path",
            "name": "site",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
              "type": "string"
            }
          },
          {
            "description": "Deployment id.",
            "in": "path",
            "name": "deployment",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "promote": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteDeployment"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Check an uploaded deployment and make it ready; promote (default true) also makes it live",
        "x-codes": [
          "deployment_not_uploaded",
          "deployment_expired",
          "deployment_failed",
          "deployment_not_ready",
          "site_storage_limit",
          "sites_unavailable"
        ],
        "x-permission": "baas:sites:manage"
      }
    },
    "/projects/{id}/sites/{site}/deployments/{deployment}/promote": {
      "post": {
        "description": "Requires the `baas:sites:manage` permission.",
        "operationId": "promoteSiteDeployment",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "The site's name (its hostname label).",
            "in": "path",
            "name": "site",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
              "type": "string"
            }
          },
          {
            "description": "Deployment id.",
            "in": "path",
            "name": "deployment",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Site"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Make a ready deployment live (a release, or a rollback to an earlier one), at once",
        "x-codes": [
          "deployment_not_ready",
          "sites_unavailable"
        ],
        "x-permission": "baas:sites:manage"
      }
    },
    "/projects/{id}/sql": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "runSQL",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "query": {
                    "maxLength": 1048576,
                    "type": "string"
                  },
                  "read_only": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "query"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SQLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Run SQL as the project's owner: one transaction, any number of statements (no BEGIN/COMMIT inside), a 15 s statement timeout (the plan's when longer). Answers every statement's command tag and the rows of the last one that returned rows (at most 1000 rows / 5 MB). read_only runs it in a READ ONLY transaction. Recorded in your activity log (the text when at most 2 KB, else its SHA-256)",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded",
          "transaction_control",
          "query_too_large"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/sql/snippets": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listSQLSnippets",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Snippet"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Saved SQL snippets",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createSQLSnippet",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "query": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "query"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Snippet"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Save a SQL snippet (at most 200 a project)",
        "x-codes": [
          "snippet_limit"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/sql/snippets/{snippet}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "deleteSQLSnippet",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "snippet",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a snippet",
        "x-permission": "baas:sql:execute"
      },
      "put": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "updateSQLSnippet",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "snippet",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "query": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "query"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Snippet"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a snippet",
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/storage/buckets": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listBuckets",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Bucket"
                      },
                      "type": "array"
                    },
                    "limits": {
                      "description": "What the plan allows: a bucket's file size cap, image transformation, S3 keys.",
                      "properties": {
                        "image_transform": {
                          "type": "boolean"
                        },
                        "max_file_bytes": {
                          "format": "int64",
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "s3_keys": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's buckets",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "createBucket",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BucketInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a bucket",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/buckets/{bucket}": {
      "delete": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "deleteBucket",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete an empty bucket",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getBucket",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Bucket"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One bucket",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      },
      "put": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "updateBucket",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BucketInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a bucket",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/buckets/{bucket}/copy": {
      "post": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "copyObject",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  },
                  "to_bucket": {
                    "type": "string"
                  },
                  "upsert": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "from",
                  "to"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "bucket": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "bucket",
                        "path"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Copy an object (the destination bucket's limits apply)",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/buckets/{bucket}/empty": {
      "post": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "emptyBucket",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete every object of a bucket",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/buckets/{bucket}/move": {
      "post": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "moveObject",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  },
                  "to_bucket": {
                    "type": "string"
                  },
                  "upsert": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "from",
                  "to"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "bucket": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "bucket",
                        "path"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Move or rename an object (to another bucket with to_bucket; its limits apply)",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/buckets/{bucket}/object": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "downloadObject",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          },
          {
            "description": "The object's name in its bucket.",
            "in": "query",
            "name": "path",
            "required": true,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The object."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Download an object (always as an attachment)",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      },
      "put": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "uploadObject",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          },
          {
            "description": "The object's name in its bucket.",
            "in": "query",
            "name": "path",
            "required": true,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          },
          {
            "description": "Replace an object that exists.",
            "in": "query",
            "name": "upsert",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "format": "binary",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "bucket": {
                          "type": "string"
                        },
                        "id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "path": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "bucket",
                        "path",
                        "id"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Upload an object (the body, streamed; its Content-Type is kept)",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/buckets/{bucket}/objects": {
      "delete": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "deleteObjects",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "paths": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "paths"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "deleted": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete objects",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listObjects",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "prefix",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ObjectEntry"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A folder of a bucket",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/storage/buckets/{bucket}/sign": {
      "post": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "signObjectURL",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "expires_in": {
                    "format": "int64",
                    "maximum": 604800,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "path": {
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "expires_in": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "url": {
                          "format": "uri",
                          "type": "string"
                        }
                      },
                      "required": [
                        "url",
                        "expires_in"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A time-limited URL of an object on the project endpoint",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/buckets/{bucket}/upload-url": {
      "post": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "signObjectUploadURL",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "path": {
                    "maxLength": 1024,
                    "type": "string"
                  },
                  "upsert": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "path"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "bucket": {
                          "type": "string"
                        },
                        "method": {
                          "enum": [
                            "PUT"
                          ],
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        },
                        "url": {
                          "format": "uri",
                          "type": "string"
                        }
                      },
                      "required": [
                        "url",
                        "method",
                        "bucket",
                        "path"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A signed upload URL on the project endpoint: the browser PUTs the file there, not through the console",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/buckets/{bucket}/uploads": {
      "post": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "startResumableUpload",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "bucket",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_.\\-]{1,100}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "cache_control": {
                    "type": "string"
                  },
                  "content_type": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string"
                  },
                  "size": {
                    "format": "int64",
                    "minimum": 1,
                    "type": "integer"
                  },
                  "upsert": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "path",
                  "size"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "expires_at": {
                          "description": "RFC 3339 time, UTC.",
                          "format": "date-time",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "id": {
                          "type": "string"
                        },
                        "offset": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "size": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id",
                        "offset"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Start a resumable upload of a large file; the bucket's and the plan's limits are checked now, it expires after 24 hours",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/policies": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listStoragePolicies",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "policies": {
                            "items": {
                              "properties": {
                                "command": {
                                  "enum": [
                                    "ALL",
                                    "SELECT",
                                    "INSERT",
                                    "UPDATE",
                                    "DELETE"
                                  ],
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "permissive": {
                                  "type": "boolean"
                                },
                                "roles": {
                                  "items": {
                                    "type": "string"
                                  },
                                  "type": "array"
                                },
                                "using": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "with_check": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "type": "object"
                            },
                            "type": "array"
                          },
                          "rls_enabled": {
                            "type": "boolean"
                          },
                          "table": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The row level security policies of storage.objects and storage.buckets",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "createStoragePolicy",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "bucket": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "operations": {
                    "items": {
                      "enum": [
                        "SELECT",
                        "INSERT",
                        "UPDATE",
                        "DELETE"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "policy": {
                    "properties": {
                      "command": {
                        "enum": [
                          "ALL",
                          "SELECT",
                          "INSERT",
                          "UPDATE",
                          "DELETE"
                        ],
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "permissive": {
                        "type": "boolean"
                      },
                      "roles": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "using": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "with_check": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "type": "object"
                  },
                  "table": {
                    "enum": [
                      "objects",
                      "buckets"
                    ],
                    "type": "string"
                  },
                  "template": {
                    "description": "own_folder: (storage.foldername(name))[1] = auth.uid(); owner_only: owner_id = auth.uid().",
                    "enum": [
                      "public_read",
                      "authenticated_read",
                      "own_folder",
                      "owner_only",
                      "custom"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "template"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "sql": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "sql"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create storage policies from a template or your own expressions, run as the project's owner in one transaction",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/policies/preview": {
      "post": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "previewStoragePolicy",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "bucket": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "operations": {
                    "items": {
                      "enum": [
                        "SELECT",
                        "INSERT",
                        "UPDATE",
                        "DELETE"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "policy": {
                    "properties": {
                      "command": {
                        "enum": [
                          "ALL",
                          "SELECT",
                          "INSERT",
                          "UPDATE",
                          "DELETE"
                        ],
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "permissive": {
                        "type": "boolean"
                      },
                      "roles": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "using": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "with_check": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "type": "object"
                  },
                  "table": {
                    "enum": [
                      "objects",
                      "buckets"
                    ],
                    "type": "string"
                  },
                  "template": {
                    "description": "own_folder: (storage.foldername(name))[1] = auth.uid(); owner_only: owner_id = auth.uid().",
                    "enum": [
                      "public_read",
                      "authenticated_read",
                      "own_folder",
                      "owner_only",
                      "custom"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "template"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "policies": {
                          "items": {
                            "properties": {
                              "policy": {
                                "properties": {
                                  "command": {
                                    "enum": [
                                      "ALL",
                                      "SELECT",
                                      "INSERT",
                                      "UPDATE",
                                      "DELETE"
                                    ],
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "permissive": {
                                    "type": "boolean"
                                  },
                                  "roles": {
                                    "items": {
                                      "type": "string"
                                    },
                                    "type": "array"
                                  },
                                  "using": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "with_check": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "type": "object"
                              },
                              "sql": {
                                "type": "string"
                              },
                              "table": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "sql": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "sql"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The statements a storage policy request would run (nothing is run)",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/storage/policies/{table}/{policy}": {
      "delete": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "dropStoragePolicy",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "enum": [
                "objects",
                "buckets"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "policy",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "sql": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "sql"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop a storage policy",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/s3-keys": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listS3Keys",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "access_key_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": "string"
                          },
                          "created_by": {
                            "format": "int64",
                            "type": "integer"
                          },
                          "description": {
                            "type": "string"
                          },
                          "revoked_at": {
                            "description": "RFC 3339 time, UTC.",
                            "format": "date-time",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "access_key_id",
                          "description",
                          "created_at",
                          "revoked_at"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "limit": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "s3": {
                      "properties": {
                        "endpoint": {
                          "format": "uri",
                          "type": "string"
                        },
                        "force_path_style": {
                          "type": "boolean"
                        },
                        "region": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "endpoint",
                        "region"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data",
                    "s3",
                    "limit"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's S3 access keys (never their secrets) and the S3 endpoint",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "createS3Key",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "maxLength": 200,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "key": {
                          "properties": {
                            "access_key_id": {
                              "type": "string"
                            },
                            "created_at": {
                              "description": "RFC 3339 time, UTC.",
                              "format": "date-time",
                              "type": "string"
                            },
                            "created_by": {
                              "format": "int64",
                              "type": "integer"
                            },
                            "description": {
                              "type": "string"
                            },
                            "revoked_at": {
                              "description": "RFC 3339 time, UTC.",
                              "format": "date-time",
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "access_key_id",
                            "description",
                            "created_at",
                            "revoked_at"
                          ],
                          "type": "object"
                        },
                        "s3": {
                          "properties": {
                            "endpoint": {
                              "format": "uri",
                              "type": "string"
                            },
                            "force_path_style": {
                              "type": "boolean"
                            },
                            "region": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "endpoint",
                            "region"
                          ],
                          "type": "object"
                        },
                        "secret_access_key": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "key",
                        "secret_access_key",
                        "s3"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create an S3 access key; its secret is shown once. S3 keys are service level: S3 requests bypass the row level security policies (bucket limits and the quota still apply); the plan's storage_s3_keys caps them",
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/s3-keys/{key}": {
      "delete": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "revokeS3Key",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Access key id.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "maxLength": 32,
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Revoke an S3 access key at once",
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/storage/uploads/{upload}": {
      "delete": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "cancelResumableUpload",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Resumable upload id.",
            "in": "path",
            "name": "upload",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Cancel a resumable upload",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      },
      "get": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "resumableUploadStatus",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Resumable upload id.",
            "in": "path",
            "name": "upload",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "expires_at": {
                          "description": "RFC 3339 time, UTC.",
                          "format": "date-time",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "id": {
                          "type": "string"
                        },
                        "offset": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "size": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id",
                        "offset"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Where a resumable upload stands (resume from offset)",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      },
      "patch": {
        "description": "Requires the `baas:storage:manage` permission.",
        "operationId": "uploadChunk",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Resumable upload id.",
            "in": "path",
            "name": "upload",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/offset+octet-stream": {
              "schema": {
                "format": "binary",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "done": {
                          "type": "boolean"
                        },
                        "id": {
                          "type": "string"
                        },
                        "offset": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id",
                        "offset",
                        "done"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Send the next chunk (at most 64 MiB) at offset; the chunk that finishes the upload stores the object, a stale offset answers 409",
        "x-codes": [
          "upstream_refused (with reason: the component's own code)",
          "console_unavailable",
          "unavailable",
          "project_paused",
          "identity_hold"
        ],
        "x-permission": "baas:storage:manage"
      }
    },
    "/projects/{id}/tables": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listTables",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Default public.",
            "in": "query",
            "name": "schema",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Table"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A schema's tables and views",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createTable",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "columns": {
                    "items": {
                      "$ref": "#/components/schemas/ColumnSpec"
                    },
                    "type": "array"
                  },
                  "comment": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "rls_enabled": {
                    "type": "boolean"
                  },
                  "schema": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "columns"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a table from the wizard's columns; row level security is on unless rls_enabled is false. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "dropTable",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cascade",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop a table. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "describeTable",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TableDetail"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One table: columns, keys, indexes, policies, triggers",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "patch": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "alterTable",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "comment": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "rls_enabled": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a table: comment (\"\" removes it), row level security, then the name. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/columns": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "addColumn",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ColumnSpec"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Add a column. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/columns/{column}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "dropColumn",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "column",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cascade",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop a column. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      },
      "patch": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "alterColumn",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "column",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "comment": {
                    "type": "string"
                  },
                  "default": {
                    "type": "string"
                  },
                  "drop_default": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "nullable": {
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string"
                  },
                  "using": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a column: type (with USING), nullability, default, comment, name. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/constraints": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "addConstraint",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConstraintSpec"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Add a foreign key, unique, check or primary key constraint. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/constraints/{constraint}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "dropConstraint",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "constraint",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cascade",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop a constraint. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/indexes": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listIndexes",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Index"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A table's indexes",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createIndex",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IndexSpec"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create an index (btree, hash, gin, gist, brin, spgist; unique, partial, concurrently). Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/indexes/{index}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "dropIndex",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "index",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "concurrently",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop an index of the table (not one a constraint owns: drop the constraint). Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/policies": {
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createPolicy",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "command": {
                    "enum": [
                      "ALL",
                      "SELECT",
                      "INSERT",
                      "UPDATE",
                      "DELETE"
                    ],
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "permissive": {
                    "type": "boolean"
                  },
                  "roles": {
                    "description": "anon, authenticated, service_role, public...",
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "using": {
                    "type": "string"
                  },
                  "with_check": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a row level security policy; USING and WITH CHECK are your SQL expressions. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/policies/{policy}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "dropPolicy",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "policy",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop a policy. Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/realtime": {
      "put": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "setTableRealtime",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "old_records": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Enable or disable Realtime (Postgres Changes) for a table; old_records sets REPLICA IDENTITY FULL (true) or DEFAULT (false). Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/rls": {
      "put": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "setTableRLS",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "force": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DDLResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Turn row level security on or off (force: also for the owner). Answers with the SQL that ran",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/tables/{table}/rows": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "deleteRows",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "keys": {
                    "items": {
                      "properties": {},
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "keys"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RowsResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete rows named by their primary keys (at most 100), all or none",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded",
          "row_not_found",
          "no_primary_key"
        ],
        "x-permission": "baas:sql:execute"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listRows",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "column.asc or column.desc; repeatable.",
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "column.op.value, op one of eq neq lt lte gt gte like ilike is_null not_null; repeatable.",
            "in": "query",
            "name": "filter",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RowPage"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A page of rows",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:view"
      },
      "patch": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "updateRow",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "key": {
                    "properties": {},
                    "type": "object"
                  },
                  "values": {
                    "properties": {},
                    "type": "object"
                  }
                },
                "required": [
                  "key",
                  "values"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RowsResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change one row, named by its whole primary key",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded",
          "row_not_found",
          "no_primary_key"
        ],
        "x-permission": "baas:sql:execute"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "insertRows",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "schema.table (the schema is the part before the first dot).",
            "in": "path",
            "name": "table",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "rows": {
                    "items": {
                      "description": "column -\u003e value",
                      "properties": {},
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "rows"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RowsResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Insert rows (at most 100)",
        "x-codes": [
          "sql_error (422, with sql_error: SQLSTATE, position, message)",
          "database_unavailable",
          "project_paused",
          "identity_hold",
          "rate_limit_exceeded"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/transfer": {
      "delete": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "cancelProjectTransfer",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Cancel the project's pending transfer",
        "x-permission": "baas:projects:manage"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectTransfer",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Transfer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The project's pending transfer to another account",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "requestProjectTransfer",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "confirm": {
                    "description": "The project's ref.",
                    "type": "string"
                  },
                  "target_account_id": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "target_account_id",
                  "confirm"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Transfer"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Ask to move the project to another Arianet account (it accepts or declines)",
        "x-codes": [
          "confirmation_mismatch",
          "same_account",
          "transfer_pending"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/projects/{id}/types/typescript": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectTypeScript",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Comma-separated schemas (default public).",
            "in": "query",
            "name": "schemas",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "lang": {
                          "type": "string"
                        },
                        "schemas": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "types": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "lang",
                        "schemas",
                        "types"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "TypeScript types of the schema for typed clients",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/usage": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getProjectUsage",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "This month's use against the plan, with a daily series",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/vault/secrets": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listVaultSecrets",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Secret"
                      },
                      "type": "array"
                    },
                    "limits": {
                      "properties": {
                        "max": {
                          "description": "The plan's limit.",
                          "format": "int64",
                          "type": "integer"
                        },
                        "used": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "max",
                        "used"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Vault secrets (never their values)",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:keys:manage` permission.",
        "operationId": "createVaultSecret",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecretInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Secret"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Store a secret (encrypted with the project's own key)",
        "x-codes": [
          "plan_limit",
          "name_taken",
          "feature_preparing"
        ],
        "x-permission": "baas:keys:manage"
      }
    },
    "/projects/{id}/vault/secrets/{secret}": {
      "delete": {
        "description": "Requires the `baas:keys:manage` permission.",
        "operationId": "deleteVaultSecret",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Secret id (UUID).",
            "in": "path",
            "name": "secret",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F-]{36}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a secret",
        "x-permission": "baas:keys:manage"
      },
      "put": {
        "description": "Requires the `baas:keys:manage` permission.",
        "operationId": "updateVaultSecret",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Secret id (UUID).",
            "in": "path",
            "name": "secret",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F-]{36}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecretInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Secret"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a secret's name, description or value",
        "x-permission": "baas:keys:manage"
      }
    },
    "/projects/{id}/vault/secrets/{secret}/reveal": {
      "post": {
        "description": "Requires the `baas:keys:manage` permission.",
        "operationId": "revealVaultSecret",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Secret id (UUID).",
            "in": "path",
            "name": "secret",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-fA-F-]{36}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "value": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Show a secret's value (an activity event)",
        "x-permission": "baas:keys:manage"
      }
    },
    "/projects/{id}/webhooks": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listWebhooks",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      },
                      "type": "array"
                    },
                    "limits": {
                      "properties": {
                        "max": {
                          "description": "The plan's limit.",
                          "format": "int64",
                          "type": "integer"
                        },
                        "used": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "max",
                        "used"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data",
                    "limits"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Database Webhooks",
        "x-permission": "baas:view"
      },
      "post": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "createWebhook",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    },
                    "secret": {
                      "type": "string"
                    },
                    "sql": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created (a dry run answers 200 with data.sql)."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Create a Database Webhook (its trigger on the table); answers the signing secret once",
        "x-codes": [
          "plan_limit",
          "blocked_address",
          "table_not_found",
          "name_taken"
        ],
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/webhooks/{hook}": {
      "delete": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "deleteWebhook",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Webhook id.",
            "in": "path",
            "name": "hook",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a webhook, its trigger and its queued events",
        "x-permission": "baas:sql:execute"
      },
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "getWebhook",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Webhook id.",
            "in": "path",
            "name": "hook",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One webhook",
        "x-permission": "baas:view"
      },
      "put": {
        "description": "Requires the `baas:sql:execute` permission.",
        "operationId": "updateWebhook",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Webhook id.",
            "in": "path",
            "name": "hook",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a webhook and its trigger",
        "x-permission": "baas:sql:execute"
      }
    },
    "/projects/{id}/webhooks/{hook}/deliveries": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listWebhookDeliveries",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "description": "Webhook id.",
            "in": "path",
            "name": "hook",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "success",
                "failed",
                "retrying"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Delivery"
                      },
                      "type": "array"
                    },
                    "next": {
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A webhook's delivery log (7 days)",
        "x-permission": "baas:view"
      }
    },
    "/projects/{id}/workspace": {
      "put": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "moveProjectWorkspace",
        "parameters": [
          {
            "description": "Project id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "workspace_id": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "workspace_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Move the project to another workspace of your account (0: none); you need baas:projects:manage there too",
        "x-codes": [
          "same_workspace"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/quotas": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listQuotas",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Quota"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The account's quota: what it holds of each resource and its limit. Beyond a limit a create is refused with 403 quota_exceeded; ask for an increase in the panel",
        "x-codes": [
          "core_unavailable"
        ],
        "x-permission": "baas:view"
      }
    },
    "/transfers": {
      "get": {
        "description": "Requires the `baas:view` permission.",
        "operationId": "listTransfers",
        "parameters": [
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "enum": [
                "incoming",
                "outgoing"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Transfer"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Pending transfers to (incoming) or from (outgoing) this account",
        "x-permission": "baas:view"
      }
    },
    "/transfers/{transfer}/accept": {
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "acceptTransfer",
        "parameters": [
          {
            "description": "Transfer id.",
            "in": "path",
            "name": "transfer",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Transfer"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Accept a transfer: core authorizes it as an order of this account and the project moves here",
        "x-codes": [
          "transfer_closed",
          "insufficient_balance",
          "identity_needed",
          "project_limit"
        ],
        "x-permission": "baas:projects:manage"
      }
    },
    "/transfers/{transfer}/decline": {
      "post": {
        "description": "Requires the `baas:projects:manage` permission.",
        "operationId": "declineTransfer",
        "parameters": [
          {
            "description": "Transfer id.",
            "in": "path",
            "name": "transfer",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Transfer"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Decline a transfer",
        "x-permission": "baas:projects:manage"
      }
    }
  },
  "security": [
    {
      "session": []
    }
  ],
  "servers": [
    {
      "description": "This region",
      "url": "https://baas.iran-1.ariaservice.net/v1"
    }
  ]
}