Skip to main content
The Share API allows you to create publicly accessible dashboard links for your websites.

Enable sharing

POST /api/websites/:id/share Enable public sharing for a website dashboard.

Path parameters

id
string
required
Website ID (format: site_XXXXXXXXXX)

Response

share_token
string
Unique share token for the public dashboard
share_url
string
Full public URL for the shared dashboard

Example

curl -X POST "https://analytics.example.com/api/websites/site_abc123/share" \
  -H "Authorization: Bearer spk_selfhosted_abc123..."
Response
{
  "share_token": "pub_xyz789abc",
  "share_url": "https://analytics.example.com/share/pub_xyz789abc"
}

Disable sharing

DELETE /api/websites/:id/share Disable public sharing and revoke the share token.

Path parameters

id
string
required
Website ID

Response

Returns 204 No Content on success.

Example

curl -X DELETE "https://analytics.example.com/api/websites/site_abc123/share" \
  -H "Authorization: Bearer spk_selfhosted_abc123..."

Public dashboard access

Once sharing is enabled, anyone with the share URL can view the dashboard without authentication.

Features available in shared dashboards

  • ✅ Real-time visitor count
  • ✅ Stats overview (pageviews, visitors, bounce rate, etc.)
  • ✅ Time series charts (pageviews over time)
  • ✅ Metrics breakdowns (pages, countries, browsers, etc.)
  • ❌ Goal statistics (not shown in public dashboards)
  • ❌ Event details (not shown in public dashboards)
  • ❌ Session drilldown (not shown in public dashboards)
Shared dashboards are publicly accessible to anyone with the URL. Only enable sharing for websites where you’re comfortable making analytics data public.

Security considerations

  • Share tokens are randomly generated 16-character alphanumeric strings
  • Tokens are stored securely in the database
  • Deleting a share immediately revokes access
  • No rate limiting on public dashboard access (consider adding reverse proxy rate limits)
Shared dashboards expose:
  • Aggregate statistics (visitor counts, pageviews, bounce rates)
  • Geographic distribution
  • Browser/OS/device breakdown
  • Top pages and referrers
Shared dashboards do NOT expose:
  • Individual visitor IDs
  • Session details
  • Custom event data
  • Goal conversion data

Use cases

Public Transparency

Share your website’s analytics publicly to demonstrate transparency

Client Reporting

Give clients view-only access to their website analytics

Team Collaboration

Share dashboards with stakeholders who don’t need full access

Embed in Documentation

Embed public dashboards in your documentation or blog

Build docs developers (and LLMs) love