Platform · API reference
Events
Every event on your account, whether or not an endpoint subscribes, and forwarding to your machine.
Related guide: Logs and events
The event object
Attributes
idstring- Unique identifier for the object. Stable across deliveries and replays.
objectenum- The type of object. One of
event. typestring- The event type, such as
mandate.approval.approved. created_attimestamp- When it happened.
environmentenum- The environment it happened in. One of
sandbox,live. account_idstring- Your account's ID.
api_versionstring- On a delivery: the API version it was rendered at, the endpoint's
api_version. dataobject- The event's object; see each event type.
object_idsarray of strings- The IDs the event is about (its data's
idand*_idfields).
The event object
{
"id": "evt_01M7VYJNP621NB5SY85XD481NG",
"object": "event",
"type": "mandate.intent.revoked",
"created_at": "2026-11-20T07:43:46.886Z",
"environment": "sandbox",
"account_id": "acct_000000000000000000000000000000a2",
"data": {
"revocation_id": "rev_01M7VYJNP6AFSN8093BPQ8CGHS",
"scope": "token",
"value": "96ca2ebb-e18e-4142-bb07-2f73ecc874e9",
"reason": "cancelled by the requester"
},
"object_ids": [
"rev_01M7VYJNP6AFSN8093BPQ8CGHS"
]
}Start a listen session
POST/v1/devtools/listen_sessions
Starts forwarding your sandbox events to your machine, as provenance listen does. Returns the stream to read and the signing secret to sign forwarded events with. Sandbox keys only, and only an All products key; a key limited to some products gets 403 insufficient_scope.
Parameters
Idempotency-Keystringheader- Retry a create safely: the same key + request returns the stored response (24 h, per caller).
eventsarray of strings- Only these event types;
*or nothing for all.
Returns
The session. The same signing secret comes back every time for your account, so a local handler is set up once.
Errors
export PROVENANCE_KEY=prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5
curl -X POST "$PROVENANCE_API/v1/devtools/listen_sessions" \
-H "Authorization: Bearer $PROVENANCE_KEY" \
-H "Content-Type: application/json" \
-d '{ "events": ["mandate.approval.approved", "mandate.approval.declined"] }'const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/devtools/listen_sessions`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5", "Content-Type": "application/json" },
body: JSON.stringify({ "events": ["mandate.approval.approved", "mandate.approval.declined"] }),
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/devtools/listen_sessions", headers={"Authorization": "Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5"}, json={
"events": [
"mandate.approval.approved",
"mandate.approval.declined"
]
}).json()Response 201
{
"id": "lsn_01M7VYJTGPT49BN44TVT9RAKK4",
"object": "listen_session",
"environment": "sandbox",
"events": [
"mandate.approval.approved",
"mandate.approval.declined"
],
"stream_path": "/v1/devtools/listen_sessions/lsn_01M7VYJTGPT49BN44TVT9RAKK4/stream?events=mandate.approval.approved%2Cmandate.intent.declined",
"secret": "whsec_bI4QonWpZAj2hpM1qyrVakd1EIjIYtxl0fdpO7",
"signature_header": "Provenance-Signature"
}Retrieve an event
GET/v1/events/{id}
One event, with the deliveries made of it to your webhook endpoints.
Parameters
idstringpathRequired- The object's ID.
Returns
The event and its deliveries.
Errors
export PROVENANCE_KEY=prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/intents" \
-H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
-H "Content-Type: application/json" \
-d '{
"action_description": "Pay invoice INV-2041",
"agent_session_id": "sess_reference_events",
"device_id": "dev_00000000000000000000000000000001"
}' > step.json
export INTENT_TOKEN=$(jq -r '.intent_token' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/revocations" \
-H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
-H "Content-Type: application/json" \
-d "{
\"intent_token\": \"$INTENT_TOKEN\",
\"reason\": \"cancelled by the requester\"
}" > /dev/null
curl -s "$PROVENANCE_API/v1/events?limit=1" \
-H "Authorization: Bearer $PROVENANCE_KEY" > step.json
export EVENT_ID=$(jq -r '.data[0].id' step.json)
curl "$PROVENANCE_API/v1/events/$EVENT_ID" \
-H "Authorization: Bearer $PROVENANCE_KEY"const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"action_description": "Pay invoice INV-2041",
"agent_session_id": "sess_reference_events",
"device_id": "dev_00000000000000000000000000000001"
}),
})).json();
const intentToken = step1.intent_token;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/revocations`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"intent_token": intentToken,
"reason": "cancelled by the requester"
}),
})).json();
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/events?limit=1`, {
headers: { Authorization: "Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" },
})).json();
const eventId = step3.data[0].id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/events/${eventId}`, {
headers: { Authorization: "Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"action_description": "Pay invoice INV-2041",
"agent_session_id": "sess_reference_events",
"device_id": "dev_00000000000000000000000000000001"
}).json()
intent_token = step1["intent_token"]
step2 = httpx.post(f"{api}/v1/mandate/revocations", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"intent_token": intent_token,
"reason": "cancelled by the requester"
}).json()
step3 = httpx.get(f"{api}/v1/events?limit=1", headers={"Authorization": "Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5"}).json()
event_id = step3["data"][0]["id"]
data = httpx.get(f"{api}/v1/events/{event_id}", headers={"Authorization": "Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5"}).json()Response 200
{
"id": "evt_01M7VYJR3RFA7D8DB5GK5Z3945",
"object": "event",
"type": "mandate.intent.revoked",
"created_at": "2026-11-20T07:43:49.368Z",
"environment": "sandbox",
"account_id": "acct_000000000000000000000000000000a2",
"data": {
"revocation_id": "rev_01M7VYJR3RJP09ZG8PH958CE55",
"scope": "token",
"value": "d2386db2-c570-4b4e-acb1-51b510205ed8",
"reason": "cancelled by the requester"
},
"object_ids": [
"rev_01M7VYJR3RJP09ZG8PH958CE55"
],
"deliveries": []
}List events
GET/v1/events
Lists your account's events, newest first, whether or not a webhook endpoint subscribes to them. Kept 7, 30 or 90 days by plan. With an API key, only an All products key reads them; a key limited to some products gets 403 insufficient_scope.
Parameters
limitintegerquery- Page size, 1–100 (default 20). Outside the range → 400 parameter_invalid.
cursorstringquery- Opaque; pass a response's
next_cursorback to get the next page. typestringquery- Only these event types, comma-separated.
created_gtetimestampquery- Only events at or after this time.
created_ltetimestampquery- Only events at or before this time.
object_idstringquery- Only events about this object.
Returns
A page of events, newest first.
Errors
export PROVENANCE_KEY=prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5
curl -s -X POST "$PROVENANCE_API/v1/mandate/intents" \
-H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
-H "Content-Type: application/json" \
-d '{
"action_description": "Pay invoice INV-2041",
"agent_session_id": "sess_reference_events",
"device_id": "dev_00000000000000000000000000000001"
}' > step.json
export INTENT_TOKEN=$(jq -r '.intent_token' step.json)
curl -s -X POST "$PROVENANCE_API/v1/mandate/revocations" \
-H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
-H "Content-Type: application/json" \
-d "{
\"intent_token\": \"$INTENT_TOKEN\",
\"reason\": \"cancelled by the requester\"
}" > /dev/null
curl "$PROVENANCE_API/v1/events?limit=2&type=mandate.intent.revoked" \
-H "Authorization: Bearer $PROVENANCE_KEY"const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"action_description": "Pay invoice INV-2041",
"agent_session_id": "sess_reference_events",
"device_id": "dev_00000000000000000000000000000001"
}),
})).json();
const intentToken = step1.intent_token;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/revocations`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"intent_token": intentToken,
"reason": "cancelled by the requester"
}),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/events?limit=2&type=mandate.intent.revoked`, {
headers: { Authorization: "Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/intents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"action_description": "Pay invoice INV-2041",
"agent_session_id": "sess_reference_events",
"device_id": "dev_00000000000000000000000000000001"
}).json()
intent_token = step1["intent_token"]
step2 = httpx.post(f"{api}/v1/mandate/revocations", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"intent_token": intent_token,
"reason": "cancelled by the requester"
}).json()
data = httpx.get(f"{api}/v1/events?limit=2&type=mandate.intent.revoked", headers={"Authorization": "Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5"}).json()Response 200
{
"object": "list",
"data": [
{
"id": "evt_01M7VYJNP621NB5SY85XD481NG",
"object": "event",
"type": "mandate.intent.revoked",
"created_at": "2026-11-20T07:43:46.886Z",
"environment": "sandbox",
"account_id": "acct_000000000000000000000000000000a2",
"data": {
"revocation_id": "rev_01M7VYJNP6AFSN8093BPQ8CGHS",
"scope": "token",
"value": "96ca2ebb-e18e-4142-bb07-2f73ecc874e9",
"reason": "cancelled by the requester"
},
"object_ids": [
"rev_01M7VYJNP6AFSN8093BPQ8CGHS"
]
}
],
"has_more": false,
"next_cursor": null
}Stream a listen session
GET/v1/devtools/listen_sessions/{id}/stream
Server-Sent Events of your sandbox events as they happen: event: event with the full event as data. Read it with the key that started the session. A stream ends after an hour; reconnect.
Parameters
idstringpathRequired- The listen session's ID.
eventsstringquery- Only these event types, comma-separated.
Returns
An event stream (text/event-stream).
Errors
export PROVENANCE_KEY=prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5
curl "$PROVENANCE_API/v1/devtools/listen_sessions/$LISTEN_SESSION_ID/stream" \
-H "Authorization: Bearer $PROVENANCE_KEY"const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/devtools/listen_sessions/${listenSessionId}/stream`, {
headers: { Authorization: "Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
data = httpx.get(f"{api}/v1/devtools/listen_sessions/{listen_session_id}/stream", headers={"Authorization": "Bearer prv_test_all_A1lP7vQ3bW9mK2sYd6cFjLh8gAe4tR5"}).json()