Entities
The record sets the portal's blocks read — each entity comes from an operation of a data source, a SQL query, a relation (join) between two others, or records you send. records get queries the synced records, records create and records import create feed an entity with no connector, aggregate computes what KPIs and charts show, and sync / tenant-syncs trigger and track the sync.
| Command | HTTP | Description |
|---|---|---|
entities list | GET /v1/entities | List entities |
entities create | POST /v1/entities | Create entity |
entities get | GET /v1/entities/{id} | Get entity |
entities update | PATCH /v1/entities/{id} | Update entity |
entities delete | DELETE /v1/entities/{id} | Delete entity |
entities aggregate | GET /v1/entities/{id}/aggregate | Aggregate records |
entities usage | GET /v1/entities/{id}/usage | Entity usage |
entities join create | POST /v1/entities/join | Create join entity |
entities join update | PUT /v1/entities/{id}/join | Update relation |
entities join preview create | POST /v1/entities/join/preview | Preview a relation |
entities logs list | GET /v1/entities/{id}/logs | Sync log |
entities logs get | GET /v1/entities/{id}/logs/{log_id} | Get sync call |
entities preview create | POST /v1/entities/preview | Preview a source |
entities records list | GET /v1/entities/{id}/records | Query records |
entities records get | GET /v1/entities/{id}/records/{record_id} | Get record |
entities records create | POST /v1/entities/{id}/records | Send records |
entities records delete | DELETE /v1/entities/{id}/records | Clear records |
entities records import create | POST /v1/entities/{id}/records/import | Import records from CSV |
entities sync get | GET /v1/entities/{id}/sync | Sync state |
entities sync create | POST /v1/entities/{id}/sync | Sync entity |
entities tenant-syncs list | GET /v1/entities/{id}/tenant_syncs | Tenant syncs |
entities tenant-syncs create | POST /v1/entities/{id}/tenant_syncs | Sync one tenant |
Examples
--params carries query, path and header parameters (id, page, filters, X-Workspace-Id); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.
# List entities
kobana dashboards entities list --fields "id,key,name,sync_mode"
# Query records
kobana dashboards entities records list \
--params '{"id": "ENTITY_ID", "limit": 50, "sort": "due_date:desc"}'
# Aggregate records
kobana dashboards entities aggregate \
--params '{"id": "ENTITY_ID", "op": "sum", "field": "valor", "group_by": "status"}'
# Send records
kobana dashboards entities records create \
--params '{"id": "ENTITY_ID"}' \
--json '{"records": [{"id": "42", "nome": "Ana Souza", "valor": 1250.5}], "mode": "upsert"}'
# Sync entity
kobana dashboards entities sync create --params '{"id": "ENTITY_ID"}'
# Sync state
kobana dashboards entities sync get --params '{"id": "ENTITY_ID"}'
# Clear records
kobana dashboards entities records delete \
--params '{"id": "ENTITY_ID"}' \
--dry-run
Next steps
- Data sources
- Portal user mapping
- Schema introspection — every parameter this resource accepts.