The branch's generated types for a secret key role
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 In: header
Path Parameters
Database id
uuidBranch id
uuidQuery Parameters
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.
ts (the default): the TypeScript module (db.ts). json: the runtime types map
alone.
Value in
- "ts"
- "json"
Generate this Postgres database (not the main one) as Database. It must be served by
the data API. Not with all_databases.
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"{}The branch's schema as the data API sees it GET
Previous Page
Change a Postgres database's default schema PATCH
Stores the schema a data API request to this database uses when it names none. On a served database the bootstrap re-runs for the new schema (so default privileges cover it) before the answer, and the data API picks the change up at once. Objects already in the new schema get the data API grants only with `grant_existing: true`; that flag with an unchanged schema grants on its existing objects now.