Custom Event Types
Register, read, publish and archive your organisation's custom event types over HTTP.
An event type is one registration: (namespace, name, version), a JSON Schema and a status (draft, published or archived). Only a published version can be emitted. The schema rules, the semver rules and the full list of registration error codes are on Custom Events (SDK); this page gives each route.
| Method | Path | Scope | Plan |
|---|---|---|---|
| GET | /api/v1/events/custom | events:read | Every plan |
| POST | /api/v1/events/custom | events:manage | Basic and above |
| GET | /api/v1/events/custom/{id} | events:read | Every plan |
| PATCH | /api/v1/events/custom/{id} | events:manage | Basic and above |
| DELETE | /api/v1/events/custom/{id} | events:manage | Basic and above |
Every route needs an API key bound to an organisation (403 FORBIDDEN otherwise), and reads and writes only that organisation's registrations: another organisation's id answers 404, the same as an id that does not exist.
Register an event type
POST /api/v1/events/custom
| Field | Type | Required | Description |
|---|---|---|---|
namespace | string | Yes | One of your organisation's allowed namespaces |
name | string | Yes | ^[a-z][a-z0-9_.-]{1,60}$, dots allowed (property.favorited) |
version | string | Yes | MAJOR.MINOR.PATCH, one step from your previous version of the same name |
status | string | No | draft (default) or published. A draft cannot be emitted: publish it with PATCH |
description | string | No | At most 2,000 characters |
payloadSchema | object | Yes | JSON Schema 2020-12 (or an OpenAPI 3.1 component schema) |
payloadExample | object | No | Must satisfy payloadSchema; at most 64 KiB |
curl -X POST https://api.platformxe.com/api/v1/events/custom \
-H "Content-Type: application/json" \
-H "x-api-key: pxk_live_your_api_key_here" \
-d '{
"namespace": "lettings",
"name": "property.favorited",
"version": "1.0.0",
"status": "published",
"description": "Fired when a customer favourites a property",
"payloadSchema": {
"type": "object",
"properties": {
"propertyId": { "type": "string", "maxLength": 64 },
"subjectId": { "type": "string", "maxLength": 64 }
},
"required": ["propertyId", "subjectId"],
"additionalProperties": false
}
}'
201 when the version was created, 200 when the same version with the same schema already existed (registering again is a no-op):
{
"success": true,
"data": {
"id": "cer_…",
"organizationId": "org_…",
"canonicalName": "TENANT_CUSTOM:org_…:lettings.property.favorited@1.0.0",
"namespace": "lettings",
"name": "property.favorited",
"version": "1.0.0",
"status": "published",
"description": "Fired when a customer favourites a property",
"registeredBy": "lettings",
"schemaHash": "9f2c…",
"schemaFlavour": "json-schema-2020-12",
"semverBump": "initial",
"createdAt": "2026-11-20T09:00:00.000Z",
"updatedAt": "2026-11-20T09:00:00.000Z"
}
}
A refused registration carries, beside code and message, the failing field and the validator's errors when there are any:
{
"success": false,
"error": {
"code": "minor_must_be_backwards_compatible",
"message": "…",
"field": "payloadSchema",
"errors": ["…"]
}
}
The route-level errors are 400 BAD_REQUEST (the body is not a JSON object), 402 CUSTOM_EVENTS_REGISTRATION_NOT_AVAILABLE (Free), 404 NOT_FOUND (organisation not found) and 429 RATE_LIMITED (60 registrations per hour per key). The schema, naming, semver, quota (402 registration_quota_exceeded), daily-cap (429 daily_registration_cap_exceeded) and conflict (409 version_already_exists) codes are listed on Custom Events: error codes.
An x-idempotency-key header replays the first answer to a retried request. An Idempotency-Key header is passed to the CUSTOM_EVENT_REQUESTED lifecycle event so your subscribers can correlate the attempt.
Every registration step emits a lifecycle event (CUSTOM_EVENT_REQUESTED through CUSTOM_EVENT_REGISTERED, or CUSTOM_EVENT_VALIDATION_FAILED); see the event catalogue.
List registrations
GET /api/v1/events/custom
Query: namespace, status (draft, published, archived), limit (1 to 200, default 100), offset. The answer is { events, pagination: { limit, offset, total, hasMore } }. An invalid parameter is 400 VALIDATION_ERROR. SDK calls: Custom Events.
Read a registration
GET /api/v1/events/custom/{id}
curl https://api.platformxe.com/api/v1/events/custom/cer_abc123 \
-H "x-api-key: pxk_live_your_api_key_here"
{
"success": true,
"data": {
"id": "cer_abc123",
"organizationId": "org_…",
"canonicalName": "TENANT_CUSTOM:org_…:lettings.property.favorited@1.0.0",
"namespace": "lettings",
"name": "property.favorited",
"version": "1.0.0",
"status": "published",
"description": "Fired when a customer favourites a property",
"payloadSchema": { "type": "object", "properties": { "propertyId": { "type": "string" } } },
"payloadExample": null,
"registeredBy": "lettings",
"createdAt": "2026-11-20T09:00:00.000Z",
"updatedAt": "2026-11-20T09:00:00.000Z",
"archivedAt": null
}
}
A federated copy received through a push is read the same way: its namespace is fed-<source organisation> and registeredBy is system:federation.
Errors: 404 NOT_FOUND (no registration with that id in your organisation).
Publish or edit the description
PATCH /api/v1/events/custom/{id}
Takes status: "published" (publish a draft), description (a string, or null to clear it), or both; any other field is 400 VALIDATION_ERROR. On Basic (latest version only), publishing a version archives the event's other live versions. Details and codes: Custom Events: publish a draft.
Archive a registration
DELETE /api/v1/events/custom/{id}
Soft-deletes the version: it can no longer be emitted, it stops counting toward your active-registration limit, and the change takes effect on every instance at once. The row and its history are kept. Archiving an archived version again answers 200 with its first archivedAt.
curl -X DELETE https://api.platformxe.com/api/v1/events/custom/cer_abc123 \
-H "x-api-key: pxk_live_your_api_key_here"
{ "success": true, "data": { "id": "cer_abc123", "status": "archived", "archivedAt": "2026-11-20T10:00:00.000Z" } }
The archive writes a history row and emits CUSTOM_EVENT_ARCHIVED.
| Code | Status | Cause |
|---|---|---|
CUSTOM_EVENTS_REGISTRATION_NOT_AVAILABLE | 402 | Free plan |
cannot_archive_generic_event | 403 | platformxe.generic is managed by the platform |
event_not_found | 404 | No registration with that id in your organisation |
NOT_FOUND | 404 | Organisation not found |
Dry run, emit and subscribe
These routes are documented with their SDK calls on Custom Events (SDK):
- POST
/api/v1/events/custom/dry-run: check a template (modeomitted) or an emit (mode: "emit") without writing anything. - POST
/api/v1/events/custom/emit: validate, store and queue a payload (202, delivery is asynchronous and at least once; deduplicate onemitId). - POST
/api/v1/events/custom/subscribe: subscribe an HTTPS webhook to one type (the same URL rules as event subscriptions).
Emit from a contextual messaging escalation with an EMIT_EVENT action.