All docs

Analytics API

Build your own dashboards and reports on top of SlingAgent's numbers. The Analytics API is a read-only, JSON HTTP API available on the Unlimited plan.

Authentication

Create a token under Settings → API tokens (it's shown once — copy it), then send it as a bearer token on every request:

curl -H "Authorization: Bearer slag_your_token_here" \
  https://slingagent.com/api/v1/analytics/summary

Requests without a valid token get 401; a token on a non-Unlimited plan gets 403.

Endpoints

All figures are scoped to your plan's analytics history window.

  • GET /api/v1/analytics — index of available reports.
  • GET /api/v1/analytics/summary — totals, unique visitors, clicks by day, by platform, by country, by hour, the day×hour heatmap, visitor mix, and pace.
  • GET /api/v1/analytics/links — every link with total + windowed clicks, posts, platforms, and last activity (the same data as the CSV export).
  • GET /api/v1/analytics/posting — scheduled vs. actual: posted/queued/failed and click yield.
  • GET /api/v1/analytics/retention — click-decay-by-age buckets.
  • GET /api/v1/analytics/revenue-timeline — monthly earnings, posts, and clicks.
  • GET /api/v1/analytics/segment?kind=platform&value=X — a single platform's drill-down (top links, the promos that resonated, and the country breakdown). Use kind=country&value=US for a country drill-down.

Notes

  • Read-only. The API never posts, edits, or deletes.
  • Rate limit. Up to 120 requests per minute per token; over that you get a 429 with a Retry-After header.
  • CORS. Cross-origin requests are allowed, so you can call the API from a browser-based tool (the token is never sent automatically — you always set it).
  • Privacy. We only ever store salted IP hashes, never raw addresses, so no personal data is exposed.
  • Responses are stable within v1; we'll version the path before making breaking changes.
  • Prefer a one-off file? The in-app Export CSV button (Pro and Unlimited) on the Analytics page downloads the per-link sheet without any code.