تخطَّ إلى المستندات
CLI

openemail events

كل أمر في مساحة الأسماء هذه، مع وسائطه وخياراته وأمثلته.

الأوامر

Things your contacts did, sent by your own code, such as an order placed or a trial started. An event starts the automations whose trigger names it and ends the waits that were holding out for it.

يقبل كل أمر هنا أيضًا الخيارات العامة، مثل --json و--profile و--dry-run. اطّلع على الخيارات العامة

openemail events send

Record that something happened to a contact

الصلاحياتcontacts:writeيتطلب تسجيل الدخول

الاستخدام

openemail events send --name <value> [flags]
openemail events send --data <json|@file|-> [flags]

Records an event against one contact, named by email or --contact-id: an order placed, a trial started, a plan changed. 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 in the answer say what it set off. Events are kept for 90 days.

Every call carries an Idempotency-Key. The SDK generates one per call and reuses it on that call's retries, so a retried network failure returns the stored event instead of recording a second one. Pass --idempotency-key to extend that across processes and restarts. A replay resolves with replayed: true and starts nothing again. The same key with a different event is a 422 idempotency_key_reuse.

An event sent with a test key is stored with mode test and starts or resumes nothing.

الخيارات

--name <value>

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. Required, here or in --data.

--email <value>

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

--contact-id <value>

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

--properties <json|@file|->

Anything worth keeping about the event, as an object of at most 50 keys and 4 KB of JSON. An event trigger can filter on these, and steps can put them in an email or a contact field. JSON shaped as Record<string, unknown>, inline or from a file with @path.

--occurred-at <when>

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

--create-contact

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.

--contact-name <value>

The name to give a contact that --create-contact adds, at most 200 characters.

--idempotency-key <value>

Your own key, 1 to 255 characters of letters, digits, _, ., : or -. Anything else is a 400 invalid_idempotency_key.

--data <json|@file|->

The whole body as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

أمثلة

The required values only
openemail events send --name order.placed
With optional flags
openemail events send --name order.placed --email [email protected] --create-contact --idempotency-key order:AC-4192:placed
Read the whole body from a JSON file
openemail events send --data @event.json

متاح أيضًا في

API
POST /events
TypeScript
events.send()
Python
events.send()
Ruby
events.send
PHP
events->send
Go
Events.Send
Java
events().send
C#
Events.SendAsync

openemail events send-batch

Record up to 100 contact events in one call

الصلاحياتcontacts:writeيتطلب تسجيل الدخول

الاستخدام

openemail events send-batch <events> [flags]

Records each event in order, as if events.send had been called for it, and reports per event. It is never all or nothing: accepted holds the events that were stored and failed the ones that were not, each with the index it had in the array, so one unknown address does not stop the rest. The promise resolves whenever the batch was processed, so check failed instead of relying on a throw.

The batch shares one Idempotency-Key, generated once per call or supplied as --idempotency-key, and the server remembers each event under the key and its position. Retrying the same array replays the events that were already stored and records only the ones that were not. Reordering the array between attempts makes an event that moved fail with idempotency_key_reuse.

الوسائط

<events>مطلوب

The events, 1 to 100 of them, each in the shape events.send takes: name, email or contactId, and optionally properties, occurredAt, createContact and contactName.

الخيارات

--idempotency-key <value>

Your own key for the whole batch, 1 to 255 characters of letters, digits, _, ., : or -.

أمثلة

The required values only
openemail events send-batch @events.json
With optional flags
openemail events send-batch @events.json --idempotency-key trials:2026-10-11

متاح أيضًا في

API
POST /events/batch
TypeScript
events.sendBatch()
Python
events.send_batch()
Ruby
events.send_batch
PHP
events->sendBatch
Go
Events.SendBatch
Java
events().sendBatch
C#
Events.SendBatchAsync

openemail events list-names

List the event names the workspace has seen

الصلاحياتautomations:readيتطلب تسجيل الدخول

الاستخدام

openemail events list-names [flags]

Returns 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. The list is not paginated.

أمثلة

openemail events list-names
Print the raw JSON
openemail events list-names --json

متاح أيضًا في

API
GET /events/names
TypeScript
events.listNames()
Python
events.list_names()
Ruby
events.list_names
PHP
events->listNames
Go
Events.ListNames
Java
events().listNames
C#
Events.ListNamesAsync