Skip to main content

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.

CommandHTTPDescription
entities listGET /v1/entitiesList entities
entities createPOST /v1/entitiesCreate entity
entities getGET /v1/entities/{id}Get entity
entities updatePATCH /v1/entities/{id}Update entity
entities deleteDELETE /v1/entities/{id}Delete entity
entities aggregateGET /v1/entities/{id}/aggregateAggregate records
entities usageGET /v1/entities/{id}/usageEntity usage
entities join createPOST /v1/entities/joinCreate join entity
entities join updatePUT /v1/entities/{id}/joinUpdate relation
entities join preview createPOST /v1/entities/join/previewPreview a relation
entities logs listGET /v1/entities/{id}/logsSync log
entities logs getGET /v1/entities/{id}/logs/{log_id}Get sync call
entities preview createPOST /v1/entities/previewPreview a source
entities records listGET /v1/entities/{id}/recordsQuery records
entities records getGET /v1/entities/{id}/records/{record_id}Get record
entities records createPOST /v1/entities/{id}/recordsSend records
entities records deleteDELETE /v1/entities/{id}/recordsClear records
entities records import createPOST /v1/entities/{id}/records/importImport records from CSV
entities sync getGET /v1/entities/{id}/syncSync state
entities sync createPOST /v1/entities/{id}/syncSync entity
entities tenant-syncs listGET /v1/entities/{id}/tenant_syncsTenant syncs
entities tenant-syncs createPOST /v1/entities/{id}/tenant_syncsSync 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​