Skip to Content
sesameSend

Events

Create and manage Events

Retrieve a list of events

GET /events

Query parameters

NameTypeRequiredDescription
limitintegernoNumber of items to return.
afterstringnoReturn items after this cursor.
beforestringnoReturn items before this cursor.

Example

curl -X GET "$SESAMESEND_URL/events" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "string",
      "name": "string",
      "schema": null,
      "created_at": "2023-10-06 23:47:56.678+00",
      "updated_at": "2023-10-06 23:47:56.678+00"
    }
  ]
}

Create an event

POST /events

Body

FieldTypeRequiredDescription
namestringyesThe name of the event. Cannot start with the reserved resend: prefix.
schemaobject | nullnoAn optional flat key/type map defining the event payload schema. Supported types are string, number, boolean, and date.

Example

curl -X POST "$SESAMESEND_URL/events" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string"
}'

Responses

StatusDescription
201OK
{
  "object": "event",
  "id": "string"
}

Send an event

POST /events/send

Body

FieldTypeRequiredDescription
eventstringyesThe name of the event to send.
contact_idstringnoThe ID of the contact to associate with this event. Exactly one of contact_id or email must be provided.
emailstringnoThe email address to associate with this event. Exactly one of contact_id or email must be provided.
payloadobjectnoAn optional payload of key/value pairs to include with the event.

Example

curl -X POST "$SESAMESEND_URL/events/send" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "event": "string"
}'

Responses

StatusDescription
202Accepted
{
  "object": "event",
  "event": "string"
}

Retrieve a single event

GET /events/{identifier}

Path parameters

NameTypeRequiredDescription
identifierstringyesThe event ID (UUID) or event name.

Example

curl -X GET "$SESAMESEND_URL/events/<identifier>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "event",
  "id": "string",
  "name": "string",
  "schema": null,
  "created_at": "2023-10-06 23:47:56.678+00",
  "updated_at": "2023-10-06 23:47:56.678+00"
}

Update an event

PATCH /events/{identifier}

Path parameters

NameTypeRequiredDescription
identifierstringyesThe event ID (UUID) or event name.

Body

FieldTypeRequiredDescription
schemaobject | nullyesA flat key/type map defining the event payload schema. Set to null to clear the schema. Supported types are string, number, boolean, and date.

Example

curl -X PATCH "$SESAMESEND_URL/events/<identifier>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "schema": null
}'

Responses

StatusDescription
200OK
{
  "object": "event",
  "id": "string"
}

Delete an event

DELETE /events/{identifier}

Path parameters

NameTypeRequiredDescription
identifierstringyesThe event ID (UUID) or event name.

Example

curl -X DELETE "$SESAMESEND_URL/events/<identifier>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "event",
  "id": "string",
  "deleted": true
}