For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
LoginBook a Demo
  • Getting Started
    • Athena SDK Quickstart
  • Database API
    • Database Filters & CRUD
  • Python Guides
    • Build with Agents
    • Use Models Directly
    • Load Data Frames
    • Upload Files
    • Create Assets
    • Structured Output
    • Long-Running AOP Execution
  • TypeScript Guides
    • Build with Agents
    • Working with Assets
    • Use Models Directly
    • Execute AOPs
    • Sheets API
    • Browser JavaScript (ESM)
    • UI Registry (Assistant.js)
    • Upload Files
    • Create Assets
    • Structured Output
  • API Reference
      • GETCheck database status
      • GETList tables in database
      • GETRead rows from database table
      • POSTInsert rows into database table
      • DELDelete rows from database table
      • PATCHUpdate rows in database table
      • GETGet table schema (columns and types)
      • POSTExecute SQL against database
Logo
LoginBook a Demo
API ReferenceDatabases

Get table schema (columns and types)

Beta
GET
https://api.athenaintel.com/api/v0/databases/:asset_id/schema/:table_name
GET
/api/v0/databases/:asset_id/schema/:table_name
$curl https://api.athenaintel.com/api/v0/databases/asset_id/schema/table_name \
> -H "X-API-KEY: <apiKey>"
1{
2 "columns": [
3 {
4 "data_type": "integer",
5 "is_nullable": false,
6 "name": "id",
7 "default_value": "nextval('users_id_seq'::regclass)"
8 },
9 {
10 "data_type": "character varying",
11 "is_nullable": true,
12 "name": "name",
13 "max_length": 255
14 },
15 {
16 "data_type": "character varying",
17 "is_nullable": false,
18 "name": "email",
19 "max_length": 255
20 },
21 {
22 "data_type": "timestamp with time zone",
23 "is_nullable": false,
24 "name": "created_at",
25 "default_value": "now()"
26 }
27 ],
28 "table_name": "users",
29 "schema": "public"
30}
Get the schema for a specific table, including column names, types, nullability, and default values. Useful for agent tooling and dynamic form generation.
Was this page helpful?
Previous

Execute SQL against database

Next
Built with

Authentication

X-API-KEYstring
API Key authentication via header
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

asset_idstringRequired
table_namestringRequired

Response

Successful Response
columnslist of objects
List of columns with their types and constraints
table_namestring
Name of the table
schemastringDefaults to public
Schema containing the table

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
501
Not Implemented Error
503
Service Unavailable Error