Ir a la documentación
API

Eventos

Cada operación de este grupo: lo que acepta, lo que devuelve y los errores con los que puede responder.

Operaciones

Things your contacts did, sent by your own code: an order placed, a trial started, a plan changed. An event is stored against the contact for 90 days. It starts every live automation whose trigger names it, ends a wait step that was waiting for it, and can be read by a branch.

Send one with POST /events or up to 100 with POST /events/batch. Both take an Idempotency-Key header, so a retry never records an event twice. A key or an app may send 600 events a minute. Sending needs contacts:write and reading the events of a contact needs contacts:read.

POST/events

Send a contact event

Alcancescontacts:writeEnvía correo
Admite Idempotency-Key

Records that something happened to one contact, named by email or contactId. Every live automation whose trigger is this event name, and whose filters match properties, takes the contact in, and any wait step holding out for the name moves on. enrolled and resumed say what it set off.

An address nobody has saved is a 404 unless createContact is true, which adds it to the contacts first. An event sent with a test key is stored with mode test and starts nothing. A key or an app may send 600 events a minute.

Requires the contacts:write scope.

Encabezados

Idempotency-Keystring

Makes a retry safe. The same key with the same event returns the stored event with replayed true and starts nothing again. The same key with a different event is a 422 idempotency_key_reuse.

Hasta 255 caracteres

Cuerpo de la petición

namestringObligatorio

What happened, such as order.placed: 1 to 100 letters, digits, dots, colons, dashes and underscores, starting with a letter or a digit. Names are matched exactly, case included.

De 1 a 100 caracteres
emailstring

The contact the event is about, by email address. Send this or contactId.

Hasta 320 caracteresFormatoemail
contactIdstring

The contact the event is about, by id. Send this or email.

De 1 a 64 caracteres
propertiesRecord<string, any>

Anything worth keeping about the event, as a JSON object of at most 50 keys and 4 KB. An event trigger can filter on these, and steps can put them in an email or a contact field.

occurredAtstring

When it happened, as an ISO 8601 instant. Left out, it is now. It cannot be in the future or more than 90 days ago.

Formatodate-time
createContactboolean

Add the address to the contacts when nobody has it yet. It needs email. Left out or false, an unknown address is a 404 contact_not_found.

contactNamestring

The name to give a contact that createContact adds.

Hasta 200 caracteres

Devuelve

A replay: the event this Idempotency-Key stored before.

Recorded.

Errores

404

contact_not_found when nobody has that address or id and createContact is not true.

422

invalid_event when the name, the properties or occurredAt break a rule or no contact is named, invalid_parameter or unknown_parameter for a body of the wrong shape, or idempotency_key_reuse when the key was already used for a different event.

429

event_rate_limited: more events in a minute than the key or app may send.

Los errores que puede devolver cualquier operación400401403500Catálogo de errores

También disponible en

TypeScript
events.send()
Python
events.send()
Ruby
events.send
PHP
events->send
Go
Events.Send
Java
events().send
C#
Events.SendAsync
CLI
openemail events send

POST/events/batch

Send contact events in a batch

Alcancescontacts:writeEnvía correo
Admite Idempotency-Key

Records up to 100 events in one call, each handled exactly as POST /events handles one, in order. One event failing does not stop the rest: accepted holds the ones that were stored and failed the ones that were not, each with the index it had in the request. A body of the wrong shape is refused whole. The batch counts as that many events toward the 600 a minute a key or an app may send.

Requires the contacts:write scope.

Encabezados

Idempotency-Keystring

Makes a retry of the whole batch safe. Each event is remembered under the key and its position, so resend the same events in the same order.

Hasta 255 caracteres

Cuerpo de la petición

eventsobject[]Obligatorio

The events, 1 to 100 of them, each in the shape a single event takes.

De 1 a 100 elementos
namestringObligatorio

What happened, such as order.placed: 1 to 100 letters, digits, dots, colons, dashes and underscores, starting with a letter or a digit. Names are matched exactly, case included.

De 1 a 100 caracteres
emailstring

The contact the event is about, by email address. Send this or contactId.

Hasta 320 caracteresFormatoemail
contactIdstring

The contact the event is about, by id. Send this or email.

De 1 a 64 caracteres
propertiesRecord<string, any>

Anything worth keeping about the event, as a JSON object of at most 50 keys and 4 KB. An event trigger can filter on these, and steps can put them in an email or a contact field.

occurredAtstring

When it happened, as an ISO 8601 instant. Left out, it is now. It cannot be in the future or more than 90 days ago.

Formatodate-time
createContactboolean

Add the address to the contacts when nobody has it yet. It needs email. Left out or false, an unknown address is a 404 contact_not_found.

contactNamestring

The name to give a contact that createContact adds.

Hasta 200 caracteres

Devuelve

What was stored and what was not.

Errores

422

invalid_parameter or unknown_parameter for a body of the wrong shape, with param naming the event and the field, such as events.3.name.

429

event_rate_limited: the batch would pass the events a minute the key or app may send. Nothing was stored.

Los errores que puede devolver cualquier operación400401403404500Catálogo de errores

También disponible en

TypeScript
events.sendBatch()
Python
events.send_batch()
Ruby
events.send_batch
PHP
events->sendBatch
Go
Events.SendBatch
Java
events().sendBatch
C#
Events.SendBatchAsync
CLI
openemail events send-batch

GET/events/names

List the event names in use

Alcancesautomations:readLee

The distinct names of the events the workspace holds, in byte order, at most 100. It is what the app suggests when somebody picks the event that starts an automation. Events are kept for 90 days, so a name nothing has sent in that time is gone.

Requires the automations:read scope.

Devuelve

Errores

Los errores que puede devolver cualquier operación400401403404422500Catálogo de errores

También disponible en

TypeScript
events.listNames()
Python
events.list_names()
Ruby
events.list_names
PHP
events->listNames
Go
Events.ListNames
Java
events().listNames
C#
Events.ListNamesAsync
CLI
openemail events list-names
MCP
listContactEventNames

GET/contacts/{email}/events

List the events of a contact

Alcancescontacts:readLee

The events recorded for one contact in the last 90 days, the most recent first by when they happened. An app a member connected reads only the contacts that member added.

Requires the contacts:read scope.

Parámetros de ruta

emailstringObligatorio

The contact, by email address, compared without case. The contactId an event or an enrollment carries works here too.

Parámetros de consulta

namestring

Only events with exactly this name.

De 1 a 100 caracteres
limitinteger

Rows per page, 1 to 200.

Al menos 1Como máximo 200Predeterminado50
cursorstring

The id of the last event on the previous page. Keyset, not offset: pass the previous page's nextCursor. One that names nothing in this list is a 400 invalid_cursor.

Devuelve

A page of events.

Errores

404

contact_not_found when nobody you can reach has that address or id.

Los errores que puede devolver cualquier operación400401403422500Catálogo de errores

También disponible en

TypeScript
contacts.listEvents()contacts.listAllEvents()contacts.iterateEvents()
Python
contacts.list_events()contacts.list_all_events()contacts.iterate_events()
Ruby
contacts.list_eventscontacts.list_all_eventscontacts.iterate_events
PHP
contacts->listEventscontacts->listAllEventscontacts->iterateEvents
Go
Contacts.ListEventsContacts.ListAllEventsContacts.IterateEvents
Java
contacts().listEventscontacts().listAllEventscontacts().iterateEvents
C#
Contacts.ListEventsAsyncContacts.ListAllEventsAsyncContacts.IterateEventsAsync
CLI
openemail contacts list-events
MCP
listContactEvents

Objetos

ContactEventobject

objectstringObligatorio
Uno de"contact_event"
idstringObligatorio

The id of the event.

contactIdstringObligatorio

The id of the contact it is about.

emailstringObligatorio

The address of that contact.

Formatoemail
namestringObligatorio

What happened, as it was sent.

propertiesobjectObligatorio

The properties the event was sent with. Empty when it had none.

occurredAtstringObligatorio

When it happened.

Formatodate-time
modestringObligatorio

test when a test key sent it. A test event is stored and starts or resumes nothing.

Uno de"live""test"
createdAtstringObligatorio

When OpenEmail received it.

Formatodate-time

ContactEventBatchobject

objectstringObligatorio
Uno de"contact_event_batch"
acceptedobject[]Obligatorio

The events that were stored, in the order they were sent.

objectstringObligatorio
Uno de"contact_event"
idstringObligatorio

The id of the event.

contactIdstringObligatorio

The id of the contact it is about.

emailstringObligatorio

The address of that contact.

Formatoemail
namestringObligatorio

What happened, as it was sent.

propertiesobjectObligatorio

The properties the event was sent with. Empty when it had none.

occurredAtstringObligatorio

When it happened.

Formatodate-time
modestringObligatorio

test when a test key sent it. A test event is stored and starts or resumes nothing.

Uno de"live""test"
createdAtstringObligatorio

When OpenEmail received it.

Formatodate-time
replayedbooleanObligatorio

True when this Idempotency-Key was used before and the stored event is returned, with nothing started again.

enrolledstring[]Obligatorio

The ids of the automations the event put the contact into.

resumedintegerObligatorio

How many waits for this event it ended, across every automation the contact is in.

Al menos 0
indexintegerObligatorio

Where the event sat in the request, from 0.

Al menos 0
failedobject[]Obligatorio

The events that were not stored.

indexintegerObligatorio

Where the event sat in the request, from 0.

Al menos 0
codestringObligatorio

Why, as the single call would answer: invalid_event, contact_not_found or idempotency_key_reuse.

messagestringObligatorio

The same in a sentence.

ContactEventListobject

objectstring
Uno de"list"
hasMoreboolean

True when another page follows. Pass nextCursor back as cursor to read it.

nextCursorstring

The id of the last row on this page, or null on the last page.

Puede ser null

ContactEventNameobject

objectstringObligatorio
Uno de"contact_event_name"
namestringObligatorio

An event name the workspace holds events for.

ContactEventResultobject

objectstringObligatorio
Uno de"contact_event"
idstringObligatorio

The id of the event.

contactIdstringObligatorio

The id of the contact it is about.

emailstringObligatorio

The address of that contact.

Formatoemail
namestringObligatorio

What happened, as it was sent.

propertiesobjectObligatorio

The properties the event was sent with. Empty when it had none.

occurredAtstringObligatorio

When it happened.

Formatodate-time
modestringObligatorio

test when a test key sent it. A test event is stored and starts or resumes nothing.

Uno de"live""test"
createdAtstringObligatorio

When OpenEmail received it.

Formatodate-time
replayedbooleanObligatorio

True when this Idempotency-Key was used before and the stored event is returned, with nothing started again.

enrolledstring[]Obligatorio

The ids of the automations the event put the contact into.

resumedintegerObligatorio

How many waits for this event it ended, across every automation the contact is in.

Al menos 0