"Best analytics tool I've used in 14 years"

Account API

Use the Account API when a backend, script, or AI agent needs to manage DataFast resources directly: websites, account tokens, website API keys, funnels, alerts, team members, integrations, and settings.

These endpoints are public REST endpoints. You do not need to use the CLI to call them.

Most Account API routes require a dft_ account token. Some website-scoped routes also accept a df_ website API key when the key belongs to the same websiteId. Read authentication and scopes before giving an agent write access.
The DataFast CLI uses these same endpoints under the hood. Use the CLI when you want a terminal workflow, and use the REST API when you want to call DataFast from your own code.

Get an account API token

Create account API tokens in Account settings -> API. Use a dft_ token for account automation, CLI sessions, and AI agents that need to manage websites, funnels, alerts, team members, integrations, or API keys.

Create a DataFast account API token

Base path

https://datafa.st/api/v1/admin

Endpoint groups

Account endpoints

EndpointMethodPathPermissionPurpose
Get accountGET/accountanalytics:readGet current user profile and plan info
Update accountPUT/accountanalytics:readUpdate current user name

Update account name:

curl -X PUT "https://datafa.st/api/v1/admin/account" \
  -H "Authorization: Bearer dft_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"Jane Doe"}'

Account tokens

Use account tokens for CLI sessions, backend automation, and AI agents.

EndpointMethodPathPermissionPurpose
List access tokensGET/access-tokensapi-keys:readList account tokens
Create access tokenPOST/access-tokensapi-keys:writeCreate an account token. The raw dft_ token is returned once
Delete access tokenDELETE/access-tokens/{tokenId}api-keys:writeRevoke an account token

Create a scoped token:

curl -X POST "https://datafa.st/api/v1/admin/access-tokens" \
  -H "Authorization: Bearer dft_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Read only agent",
    "permissions": ["analytics:read", "websites:read", "funnels:read"],
    "websiteIds": ["YOUR_WEBSITE_ID"]
  }'

Websites

EndpointMethodPathPermissionPurpose
List websitesGET/websiteswebsites:readList websites available to the token
Create websitePOST/websiteswebsites:writeCreate a website
Get websiteGET/websites/{websiteId}settings:readGet website settings
Update websitePUT/websites/{websiteId}settings:writeUpdate website settings
Delete websiteDELETE/websites/{websiteId}websites:writeCurrently returns 403; website deletion is dashboard-only

Create a website:

curl -X POST "https://datafa.st/api/v1/admin/websites" \
  -H "Authorization: Bearer dft_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "example.com",
    "timezone": "America/New_York",
    "name": "Example"
  }'

Update website settings:

curl -X PUT "https://datafa.st/api/v1/admin/websites/YOUR_WEBSITE_ID" \
  -H "Authorization: Bearer dft_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "New name",
    "kpi": "signup",
    "kpiColorScheme": "green",
    "includeRenewalRevenue": true
  }'
Common updatable fields include domain, name, timezone, currency, kpi, kpiColorScheme, revenueMetric, isCookieless, includeRenewalRevenue, allowedHostnames, excludedIps, excludedPaths, excludedCountries, and excludedHostnames.
Related CLI docs: websites.

Website API keys

Website API keys start with df_ and are scoped to one website.
EndpointMethodPathPermissionPurpose
List website keysGET/websites/{websiteId}/apikeysapi-keys:readList website API keys
Create website keyPOST/websites/{websiteId}/apikeysapi-keys:writeCreate a df_ key. The raw key is returned once
Roll website keyPUT/websites/{websiteId}/apikeys/{apiKeyId}api-keys:writeRoll an API key and return the new raw key once
Delete website keyDELETE/websites/{websiteId}/apikeys/{apiKeyId}api-keys:writeRevoke an API key

Create a website API key:

curl -X POST "https://datafa.st/api/v1/admin/websites/YOUR_WEBSITE_ID/apikeys" \
  -H "Authorization: Bearer dft_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name":"Production key"}'

Goals

EndpointMethodPathPermissionPurpose
List tracked goalsGET/websites/{websiteId}/goalssettings:readList tracked goals ordered by frequency

Use this endpoint when building a UI or agent flow that needs to choose from existing goals before setting a KPI, creating an alert, or creating a funnel.

To send goal events and query goal analytics, use Goals.

Funnels

EndpointMethodPathPermissionPurpose
List funnelsGET/websites/{websiteId}/funnelsfunnels:readList active funnels
Create funnelPOST/websites/{websiteId}/funnelsfunnels:writeCreate a funnel
Update funnelPUT/websites/{websiteId}/funnels/{funnelId}funnels:writeUpdate a funnel
Delete funnelDELETE/websites/{websiteId}/funnels/{funnelId}funnels:writeSoft-delete a funnel

Create a funnel:

curl -X POST "https://datafa.st/api/v1/admin/websites/YOUR_WEBSITE_ID/funnels" \
  -H "Authorization: Bearer dft_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Signup funnel",
    "steps": [
      { "name": "Landing page", "type": "pageview", "url": "/" },
      { "name": "Signup page", "type": "pageview", "url": "/signup" },
      { "name": "Signed up", "type": "goal", "goalName": "signup" }
    ]
  }'
Funnels need 2 to 8 steps. A step can be a pageview with a url, or a goal with a goalName.
To view funnel results, use funnel analytics. Related CLI docs: funnels.

Alerts

EndpointMethodPathPermissionPurpose
List alertsGET/websites/{websiteId}/alertsalerts:readList alerts
Create alertPOST/websites/{websiteId}/alertsalerts:writeCreate an alert
Update alertPUT/websites/{websiteId}/alerts/{alertId}alerts:writeUpdate an alert
Delete alertDELETE/websites/{websiteId}/alerts/{alertId}alerts:writeDelete an alert
Get alert historyGET/websites/{websiteId}/alerts/historyalerts:readGet recent alert trigger history

Create an alert:

curl -X POST "https://datafa.st/api/v1/admin/websites/YOUR_WEBSITE_ID/alerts" \
  -H "Authorization: Bearer dft_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "New signup",
    "trigger": { "goalName": "signup" },
    "template": {
      "subject": "New signup",
      "message": "A visitor completed signup."
    },
    "isEnabled": true
  }'
Alert history supports alertId and limit query parameters:
GET /api/v1/admin/websites/{websiteId}/alerts/history?alertId={alertId}&limit=50
Related CLI docs: alerts.

Team

EndpointMethodPathPermissionPurpose
List team membersGET/websites/{websiteId}/teamteam:readList team members
Invite team memberPOST/websites/{websiteId}/teamteam:write + owner roleInvite a team member
Remove team memberDELETE/websites/{websiteId}/teamteam:write + owner roleRemove a team member

Invite a team member:

curl -X POST "https://datafa.st/api/v1/admin/websites/YOUR_WEBSITE_ID/team" \
  -H "Authorization: Bearer dft_xxx" \
  -H "Content-Type: application/json" \
  -d '{"email":"member@example.com","role":"viewer"}'
Roles are viewer and member. Team invite and remove actions require the caller to be the website owner.

Integrations

EndpointMethodPathPermissionPurpose
Get integrationsGET/websites/{websiteId}/integrationssettings:readGet provider connection status
Connect StripePOST/websites/{websiteId}/integrations/stripesettings:writeConnect Stripe with stripeRak
Disconnect StripeDELETE/websites/{websiteId}/integrations/stripesettings:writeDisconnect Stripe
Connect Lemon SqueezyPOST/websites/{websiteId}/integrations/lemonsqueezysettings:writeConnect Lemon Squeezy with lemonsqueezyApiKey and lemonsqueezyStoreId
Disconnect Lemon SqueezyDELETE/websites/{websiteId}/integrations/lemonsqueezysettings:writeDisconnect Lemon Squeezy
Connect PolarPOST/websites/{websiteId}/integrations/polarsettings:writeConnect Polar with polarAccessToken and polarOrgId
Disconnect PolarDELETE/websites/{websiteId}/integrations/polarsettings:writeDisconnect Polar
Connect PaddlePOST/websites/{websiteId}/integrations/paddlesettings:writeConnect Paddle with paddleApiKey
Disconnect PaddleDELETE/websites/{websiteId}/integrations/paddlesettings:writeDisconnect Paddle
Disconnect ShopifyDELETE/websites/{websiteId}/integrations/shopifysettings:writeDisconnect Shopify
Disconnect WooCommerceDELETE/websites/{websiteId}/integrations/woocommercesettings:writeDisconnect WooCommerce

Provider credentials are stored by DataFast and never returned by the status endpoint.

Analytics with account tokens

Account tokens can also call website API endpoints when they include the right permission and websiteId query parameter:
curl "https://datafa.st/api/v1/analytics/timeseries?websiteId=YOUR_WEBSITE_ID&fields=visitors&interval=day" \
  -H "Authorization: Bearer dft_xxx"
For website analytics docs, start with Analytics, Visitors, or Funnel analytics.

✍️ Something missing? Suggest features.

🤖 AI agent or LLM? Read this page as markdown