Skip to documentation

Automations

Trigger

Start runs with a custom event your app sends.

Choose the event

Every automation starts with a Custom event card; custom events are the only trigger. Type an event name such as user.signed_up in Type or select an event, or pick an existing one. If the name is new, choose Create event to add it. Event names can be up to 256 characters and cannot start with opensend:, which is reserved.

Define its payload

Events are listed under Automations → Events. Click Add event, or choose Edit event on a row, to set:

  • Event name, which cannot be changed while an automation uses the event.
  • Event properties: optional property names, each with a type of string, number, boolean, or date. Add rows with Add event property.

When an event has properties, every property is required and must have its type; a payload that does not match is rejected with 422. Extra properties are allowed. An event without properties accepts any payload. Deleting an event definition only stops the check; automations keep using the name.

Send the event

Your app sends the event with send event, using a full-access key. Pass the event name, exactly one of email or contact_id, and an optional payload object.

bash
curl "$OPENSEND_BASE_URL/events/send" -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" -d '{"event":"user.signed_up","email":"you@example.net","payload":{"plan":"pro"}}'

The response is 202. Each enabled automation with that trigger starts a run for the contact. If the email belongs to no contact, one is created, but only when an enabled automation actually starts a run.

Things to know

  • Sending an event that has no definition does not create one.
  • A payload can be up to 64 KB and 32 levels deep.
  • Sent events are kept for 30 days. They are never delivered to webhooks.
  • Steps read the payload as event.<property>, for example event.plan.