List events

Read back your project's events, newest first

GET/v1/events

Your project's event history, newest first: the events your webhooks and your stream receive, read back. Use it to catch up on what happened before you were listening. The stream starts from now or from an id you already hold, and a webhook endpoint is sent only what happens after it subscribes; neither reads back.

curl "https://api.mapier.ai/v1/events?type=message.received,command.settled&limit=2" \
  -H "Authorization: Bearer $MAPIER_API_KEY" \
  -H "x-mapier-version: 2026-12-01"
200 OK
{
  "events": [
    {
      "id": "0192a7c4-6a02-7e11-8c4d-2b9f7e3a5d10",
      "type": "message.received",
      "occurredAt": "2026-08-24T18:03:11.000Z",
      "data": {
        "conversationId": "a0000000-0000-4000-8000-000000000001",
        "from": "+14155550100",
        "text": "is it here yet?",
        "externalId": "5D1B7E0A-2F3C-4B8E-9A61-1C2D3E4F5A6B",
        "replyToExternalId": null,
        "occurredAt": "2026-08-24T18:03:11.000Z",
        "attachmentIds": [],
        "attachments": [],
        "messageId": "0192a7c4-6a02-7e11-8c4d-2b9f7e3a5d22",
        "lineId": "0192a7b0-3e4f-7051-8c6d-7e8f9a0b1c2d",
        "contactId": "c0000000-0000-4000-8000-000000000003",
        "optedOut": false
      }
    },
    {
      "id": "0192a7c4-5b1e-7c3d-9f2a-6e8d4b1c0a37",
      "type": "command.settled",
      "occurredAt": "2026-08-24T18:01:02.000Z",
      "data": {
        "commandId": "3f1a0c2e-8b47-4d19-9a5e-2c6f0b8d4e71",
        "logicalActionId": "order-2481",
        "status": "succeeded",
        "errorCode": null,
        "conversationId": "a0000000-0000-4000-8000-000000000001",
        "type": "message.send",
        "messageId": "0192a7c4-5b1e-7c3d-9f2a-6e8d4b1c0a99",
        "lineId": "0192a7b0-3e4f-7051-8c6d-7e8f9a0b1c2d",
        "externalId": null,
        "namePhoto": null,
        "projectId": "b0000000-0000-4000-8000-000000000002",
        "environment": "live",
        "failureClass": null
      }
    }
  ],
  "nextCursor": "eyJiZWZvcmUiOiIyMDI2LTEwLTExVDA5OjEyOjQwWiJ9"
}

Parameters

Prop

Type

Omit type and the list is the types a new webhook endpoint is subscribed to by default. The ten opt-in types are listed only when type names them, as a webhook endpoint and the stream treat them: location.share_started, location.updated, location.share_ended, message.edited, message.unsent, poll.created, poll.options_changed, poll.voted, poll.vote_cleared and conversation.background_changed.

from and to filter on when an event was recorded. For most events that is its occurredAt. An inbound event — a message, a receipt, a reaction — is recorded later, by however long the channel took to report it: usually seconds, longer after a connection outage. So a to copied from an inbound event's occurredAt can leave that event out.

Page with cursor: pass each answer's nextCursor back, with the same filters, until it is null. A cursor past the last page answers an empty page. A cursor is opaque: never build or parse one.

Response

events is one page, newest first, and nextCursor is the cursor for the next, older page, or null on the last.

Prop

Type

Each type the stream also sends carries that stream event as its data:

typedata is the stream's
message.receivedmessage event
command.settledcommand event
message.delivered, message.readreceipt event
message.delivery_faileddelivery_failed event
location.share_started, location.updated, location.share_endedlocation event
message.edited, message.unsentmoderation event
poll.created, poll.options_changed, poll.voted, poll.vote_clearedpoll event
conversation.background_changedchat_background event

Every other type — message.sent, message.failed, reaction.added, conversation.created, line.status_changed and the rest — carries the data a webhook subscribed to it receives.

Read back, then follow

Any id you read here is a Last-Event-ID that /v1/response_stream resumes after, so you can read back and then follow. Resume from an id a few seconds older than the newest you read, and deduplicate on id: an event can appear a moment after one with a newer id.

How long events are kept

Events are kept for at least 90 days.

Errors

StatusCodeCause
400bad_requestWith a personal access token, no x-mapier-project header
401invalid_credentialsNo key, or one that is unknown, revoked or expired
403forbiddenA personal access token not made for this environment, or whose owner's role no longer allows this
403insufficient_scopeThe key does not carry the messages:read scope
404not_foundWith a personal access token, an x-mapier-project it cannot reach
409project_archivedThe project is archived
422validation_failedA type that is not an event type, a resourceId that is not a UUID, a bad from, to or cursor, or an x-mapier-version that is not a published version
429rate_limited120 requests per minute, per key; the Retry-After header says how long to wait
500internal_errorAn unexpected error on Mapier's side; quote the error's requestId to support
503service_busyMapier was too busy to take the request and did nothing; wait details.retryAfter seconds and ask again
503upstream_unavailableA service behind Mapier did not answer; retry with backoff

Guide