{"openapi":"3.1.0","info":{"title":"Canner API","version":"1.0.0","description":"REST API for the Canner deployment platform. Authenticate with a `cnr_` API token (Dashboard → Account) sent as `Authorization: Bearer cnr_…`. Base URL: `https://api.canner.ca`; the stable, versioned surface is `/v1`. Errors share one envelope: `{ \"error\": \"<code>\", \"message\": \"…\", \"request_id\": \"req_…\" }`. Every response carries an `X-Request-Id` header; quote it when contacting support.","contact":{"name":"Canner support","email":"support@canner.ca","url":"https://canner.ca"}},"components":{"securitySchemes":{"bearerToken":{"type":"http","scheme":"bearer","bearerFormat":"cnr_token","description":"API token (`cnr_…`). Create one at Dashboard → Account, then send `Authorization: Bearer cnr_…`."}},"schemas":{}},"paths":{"/v1/auth/{*}":{"options":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/auth/register/start":{"post":{"responses":{"200":{"description":"Default Response"}}}},"/v1/auth/register/options":{"post":{"responses":{"200":{"description":"Default Response"}}}},"/v1/auth/register/verify":{"post":{"responses":{"200":{"description":"Default Response"}}}},"/v1/auth/login/options":{"post":{"responses":{"200":{"description":"Default Response"}}}},"/v1/auth/login/verify":{"post":{"responses":{"200":{"description":"Default Response"}}}},"/v1/auth/tickets":{"post":{"responses":{"200":{"description":"Default Response"}}}},"/v1/auth/users":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/v1/auth/users/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/auth/users/{id}/passkeys":{"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects":{"post":{"summary":"Create a project","tags":["Projects"],"description":"Creates a project. Requires a verified email and available capacity on your plan. Returns 402 when the plan project cap is reached, 409 when the slug is taken or reserved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"repo_url":{"type":"string","format":"uri"},"repo_branch":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["web","worker"]}},"required":["name","slug"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"repo_url":{"type":"string","nullable":true},"repo_branch":{"type":"string"},"is_connected":{"type":"boolean","description":"Whether a GitHub repository is linked."},"node_version":{"type":"string"},"node_version_forced":{"type":"boolean","description":"When false, package.json engines.node can override node_version at build time."},"php_version":{"type":"string"},"php_version_forced":{"type":"boolean","description":"When false, composer.json require.php can override php_version at build time."},"java_version":{"type":"string"},"java_version_forced":{"type":"boolean","description":"When false, a declared Maven/Gradle release can override java_version at build time."},"ruby_version":{"type":"string"},"ruby_version_forced":{"type":"boolean","description":"When false, a Gemfile ruby line (or a newer .ruby-version) can move the build to another offered Ruby series."},"build_publishing_rule":{"type":"string","description":"Live-site behaviour on a failed build: publish_every_build | instant_rollback | keep_alive."},"install_command":{"type":"string"},"build_command":{"type":"string"},"geo_headers":{"type":"boolean","description":"Visitor location on: requests to the app carry X-Canner-IP-Country, X-Canner-IP-Region and X-Canner-Consent-Mode (and the Vercel/Cloudflare names). The project is then not cached."},"app_host_disabled":{"type":"boolean","description":"The <slug>.canner.app address is turned off: the project answers on its custom domains only. Refused unless a custom domain is verified; served again if the last one is removed."},"health_check_path":{"type":"string","description":"The path requested on a freshly started version to decide it is up: any response below 500 within 30 seconds counts. Default /."},"start_command":{"type":"string","nullable":true,"description":"Replaces the detected start command when set (one line, run through sh -c; $PORT is the port to listen on). null = the detected command."},"release_command":{"type":"string","nullable":true,"description":"Runs once per production deploy after a successful build, before the new version starts (migrations, seeding). Never on previews."},"previews_enabled":{"type":"boolean","description":"Whether pull requests (and manual branch deploys) build previews. A preview runs branch code with this project's environment variables and database; turn it off for a project that holds live credentials."},"files_retention_days":{"type":"number","nullable":true,"description":"Days deleted files and older versions are kept (null = 30). Raised automatically to cover the project's database backup windows."},"root_directory":{"type":"string"},"memory_limit_mb":{"type":"number"},"port":{"type":"number","nullable":true},"status":{"type":"string","description":"Lifecycle status: created, building, live, inactive, …"},"kind":{"type":"string","description":"'web' (HTTP app, health-checked + routed) or 'worker' (bot/background job, no web server)."},"always_warm":{"type":"boolean"},"is_cold":{"type":"boolean"},"caching_enabled":{"type":"boolean"},"has_purge_token":{"type":"boolean"},"has_bypass_secret":{"type":"boolean","description":"Whether a draft-bypass secret exists. Fetch it from /cache/bypass-secret."},"cache_bypass_mode":{"type":"string","description":"How a draft bypass is proven: 'strict' (secret required) or 'cookie_name'."},"framework_override":{"type":"string","nullable":true},"next_standalone":{"type":"boolean"},"app_domain":{"type":"string","nullable":true,"description":"Tenant domain shown to the user; null = legacy app.canner.ca. Both hosts always route."},"last_request_at":{"type":"string","format":"date-time","nullable":true},"crash_looping_since":{"type":"string","format":"date-time","nullable":true,"description":"Set when the crash-loop breaker stopped the project after repeated startup failures; null = healthy. Redeploy to clear."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","slug","repo_url","repo_branch","is_connected","node_version","node_version_forced","php_version","php_version_forced","java_version","java_version_forced","ruby_version","ruby_version_forced","build_publishing_rule","install_command","build_command","geo_headers","app_host_disabled","health_check_path","start_command","release_command","previews_enabled","files_retention_days","root_directory","memory_limit_mb","port","status","kind","always_warm","is_cold","caching_enabled","has_purge_token","has_bypass_secret","cache_bypass_mode","framework_override","next_standalone","app_domain","last_request_at","crash_looping_since","created_at","updated_at"],"additionalProperties":false,"description":"A Canner project."}},"required":["project"],"additionalProperties":false}}}},"402":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"429":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"get":{"summary":"List projects","tags":["Projects"],"description":"Lists the projects owned by your organization, newest first. Keyset-paginated: pass `limit` (1–100, default 50) and the previous response's `next_cursor` as `cursor`. `next_cursor` is null on the last page.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false,"description":"Max items to return (1–100). Defaults to 50."},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Opaque pagination token from a previous response's `next_cursor`. Omit for the first page."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"repo_url":{"type":"string","nullable":true},"repo_branch":{"type":"string"},"is_connected":{"type":"boolean","description":"Whether a GitHub repository is linked."},"node_version":{"type":"string"},"node_version_forced":{"type":"boolean","description":"When false, package.json engines.node can override node_version at build time."},"php_version":{"type":"string"},"php_version_forced":{"type":"boolean","description":"When false, composer.json require.php can override php_version at build time."},"java_version":{"type":"string"},"java_version_forced":{"type":"boolean","description":"When false, a declared Maven/Gradle release can override java_version at build time."},"ruby_version":{"type":"string"},"ruby_version_forced":{"type":"boolean","description":"When false, a Gemfile ruby line (or a newer .ruby-version) can move the build to another offered Ruby series."},"build_publishing_rule":{"type":"string","description":"Live-site behaviour on a failed build: publish_every_build | instant_rollback | keep_alive."},"install_command":{"type":"string"},"build_command":{"type":"string"},"geo_headers":{"type":"boolean","description":"Visitor location on: requests to the app carry X-Canner-IP-Country, X-Canner-IP-Region and X-Canner-Consent-Mode (and the Vercel/Cloudflare names). The project is then not cached."},"app_host_disabled":{"type":"boolean","description":"The <slug>.canner.app address is turned off: the project answers on its custom domains only. Refused unless a custom domain is verified; served again if the last one is removed."},"health_check_path":{"type":"string","description":"The path requested on a freshly started version to decide it is up: any response below 500 within 30 seconds counts. Default /."},"start_command":{"type":"string","nullable":true,"description":"Replaces the detected start command when set (one line, run through sh -c; $PORT is the port to listen on). null = the detected command."},"release_command":{"type":"string","nullable":true,"description":"Runs once per production deploy after a successful build, before the new version starts (migrations, seeding). Never on previews."},"previews_enabled":{"type":"boolean","description":"Whether pull requests (and manual branch deploys) build previews. A preview runs branch code with this project's environment variables and database; turn it off for a project that holds live credentials."},"files_retention_days":{"type":"number","nullable":true,"description":"Days deleted files and older versions are kept (null = 30). Raised automatically to cover the project's database backup windows."},"root_directory":{"type":"string"},"memory_limit_mb":{"type":"number"},"port":{"type":"number","nullable":true},"status":{"type":"string","description":"Lifecycle status: created, building, live, inactive, …"},"kind":{"type":"string","description":"'web' (HTTP app, health-checked + routed) or 'worker' (bot/background job, no web server)."},"always_warm":{"type":"boolean"},"is_cold":{"type":"boolean"},"caching_enabled":{"type":"boolean"},"has_purge_token":{"type":"boolean"},"has_bypass_secret":{"type":"boolean","description":"Whether a draft-bypass secret exists. Fetch it from /cache/bypass-secret."},"cache_bypass_mode":{"type":"string","description":"How a draft bypass is proven: 'strict' (secret required) or 'cookie_name'."},"framework_override":{"type":"string","nullable":true},"next_standalone":{"type":"boolean"},"app_domain":{"type":"string","nullable":true,"description":"Tenant domain shown to the user; null = legacy app.canner.ca. Both hosts always route."},"last_request_at":{"type":"string","format":"date-time","nullable":true},"crash_looping_since":{"type":"string","format":"date-time","nullable":true,"description":"Set when the crash-loop breaker stopped the project after repeated startup failures; null = healthy. Redeploy to clear."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","slug","repo_url","repo_branch","is_connected","node_version","node_version_forced","php_version","php_version_forced","java_version","java_version_forced","ruby_version","ruby_version_forced","build_publishing_rule","install_command","build_command","geo_headers","app_host_disabled","health_check_path","start_command","release_command","previews_enabled","files_retention_days","root_directory","memory_limit_mb","port","status","kind","always_warm","is_cold","caching_enabled","has_purge_token","has_bypass_secret","cache_bypass_mode","framework_override","next_standalone","app_domain","last_request_at","crash_looping_since","created_at","updated_at"],"additionalProperties":false,"description":"A Canner project."}},"next_cursor":{"type":"string","nullable":true}},"required":["projects","next_cursor"],"additionalProperties":false}}}}}}},"/v1/projects/{slug}":{"get":{"summary":"Get a project","tags":["Projects"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"repo_url":{"type":"string","nullable":true},"repo_branch":{"type":"string"},"is_connected":{"type":"boolean","description":"Whether a GitHub repository is linked."},"node_version":{"type":"string"},"node_version_forced":{"type":"boolean","description":"When false, package.json engines.node can override node_version at build time."},"php_version":{"type":"string"},"php_version_forced":{"type":"boolean","description":"When false, composer.json require.php can override php_version at build time."},"java_version":{"type":"string"},"java_version_forced":{"type":"boolean","description":"When false, a declared Maven/Gradle release can override java_version at build time."},"ruby_version":{"type":"string"},"ruby_version_forced":{"type":"boolean","description":"When false, a Gemfile ruby line (or a newer .ruby-version) can move the build to another offered Ruby series."},"build_publishing_rule":{"type":"string","description":"Live-site behaviour on a failed build: publish_every_build | instant_rollback | keep_alive."},"install_command":{"type":"string"},"build_command":{"type":"string"},"geo_headers":{"type":"boolean","description":"Visitor location on: requests to the app carry X-Canner-IP-Country, X-Canner-IP-Region and X-Canner-Consent-Mode (and the Vercel/Cloudflare names). The project is then not cached."},"app_host_disabled":{"type":"boolean","description":"The <slug>.canner.app address is turned off: the project answers on its custom domains only. Refused unless a custom domain is verified; served again if the last one is removed."},"health_check_path":{"type":"string","description":"The path requested on a freshly started version to decide it is up: any response below 500 within 30 seconds counts. Default /."},"start_command":{"type":"string","nullable":true,"description":"Replaces the detected start command when set (one line, run through sh -c; $PORT is the port to listen on). null = the detected command."},"release_command":{"type":"string","nullable":true,"description":"Runs once per production deploy after a successful build, before the new version starts (migrations, seeding). Never on previews."},"previews_enabled":{"type":"boolean","description":"Whether pull requests (and manual branch deploys) build previews. A preview runs branch code with this project's environment variables and database; turn it off for a project that holds live credentials."},"files_retention_days":{"type":"number","nullable":true,"description":"Days deleted files and older versions are kept (null = 30). Raised automatically to cover the project's database backup windows."},"root_directory":{"type":"string"},"memory_limit_mb":{"type":"number"},"port":{"type":"number","nullable":true},"status":{"type":"string","description":"Lifecycle status: created, building, live, inactive, …"},"kind":{"type":"string","description":"'web' (HTTP app, health-checked + routed) or 'worker' (bot/background job, no web server)."},"always_warm":{"type":"boolean"},"is_cold":{"type":"boolean"},"caching_enabled":{"type":"boolean"},"has_purge_token":{"type":"boolean"},"has_bypass_secret":{"type":"boolean","description":"Whether a draft-bypass secret exists. Fetch it from /cache/bypass-secret."},"cache_bypass_mode":{"type":"string","description":"How a draft bypass is proven: 'strict' (secret required) or 'cookie_name'."},"framework_override":{"type":"string","nullable":true},"next_standalone":{"type":"boolean"},"app_domain":{"type":"string","nullable":true,"description":"Tenant domain shown to the user; null = legacy app.canner.ca. Both hosts always route."},"last_request_at":{"type":"string","format":"date-time","nullable":true},"crash_looping_since":{"type":"string","format":"date-time","nullable":true,"description":"Set when the crash-loop breaker stopped the project after repeated startup failures; null = healthy. Redeploy to clear."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","slug","repo_url","repo_branch","is_connected","node_version","node_version_forced","php_version","php_version_forced","java_version","java_version_forced","ruby_version","ruby_version_forced","build_publishing_rule","install_command","build_command","geo_headers","app_host_disabled","health_check_path","start_command","release_command","previews_enabled","files_retention_days","root_directory","memory_limit_mb","port","status","kind","always_warm","is_cold","caching_enabled","has_purge_token","has_bypass_secret","cache_bypass_mode","framework_override","next_standalone","app_domain","last_request_at","crash_looping_since","created_at","updated_at"],"additionalProperties":false,"description":"A Canner project."}},"required":["project"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"patch":{"summary":"Update a project","tags":["Projects"],"description":"Updates mutable fields. memory_limit_mb is clamped to the plan ceiling; always_warm requires a paid plan. Slug, status, and port are platform-managed and not editable here.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"repo_url":{"type":"string","format":"uri","nullable":true},"repo_branch":{"type":"string","minLength":1,"maxLength":200},"node_version":{"type":"string","minLength":1,"maxLength":20},"node_version_forced":{"type":"boolean"},"php_version":{"type":"string","minLength":1,"maxLength":20},"php_version_forced":{"type":"boolean"},"java_version":{"type":"string","minLength":1,"maxLength":20},"java_version_forced":{"type":"boolean"},"ruby_version":{"type":"string","minLength":1,"maxLength":20},"ruby_version_forced":{"type":"boolean"},"build_publishing_rule":{"type":"string","enum":["publish_every_build","instant_rollback","keep_alive"]},"install_command":{"type":"string","minLength":1,"maxLength":500},"build_command":{"type":"string","minLength":1,"maxLength":500},"release_command":{"type":"string","maxLength":500,"nullable":true},"start_command":{"type":"string","maxLength":500,"nullable":true},"health_check_path":{"type":"string","minLength":1,"maxLength":200},"app_host_disabled":{"type":"boolean"},"geo_headers":{"type":"boolean"},"previews_enabled":{"type":"boolean"},"files_retention_days":{"type":"integer","minimum":1,"maximum":365,"nullable":true},"remove_previews":{"type":"boolean","description":"With previews_enabled: false, also tear down the existing previews (pinned ones included)."},"root_directory":{"type":"string","minLength":1,"maxLength":500},"memory_limit_mb":{"type":"integer","minimum":64,"maximum":65536},"always_warm":{"type":"boolean"},"kind":{"type":"string","enum":["web","worker"]},"caching_enabled":{"type":"boolean"},"cache_bypass_mode":{"type":"string","enum":["strict","cookie_name"]},"framework_override":{"type":"string","enum":["nextjs","astro","sveltekit","nuxt","remix","vite","node","static","python","python:streamlit","python:fastapi","python:flask","python:django","python:gradio","go","ruby","ruby:rails","ruby:sinatra","php","php:laravel","php:symfony","rust","java","java:maven","java:gradle","boxlang","boxlang:miniserver"],"nullable":true},"next_standalone":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"repo_url":{"type":"string","nullable":true},"repo_branch":{"type":"string"},"is_connected":{"type":"boolean","description":"Whether a GitHub repository is linked."},"node_version":{"type":"string"},"node_version_forced":{"type":"boolean","description":"When false, package.json engines.node can override node_version at build time."},"php_version":{"type":"string"},"php_version_forced":{"type":"boolean","description":"When false, composer.json require.php can override php_version at build time."},"java_version":{"type":"string"},"java_version_forced":{"type":"boolean","description":"When false, a declared Maven/Gradle release can override java_version at build time."},"ruby_version":{"type":"string"},"ruby_version_forced":{"type":"boolean","description":"When false, a Gemfile ruby line (or a newer .ruby-version) can move the build to another offered Ruby series."},"build_publishing_rule":{"type":"string","description":"Live-site behaviour on a failed build: publish_every_build | instant_rollback | keep_alive."},"install_command":{"type":"string"},"build_command":{"type":"string"},"geo_headers":{"type":"boolean","description":"Visitor location on: requests to the app carry X-Canner-IP-Country, X-Canner-IP-Region and X-Canner-Consent-Mode (and the Vercel/Cloudflare names). The project is then not cached."},"app_host_disabled":{"type":"boolean","description":"The <slug>.canner.app address is turned off: the project answers on its custom domains only. Refused unless a custom domain is verified; served again if the last one is removed."},"health_check_path":{"type":"string","description":"The path requested on a freshly started version to decide it is up: any response below 500 within 30 seconds counts. Default /."},"start_command":{"type":"string","nullable":true,"description":"Replaces the detected start command when set (one line, run through sh -c; $PORT is the port to listen on). null = the detected command."},"release_command":{"type":"string","nullable":true,"description":"Runs once per production deploy after a successful build, before the new version starts (migrations, seeding). Never on previews."},"previews_enabled":{"type":"boolean","description":"Whether pull requests (and manual branch deploys) build previews. A preview runs branch code with this project's environment variables and database; turn it off for a project that holds live credentials."},"files_retention_days":{"type":"number","nullable":true,"description":"Days deleted files and older versions are kept (null = 30). Raised automatically to cover the project's database backup windows."},"root_directory":{"type":"string"},"memory_limit_mb":{"type":"number"},"port":{"type":"number","nullable":true},"status":{"type":"string","description":"Lifecycle status: created, building, live, inactive, …"},"kind":{"type":"string","description":"'web' (HTTP app, health-checked + routed) or 'worker' (bot/background job, no web server)."},"always_warm":{"type":"boolean"},"is_cold":{"type":"boolean"},"caching_enabled":{"type":"boolean"},"has_purge_token":{"type":"boolean"},"has_bypass_secret":{"type":"boolean","description":"Whether a draft-bypass secret exists. Fetch it from /cache/bypass-secret."},"cache_bypass_mode":{"type":"string","description":"How a draft bypass is proven: 'strict' (secret required) or 'cookie_name'."},"framework_override":{"type":"string","nullable":true},"next_standalone":{"type":"boolean"},"app_domain":{"type":"string","nullable":true,"description":"Tenant domain shown to the user; null = legacy app.canner.ca. Both hosts always route."},"last_request_at":{"type":"string","format":"date-time","nullable":true},"crash_looping_since":{"type":"string","format":"date-time","nullable":true,"description":"Set when the crash-loop breaker stopped the project after repeated startup failures; null = healthy. Redeploy to clear."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","slug","repo_url","repo_branch","is_connected","node_version","node_version_forced","php_version","php_version_forced","java_version","java_version_forced","ruby_version","ruby_version_forced","build_publishing_rule","install_command","build_command","geo_headers","app_host_disabled","health_check_path","start_command","release_command","previews_enabled","files_retention_days","root_directory","memory_limit_mb","port","status","kind","always_warm","is_cold","caching_enabled","has_purge_token","has_bypass_secret","cache_bypass_mode","framework_override","next_standalone","app_domain","last_request_at","crash_looping_since","created_at","updated_at"],"additionalProperties":false,"description":"A Canner project."}},"required":["project"],"additionalProperties":false}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"402":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Delete a project","tags":["Projects"],"description":"Permanently deletes the project and all of its resources: tenant database, runtime, routing, bundles, and the project row. Returns 204. This cannot be undone.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/command-lint":{"post":{"summary":"Check a command","tags":["Projects"],"description":"Warnings for an install, build or release command — a build that starts the app, migrations in the build (with the split into a release command), install commands that are not commands. Nothing is saved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["install","build","release"]},"command":{"type":"string","maxLength":500},"existing_release":{"type":"string","maxLength":500}},"required":["kind","command"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/addons":{"get":{"summary":"List add-on blocks assigned to a project + org pool availability","tags":["Projects"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"allocations":{"type":"object","additionalProperties":{"type":"number"}},"pool":{"type":"object","additionalProperties":{"type":"object","properties":{"owned":{"type":"number"},"assigned":{"type":"number"},"unassigned":{"type":"number"}},"required":["owned","assigned","unassigned"],"additionalProperties":false}}},"required":["allocations","pool"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/addons/allocate":{"post":{"summary":"Assign an add-on block to a project","tags":["Projects"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"addon_id":{"type":"string","enum":["app_ram","dedicated_instance","reserved_ram"]},"quantity":{"type":"integer","minimum":0,"maximum":1000}},"required":["addon_id","quantity"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"addon_id":{"type":"string"},"quantity":{"type":"number"},"redeploy_recommended":{"type":"boolean"}},"required":["addon_id","quantity","redeploy_recommended"],"additionalProperties":false}}}},"402":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/cache/token":{"post":{"summary":"Generate a cache-purge token","tags":["Projects"],"description":"Generates (or rotates) the per-project token a CMS uses to purge cached pages. The plaintext is returned only here; any prior token is invalidated.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"webhook_url":{"type":"string"}},"required":["token","webhook_url"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/cache/bypass-secret":{"get":{"summary":"Get the draft-bypass secret","tags":["Projects"],"description":"Returns the secret that lets a request skip the cache for draft/preview rendering (via the __canner_bypass cookie, ?__canner_bypass= query param, or X-Canner-Bypass header), plus the current bypass mode. Null until caching has been enabled.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string","nullable":true},"mode":{"type":"string"}},"required":["secret","mode"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Rotate the draft-bypass secret","tags":["Projects"],"description":"Generates a new draft-bypass secret. Any preview link or draft cookie using the old secret stops working at once.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/cache/purge-all":{"post":{"summary":"Purge the entire project cache","tags":["Projects"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"purged":{"type":"number"}},"required":["ok","purged"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"502":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/cache/purge-tags":{"post":{"summary":"Purge cached pages by tag","tags":["Projects"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":50,"description":"Surrogate-Key tags to purge."}},"required":["tags"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"purged":{"type":"number"}},"required":["ok","purged"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"502":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/cache/log":{"get":{"summary":"List recent cache-purge events","tags":["Projects"],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/stop":{"post":{"summary":"Stop a project","tags":["Projects"],"description":"Takes the project offline (stops the runtime + routing, sets status=inactive) without deleting it, and holds it there: nothing but a deploy starts it again (not a visitor, a domain check or a restart of the server). Idempotent — redeploy to bring it back.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,48}[a-z0-9]$"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"string"}},"required":["ok","status"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/database":{"post":{"summary":"Provision a database","tags":["Databases"],"description":"Provisions an isolated Postgres database for the project and returns its connection details. The connection string is also injected into the app as DATABASE_URL. Optionally pick a Postgres version (see GET .../pg-versions) — defaults to 17. 409 if one already exists.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pg_version":{"type":"string","description":"Postgres major version to provision on. Defaults to the platform default (17) when omitted."},"display_name":{"type":"string","maxLength":80,"description":"Customer-facing name shown in the dashboard (max 40 characters). The database is still addressed as \"primary\"."},"auto_inject":{"type":"boolean","description":"Inject the connection string into the app environment at deploy time. Default true."},"dedicated":{"type":"object","properties":{"pitr":{"type":"boolean","description":"Turn on WAL archiving + scheduled base backups (point-in-time recovery)."},"window_days":{"type":"integer"},"base_backup_interval_hours":{"type":"integer"},"confirm_addon_purchase":{"type":"boolean","description":"Set true to accept buying one more dedicated-instance add-on ($9/month) when this project has none assigned. Without it, a project with no unit gets 402 addon_required and nothing is charged."}},"additionalProperties":false,"description":"Put the database on a dedicated Postgres instance (paid add-on). Fixed once created."},"backup":{"type":"object","properties":{"enabled":{"type":"boolean"},"interval_hours":{"type":"number"},"retention_days":{"type":"number"},"retention_count":{"type":"number","nullable":true}},"required":["enabled"],"additionalProperties":false,"description":"Scheduled backup policy to set on the new database (paid plans)."}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"database":{"type":"object","properties":{"db_user":{"type":"string"},"password":{"type":"string","description":"Plaintext database password — treat as a secret."},"connection_string":{"type":"string","description":"postgresql://… DSN (also injected into the app as DATABASE_URL)."},"pg_version":{"type":"string","description":"Which Postgres major version this database runs. See GET /projects/:slug/database/pg-versions for what's offered."},"pg_version_full":{"type":"string","description":"The actual running version (\"17.9\"), for display."}},"required":["db_user","password","connection_string","pg_version","pg_version_full"],"additionalProperties":true,"description":"Tenant Postgres connection details."}},"required":["database"],"additionalProperties":false}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"402":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"500":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"get":{"summary":"Get database connection info","tags":["Databases"],"description":"Returns the project database connection details (including the plaintext password). 404 if no database is provisioned.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"database":{"type":"object","properties":{"db_user":{"type":"string"},"password":{"type":"string","description":"Plaintext database password — treat as a secret."},"connection_string":{"type":"string","description":"postgresql://… DSN (also injected into the app as DATABASE_URL)."},"pg_version":{"type":"string","description":"Which Postgres major version this database runs. See GET /projects/:slug/database/pg-versions for what's offered."},"pg_version_full":{"type":"string","description":"The actual running version (\"17.9\"), for display."}},"required":["db_user","password","connection_string","pg_version","pg_version_full"],"additionalProperties":true,"description":"Tenant Postgres connection details."}},"required":["database"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Delete the database","tags":["Databases"],"description":"Drops the tenant database and its role. Returns 204. This permanently deletes all data in it.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/database/pg-versions":{"get":{"summary":"List available Postgres versions","tags":["Databases"],"description":"Postgres major versions Canner can provision or move a tenant database to, newest first, with the actual running release for display.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"string"},"full":{"type":"string"}},"required":["version","full"],"additionalProperties":false}}},"required":["versions"],"additionalProperties":false}}}}}}},"/v1/projects/{slug}/database/pg-version":{"patch":{"summary":"Change Postgres version","tags":["Databases"],"description":"Moves the tenant database to a different Postgres major version via dump + restore. Real downtime for the duration (seconds for an empty database, longer for a large one) — the app cannot reach its database mid-migration. Requires { confirm: true }. The connection string and DATABASE_URL env var do NOT change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_version":{"type":"string","description":"See GET .../pg-versions for what's offered."},"confirm":{"type":"boolean","description":"Must be true — acknowledges the downtime and that this reads/rewrites all data via dump + restore."}},"required":["target_version","confirm"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"from_version":{"type":"string"},"to_version":{"type":"string"}},"required":["ok","from_version","to_version"],"additionalProperties":false}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases":{"get":{"summary":"List databases","tags":["Databases"],"description":"Every database the project holds (the primary first), plus what the organization's plan allows.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Create an additional database","tags":["Databases"],"description":"Creates another isolated Postgres database in the project. It is injected into the app as DATABASE_URL_<NAME> (the first database stays DATABASE_URL). The project must already have its primary database. Starter is limited to one database per project.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Lowercase letters, digits and underscores, starting with a letter (max 30)."},"pg_version":{"type":"string","description":"Postgres major version; defaults to 17."},"instance":{"type":"boolean","description":"Create it on the dedicated instance of this project instead of shared hosting."},"display_name":{"type":"string","maxLength":80,"description":"Customer-facing name shown in the dashboard."},"auto_inject":{"type":"boolean","description":"Inject DATABASE_URL_<NAME> into the app at deploy time. Default true."}},"required":["name"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/settings":{"patch":{"summary":"Change a database's name or injection","tags":["Databases"],"description":"display_name is the customer-facing name shown in the dashboard (max 40 characters, null clears it); the database is still addressed by its name. auto_inject controls whether the connection string is injected into the app environment. inject_role picks WHICH credential is injected: the label of one of the logins of this database (kind login, read_only or read_write), or null for the owner, which is the default. The app then holds that login credentials and never the owner ones; the owner connection string stays available for migrations. migration_url_in_build gives the release command (never the build or the running app) the owner URL as DATABASE_URL_MIGRATE, so migrations can run there. Everything takes effect on the next deploy.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"display_name":{"type":"string","maxLength":80,"nullable":true},"auto_inject":{"type":"boolean"},"inject_role":{"type":"string","nullable":true},"migration_url_in_build":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/storage-usage":{"get":{"summary":"Storage pool usage","tags":["Databases"],"description":"One pool per organization: databases + backups (and WAL archive) + object storage. Returns the pool cap and use, the split by kind for the whole organization, and the databases and backups of this project (per database).","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/inspect":{"patch":{"summary":"Extend or keep a temporary inspect database","tags":["Databases"],"description":"An inspect database is a restore you are looking at before deciding. { hours } pushes its expiry out (from now); { keep: true } makes it a permanent, ordinary database (it is still not injected into the app until you turn injection on).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hours":{"type":"integer","minimum":1,"maximum":168},"keep":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/diff":{"get":{"summary":"Compare two databases","tags":["Databases"],"description":"Tables, columns and exact row counts of this database against another in the same project (default: the database an inspect database was restored from). `from` is the other database, `to` is this one.","parameters":[{"schema":{"type":"string"},"in":"query","name":"against","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}":{"get":{"summary":"Get a database","tags":["Databases"],"description":"Connection details (including the plaintext password) for one database, by its name (\"primary\" for the first).","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Delete an additional database","tags":["Databases"],"description":"Permanently drops one additional database and its role. The primary database is deleted with DELETE /projects/:slug/database.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/pg-version":{"patch":{"summary":"Change a database's Postgres version","tags":["Databases"],"description":"Moves one database to a different Postgres major version via dump + restore. Real downtime for the duration. Requires { confirm: true }. The connection string does not change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_version":{"type":"string"},"confirm":{"type":"boolean"}},"required":["target_version","confirm"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/database-operations":{"get":{"summary":"List database operations","tags":["Databases"],"description":"Recent exports, imports, migrations and copies for the project, newest first.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/database-operations/{id}":{"get":{"summary":"Get a database operation","tags":["Databases"],"description":"Status, progress and result of one operation. Poll until state is succeeded, failed or cancelled.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/database-operations/{id}/download":{"get":{"summary":"Download an export","tags":["Databases"],"description":"Streams the file produced by a finished export. Available for 24 hours after the export completes.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"410":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/exports":{"post":{"summary":"Export a database","tags":["Databases"],"description":"Starts a pg_dump of one database. format \"custom\" (default, restore with pg_restore) or \"plain\" (gzipped SQL, restore with psql). Poll GET /database-operations/:id, then download. Every plan; Starter is limited to a few per day.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"not":{}},{"type":"object","properties":{"format":{"type":"string","enum":["custom","plain"]}},"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"429":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/imports":{"post":{"summary":"Import a dump","tags":["Databases"],"description":"Uploads a pg_dump custom-format file (Content-Type: application/octet-stream, body = the file; max 500 MB — for larger databases use migrate-in) and restores it into this database. The database must be empty unless ?replace=true, in which case Canner snapshots it first. The restore is atomic: if it fails, nothing changes. Paid plans only.","parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"replace","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"413":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"415":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/migrate-in":{"post":{"summary":"Migrate a database in from another server","tags":["Databases"],"description":"Streams a pg_dump from a publicly reachable Postgres server (any provider) straight into this database — nothing is stored. The source URL is used once and never persisted. The database must be empty unless replace is true (Canner snapshots it first). Atomic: on failure nothing changes. Paid plans only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"description":"postgres://user:password@host:port/dbname (?sslmode=require|verify-full|prefer|disable)"},"replace":{"type":"boolean"},"confirm":{"type":"boolean"}},"required":["url"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/migrate-out":{"post":{"summary":"Migrate a database out to another server","tags":["Databases"],"description":"Streams this database into a publicly reachable Postgres server you name. The target URL is used once and never persisted. Requires { confirm: true }. Paid plans only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"description":"postgres://user:password@host:port/dbname (?sslmode=require|verify-full|prefer|disable)"},"replace":{"type":"boolean"},"confirm":{"type":"boolean"}},"required":["url"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/copy":{"post":{"summary":"Copy a database into another database you own","tags":["Databases"],"description":"Copies this database into another database in the same organization (optionally in a different project). The target must be empty unless replace is true (Canner snapshots it first). Not available on Starter.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_project":{"type":"string","description":"Slug of the target project; defaults to this project."},"target_name":{"type":"string","description":"Name of the target database (\"primary\" for the first)."},"replace":{"type":"boolean"}},"required":["target_name"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/external-access":{"get":{"summary":"Get external-access status","tags":["Databases"],"description":"Whether this database is reachable from outside Canner, its allowlist, and the public host/port to connect to.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"patch":{"summary":"Enable, disable or update external access","tags":["Databases"],"description":"Turns external (public-internet) access to this database on or off, and sets which IP addresses / CIDR ranges may connect. Enabling requires a non-empty allowlist unless allow_open acknowledges 0.0.0.0/0 or ::/0 (at most 50 entries). Requires TLS on every connection. Paid plans only; disabling is always allowed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"allowlist":{"type":"array","items":{"type":"string"}},"allow_open":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"503":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/rotate-credentials":{"post":{"summary":"Rotate the database password","tags":["Databases"],"description":"Generates a new password for this database's role. DATABASE_URL / DATABASE_URL_<NAME> is re-injected on the next deploy — a running app keeps its existing connections until it reconnects. Blocked while external access is enabled on this database — disable it first, rotate, then re-enable (see the 409 response for why).","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/backup-policy":{"get":{"summary":"Get a database's backup policy","tags":["Databases"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"patch":{"summary":"Set a database's backup policy","tags":["Databases"],"description":"Enable/disable scheduled backups and set how often and how long to keep them. Enabling schedules the first run interval_hours from now. Starter: at most one backup per day (minimum 24).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"interval_hours":{"type":"number","description":"Minimum 1 (24 on Starter)."},"retention_days":{"type":"number","description":"Minimum 1."},"retention_count":{"type":"number","nullable":true,"description":"Extra cap on how many backups to keep, on top of retention_days. null = no count cap."},"offsite_destination_id":{"type":"string","format":"uuid","nullable":true,"description":"Copy every backup of this database to this off-site destination (see GET /projects/:slug/backup-destinations). null = no off-site copy."}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/backups":{"get":{"summary":"List backups","tags":["Databases"],"description":"Scheduled and manual backups for this database, newest first. Optional from/to (ISO timestamps) narrow the window; pass next_cursor back as `before` to load the next page. limit is 1-500 (default 100).","parameters":[{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string"},"in":"query","name":"before","required":false},{"schema":{"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Take a manual backup","tags":["Databases"],"description":"Starts an on-demand encrypted backup. Poll GET .../backups/:id until state is \"succeeded\". Starter: one backup per rolling 24 hours.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/backups/{id}":{"get":{"summary":"Get a backup","tags":["Databases"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Delete a backup","tags":["Databases"],"description":"Deletes the backup immediately — this destroys its encryption key, so the file is unrecoverable even before disk space is reclaimed.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/backups/{id}/download":{"get":{"summary":"Download a backup","tags":["Databases"],"description":"Streams the decrypted pg_dump custom-format file. Decryption happens on the fly — nothing decrypted ever touches disk.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/backups/{id}/schema":{"get":{"summary":"Download the schema & policies of a backup","tags":["Databases"],"description":"A JSON description of the database as it was when the backup was taken: tables and columns, indexes, constraints, triggers, functions, types, sequences, extensions, and the whole security model (RLS enabled/forced, policies, grants incl. column grants, default privileges, roles with their attributes and memberships), plus per-table row counts and two fingerprints (schema, security). No row data and no password hashes. With ?compare=live the file also states how the live database differs right now (row counts, schema and security). Backups taken before this existed have none (404).","parameters":[{"schema":{"type":"string","enum":["live"]},"in":"query","name":"compare","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/backups/{id}/roles":{"get":{"summary":"Download the roles of a superuser-run backup","tags":["Databases"],"description":"A SQL file that recreates the roles the database used (groups, logins with their password hashes, memberships, settings and database grants). Run it as a superuser before pg_restore when restoring the downloaded backup on a server of your own. Organization admins only; only backups taken while \"Backups run as\" was superuser have it.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/backups/{id}/offsite":{"post":{"summary":"Copy a backup off-site now","tags":["Databases"],"description":"Uploads this backup (already encrypted) to an off-site destination without waiting for the next sweep: the destination_id you pass, else the one in the database's backup policy.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"not":{}},{"type":"object","properties":{"destination_id":{"type":"string","format":"uuid"}},"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/backups/{id}/verify":{"post":{"summary":"Test-restore a backup","tags":["Databases"],"description":"Restores the backup into a scratch database, reads every table back, and records the result on the backup (verify_state: verified | failed | skipped). The scratch database is removed afterwards and nothing you use is touched. Runs as an operation: poll it. Backups are also verified automatically overnight (turn that off in the alert settings).","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/backups/{id}/restore":{"post":{"summary":"Restore a backup","tags":["Databases"],"description":"Restores a backup. Without target_name, creates a brand-new database and restores into it (safe default — nothing existing is touched). With target_name, restores IN PLACE into that existing database, replacing its contents — Canner snapshots it first, but this requires { confirm: true }. Paid plans only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"not":{}},{"type":"object","properties":{"target_name":{"type":"string","description":"An existing database in this project to restore into, replacing its contents. Omit to restore into a new database instead."},"confirm":{"type":"boolean","description":"Required when target_name is given."},"inspect":{"type":"boolean","description":"Restore into a temporary inspect database (own connection string, never injected into the app) that expires by itself. Cannot be combined with target_name."},"inspect_hours":{"type":"integer","minimum":1,"maximum":168,"description":"How long an inspect database lives (default 24)."}},"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance":{"get":{"summary":"Get the dedicated instance","tags":["Databases"],"description":"The project's dedicated Postgres instance (or null), and whether this project may create one.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create the dedicated instance","tags":["Databases"],"description":"Creates a real, separate Postgres server for this project (own process and data directory, no memory cap). Choose the Postgres version now — it is fixed for the instance. `pitr: true` also turns on WAL archiving and scheduled base backups (point-in-time recovery). Databases are added to it with `instance: true` on create, or moved onto it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"not":{}},{"type":"object","properties":{"pg_version":{"type":"string"},"pitr":{"type":"boolean"},"window_days":{"type":"integer","description":"PITR window in days (1-35, default 7)."}},"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"500":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Destroy the dedicated instance","tags":["Databases"],"description":"Permanently destroys the instance and its point-in-time-recovery archive. Refused while any database still lives on it (move or delete them first). Requires ?confirm=true.","parameters":[{"schema":{"type":"string","enum":["true"]},"in":"query","name":"confirm","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/resources":{"get":{"summary":"Memory budget of the project","tags":["Databases"],"description":"One memory budget is shared by the app and its dedicated Postgres instance: a pooled part (the plan's per-app allowance, shared and throttled under pressure) and a reserved part (0.5 GB included with the instance plus any Reserved RAM blocks; guaranteed). pg_share_pct splits the pooled part; reserved RAM goes to Postgres first. Returns the split, what is in force on the instance, whether a saved change is still pending, and how much guaranteed RAM is left on the server.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"patch":{"summary":"Change the memory split","tags":["Databases"],"description":"Saves the split (pg_share_pct 10-90 of the pooled part; reserved_to_pg_mb = how much purchased Reserved RAM goes to Postgres, null = all). Nothing changes on the instance until POST .../resources/apply.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pg_share_pct":{"type":"integer"},"reserved_to_pg_mb":{"type":"integer","nullable":true}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/resources/apply":{"post":{"summary":"Apply the memory budget to the instance","tags":["Databases"],"description":"Sizes Postgres for its share (shared_buffers, cache and connection settings), sets the instance's memory limits and RESTARTS it: connections drop for a few seconds. The app's memory limit is lowered to its ceiling if it is above it and takes effect at its next deploy. Requires { confirm: true }.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"not":{}},{"type":"object","properties":{"confirm":{"type":"boolean"}},"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/power":{"post":{"summary":"Start or stop the dedicated instance","tags":["Databases"],"description":"Stopping takes every database on the instance offline (data is kept). Requires { confirm: true } to stop.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["start","stop"]},"confirm":{"type":"boolean"}},"required":["action"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/upgrade":{"get":{"summary":"Can the instance be upgraded to a newer Postgres?","tags":["Databases"],"description":"The versions this instance could be upgraded to, what would stop an upgrade right now, and, after one, until when the previous version is kept for a rollback.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Upgrade the dedicated instance to a newer Postgres major version","tags":["Databases"],"description":"Upgrades the whole instance in place: every database, role, grant, policy and extension carries over, and the connection strings do not change. Every database on it is offline for a few minutes (longer for large data), and point-in-time recovery starts a fresh window afterwards (recovery to a time before the upgrade is not possible on the new version). The previous version is kept for 7 days so you can roll back; a rollback loses what was written after the upgrade. If anything fails the instance is left as it was. Requires { confirm: true }.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"type":"string","description":"Default: the newest version offered."},"confirm":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/upgrade/rollback":{"post":{"summary":"Roll the instance back to the version before its last upgrade","tags":["Databases"],"description":"Only while the previous version is still kept. Everything written since the upgrade is LOST, and point-in-time recovery starts a fresh window. Requires { confirm: true }.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/upgrade/finish":{"post":{"summary":"Discard the previous version kept after an upgrade","tags":["Databases"],"description":"Frees the disk the old version uses. After this a rollback is no longer possible. Happens by itself after the keep period. Requires { confirm: true }.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/pitr":{"get":{"summary":"Get point-in-time recovery status","tags":["Databases"],"description":"Whether PITR is on, the restorable window (earliest .. latest archived), archive health and the base backups it is anchored on.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"patch":{"summary":"Configure point-in-time recovery","tags":["Databases"],"description":"Turn WAL archiving + scheduled base backups on or off and set the window (days) and base-backup cadence. Turning it OFF permanently deletes the recovery archive and requires { confirm: true }.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"window_days":{"type":"integer"},"base_backup_interval_hours":{"type":"integer"},"confirm":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/archive-offsite":{"patch":{"summary":"Copy the recovery archive off-site","tags":["Databases"],"description":"Choose which of the off-site destinations of the organization receives a second, encrypted copy of the WAL archive of this instance and base backups (`destination_id`), or `null` to stop. Requires point-in-time recovery on and an encrypted archive. Retention is mirrored there, and files missing on the host are brought back before a restore.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destination_id":{"type":"string","format":"uuid","nullable":true}},"required":["destination_id"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/backup-identity":{"patch":{"summary":"Choose who backups run as","tags":["Databases"],"description":"Backups, exports and copies of every database on this instance read the data as either the database owner (\"owner\", the default) or the instance superuser (\"superuser\"). Only the superuser can read tables under FORCE ROW LEVEL SECURITY, and it never depends on the owner password. Switching to superuser records the roles each database refers to (including their password hashes, sealed) with every backup and queues a fresh backup of each database. Organization admins only. Requires { confirm: true } for \"superuser\".","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"identity":{"type":"string","enum":["owner","superuser"]},"confirm":{"type":"boolean"}},"required":["identity"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/base-backups":{"post":{"summary":"Take a base backup now","tags":["Databases"],"description":"Queues a base backup of the instance (the anchor point-in-time restores replay from). One at a time.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/pitr-restore":{"post":{"summary":"Restore a database to a point in time","tags":["Databases"],"description":"Recovers this database as it was at `target` (an ISO-8601 timestamp, or \"latest\"). By default into a BRAND-NEW database on the instance, and nothing existing is touched. With `in_place: true` (and `confirm: true`) the recovered data replaces this database itself, in one transaction, after Canner snapshots it (kept 7 days): the connection string does not change, and the app sees the old data until the swap commits. Tables created after the target time are not in the recovery and are left as they are; the result names them. Poll the returned operation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"type":"string","minLength":1,"maxLength":64},"inspect":{"type":"boolean","description":"Land the recovery in a temporary inspect database (own connection string, never injected into the app) that expires by itself."},"inspect_hours":{"type":"integer","minimum":1,"maximum":168,"description":"How long an inspect database lives (default 24)."},"in_place":{"type":"boolean","description":"Replace this database with the recovered data instead of creating a new one. Snapshotted first. Requires confirm: true."},"confirm":{"type":"boolean"}},"required":["target"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/move":{"post":{"summary":"Move a database onto or off the dedicated instance","tags":["Databases"],"description":"Moves a database between shared hosting and the project's dedicated instance with a dump + restore. The connection string does not change. Real downtime while it runs. If it fails the database is left untouched. Requires { confirm: true }.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","enum":["instance","shared"]},"pg_version":{"type":"string","description":"Shared Postgres version to move to (default: the instance's version)."},"confirm":{"type":"boolean"}},"required":["to"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/database-alerts":{"get":{"summary":"Database alert settings and incidents","tags":["Databases"],"description":"Who is notified (email recipients, defaulting to every organization admin, and an optional signed webhook), whether backups are test-restored overnight, and the open and recent incidents for this project. Settings are per organization.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"patch":{"summary":"Change database alert settings","tags":["Databases"],"description":"recipients: an empty list means every organization admin. webhook_url must be https; a signing secret is generated when a webhook is first set (or rotate_webhook_secret is true) and returned ONCE as webhook_secret. Each webhook call carries X-Canner-Signature: sha256=<HMAC-SHA256 of the raw body>. verify_backups turns the overnight test restores on or off.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email_enabled":{"type":"boolean"},"recipients":{"type":"array","items":{"type":"string","maxLength":254},"maxItems":20},"webhook_url":{"type":"string","maxLength":500,"nullable":true},"rotate_webhook_secret":{"type":"boolean"},"verify_backups":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/database-alerts/test":{"post":{"summary":"Send a test alert","tags":["Databases"],"description":"Sends a test message to the current recipients and, if configured, the webhook, so you can check the setup. Limited to one every 30 seconds.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"429":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/roles":{"get":{"summary":"List a database's roles","tags":["Databases"],"description":"Named roles on this database: logins (read_only, read_write, replication or login) with their connection strings (the external string only while external access is on), and groups, which have no login and no connection string. A login lists the groups it is a member of. Roles cannot create or alter objects; use the owner credential for that.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Create a role","tags":["Databases"],"description":"Dedicated instance only. Creates a login with its own password. read_only can SELECT everything in this database (tables created later included) and nothing else; read_write can also INSERT, UPDATE and DELETE, except a well-known migration-ledger table (schema_migrations and similar), which stays SELECT-only automatically. The response may also recommend other tables that look like a migration or audit ledger by name (write_exclusion_suggestions) — a hint only, not applied; add one with POST .../roles/:label/write-exclusions if it should stay read-only too. Neither role can create, alter or drop objects, or read any other database. Two kinds are for managing privileges yourself: group is a role nobody can log in as, named by you (for example the group your migrations grant to and attach row-level security policies to); login is a login that gets CONNECT and nothing else, and whatever its groups hold (send member_of: the group labels). Set adopt on a group to register a NOLOGIN role that already exists on the instance. At most 10 roles per database. While external access is on for the database, logins are reachable from the same allowlist.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","description":"Lowercase letters, digits and underscores, starting with a letter (max 20; a group is named exactly as given, 2 to 41 characters, and may not start with pg_, tenant_ or canner)."},"kind":{"type":"string","enum":["read_only","read_write","replication","group","login"],"description":"read_only, read_write, replication (a login for a logical-replication subscriber; needs logical replication turned on for the instance), group (no login) or login (member of your groups, no blanket access)."},"member_of":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"login only: labels of the groups on this database the login becomes a member of."},"adopt":{"type":"boolean","description":"group only: take over an existing NOLOGIN role of that name instead of creating one."}},"required":["label","kind"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/roles/audit":{"get":{"summary":"Audit what each role can do","tags":["Databases"],"description":"Reads the catalog of this database (never its data) in a read-only session and reports, for the owner and every role: its attributes and effective memberships, which tables it can select, insert, update and delete, whether row-level security is enabled and forced on each table, the policies and whom they apply to, and who can create objects. findings lists what looks wrong for a least-privilege setup (the app connecting as the owner, a login holding pg_read_all_data, a migration ledger the app can write, policies on a table without row-level security). Use it in CI to assert the posture you designed.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/least-privilege":{"post":{"summary":"Run the app as a limited role (one step)","tags":["Databases"],"description":"Dedicated instance only. Creates a read-write role (default label \"app\") that can read everything and write data but never change the schema, keeps every well-known migration ledger read-only for it, and makes it the credential injected as DATABASE_URL. The database OWNER, which can change the schema, is then given to the release command only, as DATABASE_URL_MIGRATE, so migrations can still run there; the build and the running app never hold it. Safe to run again (after a migration adds a ledger, say). Takes effect on the next deploy; run your migrations with DATABASE_URL_MIGRATE in the release command. Requires { confirm: true }.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"not":{}},{"type":"object","properties":{"label":{"type":"string"},"confirm":{"type":"boolean"}},"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/roles/{label}/rotate":{"post":{"summary":"Rotate a role password","tags":["Databases"],"description":"Generates a new password for the role. Blocked while external access is on for the database (turn it off, rotate, turn it back on).","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"label","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/roles/{label}":{"patch":{"summary":"Set the groups a login belongs to","tags":["Databases"],"description":"Replaces the list of groups (labels of kind group on this database) the login is a member of, live and without a new connection string. Only a login (kind login) can have groups. The login inherits whatever privileges and row-level security policies those groups hold.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"member_of":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The complete list of group labels; an empty list removes every membership."}},"required":["member_of"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"label","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Delete a role","tags":["Databases"],"description":"Drops the login and disconnects its sessions; anything using its connection string stops working immediately. Deleting a group also removes the grants you made to it in this database and ends every membership in it. Refused (409 role_injected) while the login is the one injected into the app as DATABASE_URL: switch injection first.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"label","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/roles/{label}/predefined":{"put":{"summary":"Set a role's monitoring roles (pg_monitor, ...)","tags":["Databases"],"description":"Dedicated instance only. Makes the monitoring roles held by this role exactly `grants` (any of pg_monitor, pg_read_all_stats, pg_read_all_settings, pg_stat_scan_tables; an empty list takes them all back). Works for a role Canner created, the owner, and a role you created in SQL. Other predefined roles (pg_read_all_data, ...) are never offered. pg_monitor can read every session and statement on the instance, which is only your own there.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grants":{"type":"array","items":{"type":"string"},"maxItems":8}},"required":["grants"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"label","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/roles/{label}/write-exclusions":{"post":{"summary":"Keep one more table read-only for a read_write role","tags":["Databases"],"description":"Adds one table to a read_write role's write exclusions, live, without recreating the role or its connection string — the role can still SELECT it, never INSERT/UPDATE/DELETE it. For a table the automatic migration-ledger detection didn't catch (create-role's write_exclusion_suggestions can point at candidates, or name it directly). The table must already exist (run your migrations first); a missing one is a 400 no_table. Idempotent: adding the same table twice is a no-op. read_only and replication roles have nothing to exclude — every table is already read-only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"table":{"type":"string","description":"The table name, exactly as it appears in the database (case-sensitive)."}},"required":["table"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"label","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/security-check":{"get":{"summary":"Security and performance check","tags":["Databases"],"description":"Reads the catalog of this database (never its data) in a read-only session and lists what looks wrong. Security findings: policies that allow every row, several permissive policies that combine with OR, SECURITY DEFINER functions anyone can execute or without a fixed search_path, views that bypass row-level security, schemas where every role can create objects, and, when roles are in use, the app connecting as the owner, blanket read access, a writable migration ledger and policies without row-level security. Performance findings: tables without a primary key, unindexed foreign keys, duplicate indexes and tables with autovacuum off. Each finding has a category, a severity (warn or info), a count and the first objects it covers. Works on every plan.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/backup-destinations":{"get":{"summary":"List the off-site backup destinations","tags":["Databases"],"description":"The S3-compatible buckets of the organization (up to 5), each with its last test and how many databases copy to it. Secret keys are never returned. A database chooses its destination in its backup policy (offsite_destination_id).","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Add an off-site backup destination","tags":["Databases"],"description":"name is your label for it. endpoint is a host name (for example s3.us-west-002.backblazeb2.com, no https://); it must resolve to a public address. Backups are uploaded already encrypted with their own keys, which stay with Canner: the bucket holds ciphertext, and deleting a backup makes its copy permanently unreadable. Test it afterwards.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":60},"endpoint":{"type":"string","maxLength":260},"region":{"type":"string","maxLength":40},"bucket":{"type":"string","maxLength":80},"prefix":{"type":"string","maxLength":100},"access_key":{"type":"string","maxLength":128},"secret_key":{"type":"string","maxLength":256}},"required":["name","endpoint","bucket","access_key","secret_key"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/backup-destinations/{id}":{"put":{"summary":"Change an off-site backup destination","tags":["Databases"],"description":"Replaces the fields; secret_key may be omitted to keep the saved one. The last test result is cleared: test again. Backups already copied stay where they are.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":60},"endpoint":{"type":"string","maxLength":260},"region":{"type":"string","maxLength":40},"bucket":{"type":"string","maxLength":80},"prefix":{"type":"string","maxLength":100},"access_key":{"type":"string","maxLength":128},"secret_key":{"type":"string","maxLength":256}},"required":["name","endpoint","bucket","access_key"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Remove an off-site backup destination","tags":["Databases"],"description":"Databases that copied to it stop copying off-site, and backups already copied there lose their remote fallback. Objects already in your bucket are left there, unreadable without keys only Canner holds.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/backup-destinations/{id}/test":{"post":{"summary":"Test an off-site backup destination","tags":["Databases"],"description":"Writes a small object to the bucket, reads it back and deletes it, so wrong keys, a wrong bucket or missing permissions show up now instead of at the next backup.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"429":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/metrics":{"get":{"summary":"Database metrics","tags":["Databases"],"description":"Connections, transactions, cache hit ratio, temp files, deadlocks and size over range (1h, 24h, 7d or 30d), evenly bucketed with gaps left as gaps. For a database on the dedicated instance the response also carries the instance's memory, CPU (average cores), I/O and WAL volume. Sampled every 5 minutes (instance: every minute) and kept 30 days.","parameters":[{"schema":{"type":"string","enum":["1h","24h","7d","30d"]},"in":"query","name":"range","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/monitoring":{"get":{"summary":"Monitoring state of the dedicated instance","tags":["Databases"],"description":"Whether query insights and the log viewer are on, and the slow-query threshold.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Turn query insights and logs on or off","tags":["Databases"],"description":"Turning monitoring ON enables pg_stat_statements and the Postgres log collector (statements slower than slow_ms, default 500 ms, errors, lock waits and large temp files are logged; seven days are kept) and RESTARTS the instance: connections drop for a few seconds. Requires { confirm: true }. Changing only slow_ms on an instance that is already on needs no restart. Turning it OFF removes both and restarts again. Logs contain the text of slow and failing statements, including literal values.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"slow_ms":{"type":"number"},"confirm":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/insights":{"get":{"summary":"Slowest and busiest queries","tags":["Databases"],"description":"Top statements for this database from pg_stat_statements, with constants replaced by $1, $2… Sort by total time, mean time, call count or slowest single run. Dedicated instance with monitoring on. Counters are since monitoring was turned on or last reset.","parameters":[{"schema":{"type":"string","enum":["total","mean","calls","max"]},"in":"query","name":"sort","required":false},{"schema":{"type":"integer","minimum":1,"maximum":50},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/insights/reset":{"post":{"summary":"Reset query statistics","tags":["Databases"],"description":"Clears the collected statement statistics for this database only, so a before/after comparison starts clean.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/logs":{"get":{"summary":"Postgres log","tags":["Databases"],"description":"Recent log lines for this database (errors, warnings, statements slower than the threshold, lock waits, large temp files) plus instance-level lines (startup, checkpoints). level is a comma-separated list (ERROR,WARNING,LOG,FATAL). Never includes lines of other databases. Dedicated instance with monitoring on; seven days are kept. Statement text may contain literal values.","parameters":[{"schema":{"type":"string","maxLength":60},"in":"query","name":"level","required":false},{"schema":{"type":"number","minimum":0,"maximum":3600000},"in":"query","name":"min_ms","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"q","required":false},{"schema":{"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/extensions":{"get":{"summary":"Extensions of a database","tags":["Databases"],"description":"The curated list of extensions (vector, postgis, pg_trgm, unaccent, citext, hstore, pgcrypto, uuid-ossp, btree_gin, btree_gist, fuzzystrmatch, ltree, tablefunc, pg_cron) with what is installed in this database, the version the server offers, and whether an update is available. Only for databases on the project's dedicated instance. pg_cron can run in one database of an instance; pg_cron_database names it.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Install an extension","tags":["Databases"],"description":"Installs a catalog extension in this database. Most install at once. pg_cron needs a preloaded library, so it RESTARTS the instance (connections drop for a few seconds): pass { confirm: true } and choose when: \"now\" (default) or \"window\" to wait for the maintenance window. Extensions that can run objects on the host (postgres_fdw, dblink, file_fdw) are not offered.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"extension":{"type":"string"},"when":{"type":"string","enum":["now","window"]},"confirm":{"type":"boolean"}},"required":["extension"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/extensions/{ext}/update":{"post":{"summary":"Update an extension to the server's current version","tags":["Databases"],"description":"Runs ALTER EXTENSION ... UPDATE. Objects that use the extension keep working; read the extension's release notes for behaviour changes.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"ext","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/extensions/{ext}":{"delete":{"summary":"Remove an extension","tags":["Databases"],"description":"Runs DROP EXTENSION without CASCADE: if columns, indexes or functions still use it, nothing is removed and the response says so.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"ext","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/config":{"get":{"summary":"Tuning preset, timeouts and maintenance window","tags":["Databases"],"description":"The instance's parameter preset (balanced, read_heavy, write_heavy, analytics), the timeouts you set (statement, idle-in-transaction, lock; 0 = none), the two-hour maintenance window (day 0-6 or null for every day, hour, IANA time zone), when it next opens, and which settings wait for a restart.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"patch":{"summary":"Change the preset, timeouts or maintenance window","tags":["Databases"],"description":"preset is one of balanced, read_heavy, write_heavy, analytics; overrides may set statement_timeout_ms, idle_in_transaction_timeout_ms and lock_timeout_ms (0 = off, otherwise within safe bounds). Both take effect at once without a restart. window is the two-hour period in which planned restarts happen.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preset":{"type":"string"},"overrides":{"type":"object","additionalProperties":{"type":"number"}},"window":{"type":"object","properties":{"day":{"type":"integer","nullable":true},"hour":{"type":"integer"},"tz":{"type":"string"}},"required":["hour","tz"],"additionalProperties":false}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/restart":{"post":{"summary":"Restart the instance now","tags":["Databases"],"description":"Restarts the instance immediately (connections drop for a few seconds), which also puts settings that were waiting for the maintenance window into force and finishes anything queued behind the restart. Requires { confirm: true }.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"not":{}},{"type":"object","properties":{"confirm":{"type":"boolean"}},"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/replication":{"get":{"summary":"Logical replication of a database","tags":["Databases"],"description":"Whether logical replication is on for the instance (enabled) and in force (active: the instance has restarted with wal_level=logical), the cap on the WAL one slot may hold back (cap_mb, 256-51200), this database's publications, and its replication slots with how much WAL each holds back and its health (ok, lagging, critical, inactive, lost). A subscriber connects with a role of kind \"replication\".","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/instance/replication":{"post":{"summary":"Turn logical replication on or off","tags":["Databases"],"description":"Turning it ON sets wal_level=logical, the slot limits and a cap (cap_mb, default 2048) on the WAL a single slot may hold back, and RESTARTS the instance: pass { confirm: true } and choose when: \"now\" (default) or \"window\". Slot WAL counts toward your storage pool; a slot past the cap is invalidated so a stalled subscriber can never fill the disk. Sending enabled:true with a new cap_mb on an instance that is already on only changes the cap (no restart). Turning it OFF needs every slot removed and restarts again.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"cap_mb":{"type":"number"},"when":{"type":"string","enum":["now","window"]},"confirm":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"patch":{"summary":"Change the slot WAL cap","tags":["Databases"],"description":"Sets the most WAL one replication slot may hold back (256-51200 MB). Takes effect at once without a restart.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cap_mb":{"type":"number"}},"required":["cap_mb"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/replication/publications":{"post":{"summary":"Create a publication","tags":["Databases"],"description":"A publication says which tables a subscriber receives: give all_tables: true, or tables as [\"schema.table\", ...] (at most 200). Needs logical replication to be active.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"all_tables":{"type":"boolean"},"tables":{"type":"array","items":{"type":"string"}}},"required":["name"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/replication/publications/{pub}":{"delete":{"summary":"Drop a publication","tags":["Databases"],"description":"Subscribers that use it stop receiving changes.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"pub","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/replication/slots/{slot}":{"delete":{"summary":"Drop a replication slot","tags":["Databases"],"description":"Disconnects the subscriber if it is connected and frees the WAL the slot held back. The subscriber cannot resume from it: it must be created again.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"slot","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/subscriptions":{"get":{"summary":"Subscriptions of a database (following an external server)","tags":["Databases"],"description":"Each subscription follows publications on a Postgres server you named, and streams their changes into this database. health is syncing (initial copy), streaming, waiting, disabled or error; tables_ready / tables_total is the initial copy's progress. At most 5 per database.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Follow publications on an external server","tags":["Databases"],"description":"The dedicated instance connects OUT to the server in url (postgres://user:password@host:port/db?sslmode=require: public addresses only, encrypted unless you say otherwise) and streams the publications into this database. The tables must already exist here with the same names and columns (restore the schema first: pg_dump --schema-only). With copy_data (default) the existing rows are copied first. Changes are applied with the privileges of each table's owner, never as a superuser. The password is kept by Postgres, not by Canner; the user needs REPLICATION or ownership rights on the publication's tables as your server requires.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string","maxLength":2048},"publications":{"type":"array","items":{"type":"string"},"maxItems":10},"copy_data":{"type":"boolean"}},"required":["name","url","publications"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/subscriptions/{sub}/refresh":{"post":{"summary":"Pick up tables added to the publication","tags":["Databases"],"description":"Runs ALTER SUBSCRIPTION ... REFRESH PUBLICATION: tables that were added to the remote publication (and exist here) start syncing.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"sub","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/databases/{name}/subscriptions/{sub}":{"patch":{"summary":"Pause or resume a subscription","tags":["Databases"],"description":"A paused subscription stops applying changes; the remote server keeps the WAL it needs meanwhile (watch its disk).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"sub","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Stop following","tags":["Databases"],"description":"Removes the subscription and the replication slot it holds on the remote server. If that server cannot be reached nothing changes; retry with ?force=true to remove the subscription anyway (the remote slot is then yours to remove). Rows already copied stay in this database.","parameters":[{"schema":{"type":"string"},"in":"query","name":"force","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true},{"schema":{"type":"string"},"in":"path","name":"sub","required":true}],"responses":{"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/deploy":{"post":{"summary":"Trigger a deployment","tags":["Deployments"],"description":"Manually triggers a build + deploy from the linked GitHub repo HEAD. 400 if the project has no GitHub connection.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"201":{"description":"A newly enqueued deployment.","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"status":{"type":"string"}},"required":["deployment_id","status"],"additionalProperties":true,"description":"A newly enqueued deployment."}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/redeploy-as-worker":{"post":{"summary":"Switch to worker and redeploy","tags":["Deployments"],"description":"Sets the project kind to \"worker\" (no HTTP health check, no public route) and rebuilds the last commit. 400 if the project has no GitHub connection to rebuild from.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"201":{"description":"A newly enqueued deployment.","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"status":{"type":"string"}},"required":["deployment_id","status"],"additionalProperties":true,"description":"A newly enqueued deployment."}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/deployments/{id}/retry":{"post":{"summary":"Retry a deployment","tags":["Deployments"],"description":"Re-enqueues a new build from the same commit as the given (usually failed) deployment.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"A newly enqueued deployment.","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"status":{"type":"string"}},"required":["deployment_id","status"],"additionalProperties":true,"description":"A newly enqueued deployment."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/deployments/{id}/cancel":{"post":{"summary":"Cancel a deployment","tags":["Deployments"],"description":"Aborts an in-flight build. 409 if the deployment already reached a terminal state.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/deployments/{id}/input":{"post":{"summary":"Answer a build prompt","tags":["Deployments"],"description":"Answers \"yes\" or \"no\" to the question a build or release command stopped at. 409 if the deployment is not waiting for an answer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"string","enum":["yes","no"]}},"required":["answer"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/deployments/{id}/rollback":{"post":{"summary":"Roll back to a deployment","tags":["Deployments"],"description":"Re-promotes a prior PRODUCTION deployment by rebuilding from its commit. 409 for preview/branch deployments.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"A newly enqueued deployment.","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"status":{"type":"string"}},"required":["deployment_id","status"],"additionalProperties":true,"description":"A newly enqueued deployment."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/previews":{"get":{"summary":"List preview deployments","tags":["Deployments"],"description":"Lists currently-open preview branches and their URLs.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/metrics":{"get":{"summary":"Get request metrics","tags":["Deployments"],"description":"Bucketed traffic, memory, visitors and events over a preset or custom window at a bar width valid for it, plus cold-start and cache stats.","parameters":[{"schema":{"type":"string","enum":["1h","6h","24h","7d","30d","90d"]},"in":"query","name":"range","required":false,"description":"How far back. Default 24h. Ignored when from/to are given."},{"schema":{"type":"string","maxLength":40},"in":"query","name":"from","required":false,"description":"Start of a custom window (ISO 8601)."},{"schema":{"type":"string","maxLength":40},"in":"query","name":"to","required":false,"description":"End of a custom window (ISO 8601). Default now; never later than now."},{"schema":{"type":"string","enum":["1m","5m","15m","1h","3h","6h","1d","1w"]},"in":"query","name":"granularity","required":false,"description":"Bar width. Offered per window: 7 to 400 bars, and under an hour only inside the last 7 days. Default: the one nearest 48 bars."},{"schema":{"type":"string","maxLength":64},"in":"query","name":"tz","required":false,"description":"IANA time zone for bucket boundaries. Default UTC."},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/metrics/export":{"get":{"summary":"Export metrics","tags":["Deployments"],"description":"Traffic, memory, visitors and events as CSV or Excel over a date range and granularity.","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":true},{"schema":{"type":"string","enum":["1m","5m","15m","1h","3h","6h","1d","1w"]},"in":"query","name":"granularity","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"tz","required":false},{"schema":{"type":"string","enum":["csv","xlsx"]},"in":"query","name":"format","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/runtime-logs":{"get":{"summary":"Stream runtime logs (SSE)","tags":["Deployments"],"description":"Server-Sent Events stream of the running app stdout/stderr. Not a JSON endpoint.","parameters":[{"schema":{"type":"string"},"in":"query","name":"lines","required":false,"description":"Initial backlog lines (20-2000, default 200)."},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/deployments":{"get":{"summary":"List deployments","tags":["Deployments"],"description":"Lists deployments newest-first. Keyset-paginated: pass `limit` (1–100, default 50) and the previous response's `next_cursor` as `cursor`. `next_cursor` is null on the last page.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false,"description":"Max items to return (1–100). Defaults to 50."},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Opaque pagination token from a previous response's `next_cursor`. Omit for the first page."},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/deployments/{id}":{"get":{"summary":"Get a deployment","tags":["Deployments"],"description":"Full deployment detail, including the build log.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/deployments/{id}/screenshot/{variant}.png":{"get":{"summary":"Get a deployment screenshot (PNG)","tags":["Deployments"],"description":"Captured PNG screenshot (variant: desktop or mobile). 404 until captured. Returns image/png, not JSON.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"variant","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/deployments/{id}/logs":{"get":{"summary":"Stream build logs (SSE)","tags":["Deployments"],"description":"Server-Sent Events stream: history replay, live log lines, and status. Not a JSON endpoint.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/errors":{"get":{"summary":"List error groups","tags":["Logs"],"description":"Errors in the project grouped by what would fix them, with counts in the window, an hourly sparkline, and the deploy each began in. Kept 90 days.","parameters":[{"schema":{"type":"string","enum":["open","resolved","ignored","all"]},"in":"query","name":"status","required":false,"description":"Default open."},{"schema":{"type":"string","enum":["http","app","all"]},"in":"query","name":"kind","required":false},{"schema":{"type":"string","enum":["1h","6h","24h","7d","30d","90d"]},"in":"query","name":"range","required":false,"description":"Default 7d."},{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"q","required":false,"description":"Substring of the error title, or a Next.js error digest."},{"schema":{"type":"string","enum":["last_seen","count","first_seen"]},"in":"query","name":"sort","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"offset","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/errors/lookup":{"get":{"summary":"Find an error from a digest or message","tags":["Logs"],"description":"Paste what a visitor saw (the whole \"Application error: a server-side exception has occurred ... Digest: 1234567890\" text, just the digest, or part of an error message) and get the error groups it belongs to. A digest is matched exactly; anything else is matched against error titles. Kept 90 days.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":500},"in":"query","name":"q","required":true,"description":"A digest, the visitor-facing error text, or part of an error message."},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/errors/{id}":{"get":{"summary":"Get one error group","tags":["Logs"],"description":"The error in full: its stack, recent samples, a per-deploy breakdown, the code change it began with, and nearby server events.","parameters":[{"schema":{"type":"string","enum":["1h","6h","24h","7d","30d","90d"]},"in":"query","name":"range","required":false,"description":"Window for the hourly series."},{"schema":{"type":"string"},"in":"query","name":"from","required":false,"description":"Start of the window (ISO), e.g. the period the list was showing."},{"schema":{"type":"string"},"in":"query","name":"to","required":false,"description":"End of the window (ISO)."},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Resolve, ignore or reopen an error","tags":["Logs"],"description":"Resolving records the deploy that was live. A resolved error that happens again reopens as a regression and alerts once; an ignored one stays quiet.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","resolved","ignored"]}},"required":["status"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/errors/{id}/explain":{"post":{"summary":"Explain an error with the on-box model","tags":["Logs"],"description":"Starts an explanation by the model running on Canner's own server (nothing leaves it). Answers in up to a minute: read the error group until its explanation is done. Reuses a finished one when the facts have not changed. 20 a day per organization.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"not":{}},{"type":"object","properties":{"lang":{"type":"string","enum":["en","fr"]}},"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/error-settings":{"get":{"summary":"Error alert settings","tags":["Logs"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Set how often error emails are sent: first (default, the first error only, one email per organization ever), all (every new error, at most one an hour) or off","tags":["Logs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["first","all","off"]},"alerts":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/request-log":{"get":{"summary":"Search the request log","tags":["Logs"],"description":"Every request to the app for 7 days: method, path, status, duration. Errors and slow requests are always kept; successful ones are sampled above 300 a minute (each row says whether it was). No client addresses are stored.","parameters":[{"schema":{"type":"string","enum":["1h","6h","24h","7d","30d","90d"]},"in":"query","name":"range","required":false,"description":"Default 24h. Kept 7 days."},{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","maxLength":60},"in":"query","name":"status","required":false,"description":"\"5xx\", \"4xx,502\", \"error\" (>=400), or an exact code."},{"schema":{"type":"string","maxLength":12},"in":"query","name":"method","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"q","required":false,"description":"Substring of the path or host. A Next.js error digest (or the whole \"Application error ... Digest: N\" message) instead finds the requests that were being served when the app logged that error, even though they were answered 200."},{"schema":{"type":"string"},"in":"query","name":"min_duration","required":false,"description":"Only requests at least this many ms."},{"schema":{"type":"string","enum":["include","exclude","only"]},"in":"query","name":"bots","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"deployment","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/app-log":{"get":{"summary":"Search the app's output","tags":["Logs"],"description":"What the app printed, for 7 days, newest first. Secrets are redacted before storage. Filter by level, search by text or regular expression, and page back with next_cursor.","parameters":[{"schema":{"type":"string","enum":["1h","6h","24h","7d","30d","90d"]},"in":"query","name":"range","required":false,"description":"Default 24h. Kept 7 days."},{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string","enum":["all","warn","error"]},"in":"query","name":"level","required":false,"description":"\"warn\" is warnings and errors; \"error\" is errors with their whole stacks."},{"schema":{"type":"string","maxLength":300},"in":"query","name":"q","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"regex","required":false,"description":"Treat q as a regular expression (POSIX). Slow patterns are cut off after 4 seconds."},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"deployment","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/deploys":{"get":{"summary":"Deploy history with error statistics","tags":["Logs"],"description":"Each deploy with the commit behind it and what happened while it was live: new errors it introduced, errors seen, requests and server errors, and how many errors stopped appearing.","parameters":[{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"before","required":false,"description":"created_at of the last row, to page."},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/deploys/{id}/errors":{"get":{"summary":"Errors a deploy introduced, kept and stopped","tags":["Logs"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/logs/export":{"get":{"summary":"Export errors, requests or app output","tags":["Logs"],"description":"The same filters as the list for that source, up to 20,000 rows, as CSV (opens in Excel) or .xlsx.","parameters":[{"schema":{"type":"string","enum":["errors","requests","app"]},"in":"query","name":"source","required":true},{"schema":{"type":"string","enum":["csv","xlsx"]},"in":"query","name":"format","required":false},{"schema":{"type":"string","enum":["1h","6h","24h","7d","30d","90d"]},"in":"query","name":"range","required":false},{"schema":{"type":"string"},"in":"query","name":"from","required":false},{"schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"method","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false},{"schema":{"type":"string"},"in":"query","name":"min_duration","required":false},{"schema":{"type":"string","enum":["include","exclude","only"]},"in":"query","name":"bots","required":false},{"schema":{"type":"string"},"in":"query","name":"deployment","required":false},{"schema":{"type":"string","enum":["all","warn","error"]},"in":"query","name":"level","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"regex","required":false},{"schema":{"type":"string"},"in":"query","name":"kind","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/env-vars":{"get":{"summary":"List environment variables","tags":["Environment variables"],"description":"Lists the project's environment variables with decrypted values, ordered by environment then key.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"env_vars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"value":{"type":"string","description":"Decrypted value (the owner can read their own secrets back). Empty when value_hidden is true."},"value_hidden":{"type":"boolean","description":"True when the token may set variables but not read them back (a scoped token without env:read, such as an MCP connector token)."},"environment":{"type":"string","nullable":true,"description":"\"production\" (production deploys), \"preview\" (previews), \"runtime\" (the running app on production deploys only, never builds or previews), or null (all: production and previews)."},"is_sensitive":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","key","value","environment","is_sensitive","created_at","updated_at"],"additionalProperties":false}},"pending_redeploy":{"type":"boolean","description":"True when production or runtime variables changed after the latest production deploy started."}},"required":["env_vars","pending_redeploy"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Create environment variable(s)","tags":["Environment variables"],"description":"Creates one variable, or many at once via `{ \"vars\": [...] }`. Duplicates (same key + environment) are skipped, not overwritten. Changes reach the app on its next deploy; `pending_redeploy` on the list says when the running deploy predates them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"value":{"type":"string","maxLength":10000},"environment":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["preview"]},{"type":"string","enum":["runtime"]},{"enum":["null"],"nullable":true}],"default":null},"is_sensitive":{"type":"boolean","default":false}},"required":["key","value"],"additionalProperties":false},{"type":"object","properties":{"vars":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"value":{"type":"string","maxLength":10000},"environment":{"anyOf":[{"type":"string","enum":["production"]},{"type":"string","enum":["preview"]},{"type":"string","enum":["runtime"]},{"enum":["null"],"nullable":true}],"default":null},"is_sensitive":{"type":"boolean","default":false}},"required":["key","value"],"additionalProperties":false},"minItems":1,"maxItems":200}},"required":["vars"],"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"environment":{"type":"string","nullable":true}},"required":["id","key","environment"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"environment":{"type":"string","nullable":true},"reason":{"type":"string"}},"required":["key","environment","reason"],"additionalProperties":false}}},"required":["created","skipped"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"environment":{"type":"string","nullable":true}},"required":["id","key","environment"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"environment":{"type":"string","nullable":true},"reason":{"type":"string"}},"required":["key","environment","reason"],"additionalProperties":false}}},"required":["created","skipped"],"additionalProperties":false}}}}}}},"/v1/projects/{slug}/env-vars/injected":{"get":{"summary":"Variables Canner injects","tags":["Environment variables"],"description":"The variables Canner sets itself from the project databases (DATABASE_URL and DATABASE_URL_<NAME>), which credential each carries, and the ids of your own variables with the same name: those are ignored, because the injected value replaces them. Turn off auto-inject on the database to use your own.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"injected":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"database":{"type":"string"},"display_name":{"type":"string","nullable":true},"inject_role":{"type":"string","nullable":true},"masked_url":{"type":"string"}},"required":["key","database","display_name","inject_role","masked_url"],"additionalProperties":false}},"overridden":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"environment":{"type":"string","nullable":true}},"required":["id","key","environment"],"additionalProperties":false}}},"required":["injected","overridden"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/env-vars/{id}":{"patch":{"summary":"Update an environment variable","tags":["Environment variables"],"description":"Updates the value (and optionally is_sensitive). Key and environment are immutable — delete and recreate to change those.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","maxLength":10000},"is_sensitive":{"type":"boolean"}},"required":["value"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Delete an environment variable","tags":["Environment variables"],"description":"Deletes a variable. Returns 204. The change reaches the app on its next deploy.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/billing/status":{"get":{"summary":"Get billing status","tags":["Billing"],"description":"Returns the organization's plan, trial state, saved card summary, and free-domain credit balance. Always succeeds (renders even when Stripe is not configured).","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"stripe_enabled":{"type":"boolean"},"publishable_key":{"type":"string","nullable":true,"description":"Stripe publishable key for Elements, or null when Stripe is off."},"has_payment_method":{"type":"boolean"},"subscription_status":{"type":"string","nullable":true},"card":{"type":"object","properties":{"last4":{"type":"string"},"brand":{"type":"string","nullable":true}},"required":["last4","brand"],"additionalProperties":false,"nullable":true},"plan":{"type":"string","description":"starter | live | enterprise | dedicated (studio: retired, may still be stored)"},"trial_ends_at":{"type":"string","format":"date-time","nullable":true},"billing_interval":{"type":"string","enum":["monthly","yearly"]},"free_domain_credits":{"type":"number"},"credit_balance_cents":{"type":"number","description":"Prepaid credit held on the organization (cents), from a downgrade's unused-time proration. Auto-applied to future invoices. 0 = none."},"subscription":{"type":"object","properties":{"status":{"type":"string","nullable":true},"current_period_end":{"type":"string","format":"date-time","nullable":true,"description":"Next renewal/charge date."},"cancel_at_period_end":{"type":"boolean","description":"true = auto-renew is off; plan ends at current_period_end."},"amount_cents":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"interval":{"type":"string","enum":["monthly","yearly"]}},"required":["status","current_period_end","cancel_at_period_end","amount_cents","currency","interval"],"additionalProperties":false,"nullable":true}},"required":["stripe_enabled","publishable_key","has_payment_method","subscription_status","card","plan","trial_ends_at","billing_interval","free_domain_credits","credit_balance_cents","subscription"],"additionalProperties":true}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/billing/addons":{"get":{"summary":"Get resource add-ons: catalog, owned quantities, and allocation pools","tags":["Billing"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"stripe_enabled":{"type":"boolean"},"publishable_key":{"type":"string","nullable":true},"has_payment_method":{"type":"boolean"},"has_subscription":{"type":"boolean"},"catalog":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"display_name":{"type":"string"},"price_monthly_cents":{"type":"number"},"scope":{"type":"string","enum":["org","project"]},"owned":{"type":"number"},"assigned":{"type":"number","nullable":true},"unassigned":{"type":"number","nullable":true}},"required":["id","display_name","price_monthly_cents","scope","owned","assigned","unassigned"],"additionalProperties":false}},"projects":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"allocations":{"type":"object","additionalProperties":{"type":"number"}}},"required":["slug","name","allocations"],"additionalProperties":false}}},"required":["stripe_enabled","publishable_key","has_payment_method","has_subscription","catalog","projects"],"additionalProperties":true}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Set the owned quantity of a resource add-on (after previewing it)","tags":["Billing"],"description":"Requires confirm: true and expected_monthly_delta_cents equal to the monthly_delta_cents that POST /billing/addons/preview returned for the same change. Without them nothing is purchased.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"addon_id":{"type":"string","enum":["extra_app","app_ram","storage_block","dedicated_instance","reserved_ram","compliance","ai_credits","extra_seats"]},"quantity":{"type":"integer","minimum":0,"maximum":1000},"confirm":{"type":"boolean"},"expected_monthly_delta_cents":{"type":"integer"}},"required":["addon_id","quantity"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"addon_id":{"type":"string"},"quantity":{"type":"number"}},"required":["addon_id","quantity"],"additionalProperties":false}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"402":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/billing/addons/preview":{"post":{"summary":"Preview a change to the owned quantity of a resource add-on (no charge)","tags":["Billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"addon_id":{"type":"string","enum":["extra_app","app_ram","storage_block","dedicated_instance","reserved_ram","compliance","ai_credits","extra_seats"]},"quantity":{"type":"integer","minimum":0,"maximum":1000}},"required":["addon_id","quantity"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":true}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/billing/usage":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/v1/billing/usage/history":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/v1/billing/usage/projects":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/v1/billing/setup-intent":{"post":{"summary":"Create a SetupIntent","tags":["Billing"],"description":"Returns a Stripe SetupIntent client_secret so a browser can collect a card via Stripe Elements. 503 when Stripe is not configured.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"client_secret":{"type":"string"},"customer_id":{"type":"string"}},"required":["client_secret","customer_id"],"additionalProperties":false}}}},"500":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"503":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/billing/confirm":{"post":{"summary":"Confirm subscription","tags":["Billing"],"description":"Adopts the card saved via the SetupIntent as default and starts (or switches) the subscription. Defaults to monthly Live. 503 when Stripe is not configured.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["live","dedicated"],"description":"Defaults to live."},"interval":{"type":"string","enum":["monthly","yearly"],"description":"Defaults to monthly."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"plan":{"type":"string","enum":["live","dedicated"]},"interval":{"type":"string","enum":["monthly","yearly"]}},"required":["ok","plan","interval"],"additionalProperties":false}}}},"500":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"503":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/billing/portal":{"post":{"summary":"Billing portal session","tags":["Billing"],"description":"Returns a short-lived Stripe billing-portal URL for the org (invoices, card, address). 409 if no customer exists yet, 503 when Stripe is off.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"503":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/billing/details":{"get":{"summary":"Billing details and tax status","tags":["Billing"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":true}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"put":{"summary":"Update billing details","tags":["Billing"],"description":"Replaces legal name, address and invoice email. 403 billing_details_locked when the organization is tax exempt and the request changes anything but the invoice email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"legal_name":{"type":"string","maxLength":200},"address":{"type":"object","properties":{"line1":{"type":"string","maxLength":200},"line2":{"type":"string","maxLength":200,"default":""},"city":{"type":"string","maxLength":100},"postal_code":{"type":"string","maxLength":20},"province":{"type":"string","maxLength":40,"default":""},"country":{"type":"string","maxLength":2}},"required":["line1","city","postal_code","country"],"additionalProperties":false},"billing_email":{"anyOf":[{"type":"string","enum":[""]},{"type":"string","format":"email","maxLength":254}]}},"required":["legal_name","address","billing_email"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":true}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/billing/invoices":{"get":{"summary":"List issued invoices","tags":["Billing"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"issued_at":{"type":"string","format":"date-time"},"total_cents":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","number","issued_at","total_cents","currency","status"],"additionalProperties":false}}},"required":["invoices"],"additionalProperties":false}}}}}}},"/v1/billing/invoices/{id}/pdf":{"get":{"summary":"Download an invoice PDF","tags":["Billing"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/billing/payment-method":{"post":{"summary":"Save a payment method","tags":["Billing"],"description":"Adopts the card captured via the SetupIntent as the default payment method and records it on the organization. Does NOT create or change a subscription — use /billing/confirm for that. 503 when Stripe is not configured.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"card":{"type":"object","properties":{"last4":{"type":"string","nullable":true},"brand":{"type":"string","nullable":true}},"required":["last4","brand"],"additionalProperties":false}},"required":["ok","card"],"additionalProperties":false}}}},"500":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"503":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/billing/cancel":{"post":{"summary":"Cancel subscription","tags":["Billing"],"description":"Downgrades to Starter. when='now' cancels immediately and credits the unused time to the organization (held for a future re-upgrade); when='period_end' (default) keeps access until the renewal date, then demotes. 503 when Stripe is not configured.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"when":{"type":"string","enum":["now","period_end"],"default":"period_end","description":"'now' = immediate cancel + credit unused time; 'period_end' = keep access until renewal, no credit."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"500":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"503":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/billing/resume":{"post":{"summary":"Resume subscription","tags":["Billing"],"description":"Clears a scheduled cancellation (turns auto-renew back on) so the subscription keeps billing at the next renewal. 503 when Stripe is not configured.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"500":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"503":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/domains":{"get":{"summary":"List all domains","tags":["Domains"],"description":"Lists every custom domain across all projects the caller can access, each annotated with its parent project.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"platform_ip":{"type":"string","description":"Fallback for DNS providers with no ALIAS/ANAME support: point an apex hostname here with an A record."},"legacy_ip":{"type":"string","description":"The pre-migration platform IP — surfaced so the dashboard can name it in the \"update your DNS\" nudge for domains still on it."},"purchase_enabled":{"type":"boolean"},"domains":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"status":{"type":"string","description":"pending | verified | failed | transfer_requested"},"verified_at":{"type":"string","format":"date-time","nullable":true},"last_check_at":{"type":"string","format":"date-time","nullable":true},"last_check_error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"account_owned_domain_id":{"type":"string","nullable":true,"description":"Set when Canner registered the domain (vs bring-your-own)."},"serve_www":{"type":"boolean","description":"Whether www.<hostname> 301-redirects to the apex."},"expires_at":{"type":"string","format":"date-time","nullable":true},"auto_renew":{"type":"boolean","nullable":true},"transfer_requested_at":{"type":"string","format":"date-time","nullable":true},"on_legacy_ip_since":{"type":"string","format":"date-time","nullable":true,"description":"Set when this verified BYOD domain still resolves to one of LEGACY_PLATFORM_IPS — served via the old box's reverse-proxy fallback, not the platform directly. Null once repointed."},"challenge_delegated":{"type":"boolean","description":"The optional _acme-challenge CNAME is in place, so the certificate is issued by the DNS challenge (works behind a proxy)."},"acme_optional":{"type":"boolean","description":"True when the certificate record is optional (any domain except a wildcard)."},"dns_conflict":{"type":"string","nullable":true,"description":"A CNAME target found next to the A record for this name (DNS forbids the pairing; some networks follow it to a host with no certificate). Warning only."},"cname_target":{"type":"string","description":"Preferred DNS target for this domain's own project: point a subdomain hostname here with a CNAME (or an apex hostname here with an ALIAS/ANAME record). Survives future PLATFORM_IP changes with no customer action."},"project_id":{"type":"string"},"project_slug":{"type":"string"},"project_name":{"type":"string"},"acme_cname":{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string"}},"required":["name","target"],"additionalProperties":false,"nullable":true,"description":"Wildcard domains only: the _acme-challenge CNAME to add so Canner can issue and renew the wildcard certificate. Keep it in place."}},"required":["id","hostname","status","verified_at","last_check_at","last_check_error","created_at","account_owned_domain_id","expires_at","auto_renew","transfer_requested_at","on_legacy_ip_since"],"additionalProperties":true}}},"required":["platform_ip","legacy_ip","purchase_enabled","domains"],"additionalProperties":false}}}}}}},"/v1/domains/{id}":{"get":{"summary":"Get a domain","tags":["Domains"],"description":"Returns a single domain by its id (the id from the domains list), including registrar + registrant metadata. 404 if the caller does not own the parent project.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"platform_ip":{"type":"string"},"legacy_ip":{"type":"string"},"domain":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"status":{"type":"string","description":"pending | verified | failed | transfer_requested"},"verified_at":{"type":"string","format":"date-time","nullable":true},"last_check_at":{"type":"string","format":"date-time","nullable":true},"last_check_error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"account_owned_domain_id":{"type":"string","nullable":true,"description":"Set when Canner registered the domain (vs bring-your-own)."},"serve_www":{"type":"boolean","description":"Whether www.<hostname> 301-redirects to the apex."},"expires_at":{"type":"string","format":"date-time","nullable":true},"auto_renew":{"type":"boolean","nullable":true},"transfer_requested_at":{"type":"string","format":"date-time","nullable":true},"on_legacy_ip_since":{"type":"string","format":"date-time","nullable":true,"description":"Set when this verified BYOD domain still resolves to one of LEGACY_PLATFORM_IPS — served via the old box's reverse-proxy fallback, not the platform directly. Null once repointed."},"challenge_delegated":{"type":"boolean","description":"The optional _acme-challenge CNAME is in place, so the certificate is issued by the DNS challenge (works behind a proxy)."},"acme_optional":{"type":"boolean","description":"True when the certificate record is optional (any domain except a wildcard)."},"dns_conflict":{"type":"string","nullable":true,"description":"A CNAME target found next to the A record for this name (DNS forbids the pairing; some networks follow it to a host with no certificate). Warning only."},"cname_target":{"type":"string","description":"Preferred DNS target for this domain's own project: point a subdomain hostname here with a CNAME (or an apex hostname here with an ALIAS/ANAME record). Survives future PLATFORM_IP changes with no customer action."},"project_id":{"type":"string"},"project_slug":{"type":"string"},"project_name":{"type":"string"},"acme_cname":{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string"}},"required":["name","target"],"additionalProperties":false,"nullable":true,"description":"Wildcard domains only: the _acme-challenge CNAME to add so Canner can issue and renew the wildcard certificate. Keep it in place."}},"required":["id","hostname","status","verified_at","last_check_at","last_check_error","created_at","account_owned_domain_id","expires_at","auto_renew","transfer_requested_at","on_legacy_ip_since"],"additionalProperties":true}},"required":["platform_ip","legacy_ip","domain"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/domains":{"get":{"summary":"List a project's domains","tags":["Domains"],"description":"Lists the custom domains attached to one project.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"platform_ip":{"type":"string","description":"Fallback for DNS providers with no ALIAS/ANAME support: point an apex hostname here with an A record."},"legacy_ip":{"type":"string","description":"The pre-migration platform IP — surfaced so the dashboard can name it in the \"update your DNS\" nudge for domains still on it."},"purchase_enabled":{"type":"boolean"},"domains":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"status":{"type":"string","description":"pending | verified | failed | transfer_requested"},"verified_at":{"type":"string","format":"date-time","nullable":true},"last_check_at":{"type":"string","format":"date-time","nullable":true},"last_check_error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"account_owned_domain_id":{"type":"string","nullable":true,"description":"Set when Canner registered the domain (vs bring-your-own)."},"serve_www":{"type":"boolean","description":"Whether www.<hostname> 301-redirects to the apex."},"expires_at":{"type":"string","format":"date-time","nullable":true},"auto_renew":{"type":"boolean","nullable":true},"transfer_requested_at":{"type":"string","format":"date-time","nullable":true},"on_legacy_ip_since":{"type":"string","format":"date-time","nullable":true,"description":"Set when this verified BYOD domain still resolves to one of LEGACY_PLATFORM_IPS — served via the old box's reverse-proxy fallback, not the platform directly. Null once repointed."},"challenge_delegated":{"type":"boolean","description":"The optional _acme-challenge CNAME is in place, so the certificate is issued by the DNS challenge (works behind a proxy)."},"acme_optional":{"type":"boolean","description":"True when the certificate record is optional (any domain except a wildcard)."},"dns_conflict":{"type":"string","nullable":true,"description":"A CNAME target found next to the A record for this name (DNS forbids the pairing; some networks follow it to a host with no certificate). Warning only."},"cname_target":{"type":"string","description":"Preferred DNS target for this domain's own project: point a subdomain hostname here with a CNAME (or an apex hostname here with an ALIAS/ANAME record). Survives future PLATFORM_IP changes with no customer action."},"project_id":{"type":"string"},"project_slug":{"type":"string"},"project_name":{"type":"string"},"acme_cname":{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string"}},"required":["name","target"],"additionalProperties":false,"nullable":true,"description":"Wildcard domains only: the _acme-challenge CNAME to add so Canner can issue and renew the wildcard certificate. Keep it in place."}},"required":["id","hostname","status","verified_at","last_check_at","last_check_error","created_at","account_owned_domain_id","expires_at","auto_renew","transfer_requested_at","on_legacy_ip_since"],"additionalProperties":true}}},"required":["platform_ip","legacy_ip","purchase_enabled","domains"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Add a custom domain (BYO)","tags":["Domains"],"description":"Attaches a hostname you already own. It starts in `pending`; point a subdomain at cname_target with a CNAME (or an apex at cname_target with an ALIAS/ANAME record — falling back to an A record at platform_ip if your DNS provider supports neither), then call verify. Custom domains need a payment method on Starter (402).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string","minLength":3,"maxLength":253,"pattern":"^(\\*\\.)?[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"},"serve_www":{"type":"boolean"}},"required":["hostname"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["id","hostname","status","created_at"],"additionalProperties":true},"platform_ip":{"type":"string"},"cname_target":{"type":"string"},"acme_cname":{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string"}},"required":["name","target"],"additionalProperties":false,"nullable":true,"description":"Wildcard domains only: the _acme-challenge CNAME to add as well."}},"required":["domain","platform_ip","cname_target"],"additionalProperties":false}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"402":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/domains/search":{"get":{"summary":"Search for a domain to buy","tags":["Domains"],"description":"Typeahead domain-availability search across registrars, with CAD pricing (free-domain credits applied inline). Returns `{ results, credits_available }`.","parameters":[{"schema":{"type":"string"},"in":"query","name":"q","required":false,"description":"Search term — a bare label or a full hostname."},{"schema":{"type":"string"},"in":"query","name":"limit","required":false,"description":"Max results (1-20, default 10)."},{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/domains/purchase":{"post":{"summary":"Buy and attach a domain","tags":["Domains"],"description":"Registers a domain through Canner (acting as reseller) and attaches it to the project: charges the card (or redeems a free-domain credit), registers with the registrar, points DNS at the platform, and provisions TLS. .ca/.quebec require residency acknowledgement.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain_name":{"type":"string"},"registrant":{"type":"object","properties":{"first_name":{"type":"string","minLength":1,"maxLength":80},"last_name":{"type":"string","minLength":1,"maxLength":80},"organization":{"type":"string","maxLength":120,"nullable":true},"email":{"type":"string","format":"email","maxLength":254},"phone_cc":{"type":"string","pattern":"^\\+?\\d{1,3}$"},"phone_num":{"type":"string","pattern":"^[\\d\\-\\s().]{4,30}$"},"address1":{"type":"string","minLength":2,"maxLength":120},"address2":{"type":"string","maxLength":120,"nullable":true},"city":{"type":"string","minLength":1,"maxLength":80},"state":{"type":"string","minLength":1,"maxLength":80},"postal_code":{"type":"string","minLength":2,"maxLength":20},"country":{"type":"string","minLength":2,"maxLength":2,"pattern":"^[A-Z]{2}$"}},"required":["first_name","last_name","email","phone_cc","phone_num","address1","city","state","postal_code","country"],"additionalProperties":false},"residency_acknowledged":{"type":"boolean","default":false},"cira_cpr_category":{"type":"string"},"cira_lang_pref":{"type":"string","enum":["EN","FR"]},"serve_www":{"type":"boolean","default":true}},"required":["domain_name","registrant"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/domains/{id}/transfer-request":{"post":{"summary":"Request a domain transfer-out","tags":["Domains"],"description":"Requests transfer of a Canner-registered domain to another registrar. Notifies the operator (manual until the registrar transfer API ships) and flags the domain transfer_requested.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destination":{"type":"string","maxLength":500,"description":"Where you want to transfer the domain."},"notes":{"type":"string","maxLength":2000}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/domains/{id}/verify":{"post":{"summary":"Verify a custom domain","tags":["Domains"],"description":"Checks that the hostname resolves to platform_ip (following any CNAME/ALIAS chain, e.g. one pointed at cname_target); on success marks it verified and provisions TLS. 400 with resolved_ips/expected_ip if DNS is not pointed yet. Idempotent.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"status":{"type":"string"},"serve_www":{"type":"boolean"}},"required":["id","hostname","status","serve_www"],"additionalProperties":false},"www_ok":{"type":"boolean","nullable":true}},"required":["domain","www_ok"],"additionalProperties":false}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/domains/{id}":{"delete":{"summary":"Remove a custom domain","tags":["Domains"],"description":"Detaches a hostname from the project and rebuilds the TLS routing. Returns 204. Does not deregister a Canner-purchased domain — use transfer-request for that.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Update a custom domain","tags":["Domains"],"description":"Toggles whether www.<hostname> is served (301-redirected to the apex). For Canner-purchased domains the www DNS record is managed automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"serve_www":{"type":"boolean"}},"required":["serve_www"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"status":{"type":"string","description":"pending | verified | failed | transfer_requested"},"verified_at":{"type":"string","format":"date-time","nullable":true},"last_check_at":{"type":"string","format":"date-time","nullable":true},"last_check_error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"account_owned_domain_id":{"type":"string","nullable":true,"description":"Set when Canner registered the domain (vs bring-your-own)."},"serve_www":{"type":"boolean","description":"Whether www.<hostname> 301-redirects to the apex."},"expires_at":{"type":"string","format":"date-time","nullable":true},"auto_renew":{"type":"boolean","nullable":true},"transfer_requested_at":{"type":"string","format":"date-time","nullable":true},"on_legacy_ip_since":{"type":"string","format":"date-time","nullable":true,"description":"Set when this verified BYOD domain still resolves to one of LEGACY_PLATFORM_IPS — served via the old box's reverse-proxy fallback, not the platform directly. Null once repointed."},"challenge_delegated":{"type":"boolean","description":"The optional _acme-challenge CNAME is in place, so the certificate is issued by the DNS challenge (works behind a proxy)."},"acme_optional":{"type":"boolean","description":"True when the certificate record is optional (any domain except a wildcard)."},"dns_conflict":{"type":"string","nullable":true,"description":"A CNAME target found next to the A record for this name (DNS forbids the pairing; some networks follow it to a host with no certificate). Warning only."},"cname_target":{"type":"string","description":"Preferred DNS target for this domain's own project: point a subdomain hostname here with a CNAME (or an apex hostname here with an ALIAS/ANAME record). Survives future PLATFORM_IP changes with no customer action."},"project_id":{"type":"string"},"project_slug":{"type":"string"},"project_name":{"type":"string"},"acme_cname":{"type":"object","properties":{"name":{"type":"string"},"target":{"type":"string"}},"required":["name","target"],"additionalProperties":false,"nullable":true,"description":"Wildcard domains only: the _acme-challenge CNAME to add so Canner can issue and renew the wildcard certificate. Keep it in place."}},"required":["id","hostname","status","verified_at","last_check_at","last_check_error","created_at","account_owned_domain_id","expires_at","auto_renew","transfer_requested_at","on_legacy_ip_since"],"additionalProperties":true}},"required":["domain"],"additionalProperties":false}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/domains/{id}/dns":{"get":{"summary":"List DNS records","tags":["Domains"],"description":"Lists the DNS records for a Canner-registered domain (hosted in Cloudflare). 404 for bring-your-own domains, which you manage at your own DNS provider.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a DNS record","tags":["Domains"],"description":"Adds a DNS record (A/AAAA/CNAME/TXT/MX/NS) to a Canner-registered domain. Records are grey-cloud (DNS only).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["A","AAAA","CNAME","TXT","MX","NS"]},"name":{"type":"string","maxLength":253,"default":"@"},"content":{"type":"string","minLength":1,"maxLength":2048},"ttl":{"type":"integer","default":1},"priority":{"type":"integer","minimum":0,"maximum":65535}},"required":["type","content"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/domains/{id}/dns/{recordId}":{"patch":{"summary":"Update a DNS record","tags":["Domains"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["A","AAAA","CNAME","TXT","MX","NS"]},"name":{"type":"string","maxLength":253,"default":"@"},"content":{"type":"string","minLength":1,"maxLength":2048},"ttl":{"type":"integer","default":1},"priority":{"type":"integer","minimum":0,"maximum":65535}},"required":["type","content"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"recordId","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Delete a DNS record","tags":["Domains"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"recordId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/domains/{id}/registrar":{"get":{"summary":"Get registrar settings","tags":["Domains"],"description":"Nameservers, auto-renew state, expiry, and which controls are editable for a Canner-registered domain.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/domains/{id}/nameservers":{"put":{"summary":"Set nameservers","tags":["Domains"],"description":"Repoints a Canner-registered domain to custom nameservers. Not available for Cloudflare-registered domains (locked to Cloudflare DNS). Pointing away from Cloudflare disables Canner-hosted DNS records for the domain.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"nameservers":{"type":"array","items":{"type":"string","minLength":3,"maxLength":253},"minItems":2,"maxItems":13}},"required":["nameservers"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/domains/{id}/auto-renew":{"patch":{"summary":"Toggle auto-renew","tags":["Domains"],"description":"Enables or disables automatic renewal for a Canner-registered domain.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"auto_renew":{"type":"boolean"}},"required":["auto_renew"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/tokens":{"get":{"summary":"List API tokens","tags":["API tokens"],"description":"Returns metadata for your non-revoked API tokens, newest first. Secrets are never returned after creation.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"tokens":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Token id (use with DELETE to revoke)."},"name":{"type":"string"},"prefix":{"type":"string","description":"First 12 chars (cnr_ + 8 hex) — identifies the token without exposing it."},"scopes":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Grants, or null for a full-access token."},"last_used_at":{"type":"string","format":"date-time","nullable":true,"description":"When the token last authenticated a request, or null."},"expires_at":{"type":"string","format":"date-time","nullable":true,"description":"When the token stops working, or null if it never expires."},"projects":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Slugs of the projects the token is restricted to, or null for an organization-wide token."},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","prefix","scopes","last_used_at","expires_at","projects","created_at"],"additionalProperties":false,"description":"API token metadata. The secret itself is only returned once, at creation."}}},"required":["tokens"],"additionalProperties":false}}}}}},"post":{"summary":"Create an API token","tags":["API tokens"],"description":"Creates a new token and returns its plaintext secret. The secret is shown only in this response — store it immediately. The token acts on your organization's resources. Pass `scopes` to constrain it (e.g. an MCP connector token); omit for full access.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"A human-readable label, e.g. \"github-actions\"."},"scopes":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":20,"description":"Optional grants like \"projects:write\". Omit for a full-access token. See /docs for the vocabulary."},"expires_in_days":{"type":"integer","minimum":1,"maximum":365,"description":"The token stops working this many days from now (1 to 365). Omit for a token that never expires."},"project_slugs":{"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"minItems":1,"maxItems":50,"description":"Restrict the token to these projects of your organization: it can then act only inside them (no other project, billing, domains, users, tokens or MCP). Omit for an organization-wide token, the default."}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"A newly created token, including its one-time plaintext secret.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"},"nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"projects":{"type":"array","items":{"type":"string"},"nullable":true},"created_at":{"type":"string","format":"date-time"},"token":{"type":"string","description":"The plaintext secret (cnr_…). Shown ONCE — copy it now; it cannot be retrieved later."}},"required":["id","name","prefix","scopes","expires_at","projects","created_at","token"],"additionalProperties":false,"description":"A newly created token, including its one-time plaintext secret."}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/tokens/{id}":{"delete":{"summary":"Revoke an API token","tags":["API tokens"],"description":"Soft-revokes a token. Requests using it afterward return 401. Returns 204 on success, 404 if the token does not exist or is already revoked.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Token id from the list endpoint."}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/upload":{"options":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Upload project source","tags":["Uploads"],"description":"Uploads a .zip or .tar.gz of the project source as multipart/form-data (one file field) and enqueues a build. Size is clamped to the plan upload cap; a per-organization rate cap (10/hour) applies. Returns the new deployment id.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deployment_id":{"type":"string"},"status":{"type":"string"},"archive_kind":{"type":"string","description":"\"zip\" or \"tar\""},"max_upload_mb":{"type":"number"}},"required":["deployment_id","status","archive_kind","max_upload_mb"],"additionalProperties":false}}}},"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"413":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"415":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"429":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/uploads/ticket":{"post":{"responses":{"200":{"description":"Default Response"}}}},"/v1/data-workshop/databases":{"get":{"summary":"List project databases","tags":["Data Workshop"],"description":"Lists the Postgres databases of projects the caller can access. Each is a Data Workshop source of type \"postgres\".","responses":{"200":{"description":"Default Response"}}}},"/v1/data-workshop/databases/{slug}":{"get":{"summary":"Get a project database","tags":["Data Workshop"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/data-workshop/databases/{slug}/tables":{"get":{"summary":"List database tables","tags":["Data Workshop"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/data-workshop/databases/{slug}/tables/{name}/preview":{"get":{"summary":"Preview a database table","tags":["Data Workshop"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"schema","required":false},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"name","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/data-workshop/databases/{slug}/query":{"post":{"summary":"Run SQL against a project database","tags":["Data Workshop"],"description":"Runs SQL against the project Postgres database. read_only (default true) runs in a READ ONLY transaction; set false to allow writes/DDL. No row cap — bounded by the plan statement timeout and cancellation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sql":{"type":"string","minLength":1,"maxLength":100000},"read_only":{"type":"boolean","default":true}},"required":["sql"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/data-workshop/queries/{id}/cancel":{"post":{"summary":"Cancel a running query","tags":["Data Workshop"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/data-workshop/saved-queries":{"get":{"summary":"List saved queries","tags":["Data Workshop"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"dataset_slug","required":false},{"schema":{"type":"string"},"in":"query","name":"database_slug","required":false}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Save a query","tags":["Data Workshop"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"sql":{"type":"string","minLength":1,"maxLength":100000},"dataset_slug":{"type":"string"},"database_slug":{"type":"string"}},"required":["name","sql"],"additionalProperties":false}}}},"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/data-workshop/saved-queries/{id}":{"patch":{"summary":"Update a saved query","tags":["Data Workshop"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"sql":{"type":"string","minLength":1,"maxLength":100000}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"400":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Delete a saved query","tags":["Data Workshop"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/organization":{"get":{"summary":"Get your organization","tags":["Organization"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"plan":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"your_role":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"projects_all":{"type":"string","nullable":true},"areas":{"type":"object","additionalProperties":{"type":"string"}},"project_count":{"type":"number"},"created_at":{"type":"string","format":"date-time"}},"required":["account_id","email","role","projects_all","areas","project_count","created_at"],"additionalProperties":false}},"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}},"required":["id","email","role","status","created_at","expires_at"],"additionalProperties":false}},"seats":{"type":"object","properties":{"used":{"type":"number"},"included":{"type":"number","nullable":true},"unlimited":{"type":"boolean"}},"required":["used","included","unlimited"],"additionalProperties":false},"resources":{"type":"object","properties":{"projects":{"type":"number"},"domains":{"type":"number"},"auth_apps":{"type":"number"},"datasets":{"type":"number"}},"required":["projects","domains","auth_apps","datasets"],"additionalProperties":false}},"required":["id","name","slug","type","plan","created_at","your_role","members","invitations","seats","resources"],"additionalProperties":false}},"required":["organization"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"patch":{"summary":"Rename your organization","tags":["Organization"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"required":["organization"],"additionalProperties":false}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/organization/security":{"get":{"summary":"Organization sign-in security","tags":["Organization"],"description":"Whether passkeys are required for every user, and which users have no passkey yet.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":true}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"put":{"summary":"Require a passkey for every user (option)","tags":["Organization"],"description":"Turning it on needs your own session to have used a passkey (409 passkey_session_required otherwise). Turning it off is always allowed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"require_passkey":{"type":"boolean"}},"required":["require_passkey"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":true}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/organization/invitations":{"post":{"summary":"Invite a user","tags":["Organization"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":254}},"required":["email"]},{"type":"object","properties":{"role":{"type":"string","enum":["admin","member"]},"projects_all":{"type":"string","enum":["view","edit"],"nullable":true,"default":null},"areas":{"type":"object","additionalProperties":{"type":"string","enum":["view","edit"]},"default":{}},"projects":{"type":"object","additionalProperties":{"type":"string","enum":["view","edit"]},"default":{}}},"required":["role"]}]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}},"required":["id","email","role","status","created_at","expires_at"],"additionalProperties":false}},"required":["invitation"],"additionalProperties":false}}}},"402":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/organization/invitations/{id}":{"delete":{"summary":"Revoke an invitation","tags":["Organization"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/organization/members/{accountId}":{"patch":{"summary":"Update a user","tags":["Organization"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","member"]},"projects_all":{"type":"string","enum":["view","edit"],"nullable":true,"default":null},"areas":{"type":"object","additionalProperties":{"type":"string","enum":["view","edit"]},"default":{}},"projects":{"type":"object","additionalProperties":{"type":"string","enum":["view","edit"]},"default":{}}},"required":["role"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"accountId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"delete":{"summary":"Remove a user","tags":["Organization"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"accountId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"403":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/storage-credentials":{"get":{"summary":"List storage credentials","tags":["Object storage"],"description":"Returns metadata for this project’s non-revoked S3 credentials, newest first. Secrets are never returned after creation.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"credentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"access_key_id":{"type":"string"},"label":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"endpoint":{"type":"string","description":"S3-compatible endpoint URL."},"bucket":{"type":"string"},"region":{"type":"string","description":"Placeholder required by most S3 SDKs; MinIO does not use it."}},"required":["id","access_key_id","label","created_at","endpoint","bucket","region"],"additionalProperties":false,"description":"Storage credential metadata, including its (non-secret) connection details. The secret itself is only ever returned once, at creation or rotation — everything else here stays retrievable so a customer never loses track of how to reconnect, only the one thing that can't be shown again."}}},"required":["credentials"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"post":{"summary":"Create a storage credential","tags":["Object storage"],"description":"Issues a new S3-compatible access key/secret pair scoped to this project only — it cannot read, write, or delete objects belonging to any other project. Returns the plaintext secret once; store it immediately.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","maxLength":100,"description":"Optional friendly name, e.g. \"prod worker\"."}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"201":{"description":"A newly issued (or rotated) storage credential, including its one-time plaintext secret.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"access_key_id":{"type":"string"},"secret_access_key":{"type":"string","description":"The plaintext secret. Shown ONCE — copy it now; it cannot be retrieved later."},"endpoint":{"type":"string","description":"S3-compatible endpoint URL."},"bucket":{"type":"string"},"region":{"type":"string","description":"Placeholder required by most S3 SDKs; MinIO does not use it."},"label":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","access_key_id","secret_access_key","endpoint","bucket","region","label","created_at"],"additionalProperties":false,"description":"A newly issued (or rotated) storage credential, including its one-time plaintext secret."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/storage-credentials/{id}/rotate":{"post":{"summary":"Rotate a storage credential","tags":["Object storage"],"description":"Revokes the existing credential and issues a new one in its place, keeping the same label. The old secret stops working immediately; the new plaintext secret is returned once.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"A newly issued (or rotated) storage credential, including its one-time plaintext secret.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"access_key_id":{"type":"string"},"secret_access_key":{"type":"string","description":"The plaintext secret. Shown ONCE — copy it now; it cannot be retrieved later."},"endpoint":{"type":"string","description":"S3-compatible endpoint URL."},"bucket":{"type":"string"},"region":{"type":"string","description":"Placeholder required by most S3 SDKs; MinIO does not use it."},"label":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","access_key_id","secret_access_key","endpoint","bucket","region","label","created_at"],"additionalProperties":false,"description":"A newly issued (or rotated) storage credential, including its one-time plaintext secret."}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}},"/v1/projects/{slug}/storage-credentials/{id}":{"delete":{"summary":"Revoke a storage credential","tags":["Object storage"],"description":"Revokes a credential immediately. Requests using it afterward are rejected by MinIO. Returns 204 on success, 404 if it does not exist or is already revoked.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/projects/{slug}/storage/own-bucket":{"get":{"summary":"Own bucket: current state","tags":["Object storage"],"description":"Whether the project keeps its files in a bucket of its own, the bucket in use, and whether it can switch now.","parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"bucket":{"type":"string","description":"The bucket this project's files and credentials use now."},"can_switch":{"type":"boolean"},"blocked_by":{"type":"string","enum":["files","credentials"],"nullable":true,"description":"Why switching is not possible right now, if it isn't."}},"required":["enabled","bucket","can_switch","blocked_by"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}},"put":{"summary":"Own bucket: switch on or off","tags":["Object storage"],"description":"Moves the project between a \"<slug>/\" folder in the organization's bucket and a bucket of its own (for apps such as Rails Active Storage that write at the bucket root). Only while the project has no files and no active storage credentials; 409 says which. Create credentials after switching.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"slug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"bucket":{"type":"string","description":"The bucket this project's files and credentials use now."},"can_switch":{"type":"boolean"},"blocked_by":{"type":"string","enum":["files","credentials"],"nullable":true,"description":"Why switching is not possible right now, if it isn't."}},"required":["enabled","bucket","can_switch","blocked_by"],"additionalProperties":false}}}},"404":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}},"409":{"description":"Standard error response.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Stable, machine-readable error code, e.g. \"not_found\"."},"message":{"type":"string","description":"Human-readable explanation."},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},"description":"Field-level validation problems (on 400 invalid_input)."},"request_id":{"type":"string","description":"Quote this when contacting support."}},"required":["error"],"additionalProperties":true,"description":"Standard error response."}}}}}}}},"servers":[{"url":"https://api.canner.ca","description":"Production"}],"security":[{"bearerToken":[]}],"tags":[{"name":"Projects","description":"Create, inspect, update, and tear down projects."},{"name":"Deployments","description":"Trigger, inspect, retry, cancel, and roll back deployments."},{"name":"Environment variables","description":"Per-project build and runtime environment variables."},{"name":"Databases","description":"Per-project managed Postgres databases."},{"name":"Data Workshop","description":"Browse and query project databases (and saved queries) from Data Workshop."},{"name":"Domains","description":"Custom domains and domain registration."},{"name":"Billing","description":"Plan, subscription, and payment status."},{"name":"API tokens","description":"Manage the tokens used to authenticate against this API."},{"name":"Uploads","description":"Deploy by uploading a project archive."}]}