Skip to main content
POST
https://api.resend.com
/
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": "workflow_event",
  "event": "user.created",
  "event_instance_id": "7f2e4a3b-dfbc-4e9a-8b2c-5f3a1d6e7c8b"
}
Workflows 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-canary.0
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 a workflow trigger step.
email
string
The email address to run the workflow for.
payload
object
An optional object containing custom data to pass to the workflow. This data can be used in template variables and conditions.
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": "workflow_event",
  "event": "user.created",
  "event_instance_id": "7f2e4a3b-dfbc-4e9a-8b2c-5f3a1d6e7c8b"
}