Schema
Database schema introspection and type generation.
AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
projectID*stringProject id.
Database schema.
application/json- response
schema*Canonical schema document produced by one introspection pass; the contract behind capydb generate, the MCP get_schema tool and schema diffing.
curl -X GET 'https://capydb.dev/api/capydb/v1/projects/string/schema'{ "schema": { "database_name": "string", "extensions": [ { "name": "string", "version": "string" } ], "postgres_version": "string", "schemas": [ { "enums": [ { "comment": "string", "name": "string", "values": [ "string" ] } ], "name": "string", "tables": [ { "columns": [ { "array_dims": 0, "comment": "string", "data_type": "string", "default": "string", "generated": "stored", "identity": "always", "is_array": true, "is_enum": true, "is_generated": true, "is_nullable": true, "name": "string", "position": 0, "udt_name": "string", "udt_schema": "string" } ], "comment": "string", "foreign_keys": [ { "columns": [ "string" ], "name": "string", "on_delete": "string", "on_update": "string", "referenced_columns": [ "string" ], "referenced_schema": "string", "referenced_table": "string" } ], "kind": "table", "name": "string", "primary_key": [ "string" ], "unique_constraints": [ { "columns": [ "string" ], "name": "string" } ] } ] } ] }}AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
projectID*stringProject id.
language?stringOutput language. Defaults to typescript.
"typescript""typescript""zod""drizzle""go""python"style?stringOutput shape. For language=typescript: capydb (per-table interfaces, driver-accurate types, the default) or supabase (a Database generic compatible with supabase-js and ported projects). For language=python: dataclass (standard-library frozen dataclasses, the default) or pydantic (pydantic v2 models). Ignored by the other languages.
"capydb""supabase""dataclass""pydantic"package?stringGo package clause for language=go (default db). Must be a valid Go package name. Ignored by the other languages.
"db"Generated source file.
application/json- response
types*curl -X GET 'https://capydb.dev/api/capydb/v1/projects/string/schema/types'{ "types": { "content": "string", "filename": "string", "language": "typescript", "style": "capydb" }}AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
projectID*stringProject id.
Lint report.
application/json- response
lint*curl -X GET 'https://capydb.dev/api/capydb/v1/projects/string/lint'{ "lint": { "findings": [ { "fix": "string", "message": "string", "object": "string", "rule": "missing_primary_key", "severity": "warning" } ], "skipped": [ "string" ] }}AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
previewID*stringPreview database id.
Database schema.
application/json- response
schema*Canonical schema document produced by one introspection pass; the contract behind capydb generate, the MCP get_schema tool and schema diffing.
curl -X GET 'https://capydb.dev/api/capydb/v1/preview-databases/string/schema'{ "schema": { "database_name": "string", "extensions": [ { "name": "string", "version": "string" } ], "postgres_version": "string", "schemas": [ { "enums": [ { "comment": "string", "name": "string", "values": [ "string" ] } ], "name": "string", "tables": [ { "columns": [ { "array_dims": 0, "comment": "string", "data_type": "string", "default": "string", "generated": "stored", "identity": "always", "is_array": true, "is_enum": true, "is_generated": true, "is_nullable": true, "name": "string", "position": 0, "udt_name": "string", "udt_schema": "string" } ], "comment": "string", "foreign_keys": [ { "columns": [ "string" ], "name": "string", "on_delete": "string", "on_update": "string", "referenced_columns": [ "string" ], "referenced_schema": "string", "referenced_table": "string" } ], "kind": "table", "name": "string", "primary_key": [ "string" ], "unique_constraints": [ { "columns": [ "string" ], "name": "string" } ] } ] } ] }}AuthorizationBearer <token>Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
previewID*stringPreview database id.
language?stringOutput language. Defaults to typescript.
"typescript""typescript""zod""drizzle""go""python"style?stringOutput shape. For language=typescript: capydb (per-table interfaces, driver-accurate types, the default) or supabase (a Database generic compatible with supabase-js and ported projects). For language=python: dataclass (standard-library frozen dataclasses, the default) or pydantic (pydantic v2 models). Ignored by the other languages.
"capydb""supabase""dataclass""pydantic"package?stringGo package clause for language=go (default db). Must be a valid Go package name. Ignored by the other languages.
"db"Generated source file.
application/json- response
types*curl -X GET 'https://capydb.dev/api/capydb/v1/preview-databases/string/schema/types'{ "types": { "content": "string", "filename": "string", "language": "typescript", "style": "capydb" }}