Skip to main content
PATCH
/
events
/
:id
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.events.update('user.created', {
  schema: {
    plan: 'string',
    trial: 'boolean',
  },
});
$resend = Resend::client('re_xxxxxxxxx');

$resend->events->update('user.created', [
  'schema' => [
    'plan' => 'string',
    'trial' => 'boolean',
  ],
]);
import resend

resend.api_key = "re_xxxxxxxxx"

params: resend.Events.UpdateParams = {
  "identifier": "user.created",
  "schema": {
    "plan": "string",
    "trial": "boolean",
  },
}

resend.Events.update(params)
require "resend"

Resend.api_key = "re_xxxxxxxxx"

params = {
  identifier: "user.created",
  schema: {
    plan: "string",
    trial: "boolean",
  },
}

Resend::Events.update(params)
package main

import "github.com/resend/resend-go/v3"

func main() {
	client := resend.NewClient("re_xxxxxxxxx")

	params := &resend.UpdateEventRequest{
		Schema: map[string]string{
			"plan":  resend.EventSchemaTypeString,
			"trial": resend.EventSchemaTypeBoolean,
		},
	}

	client.Events.Update("user.created", params)
}
use resend_rs::{json, types::UpdateEventOptions, Resend, Result};

#[tokio::main]
async fn main() -> Result<()> {
  let resend = Resend::new("re_xxxxxxxxx");

  let opts = UpdateEventOptions {
    schema: json!({
      "plan": "string",
      "trial": "boolean",
    }),
  };

  let _event = resend.events.update("user.created", opts).await?;

  Ok(())
}
import com.resend.*;

public class Main {
    public static void main(String[] args) {
        Resend resend = new Resend("re_xxxxxxxxx");

        UpdateEventOptions params = UpdateEventOptions.builder()
                .identifier("user.created")
                .addSchema("plan", "string")
                .addSchema("trial", "boolean")
                .build();

        UpdateEventResponseSuccess data = resend.events().update(params);
    }
}
using Resend;
using System.Text.Json;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" );

var schema = JsonSerializer.SerializeToElement( new { plan = "string", trial = "boolean" } );

var resp = await resend.EventUpdateAsync( "user.created", new EventUpdateData { Schema = schema } );
Console.WriteLine( "EventId={0}", resp.Content );
curl -X PATCH 'https://api.resend.com/events/user.created' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json' \
     -d '{
  "schema": {
    "plan": "string",
    "trial": "boolean"
  }
}'
resend events update user.created --schema '{"plan":"string","trial":"boolean"}'
{
  "object": "event",
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Path Parameters

Body Parameters

schema
object
required
The updated schema definition for the event payload. Must be an object with flat key/type pairs, or null to clear the schema. Supported types: string, number, boolean, date.
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.events.update('user.created', {
  schema: {
    plan: 'string',
    trial: 'boolean',
  },
});
$resend = Resend::client('re_xxxxxxxxx');

$resend->events->update('user.created', [
  'schema' => [
    'plan' => 'string',
    'trial' => 'boolean',
  ],
]);
import resend

resend.api_key = "re_xxxxxxxxx"

params: resend.Events.UpdateParams = {
  "identifier": "user.created",
  "schema": {
    "plan": "string",
    "trial": "boolean",
  },
}

resend.Events.update(params)
require "resend"

Resend.api_key = "re_xxxxxxxxx"

params = {
  identifier: "user.created",
  schema: {
    plan: "string",
    trial: "boolean",
  },
}

Resend::Events.update(params)
package main

import "github.com/resend/resend-go/v3"

func main() {
	client := resend.NewClient("re_xxxxxxxxx")

	params := &resend.UpdateEventRequest{
		Schema: map[string]string{
			"plan":  resend.EventSchemaTypeString,
			"trial": resend.EventSchemaTypeBoolean,
		},
	}

	client.Events.Update("user.created", params)
}
use resend_rs::{json, types::UpdateEventOptions, Resend, Result};

#[tokio::main]
async fn main() -> Result<()> {
  let resend = Resend::new("re_xxxxxxxxx");

  let opts = UpdateEventOptions {
    schema: json!({
      "plan": "string",
      "trial": "boolean",
    }),
  };

  let _event = resend.events.update("user.created", opts).await?;

  Ok(())
}
import com.resend.*;

public class Main {
    public static void main(String[] args) {
        Resend resend = new Resend("re_xxxxxxxxx");

        UpdateEventOptions params = UpdateEventOptions.builder()
                .identifier("user.created")
                .addSchema("plan", "string")
                .addSchema("trial", "boolean")
                .build();

        UpdateEventResponseSuccess data = resend.events().update(params);
    }
}
using Resend;
using System.Text.Json;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" );

var schema = JsonSerializer.SerializeToElement( new { plan = "string", trial = "boolean" } );

var resp = await resend.EventUpdateAsync( "user.created", new EventUpdateData { Schema = schema } );
Console.WriteLine( "EventId={0}", resp.Content );
curl -X PATCH 'https://api.resend.com/events/user.created' \
     -H 'Authorization: Bearer re_xxxxxxxxx' \
     -H 'Content-Type: application/json' \
     -d '{
  "schema": {
    "plan": "string",
    "trial": "boolean"
  }
}'
resend events update user.created --schema '{"plan":"string","trial":"boolean"}'
Successful updates return 200 OK with the JSON body below.
{
  "object": "event",
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}