Projects
Project (logical database) lifecycle.
Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Query Parameters
Organization to list projects for (platform admins; org principals are always scoped to their own organization).
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects"{ "projects": [ { "primary_instance_id": "string", "created_at": "2019-08-24T14:15:22Z", "database_name": "string", "direct_port": 0, "environment": "production", "id": "string", "idle_transaction_timeout": "string", "last_error": "string", "latest_job_id": "string", "max_connections": 0, "name": "string", "organization_id": "string", "plan": "string", "pooled_port": 0, "postgres_version": "string", "public_host": "string", "region": "string", "role_name": "string", "runtime_status": "active", "slug": "string", "ssl_mode": "string", "state": "provisioning", "statement_timeout": "string", "storage_limit_bytes": 0, "updated_at": "2019-08-24T14:15:22Z" } ]}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }, "project": { "primary_instance_id": "string", "created_at": "2019-08-24T14:15:22Z", "database_name": "string", "direct_port": 0, "environment": "production", "id": "string", "idle_transaction_timeout": "string", "last_error": "string", "latest_job_id": "string", "max_connections": 0, "name": "string", "organization_id": "string", "plan": "string", "pooled_port": 0, "postgres_version": "string", "public_host": "string", "region": "string", "role_name": "string", "runtime_status": "active", "slug": "string", "ssl_mode": "string", "state": "provisioning", "statement_timeout": "string", "storage_limit_bytes": 0, "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects/string"{ "project": { "primary_instance_id": "string", "created_at": "2019-08-24T14:15:22Z", "database_name": "string", "direct_port": 0, "environment": "production", "id": "string", "idle_transaction_timeout": "string", "last_error": "string", "latest_job_id": "string", "max_connections": 0, "name": "string", "organization_id": "string", "plan": "string", "pooled_port": 0, "postgres_version": "string", "public_host": "string", "region": "string", "role_name": "string", "runtime_status": "active", "slug": "string", "ssl_mode": "string", "state": "provisioning", "statement_timeout": "string", "storage_limit_bytes": 0, "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/v1/projects/string" \ -H "Content-Type: application/json" \ -d '{}'{ "project": { "primary_instance_id": "string", "created_at": "2019-08-24T14:15:22Z", "database_name": "string", "direct_port": 0, "environment": "production", "id": "string", "idle_transaction_timeout": "string", "last_error": "string", "latest_job_id": "string", "max_connections": 0, "name": "string", "organization_id": "string", "plan": "string", "pooled_port": 0, "postgres_version": "string", "public_host": "string", "region": "string", "role_name": "string", "runtime_status": "active", "slug": "string", "ssl_mode": "string", "state": "provisioning", "statement_timeout": "string", "storage_limit_bytes": 0, "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Query Parameters
Required (true) when deleting a production-environment project. Acknowledges permanent deletion of the live database.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/v1/projects/string"{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects/string/extensions"{ "extensions": [ { "default_version": "string", "description": "string", "enabled": true, "name": "postgis", "requires_restart": true, "trusted": true, "installed_version": "string", "available_version": "string", "update_available": true } ]}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/extensions" \ -H "Content-Type: application/json" \ -d '{ "name": "postgis" }'{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Postgres extension name.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/v1/projects/string/extensions/string"{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Postgres extension name.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/extensions/string/update"{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Query Parameters
Restart even while sessions are active. Administrators only.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/upgrade/minor"{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Query Parameters
PostgreSQL major to evaluate, e.g. 18.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/upgrade/major/preflight?target_major=0"{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Query Parameters
PostgreSQL major to upgrade to, e.g. 18.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/upgrade/major?target_major=0"{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/upgrade/major/confirm"{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/upgrade/major/rollback"{ "job": { "attempts": 0, "claimed_at": "2019-08-24T14:15:22Z", "claimed_by": "string", "host_id": "string", "instance_id": "string", "completed_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "error": "string", "id": "string", "last_exit_code": 0, "last_stderr": "string", "last_stdout": "string", "locked_resource": "string", "max_attempts": 0, "organization_id": "string", "preview_database_id": "string", "project_id": "string", "result": null, "retry_classification": "string", "started_at": "2019-08-24T14:15:22Z", "state": "pending", "type": "project.apply_plan", "updated_at": "2019-08-24T14:15:22Z" }}