Skip to main content
Betterumami’s tracking endpoints let you record analytics events from anywhere — a backend service, a mobile app, a CLI tool, or any environment where embedding a JavaScript snippet isn’t practical. Both endpoints accept the same event shape, require no authentication token, and return a session reference you can use to stitch events together. The only hard requirement is a valid User-Agent header so the server can correctly parse the client environment.

POST /api/send

Use this endpoint to record a single event — a pageview, a named custom event, a user identification call, or a performance measurement. Cloud endpoint: https://cloud.umami.is/api/send
Self-hosted endpoint: https://<your-instance>/api/send
Unlike most Betterumami API endpoints, /api/send does not require an Authorization header. Your Website ID (set in payload.website) is the only credential needed to associate the event with your account.
You must include a valid User-Agent header on every request. Requests with a missing or empty User-Agent are silently dropped and no event is recorded.

Parameters

All fields live inside a payload object. The top-level type field selects the event category.
string
required
The category of event to record. One of:
  • event — a pageview or named custom event
  • identify — a user identification payload that enriches subsequent events
  • performance — a web performance measurement (e.g. Core Web Vitals)
string
required
The Website ID of the site this event belongs to. Find this value under Settings → Websites in your Betterumami dashboard.
string
The page URL path where the event occurred (e.g. /blog/my-post). For pageviews, this is the canonical URL of the page.
string
The hostname of the site (e.g. www.example.com). Used to group events by domain.
string
The page title at the time the event was recorded (e.g. "My Blog Post | Acme Corp").
string
The referring URL, if any. Pass an empty string if there is no referrer.
string
The visitor’s screen resolution formatted as "widthxheight" (e.g. "1920x1080"). Used for device breakdowns.
string
The visitor’s browser language tag (e.g. "en-US"). Used for language breakdowns.
string
The name of the custom event (e.g. "signup", "add-to-cart"). Required when recording a named event rather than a plain pageview.
string
An optional freeform tag you can attach to the event for segmentation (e.g. "experiment-a").
string
A client-generated session identifier. If omitted, the server generates one. Pass a stable value to join events across multiple requests into the same session.
object
An optional key-value map of custom properties to attach to the event (e.g. {"plan": "pro", "trial": true}). Values can be strings, numbers, or booleans.

Sample request and response

The response contains three fields:

Building the payload from browser APIs

When calling /api/send from a browser context, you can derive most payload fields directly from native browser APIs:
When sending events from a Node.js server, set the User-Agent header to the actual browser User-Agent string you received from the incoming request rather than a generic server identifier. This keeps your analytics data accurate for device and browser breakdowns.

POST /api/batch

Use /api/batch to send multiple events in a single HTTP request. This is more efficient than making one /api/send call per event and is the recommended pattern when you’re replaying buffered events, ingesting offline data, or flushing a client-side queue on page unload. Cloud endpoint: https://cloud.umami.is/api/batch
Self-hosted endpoint: https://<your-instance>/api/batch
The request body is a JSON array where each element has the same shape as a single /api/send body. All type values and payload fields supported by /api/send are supported here too.
Like /api/send, the /api/batch endpoint does not require an Authorization header, but it does require a valid User-Agent header.

Sample request and response

Response fields

A partial success is still a 200 OK response. Always check the errors field — even when the HTTP status is successful, individual events in the batch may have been rejected. Use the details array to identify and retry failed items.

Handling partial failures