PlatformXeDocs
Get API Key

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.

MethodPathScopePlan
GET/api/v1/events/customevents:readEvery plan
POST/api/v1/events/customevents:manageBasic and above
GET/api/v1/events/custom/{id}events:readEvery plan
PATCH/api/v1/events/custom/{id}events:manageBasic and above
DELETE/api/v1/events/custom/{id}events:manageBasic 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

FieldTypeRequiredDescription
namespacestringYesOne of your organisation's allowed namespaces
namestringYes^[a-z][a-z0-9_.-]{1,60}$, dots allowed (property.favorited)
versionstringYesMAJOR.MINOR.PATCH, one step from your previous version of the same name
statusstringNodraft (default) or published. A draft cannot be emitted: publish it with PATCH
descriptionstringNoAt most 2,000 characters
payloadSchemaobjectYesJSON Schema 2020-12 (or an OpenAPI 3.1 component schema)
payloadExampleobjectNoMust 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.

CodeStatusCause
CUSTOM_EVENTS_REGISTRATION_NOT_AVAILABLE402Free plan
cannot_archive_generic_event403platformxe.generic is managed by the platform
event_not_found404No registration with that id in your organisation
NOT_FOUND404Organisation 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 (mode omitted) 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 on emitId).
  • 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.