Tables

List every table in the connected database's public schema that passes the configured allow-list, together with its display name and an estimated row count.

Request

GET /api/tables

No path parameters, no query parameters, no request body.

Response

200 OK. A JSON object with a single tables array. Each entry describes one visible table.

FieldTypeNotes
tables[].namestringThe real table name in PostgreSQL's public schema. Use this for path parameters on the columns and rows endpoints.
tables[].display_namestringThe name the UI shows. Either the override from [display.tables] in config.toml, or — if no override is set — the table name rewritten from snake_case to Title Case.
tables[].row_count_estimateinteger or nullPostgreSQL's pg_class.reltuples estimate, cast to a signed 64-bit integer. null when the planner has no statistics yet (raw estimate below zero).

Example

curl http://127.0.0.1:3141/api/tables
{
  "tables": [
    {
      "name": "vehicles_log",
      "display_name": "Fleet Log",
      "row_count_estimate": 523401
    },
    {
      "name": "supervisors",
      "display_name": "Supervisors",
      "row_count_estimate": 42
    },
    {
      "name": "route_events",
      "display_name": "Route Events",
      "row_count_estimate": null
    }
  ]
}

Filtering behaviour

SeeKi reads every user table in the public schema, then drops anything that fails config.tables.allows(name). If the config has an include allow-list, only matching tables are returned; if it has an exclude list, those tables are removed; if neither is set, every public table is returned.

Schema scope

Only the public schema is listed. Tables in other schemas are not visible to SeeKi today, regardless of the allow-list.

Errors

StatusWhen
503The server is still in setup mode — a database has not yet been configured. Body: {"error": "This endpoint is not available in setup mode"}.
500The database query failed. The real error is written to the server log; the response body is {"error": "Internal server error"}.

Related