Skip to content

Events API

List and look up individual events through the API, and when to use the query API instead.

The events endpoint lists raw events, newest first. It suits quick lookups, such as "the last few events for this user".

For anything bigger, such as counting, grouping, exporting or reading many pages, use the query API instead: it is faster, more flexible and has no paging limits of its own. To send events, use the capture API.

All requests need a personal API key with the query:read scope.

List events

GET /api/projects/<project ID>/events/
bash
curl "https://app.myjourneyanalytics.com/api/projects/12345/events/?event=%24pageview&distinct_id=user_123&limit=50" \
  -H "Authorization: Bearer <personal API key>"
ParameterDescription
eventOnly events with this name, for example $pageview or order completed
distinct_idOnly events from this distinct ID
person_idOnly events from this person
afterOnly events after this time. Defaults to 24 hours ago
beforeOnly events before this time. Defaults to now
propertiesA JSON array of property filters, such as [{"key":"$browser","value":"Chrome","operator":"exact","type":"event"}]
limitHow many events to return. Defaults to 100, at most 1,000
include_persontrue to include the person's details with each event

Because after defaults to the last 24 hours, set it explicitly when you need older events:

bash
curl "https://app.myjourneyanalytics.com/api/projects/12345/events/?after=2026-09-01T00:00:00Z&before=2026-09-02T00:00:00Z" \
  -H "Authorization: Bearer <personal API key>"

The response

json
{
  "next": "https://app.myjourneyanalytics.com/api/projects/12345/events/?event=%24pageview&before=2026-10-15T08%3A12%3A40.123000%2B00%3A00",
  "results": [
    {
      "id": "0192f0a4-5c1e-7d2b-9a51-3f0c2b9e4d11",
      "distinct_id": "user_123",
      "event": "$pageview",
      "timestamp": "2026-10-15T08:12:40.123000Z",
      "properties": { "$current_url": "https://example.com/pricing" }
    }
  ]
}

To get the next page, request the next URL. It sets before to the time of the last event you received, so each page carries on where the previous one ended. When next is null, there are no more events in the window.

Avoid the offset parameter. It is deprecated, gets slower as it grows, and large values are refused. See timestamp-based pagination.

Get one event

GET /api/projects/<project ID>/events/<event ID>/

The event ID is the event's UUID, the id field in list results. Add ?include_person=true to include the person.

Use the query API for analysis

This query returns the same events as the first example, but you can also select only the columns you need, aggregate and join:

bash
curl -X POST https://app.myjourneyanalytics.com/api/projects/12345/query/ \
  -H "Authorization: Bearer <personal API key>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "kind": "JenQLQuery",
      "query": "SELECT timestamp, event, properties.$current_url FROM events WHERE distinct_id = '\''user_123'\'' AND timestamp > now() - INTERVAL 7 DAY ORDER BY timestamp DESC LIMIT 50"
    }
  }'

See the query API for the details.

Can't find what you need? Contact support