Invoker Analytics/Documentation
API Reference

REST API Documentation

Integrate Invoker Analytics into your applications with our REST API.

Authentication

All API requests require authentication using a Bearer token. You can obtain your API token from your account settings.

Authorization Header
Authorization: Bearer YOUR_API_TOKEN

Base URL

https://api.invoker-analytics.com/api

Endpoints

Sites

GET/sites
List all sites for the authenticated user
curl -X GET "https://api.invoker-analytics.com/api/sites" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
POST/sites
Create a new site
curl -X POST "https://api.invoker-analytics.com/api/sites" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "newsite.com",
    "timezone": "America/New_York"
  }'

Analytics

GET/sites/{site_id}/analytics/stats
Get aggregate statistics for a site

Query Parameters

ParameterTypeDescription
periodstringTime period (today, 7d, 30d, 12mo, custom)
startDatedateStart date for custom period (YYYY-MM-DD)
endDatedateEnd date for custom period (YYYY-MM-DD)
curl -X GET "https://api.invoker-analytics.com/api/sites/1/analytics/stats?period=30d" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
GET/sites/{site_id}/analytics/pages
Get page view statistics
{
  "data": [
    {
      "page": "/",
      "hits": 5420,
      "visitors": 2100,
      "percentage": 35.2
    },
    {
      "page": "/pricing",
      "hits": 2150,
      "visitors": 980,
      "percentage": 14.0
    }
  ]
}

Events

POST/event
Track a custom event (no auth required, uses domain validation)
curl -X POST "https://api.invoker-analytics.com/api/event" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "example.com",
    "name": "Button Click",
    "url": "https://example.com/pricing",
    "props": {
      "button_id": "cta-signup",
      "variant": "blue"
    }
  }'

Shared Dashboards

POST/sites/{site_id}/shares
Create a shared dashboard
curl -X POST "https://api.invoker-analytics.com/api/sites/1/shares" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Client Dashboard",
    "password": "optional-password",
    "allowed_metrics": ["pageviews", "visitors", "pages"],
    "expires_at": "2024-12-31T23:59:59Z"
  }'

Error Handling

The API uses standard HTTP status codes to indicate success or failure:

Status CodeDescription
200Success
201Created
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing token
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded

Rate Limits

API requests are rate limited to ensure fair usage:

  • Standard plans: 100 requests per minute
  • Pro plans: 500 requests per minute
  • Enterprise: Custom limits available

Rate limit headers are included in all responses:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705329600