{% extends 'paxalia/base.html' %} {% load static i18n %} {% block title %}{% trans "Paxalia API Reference" %} – Paxalia Analytics{% endblock %} {% block page_title %}{% trans "Paxalia API Reference" %}{% endblock %} {% block page_subtitle %}{% trans "Server-to-server event ingestion and read access" %}{% endblock %} {% block extra_css %} {% endblock %} {% block dashboard_content %}
{% trans "Every request needs an" %} {% trans "API key" %} {% trans "sent as a Bearer token:" %}
Authorization: Bearer pxa_...
{% trans "A key has one or both scopes: ingest (post events) and read (query data). Requests are rate-limited to 300/minute per key. This is separate from the anonymous, browser-facing event snippet — a secret key should never be embedded in client-side JavaScript." %}
{% trans "Requires the ingest scope. Same payload shape as the public event snippet." %}
curl -X POST {{ base_url }}ingest/ \
-H "Authorization: Bearer pxa_..." \
-H "Content-Type: application/json" \
-d '{"category": "signup", "action": "completed", "label": "referral"}'
{% trans "Requires the read scope. Query params: start_date, end_date (YYYY-MM-DD, default: last 30 days)." %}
curl {{ base_url }}stats/summary/?start_date=2026-01-01&end_date=2026-01-31 \
-H "Authorization: Bearer pxa_..."
{
"start_date": "2026-01-01",
"end_date": "2026-01-31",
"total_views": 48213,
"unique_visitors": 12904
}
{% trans "Requires the read scope. Query params: start_date, end_date, limit (max 500, default 100), offset." %}
curl "{{ base_url }}pageviews/?limit=50" \
-H "Authorization: Bearer pxa_..."
{
"total": 48213, "limit": 50, "offset": 0,
"results": [
{"path": "/pricing/", "method": "GET", "status_code": 200,
"referrer": "https://google.com/", "country_code": "US",
"utm_source": "", "utm_medium": "", "utm_campaign": "",
"created_at": "2026-01-15T09:32:00Z"}
]
}
{% trans "Requires the read scope. Query params: start_date, end_date, limit, offset, category." %}
curl "{{ base_url }}events/?category=signup" \
-H "Authorization: Bearer pxa_..."