load-table
GET structure endpoint for a registered table
load-table answers: "How should this table look and behave?" It does not (by default) return all rows — only metadata the UI needs to render headers, filters, and buttons.
Request
GET /api/api-table/control-tables/load-table/{tableName}/{withData?}| Parameter | Type | Description |
|---|---|---|
tableName | string | Config key — e.g. users |
withData | bool (optional) | true = include first page of rows in response |
Headers:
Authorization: Bearer {token}
Accept: application/jsonOptional body/query params: Scoped context passed to table constructor (e.g. { "warehouseId": "5" }).
Response fields (explained)
{
"success": true,
"tableName": "users",
"columns": [ /* see below */ ],
"filters": [ /* filter sheet */ ],
"advancedFilters": [ /* expanded filters */ ],
"rowActions": { /* action buttons */ },
"bulkActions": [ /* toolbar actions */ ],
"sortables": ["id", "name", "email"],
"defSortCol": "id",
"defSortDir": "desc"
}| Field | Junior explanation | Senior note |
|---|---|---|
columns | What columns to draw | Built from $TBLColumns via column type classes |
filters | Filter form fields | From filters() |
rowActions | Per-row buttons | Includes default show_details |
bulkActions | Toolbar dropdown | Includes default export_excel |
sortables | Allowed sort fields | Client cannot sort outside this list |
When withData=true, response also includes data (paginated items) and bindings.
When to use withData=true
| Use | Skip |
|---|---|
| Mobile apps wanting one round-trip | Standard web — frontend loads structure then queries separately |
| Simple tables with tiny datasets | Large tables — structure should stay lightweight |
Common mistakes
| Mistake | Symptom |
|---|---|
Wrong tableName in URL | Exception: table not exists |
| Forgot auth token | 401 |
Empty $TBLColumns | Table renders with no columns |
TABLENAME mismatch | 404 or table not exists |
Example curl
curl -s -H "Authorization: Bearer $TOKEN" \
https://app.test/api/api-table/control-tables/load-table/users | jq '.columns'