Events
Create and manage Events
Retrieve a list of events
GET /events
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of items to return. |
after | string | no | Return items after this cursor. |
before | string | no | Return items before this cursor. |
Example
curl -X GET "$SESAMESEND_URL/events" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | The name of the event. Cannot start with the reserved resend: prefix. |
schema | object | null | no | An 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
| Status | Description |
|---|---|
201 | OK |
{
"object": "event",
"id": "string"
}Send an event
POST /events/send
Body
| Field | Type | Required | Description |
|---|---|---|---|
event | string | yes | The name of the event to send. |
contact_id | string | no | The ID of the contact to associate with this event. Exactly one of contact_id or email must be provided. |
email | string | no | The email address to associate with this event. Exactly one of contact_id or email must be provided. |
payload | object | no | An 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
| Status | Description |
|---|---|
202 | Accepted |
{
"object": "event",
"event": "string"
}Retrieve a single event
GET /events/{identifier}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
identifier | string | yes | The event ID (UUID) or event name. |
Example
curl -X GET "$SESAMESEND_URL/events/<identifier>" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"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
| Name | Type | Required | Description |
|---|---|---|---|
identifier | string | yes | The event ID (UUID) or event name. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
schema | object | null | yes | A 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
| Status | Description |
|---|---|
200 | OK |
{
"object": "event",
"id": "string"
}Delete an event
DELETE /events/{identifier}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
identifier | string | yes | The event ID (UUID) or event name. |
Example
curl -X DELETE "$SESAMESEND_URL/events/<identifier>" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"object": "event",
"id": "string",
"deleted": true
}