Platform Event Schema and Payload Format

This page describes how to construct a valid message payload for a Salesforce Platform Event. Incorrect payloads are a common source of 400 errors when you use the Micro-Integration for Salesforce as a target.

Naming Conventions

  • The API name for any custom Platform Event always ends with __e. For example, a Platform Event named TestEvent has the API name TestEvent__e.
  • The destination path follows the pattern /event/<EVENT_NAME>__e. The subscription path follows the pattern /event/<EVENT_NAME>__e.
  • Custom fields always end with __c. For example, a field named message becomes message__c in the schema.

Standard Fields

Every Platform Event schema automatically includes the following fields regardless of what custom fields you add:

  • CreatedDate—a Unix timestamp in milliseconds (not seconds).
  • CreatedById—a non-empty string identifying the publisher. Must be a valid Salesforce user or entity ID string.

If a required field is missing from the payload, Salesforce rejects the event. This includes CreatedDate and CreatedById. If a custom field is optional (nullable), you can omit it or set it to null.

Payload Examples

The following examples show the format for some common payloads:

  • Platform Event with No Custom Fields

    {
      "CreatedDate": 1700000000550,
      "CreatedById": "05xx000001Sv6A"
    }
  • Platform Event with a Custom Text Field (message__c)

    {
      "CreatedDate": 1700000000550,
      "CreatedById": "05xx000001Sv6A",
      "message__c": "Hello World!"
    }

Retrieving the Schema for Your Platform Event

To confirm the exact schema for your event, use the Salesforce Platform Events REST API. For more information, see Get Event Schemas in the Salesforce documentation.