Skip to main content

Get a table's schema

Read a table’s columns and row count without downloading its data.

GET /projects/:projectid/databases/:dbid/tables/:tblid

Authentication​

Send the project API key in the Authorization header, without a Bearer prefix. Requires databases.read for the database in the URL.

Request​

tblid is the table name. No request body.

Example​

Use the environment variables from the database overview. Replace example IDs with your own.

curl --include --request GET \
--header "Authorization: ${INTELLECTIBLE_PROJECT_API_KEY}" \
"${INTELLECTIBLE_PUBLIC_API_URL}/projects/${INTELLECTIBLE_PROJECT_ID}/databases/${INTELLECTIBLE_DATABASE_ID}/tables/${INTELLECTIBLE_TABLE_ID}"

Response​

200 OK

{
"table": "customers",
"columns": [
{
"name": "intellectible_id",
"type": "text",
"udt_name": "text",
"isUnique": true
},
{
"name": "customer_name",
"type": "text",
"udt_name": "text",
"isUnique": false
}
],
"rowCount": 2
}
FieldDescription
tableRequested table name.
columnsColumn metadata: name, PostgreSQL type, underlying udt_name, and isUnique.
rowCountRow count; large tables may use a PostgreSQL estimate.

The response does not include rows, index definitions, defaults, or a complete SQL schema. Use Read rows for data.

See Errors and safe retries for shared failure handling.