Welcome to onpath
OnPath KPI Ingest API Push KPI values into OnPath from any system using a simple HTTP API. Create an API token, assign it to one or more data feeds, then send single updates or large batches in real time.
The Basics
Base URL
| Endpoint | Methods |
|---|---|
https://api.onpath.io/functions/v1/kpi-ingest | GET, POST |
https://api.onpath.io/functions/v1/kpi-ingest/feeds | GET |
Getting Started
Before you can push KPI values, two things need to be in place in the OnPath dashboard: an API token and at least one data feed with that token assigned to it.
Step 1 — Create an API token
Go to Org API Tokens and create a new token. Give it a descriptive name (e.g. Production ingest) so you can identify it later. Copy the key — it is shown only once.
Step 2 — Create a data feed and assign the token
Go to Data Sources and create a new ingest feed for each KPI you want to push data into (e.g. "Revenue", "NPS", "Churn Rate"). When configuring the feed, assign the API token you created in Step 1.
A single API token can be assigned to multiple feeds, which means one token is all you need to push data to an entire set of KPIs. The API will only accept ingest requests that target feeds explicitly assigned to the token in use.
Step 3 — Find your feed slugs
Each feed has a unique slug that you reference in API requests. You can find slugs in two ways:
- Dashboard — open a feed's settings in Data Sources to copy its slug.
- API — call
GET /kpi-ingest/feedsto list all feeds assigned to your token, along with their slugs.
Step 4 — Send your first value
curl https://api.onpath.io/functions/v1/kpi-ingest \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"slug": "YOUR_FEED_SLUG", "value": 125000}'Authentication
All endpoints require an OnPath KPI API key. Create one at app.onpath.io/org-api-tokens. There are two equivalent ways to supply it.
Option 1 — HTTP Basic Auth
Pass any string as the username and your API key as the password.
curl -u "anyuser:YOUR_API_KEY" \
https://api.onpath.io/functions/v1/kpi-ingestOption 2 — x-api-key Header (recommended)
x-api-key Header (recommended)curl -H "x-api-key: YOUR_API_KEY" \
https://api.onpath.io/functions/v1/kpi-ingestSingle vs Batch Ingest
The POST /kpi-ingest endpoint accepts both a single object and an array — the shape of your request body determines the mode.
| Mode | Body | Use when |
|---|---|---|
| Single | { "slug": "…", "value": 42 } | Updating one feed from a webhook or event |
| Batch | [{ "slug": "…", "value": 42 }, …] | Syncing multiple KPIs from a scheduled job |
Batch requests are processed atomically — if any item is invalid, the entire request is rejected with a 400.
Feed Slugs
Every ingest feed has a unique slug (e.g. swift-peak-3f9a). Feeds are created and managed in Data Sources, where you also assign API tokens to them.
You can look up slugs in two ways:
- Dashboard — open a feed in Data Sources and copy its slug from the settings panel.
- API — call
GET /kpi-ingest/feedsto retrieve all slugs currently assigned to your token.
Slugs are stable identifiers and will not change when a feed is renamed. One API token can be assigned to multiple feeds — use batch ingest to update them all in a single request.
Rate Limits
The API enforces a limit of 10 requests per second per API key. Exceeding this returns a 429 response with a Retry-After header indicating how many seconds to wait.
Use batch ingest to reduce request volume when pushing many KPI values at once.
Error Codes
All error responses share the same envelope:
{
"error": "Human-readable message",
"code": "machine_readable_code"
}| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_json | Request body could not be parsed as JSON. |
| 400 | invalid_payload | Body parses correctly but fails schema validation (e.g. non-finite value). |
| 401 | auth_required | No credentials were supplied or the Authorization header is malformed. |
| 401 | invalid_api_key | Credentials were supplied but the API key is not recognised. |
| 403 | subscription_required | Valid credentials, but the org lacks an active Pro entitlement. |
| 405 | method_not_allowed | The HTTP method is not supported on this endpoint. |
| 429 | rate_limit_exceeded | Too many requests from the same API key. |
| 500 | feed_validation_failed | Server error while resolving the supplied feed slug(s). |
| 500 | ingest_store_failed | Server error while persisting KPI value(s). |
| 500 | feed_list_failed | Server error while fetching the feed list. |
Updated 19 days ago