Poll API
Poll API provides a stream of Doma Protocol events. These events could be used to build your own representation of Doma protocol state, analytics, or any kind of processing.
API works using Poll -> Acknowledge system. It means that to receive new events, older events should be acknowledged. Sample integration could look like this:
Call Poll API to get new events. Optional
limitandeventTypescould be specified.Process events (store in database, send to message queue, etc.).
Call Poll Ack API to acknowledge last received event (you can use
lastIdfrom response). This would acknowledge all of the events from polled batch.
Tips:
To process events one-by-one, specify
limit=1in Poll API call.To reprocess already received events (e.g. if new event type is added), Poll Reset API can be used to rewind polling cursor to a lower id. To reset cursor to the beginning,
eventIdshould be set to0.Each returned event has a
uniqueIdfield, that can be used as an idempotency key for events processing.
Returns blockchain events that have occurred since the last acknowledged event.
Cursor identifier to use for tracking the polling state. Can be used to manage multiple independent polling states.
Maximum number of events to return in a single response page.
Whether to return only finalized events.
trueBad Request. Invalid query parameters.
Unauthorized. API Key is missing or invalid.
Forbidden. API Key is missing 'EVENTS' permission.
GET /v1/poll HTTP/1.1
Host: api-testnet.doma.xyz
Api-Key: YOUR_API_KEY
Accept: */*
{
"events": [
{
"id": 101,
"name": "example.com",
"tokenId": "109782310436602119473309635585647935844683647842954156419454133097053284015402",
"type": "NAME_TOKEN_MINTED",
"uniqueId": "text",
"relayId": "text",
"eventData": {
"networkId": "eip155:1",
"finalized": true,
"txHash": "text",
"blockNumber": "11111",
"logIndex": 1,
"tokenAddress": "0x1234567890123456789012345678901234567890",
"tokenId": "1",
"type": "NAME_TOKEN_MINTED",
"owner": "text",
"name": "example.com",
"expiresAt": "2026-01-17T13:55:54.099Z",
"correlationId": "text"
}
}
],
"lastId": 42,
"hasMoreEvents": true
}Updates the last acknowledged event id for the client.
Last event id that was processed by the client.
Cursor identifier to use for tracking the polling state. Can be used to manage multiple independent polling states.
No content
Bad Request. Invalid event id.
Unauthorized. API Key is missing or invalid.
Forbidden. API Key is missing 'EVENTS' permission.
POST /v1/poll/ack/{lastEventId} HTTP/1.1
Host: api-testnet.doma.xyz
Api-Key: YOUR_API_KEY
Accept: */*
No content
Updates the last acknowledged event id for the client. Can be used to reset the polling state to re-consume events.
Event id to reset the last acknowledged event id to.
Cursor identifier to use for tracking the polling state. Can be used to manage multiple independent polling states.
No content
Bad Request. Invalid event id.
Unauthorized. API Key is missing or invalid.
Forbidden. API Key is missing 'EVENTS' permission.
POST /v1/poll/reset/{eventId} HTTP/1.1
Host: api-testnet.doma.xyz
Api-Key: YOUR_API_KEY
Accept: */*
No content
Last updated