Actually Tracking

Authentication

Learn how to authenticate with the Actually Tracking API using client credentials.

Authentication

To authenticate with the Actually Tracking API, you need to use your clientId and clientSecret. Different API endpoints may require different access levels:

  • Track API: Default client works with write mode
  • Export API: Requires read or root mode
  • Insights API: Requires read or root mode
  • Manage API: Requires root mode only

The default client (created with a project) has write mode and does not have access to the Export, Insights, or Manage APIs. You'll need to create additional clients with appropriate access levels.

Headers

Include the following headers with your API requests:

  • actuallytracking-client-id: Your Actually Tracking client ID
  • actuallytracking-client-secret: Your Actually Tracking client secret

Example

curl 'https://api.actuallytracking.com/insights/{projectId}/metrics' \
  -H 'actuallytracking-client-id: YOUR_CLIENT_ID' \
  -H 'actuallytracking-client-secret: YOUR_CLIENT_SECRET'

Security Best Practices

  1. Store credentials securely: Never expose your clientId and clientSecret in client-side code
  2. Use HTTPS: Always use HTTPS to ensure secure communication
  3. Rotate credentials: Regularly rotate your API credentials
  4. Limit access: Give each key only the permissions it needs

Error Responses

If authentication fails, you'll receive a 401 Unauthorized response:

{
  "error": "Unauthorized",
  "message": "Invalid client credentials"
}

Common authentication errors:

  • Invalid client ID or secret
  • Client doesn't have required permissions (e.g., trying to access Manage API with a non-root client)
  • Malformed client ID (must be a valid UUIDv4)
  • Client type mismatch (e.g., write client trying to access Export API)

Client Types

Actually Tracking supports three client types with different access levels:

TypeDescriptionAccess
writeWrite accessTrack API only
readRead-only accessExport API, Insights API
rootFull accessAll APIs including Manage API

Note: Root clients have organization-wide access and can manage all resources. Use root clients carefully and store their credentials securely.

Permissions

Instead of a type, you can give a key a list of permissions. It can then do exactly what the list names. Create one in Project settings → Clients → Create client → Custom permissions, or through the Manage API.

PermissionAllowsWorks on
events:writeTrack API: send events and update profiles, and report crawler visitsOne project
analytics:readExport, Insights and revenue APIs, and MCPOne project or every project
imports:writeStart importsOne project
dashboards:writeManage API for dashboards and reports, and the MCP tools that change themEvery project
references:writeManage API for references (chart annotations)Every project
projects:writeManage API for projectsEvery project
clients:writeManage API for keys. A key can only create keys with permissions it has itselfEvery project
funnels:writeManage API for funnelsOne project or every project
alerts:writeManage API for alertsOne project or every project
goals:writeManage API for goalsOne project or every project
team:writeManage API for the team: members and viewersEvery project

A request that needs a permission the key lacks gets a 401 naming it, for example Export: This API key does not have the analytics:read permission.

Keys created with a type keep working exactly as before. In permission terms, write is events:write, read is analytics:read and imports:write on one project, and root is everything except sending events, on every project.

Rate Limiting

The API implements rate limiting to prevent abuse. Rate limits vary by endpoint:

  • Track API: Higher limits for event tracking
  • Crawler reporting (/crawl): 1,000 requests per 10 seconds
  • Export/Insights APIs: 100 requests per 10 seconds
  • Manage API: 20 requests per 10 seconds

If you exceed the rate limit, you'll receive a 429 Too Many Requests response. Implement exponential backoff for retries.

Remember to replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with your actual Actually Tracking API credentials.

On this page