Update Event
Update an event definition's description or schema.
Endpoint
PATCH /events/{id}
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The event ID |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
description | string | No | Updated description. Max 2000 characters. |
schema | object | No | Replacement field schema. See Create Event. |
name is immutableThe event name cannot be changed after creation — it is not accepted by this endpoint. To rename an event, create a new definition and migrate any automations that reference the old one.
Schema is replaced, not merged
Providing schema replaces the entire field list. To add a field, send the full updated fields array.
Response
Returns the updated event. See Create Event for the field reference.
{
"id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"name": "order.completed",
"description": "Updated description.",
"schema": {
"fields": [
{ "name": "order_id", "type": "string", "required": true },
{ "name": "total", "type": "number", "required": true }
]
},
"created_at": "2026-06-01T12:00:00.000Z",
"updated_at": "2026-06-02T09:30:00.000Z"
}
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X PATCH "https://api.arsel.sa/v1/events/01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a" \
-H "Authorization: Bearer be_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"description": "Updated description.",
"schema": {
"fields": [
{ "name": "order_id", "type": "string", "required": true },
{ "name": "total", "type": "number", "required": true }
]
}
}'
const id = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a";
const response = await fetch(`https://api.arsel.sa/v1/events/${id}`, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer be_your_api_key",
},
body: JSON.stringify({
description: "Updated description.",
schema: {
fields: [
{ name: "order_id", type: "string", required: true },
{ name: "total", type: "number", required: true },
],
},
}),
});
const event = await response.json();
console.log(event.updated_at);
import requests
event_id = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a"
response = requests.patch(
f"https://api.arsel.sa/v1/events/{event_id}",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer be_your_api_key",
},
json={
"description": "Updated description.",
"schema": {
"fields": [
{"name": "order_id", "type": "string", "required": True},
{"name": "total", "type": "number", "required": True},
]
},
},
)
print(response.json()["updated_at"])
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var id = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a";
var payload = new
{
description = "Updated description.",
schema = new
{
fields = new[]
{
new { name = "order_id", type = "string", required = true },
new { name = "total", type = "number", required = true }
}
}
};
var json = System.Text.Json.JsonSerializer.Serialize(payload);
var request = new HttpRequestMessage(HttpMethod.Patch, $"https://api.arsel.sa/v1/events/{id}")
{
Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json")
};
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
<?php
$id = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a";
$ch = curl_init("https://api.arsel.sa/v1/events/$id");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer be_your_api_key"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"description" => "Updated description.",
"schema" => [
"fields" => [
["name" => "order_id", "type" => "string", "required" => true],
["name" => "total", "type" => "number", "required" => true]
]
]
]));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Error Responses
- 404 Not Found
- 422 Validation Error
- 401 Unauthorized
{
"status_code": 404,
"name": "not_found",
"message": "Event 01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a not found"
}
{
"status_code": 422,
"name": "validation_error",
"message": "field.name must be a valid identifier"
}
{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid or missing API key"
}