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

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.events.create({
  name: 'user.created',
  schema: {
    plan: 'string',
  },
});
{
  "object": "event",
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Documentation Index

Fetch the complete documentation index at: https://resend.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Body Parameters

name
string
required
The name of the event. Used to match events to automation triggers.
The event name can be any string (e.g., user.created, welcome, my-custom-event). Dot notation is a recommended convention but is not required. If multiple enabled automations use the same event name, all of them will be triggered. Use unique event names if you want to target a specific automation.
Event names cannot start with the resend: prefix, which is reserved for system events.
schema
object
An optional schema definition for the event payload. Must be an object with flat key/type pairs. Supported types: string, number, boolean, date.
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.events.create({
  name: 'user.created',
  schema: {
    plan: 'string',
  },
});
Successful creation returns 201 Created with the JSON body below.
{
  "object": "event",
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}