Skip to main content
POST
/
events
/
send
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

// Trigger with a contact ID
const { data, error } = await resend.events.send({
  event: 'user.created',
  contactId: '7f2e4a3b-dfbc-4e9a-8b2c-5f3a1d6e7c8b',
  payload: {
    plan: 'pro',
  },
});

// Trigger with an email address
const { data, error } = await resend.events.send({
  event: 'user.created',
  email: 'steve.wozniak@gmail.com',
  payload: {
    plan: 'pro',
  },
});
{
  "object": "event",
  "event": "user.created"
}
Automations are currently in private alpha and only available to a limited number of users. APIs might change before GA.To use the methods on this page, you must upgrade your Resend SDK:
npm install resend@6.10.0-preview-workflows.3
Contact us if you’re interested in testing this feature.

Body Parameters

event
string
required
The name of the event to trigger. Must match the event name configured in an automation trigger step.
Either contact_id or email must be provided, but not both.
email
string
The email address to run the automation for. Required if contact_id is not provided.
payload
object
An optional object containing custom data to pass to the automation. This data can be used in template variables and conditions. If the event has a schema defined, the payload values will be validated and coerced to match the schema types.
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

// Trigger with a contact ID
const { data, error } = await resend.events.send({
  event: 'user.created',
  contactId: '7f2e4a3b-dfbc-4e9a-8b2c-5f3a1d6e7c8b',
  payload: {
    plan: 'pro',
  },
});

// Trigger with an email address
const { data, error } = await resend.events.send({
  event: 'user.created',
  email: 'steve.wozniak@gmail.com',
  payload: {
    plan: 'pro',
  },
});
{
  "object": "event",
  "event": "user.created"
}