Everything an AI agent can do with the Plausible API.

A reference guide for building AI agents: every method, how to authenticate, and the permissions each one needs.

Endpoints19
API versionv2
Last updated23 June 2026
Orientation

How the Plausible API works.

The Plausible API is how an app or AI agent works with a Plausible account: querying a site's visitors and conversions, creating or deleting a site, managing its goals and shared links, or recording a pageview from a server. Access is granted through a Bearer API key, where a Stats key reads analytics and a separate Sites key provisions and manages sites, so the key type sets the boundary. Plausible does not push events; an integration polls the stats it needs.

19Endpoints
7Capability groups
10Read
9Write
2Permissions
Authentication
Plausible authenticates API calls with a Bearer API key. There are two key types, chosen when the key is created: a Stats API key reads analytics, and a Sites API key provisions and manages sites. A Stats key cannot change sites, and a Sites key is what the provisioning endpoints require. The Events API takes no key at all.
Permissions
Access is set by the key type rather than fine-grained scopes. A Stats key is read-only over analytics; a Sites key can create, update, and delete sites, goals, shared links, and custom properties. A modern Sites key is scoped to a specific team and only acts on that team's sites.
Versioning
Plausible versions its stats interface in the path. The current interface is the v2 query endpoint, introduced in October 2024, which replaced the separate v1 aggregate, timeseries, and breakdown endpoints. The v1 stats endpoints and the v1 sites endpoints remain available for existing integrations.
Data model
The API is built around a site, identified by its domain. The Stats API answers questions about a site's traffic by combining metrics like visitors, pageviews, and conversion rate with dimensions like page, source, and country. The Sites API manages the site itself and its goals, shared links, and custom properties. The Events API records new pageviews and custom events against a site.
Connect & authenticate

Connection & authentication methods.

How an app or AI agent connects to Plausible determines what it can reach. There is a route for reading stats, a route for managing sites, and a route for sending events, and each is governed by the key behind it and the type of access that key carries.

Ways to connect

Stats API

The Stats API reads historical and real-time analytics. The current v2 query endpoint takes a JSON body naming a site, a date range, and the metrics to return, with optional dimensions, filters, and ordering, so one request can be an aggregate, a time series, or a breakdown. A Stats API key authenticates each call with the Bearer method.

Best forReading traffic and conversion data into an app or AI agent.
Governed byThe Stats API key.
Docs ↗

Sites Provisioning API

The Sites Provisioning API creates, lists, updates, and deletes sites, and manages their goals, shared links, and custom properties. It is authenticated with a separate Sites API key using the Bearer method, and a modern key is scoped to a specific team. The Sites API is an Enterprise plan feature.

Best forManaging sites and their configuration programmatically.
Governed byThe Sites API key and the team it is scoped to.
Docs ↗

Events API

The Events API records pageviews and custom events from places the tracking script cannot run, like a mobile app or a server. It needs no API key; the request carries a User-Agent header used to derive the visitor and a body naming the site domain, the event, and the page URL, and an X-Forwarded-For header sets the real client IP for server-side calls.

Best forIngesting analytics events from apps and servers.
Governed byNo key; the site domain in the request body.
Docs ↗
Authentication

Stats API key

A Stats API key authenticates read calls to the Stats API, sent as a Bearer token. It is created in account settings by choosing Stats API from the key type. It reads analytics for the account's sites and cannot provision or change sites.

TokenBearer API key
Best forRead-only access to stats.
Docs ↗

Sites API key

A Sites API key authenticates calls to the Sites Provisioning API, sent as a Bearer token. It is created by choosing Sites API from the key type, and a modern key is scoped to a specific team so it only acts on that team's sites. It is needed to create, update, or delete sites, goals, shared links, and custom properties.

TokenBearer API key
Best forManaging sites and their configuration.
Docs ↗

No key (Events API)

The Events API takes no API key. A request is accepted on the strength of the site domain in its body, with a User-Agent header to identify the visitor. Because anyone can post to it, it is an ingestion endpoint rather than an authenticated one.

TokenNone
Best forSending events from apps and servers.
Docs ↗
Capability map

What an AI agent can do in Plausible.

The Plausible API splits into reading stats, provisioning sites, and ingesting events. Reading stats answers questions about traffic and conversions, while provisioning a site, a goal, or a shared link changes the account itself, and sending an event records new analytics data.

Endpoint reference

Every Plausible API method.

Filter by method, access, or permission, or search any path. Select a row for version detail, rate limits, the related webhook event, and the source.

MethodEndpointWhat it doesAccessPermissionVersion

Stats (query)

Methods for reading historical and real-time analytics with the v2 query endpoint.1

Read-only. Takes a JSON body with site_id, date_range, metrics, and optional dimensions, filters, and order_by. The Stats API is a Business plan feature.

Acts onstats_query
Permission (capability)Stats key
VersionIntroduced 2024-10-09
Webhook eventNone
Rate limit600 requests per hour per key

Stats (legacy v1)

The older v1 stats endpoints, kept available for existing integrations.4

Read-only. Superseded by the v2 query endpoint, which Plausible recommends for new integrations.

Acts onstats_aggregate
Permission (capability)Stats key
VersionDeprecated 2024-10-09
Webhook eventNone
Rate limit600 requests per hour per key

Read-only. Superseded by the v2 query endpoint.

Acts onstats_timeseries
Permission (capability)Stats key
VersionDeprecated 2024-10-09
Webhook eventNone
Rate limit600 requests per hour per key

Read-only. Superseded by the v2 query endpoint's dimensions.

Acts onstats_breakdown
Permission (capability)Stats key
VersionDeprecated 2024-10-09
Webhook eventNone
Rate limit600 requests per hour per key

Read-only. A current visitor is one active in the last 5 minutes.

Acts onstats_realtime
Permission (capability)Stats key
VersionDeprecated 2024-10-09
Webhook eventNone
Rate limit600 requests per hour per key

Sites

Methods for creating, listing, updating, and deleting sites in an account.6

Read-only. Accepts an optional team_id to scope results to one team. The Sites API is an Enterprise plan feature.

Acts onsite
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Takes domain, with optional timezone, team_id, and tracker_script_configuration.

Acts onsite
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only. The site_id is the site domain as added to Plausible.

Acts onsite
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Takes optional domain and tracker_script_configuration.

Acts onsite
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Irreversible; removes the site and the stats collected under it.

Acts onsite
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only. A modern key is scoped to a specific team and only sees sites in that team.

Acts onteam
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Goals

Methods for managing the goals a site converts on.3

Read-only. Scoped to one site by site_id.

Acts ongoal
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Takes site_id and goal_type (event or page), plus event_name or page_path, with optional display_name.

Acts ongoal
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Removes the goal; the site stops counting it as a conversion.

Acts ongoal
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply
Methods for creating shareable dashboard links for a site.1

Takes site_id and name; returns a URL that grants dashboard access to anyone who holds it.

Acts onshared_link
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Custom properties

Methods for managing the custom event properties a site collects.3

Read-only. Scoped to one site by site_id.

Acts oncustom_property
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Takes site_id and the property to enable.

Acts oncustom_property
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Stops the property showing in the dashboard; past data is retained.

Acts oncustom_property
Permission (capability)Sites key
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Events (ingestion)

The endpoint for recording pageviews and custom events from apps and servers.1

Public ingestion; needs no API key. Requires a User-Agent header and a body with domain, name, and url, with optional referrer, props, and revenue.

Acts onevent
Permission (capability)None required
VersionIntroduced 2021-09-08
Webhook eventNone
Rate limitStandard limits apply
No endpoints match those filters.
Webhooks

Webhook events.

Plausible does not push events to an integration. To learn about new activity, an app polls the Stats API on its own schedule rather than receiving a callback.

EventWhat it signalsTriggered by
No events match that search.
Rate limits & pagination

Rate limits, pagination & request size.

Plausible meters how fast a key can call the API, capping requests per hour, and pages large stats results with a row limit and an offset.

Request rate

Plausible meters the Stats API by request rate per key, allowing 600 requests per hour by default; higher capacity is available by contacting Plausible. There is no per-method point cost. The Events API is a public ingestion endpoint and is not authenticated with a key.

Pagination

A Stats API v2 query pages results with a pagination object, defaulting to a limit of 10,000 rows and an offset of 0. An integration raises the offset to walk through a result set larger than one page.

Request size

A single stats query returns at most its pagination limit of rows, 10,000 by default. An Events API request carries at most 30 custom property key-value pairs per event.

Errors

Status codes & error handling.

The status codes an agent should handle, and what to do about each.

StatusCodeMeaningWhat to do
401unauthorizedNo valid API key was provided, or the key was sent incorrectly.Send a valid key as a Bearer token in the Authorization header, and confirm it is the right key type for the endpoint.
429too_many_requestsThe key went over its hourly request limit, 600 requests per hour by default.Slow the request rate and retry later, or contact Plausible to raise the limit.
Versioning & freshness

Version history.

Plausible versions its stats interface by a path segment, currently the v2 query endpoint, and keeps the older v1 stats endpoint available for existing integrations.

Version history

What changed, and when

Latest versionv2
v2Current version
Stats API v2 (current)

The v2 query endpoint replaced the separate v1 aggregate, timeseries, and breakdown endpoints with a single endpoint that takes a JSON body. It added multiple dimension breakdowns, custom result ordering, new location dimensions, regex matching, and OR/AND/NOT filter conditions, with better performance on large datasets.

What changed
  • Single /api/v2/query endpoint for aggregate, time series, and breakdown queries.
  • Multiple dimension breakdowns in one query.
  • New location dimensions: country_name, region_name, city_name.
  • Regex matching and OR/AND/NOT filter conditions; custom order_by.
  • Interactive query playground.
2021-09-08Feature update
Events API released

Plausible released the Events API to record pageviews and custom events from places the tracking script cannot run, like mobile apps and server-side code, alongside the existing Stats and Sites APIs.

What changed
  • POST /api/event endpoint for pageviews and custom events.
  • No API key required; identifies the visitor from the User-Agent header.

Build new integrations on the v2 query endpoint; the v1 stats endpoint remains for older code.

Plausible changelog ↗
Questions

Plausible API, answered.

What is the difference between a Stats API key and a Sites API key?+
They are two key types chosen when a key is created. A Stats API key reads analytics through the Stats API and cannot change anything. A Sites API key is required to provision and manage sites, goals, shared links, and custom properties through the Sites API. Picking the right type at creation is how access is limited.
Does Plausible send webhooks?+
No. Plausible does not push events to an integration when something happens. An app that wants to know about new traffic polls the Stats API on its own schedule, for example querying the real-time visitor count or re-running an aggregate query.
What are the rate limits?+
An API key is limited to 600 requests per hour by default. Going over returns a 429 response. Plausible can raise the limit on request through support. The Events API is a public ingestion endpoint and is not authenticated with a key.
How do I authenticate a request?+
Send the API key as a Bearer token in the Authorization header. Use a Stats API key for the Stats API and a Sites API key for the Sites Provisioning API; sending the wrong type fails. The Events API is the exception and needs no key.
What is the difference between the v1 and v2 Stats APIs?+
The v2 query endpoint, introduced in October 2024, is a single endpoint that takes a JSON body and can return an aggregate, a time series, or a breakdown, with multiple dimensions, regex filters, and OR/AND/NOT conditions. The older v1 stats endpoints are separate paths for aggregate, timeseries, and breakdown, and remain available for existing integrations.
Do I need a paid plan to use the API?+
Yes. The Stats API is a Business plan feature, and the Sites Provisioning API is an Enterprise plan feature. The Events API is available for tracking and needs no key.
Related

More analytics API guides for agents

What is Bollard AI?

Control what every AI agent can do in Plausible.

Bollard AI sits between a team's AI agents and Plausible. Grant each agent exactly the access it needs, reading stats without ever managing sites, and every call is checked and logged.

  • Let a reporting agent read stats while it can never create or delete a site.
  • Denied by default, so an agent reaches only what has been explicitly allowed.
  • Every call recorded in plain English: who, what, where, and the decision.
Plausible
Traffic Reporter
Query site stats ActionOffReadFull use
Create and delete sites ActionOffReadFull use
Goals ResourceOffReadFull use
Send events ActionOffReadFull use
Per-agent access, set in Bollard AI, not in Plausible