CapyDB Docs
ReferenceAPI

Projects

Project (logical database) lifecycle.

GET
/v1/projects

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Query Parameters

organization_id?string

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": [    {      "cluster_id": "string",      "created_at": "2019-08-24T14:15:22Z",      "database_name": "string",      "direct_port": 0,      "environment": "string",      "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,      "public_host": "string",      "region": "string",      "role_name": "string",      "slug": "string",      "ssl_mode": "string",      "state": "string",      "statement_timeout": "string",      "storage_limit_bytes": 0,      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
POST
/v1/projects

Authorization

AuthorizationBearer <token>

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",    "cluster_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",    "retry_classification": "string",    "started_at": "2019-08-24T14:15:22Z",    "state": "pending",    "type": "string",    "updated_at": "2019-08-24T14:15:22Z"  },  "project": {    "cluster_id": "string",    "created_at": "2019-08-24T14:15:22Z",    "database_name": "string",    "direct_port": 0,    "environment": "string",    "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,    "public_host": "string",    "region": "string",    "role_name": "string",    "slug": "string",    "ssl_mode": "string",    "state": "string",    "statement_timeout": "string",    "storage_limit_bytes": 0,    "updated_at": "2019-08-24T14:15:22Z"  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
GET
/v1/projects/{projectID}

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

projectID*string

Project id.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/projects/string"
{  "project": {    "cluster_id": "string",    "created_at": "2019-08-24T14:15:22Z",    "database_name": "string",    "direct_port": 0,    "environment": "string",    "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,    "public_host": "string",    "region": "string",    "role_name": "string",    "slug": "string",    "ssl_mode": "string",    "state": "string",    "statement_timeout": "string",    "storage_limit_bytes": 0,    "updated_at": "2019-08-24T14:15:22Z"  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
PATCH
/v1/projects/{projectID}

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

projectID*string

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": {    "cluster_id": "string",    "created_at": "2019-08-24T14:15:22Z",    "database_name": "string",    "direct_port": 0,    "environment": "string",    "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,    "public_host": "string",    "region": "string",    "role_name": "string",    "slug": "string",    "ssl_mode": "string",    "state": "string",    "statement_timeout": "string",    "storage_limit_bytes": 0,    "updated_at": "2019-08-24T14:15:22Z"  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
DELETE
/v1/projects/{projectID}

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

projectID*string

Project id.

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",    "cluster_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",    "retry_classification": "string",    "started_at": "2019-08-24T14:15:22Z",    "state": "pending",    "type": "string",    "updated_at": "2019-08-24T14:15:22Z"  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
GET
/v1/projects/{projectID}/extensions

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

projectID*string

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",      "trusted": true    }  ]}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
POST
/v1/projects/{projectID}/extensions

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

projectID*string

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",    "cluster_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",    "retry_classification": "string",    "started_at": "2019-08-24T14:15:22Z",    "state": "pending",    "type": "string",    "updated_at": "2019-08-24T14:15:22Z"  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
DELETE
/v1/projects/{projectID}/extensions/{name}

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

projectID*string

Project id.

name*string

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",    "cluster_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",    "retry_classification": "string",    "started_at": "2019-08-24T14:15:22Z",    "state": "pending",    "type": "string",    "updated_at": "2019-08-24T14:15:22Z"  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}