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"
}

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 associate with this event. Exactly one of contact_id or email must be provided. If no contact with this email exists in your Audience, one will be created automatically when the automation runs.
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',
  },
});
Successful requests return 202 Accepted with the JSON body below.
{
  "object": "event",
  "event": "user.created"
}