Chelabase
ManagementData api

The branch's generated types for a secret key role

GET
/v1/databases/{id}/branches/{branch_id}/data-api/types

What GET /data/v1/types serves a secret key of role on this branch (with no database list), byte for byte: the TypeScript module db.ts (Database and the runtime types map for @chelabase/client), or with format=json the types map alone. Studio's Download types. You may call it when you pass createKey's checks on the caller and the role: Developer access on the branch, not a personal login's role, and a role you may use. Its all-rows exposure check (exposes_data_api) does not apply, since types expose the schema and never rows. The ETag is the body's hash: send it back as If-None-Match for a 304 while the schema is unchanged. Not cached (Cache-Control: no-store).

Authorization

bearer
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Database id

Formatuuid
branch_id*string

Branch id

Formatuuid

Query Parameters

role?string

The secret key role whose types to generate; authenticated (a new key's default) when absent. You must be allowed to create a secret key for it.

format?string

ts (the default): the TypeScript module (db.ts). json: the runtime types map alone.

Value in

  • "ts"
  • "json"
database?string

Generate this Postgres database (not the main one) as Database. It must be served by the data API. Not with all_databases.

all_databases?boolean

true: every database the data API serves on the branch, as Databases and a types map keyed by name (main as main).

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/databases/497f6eca-6276-4993-bfeb-53cbbbba6f08/branches/497f6eca-6276-4993-bfeb-53cbbbba6f08/data-api/types"
{}