Read an event
GET /v1/events/{event_id}
| Property | Value |
|---|---|
| Operation | get_event |
| Group | Events |
| Scope | events:read |
Scopes of include values | data needs events:read |
| Route class | read |
| Idempotency | No Idempotency-Key |
| Audit | An audited content read events.event.read, when the request names an include value |
| Released in | 1.52.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Answers one event of the log by its id, as a delivery carried it, for 30 days (a target); an event of the other environment, or one pruned from the log, is not_found. From 1.62.0 a custom event's data in PHI mode is answered only to a read that names include=data, an audited content read (ADR 0051 rule 8); outside PHI mode the data is answered as delivered.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the events:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl "$VOCAL_API/v1/events/evt_..." \
-H "Authorization: Bearer $VOCAL_API_KEY"const response = await fetch(`${process.env.VOCAL_API}/v1/events/evt_...`, {
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
},
});
console.log(response.status, await response.text());import os
import requests
response = requests.get(
f"{os.environ['VOCAL_API']}/v1/events/evt_...",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
event_id | path | EventId | yes | The id of an event: evt_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
include | query | array of EventInclude | no | data adds a custom event's data in PHI mode. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | Event | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden |
404 | application/json | ErrorEnvelope | not_found |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is Event.
| Field | Type | Required | Description |
|---|---|---|---|
api_version | "v1" | yes | |
created_at | Timestamp | yes | When the change the event describes committed. |
data | map of any | yes | The type's data, typed in the catalog (GET /v1/event-types, and the *EventData components). In PHI mode only its structural and identifier fields travel; from 1.62.0 a custom event's data is the customer's, which in PHI mode travels empty and GET /v1/events/{event_id} answers with include=data. |
family | EventFamily | yes | |
id | EventId | yes | Assigned once in the producing transaction and kept across retries and replays: de-duplicate on it. |
livemode | boolean | yes | True for the live environment. |
object | "event" | yes | |
organization_id | OrganizationId | yes | |
project_id | ProjectId or null | yes | The resource's Project: the default Project until Projects ship, null for a resource of the Organization itself, such as a Member. |
sequence | integer | yes | The per-Organization order the relay assigns (ADR 0051 rule 7). Events about one subject keep their causal order; across subjects the order is relay order. A Webhook receiver uses it to discard a stale update. From 1.64.0, stated: a webhook.test envelope, which takes no place in the log, carries the latest relayed sequence of the Organization, at least 1, so it is never a new position in the order. |
source | EventSource | yes | |
subject | EventSubject | yes | |
targets | EventTargets or null | no | On a custom event (1.62.0): the Call and the Process its request named; absent on every other type. |
type | string | yes | The event type, one of EventTypeName, or from 1.62.0 a CustomEventType of the family custom; a reader treats a type it does not know as an event it does not interpret. |