A Data Bucket is a container for storing time-series or key-value data that powers your dashboard widgets.
Records are indexed by timestamp. Each record contains a timestamp key and multiple series values.
Use cases: Metrics over time, sensor readings, monitoring data
Data structure:
{ "k": "2025-10-20T10:00:00Z", "d": [ {"sk": 1, "v": 25.5}, {"sk": 2, "v": 23.1} ] }
k - Timestamp key (ISO 8601 format)d - Array of series valuessk - Series key (integer identifier)v - Numeric value (float)Records are indexed by string. Each record contains a string key and multiple series values.
Use cases: Configuration data, state storage, categorical metrics
Data structure:
{ "k": "2025", "d": [ {"sk": 1, "v": 45.2}, {"sk": 2, "v": 52.1} ] }
k - String keyd - Array of series valuessk - Series key (integer identifier)v - Numeric value (float)Data buckets are scoped to a specific dashboard. When you create a bucket, it belongs to one dashboard and can only be accessed by widgets on that dashboard.
Configure how many records are retained in your buckets:
Retention settings are configured per dashboard and apply to all buckets within that dashboard.
Creating one record with a timestamp key:
curl -X POST https://data.dashgrid.com/api/buckets/{BUCKET_ID} \ -H "Content-Type: application/json" \ -H "X-API-Key: {YOUR_API_KEY}" \ -d '[ { "key": "2025-10-20T10:00:00Z", "data": [ {"series_key": 1, "value": 25.5}, {"series_key": 2, "value": 23.1} ] } ]'
Creating multiple records with timestamp keys in one request:
curl -X POST https://data.dashgrid.com/api/buckets/{BUCKET_ID} \ -H "Content-Type: application/json" \ -H "X-API-Key: {YOUR_API_KEY}" \ -d '[ { "key": "2025-10-20T10:00:00Z", "data": [ {"series_key": 1, "value": 25.5}, {"series_key": 2, "value": 23.1} ] }, { "key": "2025-10-20T10:01:00Z", "data": [ {"series_key": 1, "value": 25.7}, {"series_key": 2, "value": 23.3} ] } ]'
Creating one record with a string key:
curl -X POST https://data.dashgrid.com/api/buckets/{BUCKET_ID} \ -H "Content-Type: application/json" \ -H "X-API-Key: {YOUR_API_KEY}" \ -d '[ { "key": "2024", "data": [ {"series_key": 1, "value": 45.2}, {"series_key": 2, "value": 52.1} ] } ]'
Creating multiple records in one request:
curl -X POST https://data.dashgrid.com/api/buckets/{BUCKET_ID} \ -H "Content-Type: application/json" \ -H "X-API-Key: {YOUR_API_KEY}" \ -d '[ { "key": "2024", "data": [ {"series_key": 1, "value": 45.2}, {"series_key": 2, "value": 52.1} ] }, { "key": "2025", "data": [ {"series_key": 1, "value": 78.5} ] } ]'
When you insert records into TSV buckets:
When you insert records into KV buckets:
Important: For both bucket types, Dashgrid does NOT merge or append series values - it performs a complete replacement of the record.
Existing record:
{ "k": "2025-01-19T10:00:00Z", "d": [ {"sk": 1, "v": 100}, {"sk": 2, "v": 200} ] }
Writing new data:
[ { "k": "2025-01-19T10:00:00Z", "d": [ {"sk": 1, "v": 150} ] } ]
Result: The record is completely replaced. Series 2 is gone, and series 1 now has value 150.
You can send an empty data array to clear all series for a specific key:
[ { "k": "2025-01-19T10:00:00Z", "d": [] } ]
This will create or update the record with no data points, effectively clearing all series data for that key while keeping the record itself.
Endpoint: POST https://data.dashgrid.com/api/buckets/{BUCKET_ID}
Authentication: X-API-Key: {YOUR_API_KEY} header
Field Specifications:
2025-10-20T10:00:00Z) for TSV buckets, or any string for KV bucketsMinified Format: You can use shortened field names (k, d, sk, v) instead of full names for bandwidth efficiency. Both formats are accepted.
curl https://data.dashgrid.com/api/buckets/{bid}/records?limit=10&offset=0 \ -H "X-API-Key: {YOUR_API_KEY}"
Response (flattened format with k key, ca created_at, and the series keys as string numbers):
{ "records": [ { "k": "2025-10-20T10:01:00Z", "ca": "2025-10-20T10:01:05Z", "1": 25.7, "2": 23.3 }, { "k": "2025-10-20T10:00:00Z", "ca": "2025-10-20T10:00:05Z", "1": 25.5, "2": 23.1 } ] }
Query parameters:
limit (integer, optional): Number of records to return (default: 100, max: 1000)offset (integer, optional): Number of records to skip (default: 0)Response (flattened format with k key, ca created_at, and the series keys as string numbers):
curl https://data.dashgrid.com/api/buckets/{bid}/records/{record_key} \ -H "X-API-Key: {YOUR_API_KEY}"
Response:
{ "records": [ { "k": "2025-10-20T10:00:00Z", "ca": "2025-10-20T10:00:05Z", "1": 25.5, "2": 23.1 } ] }
Deletes an individual record from (KV, String Key) bucket:
curl -X DELETE https://data.dashgrid.com/api/buckets/{BUCKET_ID}/records/{KEY} \ -H "X-API-Key: {YOUR_API_KEY}"
⚠️ Important:
Writes an empty data array to clear values while preserving the timestamp:
curl -X POST https://data.dashgrid.com/api/buckets/{BUCKET_ID} \ -H "Content-Type: application/json" \ -H "X-API-Key: {YOUR_API_KEY}" \ -d '[ { "key": "2025-01-19T10:00:00Z", "data": [] } ]'
Deletes all records in a bucket. This can be triggered via API when you need to clear a bucket and start fresh.
curl -X DELETE https://data.dashgrid.com/api/buckets/{BUCKET_ID}/purge \ -H "X-API-Key: {YOUR_API_KEY}"
⚠️ Important:
{"error": "API key required"}
Missing or invalid X-API-Key header.
{"error": "permission denied"}
API key doesn't have access to this bucket's dashboard.
{"error": "bucket not found"}
Bucket ID doesn't exist.
{"error": "validation error: d.sk must be integer between 1 and 10"}
Invalid request data. Common validation errors: