Ingest KPI points
POST /hooks/kpi_ingest.php accepts one point, { "points": [...] }, or a bare array of up to 500 points.
Required scope: metrics:write
Content type: application/json
Rate limit: 600 requests/hour/key
curl --fail-with-body -X POST \ "https://app.dialdozer.com/hooks/kpi_ingest.php" \ -H "X-Api-Key: $DIALDOZER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "points": [ {"metric_key":"ad.spend","day":"2026-07-17","value":145.75,"dim_key":"google"}, {"metric_key":"revenue.closed","day":"2026-07-17","value":4200,"dim_key":"solar"} ] }'| Field | Type | Required | Rules |
|---|---|---|---|
metric_key | string | yes | 1–60 characters; letters, digits, _ . : -. Unknown keys are auto-registered with label=key and sum aggregation. |
value | number | yes | Numeric JSON value or numeric string. |
day | string | no | YYYY-MM-DD; defaults to the server’s current date. Calendar validity beyond this shape is not explicitly checked by the endpoint. |
dim_key | string | no | Up to 80 characters. |
org_id | integer | platform-global key only | Valid client organization. Tenant-key ownership always overrides request input. Invalid/house values resolve to house scope (null). |
{"ok":true,"upserts":2}Batch processing is partial: valid points are upserted even when siblings fail. HTTP 200 then includes indexed errors:
{"ok":true,"upserts":1,"errors":[{"index":1,"error":"bad_value"}]}If no point is valid, HTTP 422 returns no_valid_points plus the indexed error list. Other validation errors include malformed_json, malformed_body, too_many_points, and no_points.