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

EndpointMethods
https://api.onpath.io/functions/v1/kpi-ingestGET, POST
https://api.onpath.io/functions/v1/kpi-ingest/feedsGET



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.

🔑

Keep your API key secret. Do not commit it to source control or expose it in client-side code.


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/feeds to 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-ingest

Option 2 — x-api-key Header (recommended)

curl -H "x-api-key: YOUR_API_KEY" \
  https://api.onpath.io/functions/v1/kpi-ingest
💡

Both methods accept the same API key. Use whichever fits your HTTP client or integration platform.




Single 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.

ModeBodyUse 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:

  1. Dashboard — open a feed in Data Sources and copy its slug from the settings panel.
  2. API — call GET /kpi-ingest/feeds to 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"
}
HTTPCodeMeaning
400invalid_jsonRequest body could not be parsed as JSON.
400invalid_payloadBody parses correctly but fails schema validation (e.g. non-finite value).
401auth_requiredNo credentials were supplied or the Authorization header is malformed.
401invalid_api_keyCredentials were supplied but the API key is not recognised.
403subscription_requiredValid credentials, but the org lacks an active Pro entitlement.
405method_not_allowedThe HTTP method is not supported on this endpoint.
429rate_limit_exceededToo many requests from the same API key.
500feed_validation_failedServer error while resolving the supplied feed slug(s).
500ingest_store_failedServer error while persisting KPI value(s).
500feed_list_failedServer error while fetching the feed list.

Did this page help you?