CapyDB Docs
ReferenceAPI

Studio

SQL console and table data browser/editor.

POST
/v1/projects/{projectID}/sql

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/sql" \  -H "Content-Type: application/json" \  -d '{    "query": "string"  }'
{  "result": {    "columns": [      "string"    ],    "duration_ms": 0,    "rows": [      {}    ],    "row_count": 0,    "truncated": true  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
GET
/v1/projects/{projectID}/tables

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/tables"
{  "tables": [    {      "schema": "string",      "table": "string",      "type": "string"    }  ]}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
GET
/v1/projects/{projectID}/tables/{schema}/{table}/rows

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.

schema*string

Database schema name.

table*string

Table name.

Query Parameters

limit?integer

Maximum number of rows to return.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/projects/string/tables/string/string/rows"
{  "result": {    "columns": [      "string"    ],    "rows": [      {}    ]  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
POST
/v1/projects/{projectID}/tables/{schema}/{table}/rows

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.

schema*string

Database schema name.

table*string

Table name.

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/tables/string/string/rows" \  -H "Content-Type: application/json" \  -d '{}'
{  "result": {    "rows_affected": 0,    "rows": [      {}    ]  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
PATCH
/v1/projects/{projectID}/tables/{schema}/{table}/rows

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.

schema*string

Database schema name.

table*string

Table name.

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/tables/string/string/rows" \  -H "Content-Type: application/json" \  -d '{}'
{  "result": {    "rows_affected": 0,    "rows": [      {}    ]  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
DELETE
/v1/projects/{projectID}/tables/{schema}/{table}/rows

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.

schema*string

Database schema name.

table*string

Table name.

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 DELETE "https://example.com/v1/projects/string/tables/string/string/rows" \  -H "Content-Type: application/json" \  -d '{}'
{  "result": {    "rows_affected": 0,    "rows": [      {}    ]  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
GET
/v1/projects/{projectID}/tables/{schema}/{table}/columns

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.

schema*string

Database schema name.

table*string

Table name.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/projects/string/tables/string/string/columns"
{  "columns": [    {      "data_type": "string",      "default": "string",      "is_nullable": true,      "is_primary_key": true,      "name": "string",      "position": 0    }  ]}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
GET
/v1/projects/{projectID}/sql/history

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.

Query Parameters

limit?integer

Maximum number of history entries to return (default 50).

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/projects/string/sql/history"
{  "history": [    {      "actor_id": "string",      "actor_kind": "string",      "created_at": "2019-08-24T14:15:22Z",      "duration_ms": 0,      "error": "string",      "id": "string",      "organization_id": "string",      "project_id": "string",      "query": "string",      "row_count": 0,      "success": true    }  ]}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}