Skip to main content

Get a table's schema

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

Columns and row count.

Returns the table's columns and how many rows it holds. The rows themselves come from Read rows.

Authentication

  • Project API key: The credential for everything external. Created in Project Settings, bound to one project, and limited to the scopes it was granted. Format: proj.<keyId>.<secret>.
  • Required permission: databases.read on :dbid.

Path parameters

NameTypeRequiredDefaultDescription
projectidstringYes-The project id.
dbidstringYes-The database id.
tblidstringYes-The table name.

Example request

curl -X GET \
-H "Authorization: proj.KEY_ID.SECRET" \
{{BASE_URL}}/projects/{{PROJECT_ID}}/databases/DATABASE_ID/tables/orders

Responses

200

The table's schema.

{
"table": "orders",
"columns": [
{
"name": "intellectible_id",
"type": "text",
"udt_name": "text",
"isUnique": true
},
{
"name": "total",
"type": "numeric",
"udt_name": "numeric",
"isUnique": false
}
],
"rowCount": 1842
}

404

No such table.