Platform Events
Platform Events
Guide
Version 62.0, Winter ’25
names and marks. Other marks appearing herein may be trademarks of their respective owners.
CONTENTS
Use platform events to connect business processes in Salesforce and external apps through the
EDITIONS
exchange of real-time event data. Platform events are secure and scalable messages that contain
data. Publishers publish event messages that subscribers receive in real time. To customize the data Available in: both Salesforce
published, define platform event fields. Classic and Lightning
Experience
IN THIS SECTION: Available in: Performance,
Delivering Custom Notifications with Platform Events Unlimited, Enterprise, and
Platform events are part of Salesforce’s enterprise messaging platform. The platform provides Developer Editions
an event-driven messaging architecture to enable apps to communicate inside and outside of
Salesforce. Before diving into platform events, take a look at what an event-based software
system is.
Defining Your Custom Platform Event
Define a platform event in Setup and add custom fields.
Publishing Platform Events
After a platform event has been defined in your Salesforce org, publish event messages from a Salesforce app using processes, flows,
or Apex or an external app using Salesforce APIs.
Subscribing to Platform Events
Receive platform events in processes, flows, Apex triggers, Pub/Sub API, or CometD clients.
Testing Your Platform Event in Apex
Add Apex tests to test platform event subscribers. Before you can package or deploy Apex code, including triggers, to production,
it must have tests and sufficient code coverage. Add Apex tests to provide code coverage for your triggers.
Encrypting Platform Event Messages at Rest in the Event Bus
For increased security, you can enable encryption of platform event messages while they’re stored in the event bus in a Shield
Encryption org.
Monitor Platform Event Publishing and Delivery Usage
To get usage data for event publishing and delivery to Pub/Sub API and CometD clients, empApi Lightning components, and
event relays, query the PlatformEventUsageMetric object. In API 58.0 and later, enable and use Enhanced Usage Metrics to get
granular usage data for various time segments. If Enhanced Usage Metrics isn’t enabled, usage data is available for the last 24 hours,
ending at the last hour, and for historical daily usage. PlatformEventUsageMetric is available in API version 50.0 and later.
Platform Event Considerations
Learn about special behaviors related to defining, publishing, and subscribing to platform events. Learn how to test platform events.
And get an overview of the various events that Salesforce offers.
Examples
Check out platform event apps—an end-to-end example using flows, a Java client, and a sample app that covers a business scenario.
Reference
The reference documentation for platform events covers an API object, Apex methods, limits, error codes, and standard platform
events.
1
Platform Events Developer Guide Delivering Custom Notifications with Platform Events
IN THIS SECTION:
Event-Driven Software Architecture
An event-driven (or message-driven) software architecture consists of event producers, event consumers, and channels. The
architecture is suitable for large distributed systems because it decouples event producers from event consumers, thereby simplifying
the communication model in connected systems.
Enterprise Messaging Platform Events
The Salesforce enterprise messaging platform offers the benefits of event-driven software architectures. Platform events are the
event messages (or notifications) that your apps send and receive to take further action. Platform events simplify the process of
communicating changes and responding to them without writing complex logic. Publishers and subscribers communicate with
each other through events. One or more subscribers can listen to the same event and carry out actions.
2
Platform Events Developer Guide Enterprise Messaging Platform Events
In comparison, systems in an event-based model obtain information and can react to it in near real time when the event occurs. Event
producers don’t know the consumers that receive the events. Any number of consumers can receive and react to the same events. The
only dependency between producers and consumers is the semantic of the message content.
3
Platform Events Developer Guide Enterprise Messaging Platform Events
You define a custom platform event in Salesforce in the same way that you define a custom object. Create a platform event definition
by giving it a name and adding custom fields. Platform events support a subset of field types in Salesforce. See Platform Event Fields.
This table lists a sample definition of custom fields for a printer ink event.
You can publish custom platform events on the Lightning Platform by using Apex or point-and-click tools, such as Process Builder and
Flow Builder, or an API in external apps. Similarly, you can subscribe to an event either on the platform through an Apex trigger or
point-and-click tools or in external apps, such as Pub/Sub API. When an app publishes an event message, event subscribers receive the
event message and execute business logic. Using the printer ink example, a software system monitoring a printer makes an API call to
publish an event when the ink is low. The printer event message contains the printer model, serial number, and ink level. After the printer
sends the event message, an Apex trigger is fired in Salesforce. The trigger creates a case record to place an order for a new cartridge.
Note: Previously, standard-volume events were available. In API version 45.0 and later, your new custom event definitions are
high volume by default. High-volume platform events offer better scalability than standard-volume platform events. Standard-volume
custom platform events will be retired in Winter ’25. To migrate existing standard-volume events, see Migrate Standard-Volume
Platform Events to High-Volume Platform Events Before Retirement.
4
Platform Events Developer Guide Enterprise Messaging Platform Events
For more information about granting user permissions, see Manage Data Access in Salesforce Help.
• The publishing of high-volume platform events is asynchronous. For more information, see Asynchronous Publishing.
When publishing platform events, DML limits and other Apex governor limits apply.
5
Platform Events Developer Guide Defining Your Custom Platform Event
For more information, see Event Message Durability in the Pub/Sub API Developer Guide.
Order of Events
If you publish multiple events in one publish call, the order of events in a batch is guaranteed for that publish request. So the order of
event messages that are stored in the event bus and delivered to subscribers matches the order of events that are passed in the call.
You can publish multiple events in several ways, including the Apex EventBus.publish method or the REST API composite
resource. For events published across different requests, the order of events isn’t guaranteed because publish requests can be processed
by different Salesforce application servers. As a result, a later request could be processed faster than an earlier request.
Salesforce assigns a replay ID value to a received platform event message and persists it in the event bus. Subscribers receive platform
event messages from the event bus in the order of the replay ID.
SEE ALSO:
Publishing Platform Events
Subscribing to Platform Events
Standard Platform Event Objects
6
Platform Events Developer Guide Platform Event Fields
• Select Publish After Commit only if the subscriber requires committed transaction data when it receives the event message.
With this option, the event message is published only after a transaction commits successfully and isn’t published if the transaction
fails.
Note: The publish behavior doesn't apply to event messages published with Pub/Sub API.
5. Click Save.
6. To add a field, in the Custom Fields & Relationships related list, click New.
7. To set up the field properties, follow the custom field wizard.
Note:
• If you change the publish behavior, expect up to a 5-minute delay for the change to take effect.
• In Lightning Experience, platform events aren’t shown in the Object Manager’s list of standard and custom objects and aren’t
available in Schema Builder.
Standard Fields
Platform events include standard fields. These fields appear on the New Platform Event page.
Field Description
Label Name used to refer to your platform event in a user interface page.
Starts with a vowel sound If it’s appropriate for your org’s default language, indicate whether
the label is preceded by “an” instead of “a.”
Object Name Unique name used to refer to the platform event when using the
API. In managed packages, this name prevents naming conflicts
with package installations. Use only alphanumeric characters and
underscores. The name must begin with a letter and have no
spaces. It can't end with an underscore or have two consecutive
underscores.
Deployment Status Indicates whether the platform event is visible to other users.
Custom Fields
In addition to the standard fields, you can add custom fields to your custom event. Platform event custom fields support only these field
types.
• Checkbox
• Date
• Date/Time
• Number
7
Platform Events Developer Guide Migrate Platform Event Definitions with Metadata API
• Text
• Text Area (Long)
The maximum number of fields that you can add to a platform event is the same as for a custom object. See Salesforce Features and
Edition Allocations.
SEE ALSO:
Decoupled Publishing and Subscription
Considerations for Defining and Publishing Platform Events
Considerations for Publishing and Subscribing to Platform Events with Apex and APIs
Example: Here is a definition of a platform event with a number field and two text fields.
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
8
Platform Events Developer Guide Migrate Platform Event Definitions with Metadata API
<deploymentStatus>Deployed</deploymentStatus>
<eventType>HighVolume</eventType>
<publishBehavior>PublishAfterCommit</publishBehavior>
<fields>
<fullName>Ink_Percentage__c</fullName>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>Ink Percentage</label>
<precision>18</precision>
<required>false</required>
<scale>2</scale>
<type>Number</type>
<unique>false</unique>
</fields>
<fields>
<fullName>Printer_Model__c</fullName>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>Printer Model</label>
<length>20</length>
<required>false</required>
<type>Text</type>
<unique>false</unique>
</fields>
<fields>
<fullName>Serial_Number__c</fullName>
<externalId>false</externalId>
<isFilteringDisabled>false</isFilteringDisabled>
<isNameField>false</isNameField>
<isSortingDisabled>false</isSortingDisabled>
<label>Serial Number</label>
<length>20</length>
<required>false</required>
<type>Text</type>
<unique>false</unique>
</fields>
<label>Low Ink</label>
<pluralLabel>Low Ink</pluralLabel>
</CustomObject>
The eventType field specifies the platform event volume. Only the HighVolume value is supported. The StandardVolume
value is deprecated. If you create a platform event with the StandardVolume event type, you get an error.
This package.xml manifest file references the previous event definition. The name of the referenced event is Low_Ink__e.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Low_Ink__e</members>
<name>CustomObject</name>
</types>
9
Platform Events Developer Guide Get the Event Schema
<version>62.0</version>
</Package>
To retrieve or deploy triggers associated to a platform event, use the ApexTrigger metadata type. For more information about how to
use Metadata API and its types, see the Metadata API Developer Guide.
IN THIS SECTION:
Get the Event Schema with REST API
Use REST API eventschema resource to retrieve the event schema by using the event name or the schema ID.
Get the Event Schema with Pub/Sub API
Use Pub/Sub API to retrieve the event schema with the GetSchema RPC method and pass in a schema ID.
10
Platform Events Developer Guide Publishing Platform Events
Because the schema typically doesn’t change often, we recommend that you call GetSchema once and use the returned schema for
all operations. If the event schema changes, for example, when an administrator adds a field to the event definition, the schema ID
changes. We recommend that you store the schema ID and compare it with the latest schema ID. If the schema ID changes, call
GetSchema to retrieve the new schema.
For more information, see GetSchema RPC Method in the Pub/Sub API Developer Guide.
IN THIS SECTION:
Publish Event Messages with Flows
Use flows to publish event messages from a Salesforce app as part of some user interaction, an automated process, Apex, or workflow
action.
Publish Event Messages with Processes
Use Process Builder to publish event messages from a Salesforce app as part of an automated process.
Publish Event Messages with Apex
Use Apex to publish event messages from a Salesforce app.
Publish Event Messages with Salesforce APIs
External apps use an API to publish platform event messages.
Publish Event Messages with Pub/Sub API
Use Pub/Sub API to publish platform event messages from an external app and get final publish results. Simplify your development
by using one API to publish, subscribe, and retrieve the event schema. Based on gRPC and HTTP/2, Pub/Sub API enables efficient
publishing of binary event messages in the Apache Avro format.
SEE ALSO:
Decoupled Publishing and Subscription
11
Platform Events Developer Guide Publish Event Messages with Processes
2. For How to Set the Record Fields, choose Use separate variables, resources, and literal values.
3. For Object, enter Printer and select Printer Status.
4. Set these field values.
Field Value
Printer Model XZO-5
SEE ALSO:
Salesforce Help: Flows
12
Platform Events Developer Guide Publish Event Messages with Processes
Tip: If a platform event is configured to publish immediately, the process publishes each event message outside of the database
transaction. If the transaction fails and is rolled back, the event message is still published and can’t be rolled back. So if you see an
informational message under the selected platform event, consider whether you want the process to publish an event message
only after the transaction commits successfully.
For example, here’s how to configure a Create a Record action that publishes a Low Ink event message. This example assumes that the
Low Ink platform event is defined in your org and that the event has these custom fields.
• Printer Model (Text)
• Serial Number (Text)
• Ink Percentage (Number)
1. For Record Type, enter low and select Low Ink.
2. Set the field values.
SEE ALSO:
Salesforce Help: Process Builder
Decoupled Publishing and Subscription
Platform Event Fields
13
Platform Events Developer Guide Publish Event Messages with Apex
To publish event messages, call the EventBus.publish method. For example, if you defined a custom platform event called Low
Ink, reference this event type as Low_Ink__e. Next, create instances of this event, and then pass them to the Apex method.
Example: This example creates two events of type Low_Ink__e, publishes them, and then checks whether the publishing
was successful or errors were encountered.
Before you can run this snippet, define a platform event with the name of Low_Ink__e and these fields: Printer_Model__c
of type Text, Serial_Number__c of type Text (marked as required), Ink_Percentage__c of type Number(16, 2).
List<Low_Ink__e> inkEvents = new List<Low_Ink__e>();
inkEvents.add(new Low_Ink__e(Printer_Model__c='XZO-5', Serial_Number__c='12345',
Ink_Percentage__c=0.2));
inkEvents.add(new Low_Ink__e(Printer_Model__c='MN-123', Serial_Number__c='10013',
Ink_Percentage__c=0.15));
14
Platform Events Developer Guide Publish Event Messages with Apex
Database.SaveResult[getErrors=(
Database.Error[getFields=();
getMessage=d65ae914-2488-414a-85d4-4df93ea9a05c;
getStatusCode=OPERATION_ENQUEUED;]);
getId=e02xx0000000001AAA;isSuccess=true;]
Publish Behavior
The platform event message is published either immediately or after a transaction is committed, depending on the publish behavior
that you set in the platform event definition. For more information, see Platform Event Fields. Apex governor limits apply. For events
configured with the Publish After Commit behavior, each method execution is counted as one DML statement against the Apex DML
statement limit. You can check limit usage using the Apex Limits.getDMLStatements() method. For events configured with
the Publish Immediately behavior, each method execution is counted against a separate event publishing limit of 150
EventBus.publish() calls. You can check limit usage using the Apex Limits.getPublishImmediateDML() method.
15
Platform Events Developer Guide Publish Event Messages with Apex
IN THIS SECTION:
Get the Result of Asynchronous Platform Event Publishing with Apex Publish Callbacks
Get the final result of an EventBus.publish call through an Apex publish callback that you implement. Without the callback,
you can get only the intermediate queueing result in Database.SaveResult of an EventBus.publish call, not the
final result.
SEE ALSO:
Apex Developer Guide: EventBus Class
Platform Event Error Status Codes
Apex Developer Guide: Execution Governors and Limits
Apex Developer Guide: Limits Class
Get the Result of Asynchronous Platform Event Publishing with Apex Publish Callbacks
Get the final result of an EventBus.publish call through an Apex publish callback that you implement. Without the callback, you
can get only the intermediate queueing result in Database.SaveResult of an EventBus.publish call, not the final result.
Event publishing is asynchronous, and the immediate result returned in SaveResult is the result of queuing the publish operation
in Salesforce. Sometimes immediate errors are returned, for example, due to a missing required field in the event message. If no immediate
errors are returned and when resources become available, the system carries out the queued publish call, and the final result is sent in
an Apex publish callback.
Note: Apex publish callbacks are available for high-volume platform events. Legacy standard-volume events aren’t supported.
IN THIS SECTION:
Apex Publish Callback Class
An Apex publish callback contains the result of an asynchronous publish operation in Apex. After the publish operation completes
and the final result is ready, the system returns a callback. You can implement one of these two interfaces:
EventBus.EventPublishFailureCallback for failed publishes and
EventBus.EventPublishSuccessCallback for successful publishes.
Callback Running User and Debug Logs
A publish callback runs under the Automated Process user. As a result, all records that are created in a callback have their system
user fields, such as CreatedById and OwnerId, set to Automated Process.
Create an Event with an EventUuid Field
The EventUuid field uniquely identifies an event message and is used to match the events returned in the callback result with
the events in the publish call. To have the system generate an EventUuid field value in each event object, use the
SObjectType.newSObject(recordTypeId, loadDefaults) Apex method to create the event object.
Invoke the Publish Callback
To have the system invoke the callback when the final publish result is available, pass in an instance of the callback class as the
second parameter in the EventBus.publish call.
Publish Callback Best Practices
Keep in mind these best practices for publish callbacks when implementing this feature.
Example: Publish Callback Class That Creates Follow-Up Tasks for Failed Publishes
This publish callback class creates a task when event publishing fails in the onFailure method. The inserted task includes the
number of failed events and the event UUIDs.
16
Platform Events Developer Guide Publish Event Messages with Apex
If the asynchronous publish operation fails, the onFailure method is invoked. In the implemented onFailure method, you can
write logic to act in response to the final result of the publishing operation. The onFailure method takes a parameter that contains
the result of the publish operation: EventBus.FailureResult result. The result contains the EventUuid field values for
each failed event but doesn’t contain the data for the event. Use the getEventUuids method to get the universally unique identifiers
(UUIDs) of the events. Each event UUID is a UUID that identifies an event message.
17
Platform Events Developer Guide Publish Event Messages with Apex
processing successful event publishes likely isn’t a concern. Also, a large volume of events can be published successfully, so be mindful
about the performance and Apex limit impacts when processing the results.
public class SuccessCallback implements EventBus.EventPublishSuccessCallback {
If the asynchronous publish operation succeeds, the onSuccess method is invoked. In the implemented onSuccess method,
you can write logic to act in response to the final result of the publishing operation. The onSuccess method takes a parameter that
contains the result of the publish operation: EventBus.SuccessResult result. The result contains the EventUuid field
values for each successfully published event but doesn’t contain the data for the event. Use the getEventUuids method to get the
UUIDs of the events. Each event UUID is a UUID that identifies an event message.
Note: Implement both failure and success callbacks only if you have valid use cases for processing both. Because most publish
calls typically succeed, processing successful event publishes likely isn’t a concern. Also, a large volume of events can be published
successfully, so be mindful about the performance and Apex limit impacts when processing the results in the onSuccess
method.
public class FailureAndSuccessCallback implements EventBus.EventPublishFailureCallback,
EventBus.EventPublishSuccessCallback {
SEE ALSO:
Identify and Match Event Messages with the EventUuid Field
Apex Reference Guide: System.Quiddity Enum: PLATFORM_EVENT_PUBLISH_CALLBACK
18
Platform Events Developer Guide Publish Event Messages with Apex
// Debug output
// EventUuid: 19bd382e-8964-43de-ac01-d5d82dd0bf78
Note: If you aren’t interested in correlating the events in the publish call with the publish results, you don’t need the EventUuid
value in the created event. In this case, you can create the event by using the event API name directly, which doesn’t include the
EventUuid value in the event object. For example: Order_Event__e event = new Order_Event__e();.
This publish call publishes a list of events and passes in a callback instance.
List<Database.SaveResult> results = EventBus.publish(eventList, cb);
This publish call publishes one event and passes in a callback instance.
Database.SaveResult sr = EventBus.publish(myEvent, cb);
19
Platform Events Developer Guide Publish Event Messages with Apex
If the Apex publish callbacks feature is disabled in your Salesforce org, the EventBus.publish calls that use callbacks still execute
but don’t invoke the callbacks. Also, the returned status code is OPERATION_ENQUEUED.
Don’t Republish the Same Event Object That Is Created with SObjectType.newSObject
If you create an event object with the SObjectType.newSObject(recordTypeId, loadDefaults) Apex method, we
recommend that you don’t publish the same event object more than once. Because the event object is populated with an EventUuid
value, if you publish it more than once, non-unique EventUuid values are tracked in the callbacks. The duplicate EventUuid
values can cause unexpected results. This behavior doesn’t apply to events that you create by using the API name Event_Name__e
event = new Event_Name__e().
20
Platform Events Developer Guide Publish Event Messages with Apex
In contrast, this example shows what to avoid. It’s inefficiently making 10 calls to the publish method with a callback, each with one
event. This example can result in more callback executions later than when events are batched in one publish call.
// !! NOT RECOMMENDED !!
FailureCallback cb = new FailureCallback();
// Create events individually and pass each event to the publish call
for(Integer i = 0;i<10;i++) {
EventBus.publish((Order_Event__e)Order_Event__e.sObjectType.newSObject(null, true),
cb);
}
Keep the Event UUID Map Size Small for Improved Performance
To reduce the callback instance size, keep the map of event UUIDs small in the callback. A small callback instance size ensures better
performance and helps avoid hitting the cumulative usage limit of all publish callbacks. Map the event UUID to a record ID that you can
query to populate the remaining event fields. Alternatively, if you want to save the entire event as the map value, make sure that the
event doesn’t have too many fields and the field sizes are small. For an example of how a map is used for republishing events in the
onFailure method, see Example: Publish Callback Class That Correlates Callback Results with Event Messages.
SEE ALSO:
Apex Publish Callback Limits
Example: Publish Callback Class That Creates Follow-Up Tasks for Failed Publishes
This publish callback class creates a task when event publishing fails in the onFailure method. The inserted task includes the number
of failed events and the event UUIDs.
public class FailureCallback implements EventBus.EventPublishFailureCallback {
21
Platform Events Developer Guide Publish Event Messages with Apex
insertTask(eventUuids, false);
}
22
Platform Events Developer Guide Publish Event Messages with Apex
event2.Order_Id__c='Order2 ID';
System.debug('event2 EventUuid: ' + event2.EventUuid);
Example: Publish Callback Class That Creates Follow-Up Tasks for Failed and Successful Publishes
This publish callback class is a modification of the previous example—it also implements the
EventBus.EventPublishSuccessCallback interface and processes both success and failure cases. It creates a task when
event publishing fails or succeeds. The inserted task includes the number of failed events and the event UUIDs.
Before running this example, change the email address in the example to an email address of a user who has permission to create tasks
in your org. To view debug logs for the FailureCallback class, make sure that you set up user trace flags for the Automated
Process user. For more information, see Callback Running User and Debug Logs.
public class FailureAndSuccessCallback implements EventBus.EventPublishFailureCallback,
EventBus.EventPublishSuccessCallback {
23
Platform Events Developer Guide Publish Event Messages with Apex
To publish events with the callback class, use the code snippet in Example: Publish Events with a Callback Instance and change the
callback instance name in the EventBus.publish method to FailureAndSuccessCallback.
// Publish events with an instance of the callback.
List<Database.SaveResult> results = EventBus.publish(eventList,
new FailureAndSuccessCallback());
Example: Publish Callback Class That Correlates Callback Results with Event Messages
This example callback class implementation shows how to retry publishing failed events. It’s based on a trigger on the Order object.
24
Platform Events Developer Guide Publish Event Messages with Apex
Callback Class
If event publishing fails, the onFailure method in the FailureCallbackWithCorrelation class is invoked. This method
retries publishing failed events up to two times. A map holds the UUID values of each published event and maps it to the order record
ID. This mapping is used to populate the event Order_Id__c field. Alternatively, you can use the record ID to obtain field data from
the record and populate event fields. The example omits this detail for simplicity.
The examples in this section require a platform event, Order Event, to be defined with a Text(18) field of Order Id.
public class FailureCallbackWithCorrelation implements EventBus.EventPublishFailureCallback
{
public static final Integer MAX_RETRIES = 2;
private Integer retryCounter = 0;
private Map<String,String> uuidMap;
// Callback constructor
public FailureCallbackWithCorrelation(Map<String,String> uuidMap) {
this.uuidMap = uuidMap;
}
// Use a new map since the new event will have a different uuid
newUuidMap.put(event.EventUuid, event.Order_Id__c);
}
// Replace old uuid map because we no longer need its contents
uuidMap = newUuidMap;
// Increase counter
retryCounter++;
} else {
// Retry exhausted, log an error instead
System.debug(eventUuids.size() + ' event(s) failed to publish after ' +
MAX_RETRIES + ' retries ' +
'for Order with Ids: ' + String.join(uuidMap.values(), ', '));
}
25
Platform Events Developer Guide Publish Event Messages with Apex
Apex Trigger
For each inserted or updated order record, the trigger publishes the Order_Event__e platform event with a populated EventUuid
field.
trigger OrderTrigger on Order (after insert, after update) {
Map<String,String> uuidMap = new Map<String,String>();
List<Order_Event__e> events = new List<Order_Event__e>();
To run the trigger, insert an order record. Because an order depends on an account and contract, create these records first. You can
create the records in the user interface or via Apex or an API. An Apex snippet is provided for your convenience. You can run this snippet
in the Developer Console, in the Execute Anonymous Window.
// Create account
Account a = new Account();
a.Name = 'Account Callback';
26
Platform Events Developer Guide Publish Event Messages with Apex
insert a;
// Create contract
Contract c = new Contract();
c.StartDate = Date.today();
c.ContractTerm = 12;
c.Status = 'Draft';
c.AccountId = a.Id;
insert c;
// Create order
Order o = new Order();
o.AccountId = a.Id;
o.ContractId = c.Id;
o.Status = 'Draft';
o.EffectiveDate = Date.today();
insert o;
The Test.getEventBus().fail() method causes the publishing of events to fail immediately after the call, and event messages
are removed from the test event bus. This method causes the onFailure() method in the callback class to be invoked. When the
event messages fail to publish, none of the triggers defined on the platform event receive any failed events.
To simulate successful event delivery, call the Test.getEventBus().deliver(); method or have your events delivered after
Test.stopTest(). Event messages are delivered immediately after each of those statements. Successful event delivery triggers
the execution of the onSuccess() method in the callback class.
27
Platform Events Developer Guide Publish Event Messages with Apex
// Fail event
// (invoke onFailure and DO NOT deliver event to subscribers)
Test.getEventBus().fail();
System.debug('tasksFailed[0].Description=' + tasksFailed[0].Description);
System.debug('event.EventUuid=' + event.EventUuid);
System.Assert.isTrue(tasksFailed[0].Description.contains(event.EventUuid),
'EventUuid was not found in the Description field.');
System.Assert.isTrue(tasksSuccessful[0].Description.contains(event.EventUuid),
'EventUuid was not found in the Description field.');
// Start test
Test.startTest();
28
Platform Events Developer Guide Publish Event Messages with Apex
System.Assert.isTrue(tasksSuccessful[0].Description.contains(event.EventUuid),
'EventUuid was not found in the Description field.');
}
}
@isTest
static void testFailedEventsWithFail() {
// Create test event
Order_Event__e event = (Order_Event__e)Order_Event__e.sObjectType.newSObject(
null, true);
event.Order_Id__c='dummyOrderId';
// Populate map
Map<String,String> uuidMap = new Map<String,String>();
uuidMap.put(event.EventUuid, 'dummyOrderId');
// Create callback
FailureCallbackWithCorrelation cb = new FailureCallbackWithCorrelation(uuidMap);
29
Platform Events Developer Guide Publish Event Messages with Apex
Assert.areEqual(0, cb.getRetryCounter(),
'Newly created callback should have retry counter at 0');
SEE ALSO:
Platform Events Developer Guide: Testing Your Platform Event in Apex
Description Limit
Maximum cumulative usage of all publish callbacks in the last 30 5 MB
minutes
30
Platform Events Developer Guide Publish Event Messages with Salesforce APIs
The publish callback size used in the callback allocation is the size of the objects contained in a callback class instance, such as the class
variable objects. It isn’t the length of the Apex class in characters. For example, in the FailureCallbackWithCorrelation
class in Example: Publish Callback Class That Correlates Callback Results with Event Messages, the objects that contribute to the size
counted in the allocation are these class variables: MAX_RETRIES, retryCounter, and uuidMap. The cumulative usage is the
sum of the sizes of callback instances that were executed in the last 30 minutes. If you hit the callback size limit, try to reduce the size of
the objects stored in your callback class through the class variables. Alternatively, limit the number of retried callback executions or wait
before using callbacks again. The callback limit is a rolling limit and counts usage in the last 30 minutes, so usage can decrease after
some time has passed. Usage is updated every time you publish an event with a callback.
To monitor the usage of all publish callbacks in the last 30 minutes, make a REST API call to the limits resource, and inspect the
PublishCallbackUsageInApex value in the returned response. Make a GET request to:
/services/data/v58.0/limits
The PublishCallbackUsageInApex value in the returned response looks similar to this example. The
PublishCallbackUsageInApex value returns the maximum usage and the remaining usage size in bytes.
"PublishCallbackUsageInApex" : {
"Max" : 5242880,
"Remaining" : 4011396
}
SEE ALSO:
REST API Developer Guide: Limits
REST API Developer Guide: List Organization Limits
{
"id" : "e01xx0000000001AAA",
"success" : true,
31
Platform Events Developer Guide Publish Event Messages with Salesforce APIs
"errors" : [ {
"statusCode" : "OPERATION_ENQUEUED",
"message" : "232fd30e-0a71-42bd-a97b-be0e329b2ded",
"fields" : [ ]
} ]
}
The examples in the next sections are based on a high-volume platform event.
REST API
To publish a platform event message using REST API, send a POST request to this endpoint.
/services/data/v62.0/sobjects/Event_Name__e/
Example: If you defined a platform event named Low Ink, publish event notifications by inserting Low_Ink__e data. This
example creates one event of type Low_Ink__e in REST API.
REST endpoint:
/services/data/v62.0/sobjects/Low_Ink__e/
Request body:
{
"Printer_Model__c" : "XZO-5"
}
After the platform event message is published, the REST response looks like this output. Headers are deleted for brevity.
HTTP/1.1 201 Created
{
"id" : "e01xx0000000001AAA",
"success" : true,
"errors" : [ {
"statusCode" : "OPERATION_ENQUEUED",
"message" : "232fd30e-0a71-42bd-a97b-be0e329b2ded",
"fields" : [ ]
} ]
}
Example: This composite request contains two platform events in the request body.
{
"allOrNone": true,
"compositeRequest": [
32
Platform Events Developer Guide Publish Event Messages with Salesforce APIs
{
"method": "POST",
"url": "/services/data/v62.0/sobjects/Low_Ink__e",
"referenceId": "event1",
"body": {
"Serial_Number__c" : "1000",
"Printer_Model__c" : "XZO-5"
}
},
{
"method": "POST",
"url": "/services/data/v62.0/sobjects/Low_Ink__e",
"referenceId": "event2",
"body": {
"Serial_Number__c" : "1001",
"Printer_Model__c" : "XY-10"
}
}
]
}
After the platform event messages are published, the REST response looks like this output. Headers are deleted from this sample
response.
{
"compositeResponse" : [ {
"body" : {
"id" : "e01xx0000000001AAA",
"success" : true,
"errors" : [ {
"statusCode" : "OPERATION_ENQUEUED",
"message" : "436ccd6f-cc43-4861-a260-a3ffbc1bc27c",
"fields" : [ ]
} ]
},
"httpStatusCode" : 201,
"referenceId" : "event1"
}, {
"body" : {
"id" : "e01xx0000000001AAA",
"success" : true,
"errors" : [ {
"statusCode" : "OPERATION_ENQUEUED",
"message" : "85d962fb-f05c-4ccf-9ee1-ac751d0fc07f",
"fields" : [ ]
} ]
},
"httpStatusCode" : 201,
"referenceId" : "event2"
} ]
}
Note: The allOrNone header in the composite REST request and in SOAP API applies only to platform events defined
with the Publish After Commit option. For more information, see Platform Events and Transactions.
33
Platform Events Developer Guide Publish Event Messages with Salesforce APIs
SOAP API
To publish a platform event message using SOAP API, use the create() call.
Example: This example shows the SOAP message (using Partner API) of a request to create three platform event messages in
one call. Each event has one custom field named Printer_Model__c.
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:sobject.partner.soap.sforce.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns2="urn:partner.soap.sforce.com">
<SOAP-ENV:Header>
<ns2:SessionHeader>
<ns2:sessionId>00DR00000001fWV!AQMAQOshATCQ4fBaYFOTrHVixfEO6l...</ns2:sessionId>
</ns2:SessionHeader>
<ns2:CallOptions>
<ns2:client>ClientApp/34.0.12i</ns2:client>
<ns2:defaultNamespace xsi:nil="true"/>
<ns2:returnFieldDataTypes xsi:nil="true"/>
</ns2:CallOptions>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns2:create>
<ns2:sObjects>
<ns1:type>Low_Ink__e</ns1:type>
<ns1:fieldsToNull xsi:nil="true"/>
<ns1:Id xsi:nil="true"/>
<Printer_Model__c>XZO-600</Printer_Model__c>
</ns2:sObjects>
<ns2:sObjects>
<ns1:type>Low_Ink__e</ns1:type>
<ns1:fieldsToNull xsi:nil="true"/>
<ns1:Id xsi:nil="true"/>
<Printer_Model__c>XYZ-100</Printer_Model__c>
</ns2:sObjects>
<ns2:sObjects>
<ns1:type>Low_Ink__e</ns1:type>
<ns1:fieldsToNull xsi:nil="true"/>
<ns1:Id xsi:nil="true"/>
<Printer_Model__c>XYZ-9000</Printer_Model__c>
</ns2:sObjects>
</ns2:create>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The response of the Partner SOAP API request looks something like this response. Headers are deleted for brevity.
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:partner.soap.sforce.com">
<soapenv:Header>
...
</soapenv:Header>
34
Platform Events Developer Guide Publish Event Messages with Pub/Sub API
<soapenv:Body>
<createResponse>
<result>
<id>e00xx000000000F</id>
<success>true</success>
<errors>
<message>04b8724e-e7e7-4caf-9bcd-0d14c9f97e31</message>
<statusCode>OPERATION_ENQUEUED</statusCode>
</errors>
</result>
<result>
<id>e00xx000000000G</id>
<success>true</success>
<errors>
<message>7378b9cc-d381-4150-b093-336e3a0e4018</message>
<statusCode>OPERATION_ENQUEUED</statusCode>
</errors>
</result>
<result>
<id>e00xx000000000H</id>
<success>true</success>
<errors>
<message>32da1ef3-6877-485a-8dde-1174f589e31a</message>
<statusCode>OPERATION_ENQUEUED</statusCode>
</errors>
</result>
</createResponse>
</soapenv:Body>
</soapenv:Envelope>
SEE ALSO:
REST API Developer Guide
REST API Developer Guide : Using Composite Resources
SOAP API Developer Guide: create() call
Bulk API 2.0 Bulk API Developer Guide
Platform Event Error Status Codes
35
Platform Events Developer Guide Subscribing to Platform Events
The Publish RPC method is a unary RPC, which means that it sends only one request and receives only one response.
rpc Publish (PublishRequest) returns (PublishResponse);
The PublishStream RPC method uses bidirectional streaming. It can send a stream of publish requests while receiving a stream
of publish responses from the server. Use PublishStream to achieve a higher publish rate than with Publish.
rpc PublishStream (stream PublishRequest) returns (stream PublishResponse);
The PublishResponse holds a PublishResult for each event published that indicates the final success or failure of the
publish operation, and not the intermediate queueing results. A successful status means that the event was published. A failed status
means that the event failed to publish, and the client can retry publishing this event.
To learn more about the RPC methods in Pub/Sub API, see Pub/Sub API RPC Method Reference in the Pub/Sub API Developer Guide.
Write a Pub/Sub API client to publish platform event messages. You can use one of the 11 supported programming languages, including
Python, Java, Go, and Node. To learn how to write a client in Java or Python, check out Quick Starts in the Pub/Sub API Developer Guide.
For code examples in other languages, see the Pub/Sub API GitHub repository.
IN THIS SECTION:
Set Up Debug Logs for Event Subscriptions
Debug logs for platform event triggers, event processes, and resumed flow interviews are created by Automated Process and are
separate from their corresponding Apex code logs. For a platform event trigger with an overridden running user, debug logs are
created by the specified user. The debug logs aren’t available in the Developer Console’s Log tab.
Subscribe to Platform Event Messages with Flows
Launch flows or resume running instances of flows, called interviews, when platform event messages are received. Subscribed flows
and interviews can receive event messages published through Apex, APIs, flows, and other processes. Flows and interviews provide
an autosubscription mechanism.
Subscribe to Platform Event Messages with Processes
Processes built in Process Builder can subscribe to platform events and receive event messages published through Apex, APIs, flows,
and other processes. Processes provide an autosubscription mechanism.
Subscribe to Platform Event Notifications with Apex Triggers
Use Apex triggers to subscribe to events. You can receive event notifications in triggers regardless of how they were
published—through Apex or APIs. Triggers provide an autosubscription mechanism. No need to explicitly create and listen to a
channel in Apex.
Subscribe to Platform Event Notifications in a Lightning Component
Subscribe to platform events with the empApi component in your Lightning web component or Aura component. The empApi
component provides access to methods for subscribing to a streaming channel and listening to event messages.
Subscribe to Platform Event Notifications with Pub/Sub API
Use Pub/Sub API to subscribe to event messages in an external client to integrate your systems. Simplify your development by using
one API to publish, subscribe, and retrieve the event schema. Based on gRPC and HTTP/2, Pub/Sub API enables efficient delivery of
binary event messages in the Apache Avro format. You can control the volume of event messages received per Subscribe call based
on event processing speed in the client.
36
Platform Events Developer Guide Set Up Debug Logs for Event Subscriptions
SEE ALSO:
Decoupled Publishing and Subscription
IN THIS SECTION:
Add a Trace Flag Entry for the Default Automated Process User
To collect logs for an event subscription, add a trace flag entry for the Automated Process entity in Setup.
Add a Trace Flag Entry for the Overridden User
To collect logs for an Apex trigger whose default running user is overridden, add a trace flag entry for the user in Setup.
SEE ALSO:
Salesforce Help: Set Up Debug Logging
Add a Trace Flag Entry for the Default Automated Process User
To collect logs for an event subscription, add a trace flag entry for the Automated Process entity in Setup.
1. From Setup, in the Quick Find box, enter Debug Logs, then click Debug Logs.
37
Platform Events Developer Guide Subscribe to Platform Event Messages with Flows
2. Click New.
3. For Traced Entity Type, select Automated Process.
4. Select the time period to collect logs. The start and expiration dates default to the current date and time. To extend the expiration
date, click the end date input box, and select the next day from the calendar.
5. For Debug Level, click New Debug Level. Enter a name, such as CustomDebugLevel, and accept the defaults.
6. Click Save.
To collect logs for the user who publishes the events, add another trace flag entry for that user.
38
Platform Events Developer Guide Subscribe to Platform Event Messages with Flows
As you build the flow, you can use the field values from the platform event message by referencing the $Record global variable.
Example: This Pause element is set up to resume a flow interview when a vendor response event message is received (1). The
order number in the event message must match the flow’s orderNumber variable value, and the order status must be Shipped
(2). When the flow interview resumes, the vendorResponse record variable is populated with the data from the event message
(3).
39
Platform Events Developer Guide Subscribe to Platform Event Messages with Flows
SEE ALSO:
Considerations for Subscribing to Platform Events with Processes and Flows
Salesforce Help: Flow Limits and Considerations
Salesforce Help: Paused Flow Interview Considerations
End-to-End Example: Printer Supply Automation
40
Platform Events Developer Guide Subscribe to Platform Event Messages with Processes
Example: This process starts when it receives a Printer Status event message. When it starts, the process looks for an Asset record
whose serial number matches the serial number in the event message.
41
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
All processes are subject to entitlements, limits, and other considerations, including Apex governor limits.
SEE ALSO:
Salesforce Help: Process Limits and Considerations
Considerations for Subscribing to Platform Events with Processes and Flows
Set Up Debug Logs for Event Subscriptions
Obtain Processes That Subscribe to a Platform Event in Metadata API
Subscribe to Platform Event Messages with Flows
Example: This example shows a trigger for the Low Ink event. It iterates through each event and checks the
Printer_Model__c field value. The trigger inspects each received notification and gets the printer model from the notification.
If the printer model matches a certain value, other business logic is executed. For example, the trigger creates a case to order a
new cartridge for this printer model.
// Trigger for catching Low_Ink events.
trigger LowInkTrigger on Low_Ink__e (after insert) {
// List to hold all cases to be created.
List<Case> cases = new List<Case>();
// Get user Id for case owner. Replace username value with a valid value.
User adminUser = [SELECT Id FROM User WHERE Username='[email protected]'];
42
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
An Apex trigger processes platform event notifications sequentially in the order they’re received. The order of events is based on the
event replay ID. An Apex trigger can receive a batch of events at once. The maximum batch size in a platform event trigger is 2,000 event
messages. The order of events is preserved within each batch. The events in a batch can originate from one or more publishers.
Unlike triggers on standard or custom objects, triggers on platform events don’t execute in the same Apex transaction as the one that
published the event. The trigger runs asynchronously in its own process. As a result, there can be a delay between when an event is
published and when the trigger processes the event.
The trigger runs under the Automated Process entity or the user you select in the trigger configuration. If no user is configured, debug
logs corresponding to the trigger execution are created by Automated Process. System fields, such as CreatedById and
LastModifiedById, reference the Automated Process entity. You can override the trigger's default running user so that the user
for debug logs and records is set to the selected user. For more information, see Configure the User and Batch Size for Your Platform
Event Trigger with PlatformEventSubscriberConfig.
Note: The OwnerId field of records saved in the trigger is set to the trigger's running user. By default, it’s Automated Process.
For more information on how to change the OwnerId, see Considerations for Publishing and Subscribing to Platform Events with
Apex and APIs.
Event triggers have many of the same limitations of custom and standard object triggers. For example, with some exceptions, you
generally can’t make Apex callouts from triggers. For more information, see Implementation Considerations for triggers in the Apex
Developer Guide.
43
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
IN THIS SECTION:
Platform Event Processing at Scale with Parallel Subscriptions for Apex Triggers
To speed up platform event processing in an Apex trigger, use parallel subscriptions to process events simultaneously instead of in
a single stream. With parallel subscriptions, you can scale your Apex platform event triggers to handle high volumes of events. Parallel
subscriptions are available for custom high-volume platform events but not for standard events or change events.
Configure the User and Batch Size for Your Platform Event Trigger with PlatformEventSubscriberConfig
You can override the default running user and batch size of a platform event Apex trigger. By default, the trigger runs as the Automated
Process system user with a batch size of 2,000 event messages. Configuring the user and batch size enables you to bypass some
limitations that sometimes arise from using the defaults. Use PlatformEventSubscriberConfig in Tooling API or Metadata API to
configure the trigger.
Find Uncaught Exceptions in Event Log Files
If an unhandled exception occurs during the execution of your platform event Apex trigger, you can get information about the
exception using event log files in Event Monitoring. Examples of an unhandled exception include an uncatchable limit exception
or an exception that the trigger doesn’t catch.
Resume a Platform Event Trigger After an Uncaught Exception
Set a checkpoint in the event stream for where the platform event trigger resumes execution in a new invocation. If an Apex governor
limit is hit or another uncaught exception is thrown, the checkpoint is used during the next execution of the trigger. Trigger processing
resumes after the last successfully checkpointed event message. You can also set a checkpoint to explicitly control the number of
events processed in one trigger execution. However, you can configure the trigger batch size more easily using Metadata API or
Tooling API. For more information, see Configure the User and Batch Size for Your Platform Event Trigger with
PlatformEventSubscriberConfig.
Retry Event Triggers with EventBus.RetryableException
Get another chance to process event notifications. Retrying a trigger is helpful when a transient error occurs or when waiting for a
condition to change. Retry a trigger if the error or condition is external to the event records and is likely to go away later.
Email Notifications for Triggers in Error State
When an Apex platform event trigger exceeds the maximum number of retries and is in the error state, you’re notified by email.
When the trigger subscriber reaches the error state, it disconnects and stops receiving published events.
Comparing setResumeCheckpoint() and EventBus.RetryableException
Determine which method is most suitable for resuming a platform event trigger.
SEE ALSO:
Apex Developer Guide: Execution Governors and Limits
Set Up Debug Logs for Event Subscriptions
View and Manage an Event’s Subscribers on the Platform Event’s Detail Page
Considerations for Publishing and Subscribing to Platform Events with Apex and APIs
Platform Event Processing at Scale with Parallel Subscriptions for Apex Triggers
To speed up platform event processing in an Apex trigger, use parallel subscriptions to process events simultaneously instead of in a
single stream. With parallel subscriptions, you can scale your Apex platform event triggers to handle high volumes of events. Parallel
subscriptions are available for custom high-volume platform events but not for standard events or change events.
44
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
Important: Parallel Subscriptions require a custom platform event with a recent event schema. Use a new or recently created
custom platform event. If you want to use an existing custom platform event whose definition hasn’t changed in several Salesforce
releases, you can regenerate the event schema by adding or renaming a field to the platform event.
This diagram shows the flow of events from the event bus to the parallel subscriptions. For simplicity, the event bus in the diagram
contains events for only the custom platform event that the Apex trigger is subscribed to.
45
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
IN THIS SECTION:
Order of Events in Parallel Subscriptions
The order of events that get distributed to the parallel subscriptions doesn't always match the order of events in the event bus.
Choosing a Partition Key
Which event field you choose for the partition key depends on whether you want to maximize the trigger’s performance or whether
the order of event processing is important.
Parallel Subscription Limits
Check out the limits for parallel subscriptions. These limits are enforced when you save the parallel subscription configurations using
PlatformEventSubscriberConfig in Tooling API or Metadata API.
Parallel Subscription Configuration Examples in Tooling API and Metadata API
Configure parallel subscriptions for an Apex trigger by using PlatformEventSubscriberConfig in Tooling API or Metadata API.
Apex Trigger Repartitioning
To repartition an Apex trigger that is already configured with parallel subscriptions, update the existing PlatformEventSubscriberConfig
in Tooling API or Metadata API.
Configure Parallel Subscriptions for an Apex Trigger
Referencing this multiple-step example, configure an Apex trigger with three partitions and a custom field partition key. Then verify
the trigger parallel subscriptions in Setup.
Testing an Apex Trigger Configured with Parallel Subscriptions
You can test an Apex platform event trigger that’s configured with parallel subscriptions the same way that you test a regular Apex
platform event trigger.
Parallel Subscriptions Considerations
Keep in mind these considerations about parallel subscriptions.
46
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
SEE ALSO:
Order of Events in Parallel Subscriptions
Limit Value
Maximum number of parallel subscriptions (partitions) that you 10
can configure for one Apex trigger
You can monitor how many Apex triggers are configured for parallel subscriptions by using the REST limits resources and checking for
the PlatformEventTriggersWithParallelProcessing value.
This example shows a portion of the output of the REST limits resource that lists the maximum value and usage for the maximum number
of Apex triggers that can be configured for parallel subscriptions.
"PlatformEventTriggersWithParallelProcessing": {
"Max": 5,
47
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
"Remaining": 2
}
SEE ALSO:
REST API Developer Guide: Limits
REST API Developer Guide: List Org Limits
Example: Tooling API Request for the EventUuid Partition Key Field
This example shows the body of a REST request for PlatformEventSubscriberConfig in Tooling API. It specifies the EventUuid partition
key and three partitions. PlatformEventConsumerId references the ID of the Apex trigger.
{
"DeveloperName":"MyOrderEventTriggerConfig",
"MasterLabel":"MyOrderEventTriggerConfig",
"PlatformEventConsumerId": "Apex_Trigger_Id",
"PartitionKey": "EventUuid",
"NumPartitions": "3"
}
48
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
SEE ALSO:
Metadata API Developer Guide: PlatformEventSubscriberConfig
Tooling API Developer Guide: PlatformEventSubscriberConfig
49
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
/services/data/v62.0/tooling/sobjects/PlatformEventSubscriberConfig/record_ID
For information about the request body to send for PlatformEventSubscriberConfig, see Configure Parallel Subscriptions for an Apex
Trigger.
In Metadata API, you can redeploy the PlatformEventSubscriberConfig component by using the same developer name and different
values.
Note: No new repartitioning can start while another one is in progress. Also, in rare cases, after repartitioning is initiated, it can
take longer for the system to finish processing events in the old partitions and delete those partitions. The reason for this behavior
is that partitioning depends on event-publish activity in the event bus, which is shared with other Salesforce orgs. If there’s no
publish activity from any org, the old partitions don't process events and become stagnant. However, this case is rare because it’s
unlikely that no org publishes platform events for an extended time period.
50
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
{
System.debug('Processed Order Number: ' + evt.Order_Number__c);
}
}
6. Supply this request body, replacing Apex_Trigger_Id with the trigger ID value you just queried. If you’re using Postman,
expand Tooling > Post Tooling SObject. For the SOBJECT_API_NAME parameter, specify
PlatformEventSubscriberConfig, and this request body.
{
"DeveloperName":"MyOrderEventTriggerConfig",
"MasterLabel":"MyOrderEventTriggerConfig",
"PlatformEventConsumerId": "Apex_Trigger_Id",
"PartitionKey": "Order_Event__e.Order_Number__c",
"NumPartitions": "3"
}
51
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
Note: You can override the default running user to another user in PlatformEventSubscriberConfig. See Configure the User and
Batch Size for Your Platform Event Trigger with PlatformEventSubscriberConfig. For instructions on setting up debug logs for a
specific user, see Add a Trace Flag Entry for the Overridden User.
SEE ALSO:
Set Up Debug Logs for Event Subscriptions
// Publish events
List<Order_Event__e> events = new List<Order_Event__e>();
for(Integer i=0;i<10;i++) {
Order_Event__e evt = new Order_Event__e(
Order_Number__c=String.valueOf(i));
events.add(evt);
}
List<Database.SaveResult> results = EventBus.publish(events);
2. Click Execute.
52
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
2. On the Platform Events page, click the platform event name: Order Event.
3. On the platform event detail page, verify that the Apex trigger is listed in the Parallel Subscriptions related list.
4. You can verify the trigger's execution by checking the debug output in the debug logs.
In this case, three debug log entries are created, one for each Apex trigger invocation, which corresponds to one partition.
SEE ALSO:
Salesforce Help: View Debug Logs
53
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
Configure the User and Batch Size for Your Platform Event Trigger with
PlatformEventSubscriberConfig
You can override the default running user and batch size of a platform event Apex trigger. By default, the trigger runs as the Automated
Process system user with a batch size of 2,000 event messages. Configuring the user and batch size enables you to bypass some limitations
that sometimes arise from using the defaults. Use PlatformEventSubscriberConfig in Tooling API or Metadata API to configure the trigger.
Running the trigger as a specific user instead of the default Automated Process entity has these benefits:
• Records are created, modified, and deleted as this user.
• OwnerId fields of created records are populated to this user.
• Records are shared with the user when sharing is enabled. For example, when the trigger calls into an Apex class declared with the
with sharing keywords.
• Debug logs for the trigger execution are created by this user.
• You can send email messages from the trigger, which isn’t supported with the default Automated Process user.
54
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
You can specify any active user in the Salesforce org. The trigger runs in system context with privileges to access all records regardless
of the user's object and field-level permissions. Record sharing is enforced for the running user when the trigger calls into an Apex class
declared with the with sharing keywords.
In addition to setting a user, you can specify a custom batch size from 1 through 2,000. The batch size is the maximum number of event
messages that can be sent to a trigger in one execution. For platform event triggers, the default batch size is 2,000. Setting a smaller
batch size can help avoid hitting Apex governor limits.
Note:
• We don't recommend setting the batch size to 1 to process one event at a time. Small batch sizes can slow down the processing
of event messages.
• If a trigger is running and subscribed to a platform event, new configuration settings take effect after you suspend and resume
the trigger. You can suspend and resume a trigger from the platform event detail page by clicking Manage next to the Apex
trigger in the Subscriptions related list. For more information, see View and Manage an Event’s Subscribers on the Platform
Event’s Detail Page.
To configure a platform event trigger with Tooling API, see PlatformEventSubscriberConfig in the Tooling API Developer Guide. To add a
configuration, perform a POST with the PlatformEventSubscriberConfig REST resource, and perform a GET call to retrieve a configuration
by ID. Also, you can query the configurations using Tooling API.
To configure a platform event trigger with Metadata API, see PlatformEventSubscriberConfig in the Metadata API Developer Guide. You
can use Visual Studio Code with the Salesforce Extension pack to deploy and retrieve Metadata API. For more information about installing
Visual Studio Code and the extension pack, see Salesforce Extensions for Visual Studio Code. For more information about deploying and
retrieving metadata using the CLI, see source Commands and mdapi Commands in the Salesforce CLI Command Reference.
SEE ALSO:
Apex Developer Guide: Apex Security and Sharing
Apex Developer Guide: Execution Governors and Limits
SEE ALSO:
Object Reference for the Salesforce Platform: EventLogFile
Object Reference for the Salesforce Platform: Apex Unexpected Exception Event Type
Trailhead: Event Monitoring
55
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
EventBus.TriggerContext.currentContext().setResumeCheckpoint(replayId);
When the trigger stops its flow of execution, either intentionally or because of an unhandled exception, such as a limit exception, it fires
again with a new batch (the sObject list in Trigger.New). The new batch starts with the event message after the one with the replay
ID that you set. The events are resent in their original order based on the ReplayID field values, which are unchanged. The trigger processes
the resent events and later batches sequentially. The setResumeCheckpoint(replayId) method doesn’t cause the trigger
execution to stop, but you can end the execution explicitly. For example, to control the batch size, end the execution flow after some
event messages are processed.
If the supplied Replay ID isn’t valid, the method throws an EventBus.InvalidReplayIdException. An invalid Replay ID is
a replay ID that isn’t in the current trigger batch of events in the Trigger.new list.
Note: Resuming a batch in one trigger doesn’t affect another trigger on the same event object. However, having multiple triggers
on the same object isn’t a best practice because we can’t guarantee the order of execution, so we recommend that you add only
one trigger per object.
Example: This example trigger sets the replay ID of the last processed event message in each iteration. If a limit exception occurs,
the trigger is fired again and resumes processing starting with the event message after the one with the set replay ID.
trigger ResumeEventProcessingTrigger on Low_Ink__e (after insert) {
for (Low_Ink__e event : Trigger.New) {
// Process the event message.
// ...
}
}
Example: This example controls the platform event trigger batch size and matches it with the 200 batch size of Apex object
triggers. The trigger counts the number of event messages processed. The setResumeCheckpoint(replayId) is called
in each iteration of the loop after each event message that is successfully processed. The loop is exited if you exceed the count of
200 events, and the trigger stops execution. If you have unprocessed event messages, the trigger fires again. The list of event
messages sent to the new trigger invocation starts with the event message after the one with the set replay ID.
56
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
Note: Starting in API version 51.0, you can configure the trigger batch size by using PlatformEventSubscriberConfig in
Metadata API or Tooling API. For more information, see Configure the User and Batch Size for Your Platform Event Trigger
with PlatformEventSubscriberConfig.
trigger ControlBatchSizeTrigger on Low_Ink__e (after insert) {
Integer counter = 0;
for (Low_Ink__e event : Trigger.New) {
// Increase batch counter.
counter++;
// Only process the first 200 event messages
if (counter > 200) {
// Resume after the last successfully processed event message
// after the trigger stops running.
// Exit for loop.
break;
}
The TestBatchSizeTriggerResumption test class contains a test for the ControlBatchSizeTrigger. The test
method in the class publishes 201 event messages. Next, it calls the deliver() method twice to fire the trigger twice. The first
invocation processes 200 event messages. The second invocation processes the last event message. The test verifies that the
trigger was invoked by inspecting the EventBusSubscriber.Position property, which holds the replay ID of the last
processed event message.
@isTest
public class TestBatchSizeTriggerResumption {
Test.startTest();
57
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
Test.getEventBus().deliver();
// VERIFICATION
// Get new position of this subscriber
EventBusSubscriber subNew =
[SELECT Name, Position, Topic
FROM EventBusSubscriber
WHERE Topic='Low_Ink__e' AND Name='ControlBatchSizeTrigger'];
System.debug(subNew);
System.assertEquals(subOld.Position + 1, subNew.Position);
Test.stopTest();
}
}
[other]: Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain
terms to avoid any effect on customer implementations.
An example of a transient condition: A trigger adds a related record to a master record if a field on the master record equals a certain
value. It’s possible that in a subsequent try, the field value changes and the trigger can perform the operation.
To retry the event trigger, throw EventBus.RetryableException. Events are resent after a small delay. The delay increases in
subsequent retries. If the trigger receives a batch of events, retrying the trigger causes all events in the batch to be resent. The events
are resent in their original order based on the ReplayID field values, which are unchanged. The trigger processes the resent events and
later batches sequentially. Resent events have the same field values as the original events, but the batch sizes of the events can differ.
For example, the initial trigger can receive events with replay ID 10 to 20. The resent batch can be larger, containing events with replay
ID 10 to 40. When the trigger is retried, the DML operations performed in the trigger before the retry are rolled back and no changes are
saved.
58
Platform Events Developer Guide Subscribe to Platform Event Notifications with Apex Triggers
We recommend limiting the retries to less than nine times. Use the
EventBus.TriggerContext.currentContext().retries property to check how many times the trigger has been
retried. Alternatively, you can query the EventBusSubscriber.retries field in API version 43.0 and later.
Example: This example is a skeletal trigger that gives you an idea of how to throw EventBus.RetryableException
and limit the number of retries. The trigger uses an if statement to check whether a certain condition is true. Alternatively, you
can use a try-catch block and throw EventBus.RetryableException in the catch block.
trigger ResendEventsTrigger on Low_Ink__e (after insert) {
if (condition == true) {
// Process platform events.
} else {
// Ensure we don't retry the trigger more than 4 times
if (EventBus.TriggerContext.currentContext().retries < 4) {
// Condition isn't met, so try again later.
throw new EventBus.RetryableException(
'Condition is not met, so retrying the trigger again.');
} else {
// Trigger was retried enough times so give up and
// resort to alternative action.
// For example, send email to user.
}
}
}
59
Platform Events Developer Guide Subscribe to Platform Event Notifications in a Lightning
Component
Use setResumeCheckpoint() when the trigger has Throw the EventBus.RetryableException to reprocess
processed event messages successfully before an unhandled events when you expect an external condition to change or a
exception occurs, such as a limit exception. After the exception, transient error to go away.
the trigger resumes after the last checkpointed event message.
Trigger execution continues after setResumeCheckpoint(). Trigger execution halts after the
EventBus.RetryableException is thrown.
DML operations performed are committed. DML operations performed before the exception is thrown are
rolled back and not committed.
When the trigger fires again, only the event messages after the When the trigger fires again, all event messages from the previous
one with the specified replay ID are resent, in addition to any new batch are resent in the new batch, in addition to any new event
event messages. messages.
These TriggerContext properties don’t apply and aren’t These TriggerContext properties are populated: retries
populated: retries and lastError. and lastError.
No limit on how many times you can set a checkpoint with You can retry the trigger nine times after its initial run by throwing
setResumeCheckpoint() and how many times the trigger EventBus.RetryableException.
can resume from the checkpoint after an unhandled exception
occurs.
Note: As of Spring ’19 (API version 45.0), you can build Lightning components using two programming models: the Lightning
Web Components model, and the original Aura Components model. Lightning web components are custom HTML elements built
using HTML and modern JavaScript. Lightning web components and Aura components can coexist and interoperate on a page.
60
Platform Events Developer Guide Subscribe to Platform Event Notifications with Pub/Sub API
Salesforce sends platform events to Pub/Sub API clients sequentially in the order they’re received. The order of event notifications is
based on the replay ID of events. A client can receive a batch of events at once. The total number of events across all batches received
in FetchResponses per Subscribe call is equal to the number of events the client requests. The number of events in each individual batch
can vary. If the client uses a buffer for the received events, ensure that the buffer size is large enough to hold all event messages in the
batch. The buffer size needed depends on the publishing rate and the event message size. We recommend you set the buffer size to 3
MB.
To learn more about the RPC methods in Pub/Sub API, see Pub/Sub API RPC Method Reference in the Pub/Sub API Developer Guide.
The platform event channel name is case-sensitive. To subscribe to an event, use this format.
/event/Event_Name__e
/event/Channel_Name__chn
Example: If you have a platform event named Low Ink, provide this channel name when subscribing.
/event/Low_Ink__e
This example shows the fields in the payload of the received event message. This example prints out the payload only. The received
event message also contains the schema ID and the event ID, in addition to the payload.
{
"CreatedDate": 1652978695951,
"CreatedById": "005SM000000146PYAQ",
"Printer_Model__c": "XZO-5",
"Serial_Number__c": "12345",
61
Platform Events Developer Guide Subscribe to Platform Event Notifications with CometD
"Ink_Percentage__c": 0.2
}
Pub/Sub API is used for system integration and isn’t intended for end-user scenarios. The binary event format enables efficient delivery
of lightweight messages. As a result, after decoding the event payload, some fields aren’t human readable and require additional
processing. For example, CreatedDate is in Epoch time and can be converted to another date format for readability.
The event schema is versioned—when the schema changes, the schema ID changes as well. For more information about retrieving the
event schema, see Get the Event Schema with Pub/Sub API.
Write a Pub/Sub API client to subscribe to platform event messages. You can use one of the 11 supported programming languages,
including Python, Java, Go, and Node.
• To learn how to write a client in Java or Python, check out the Python quick start in Quick Starts in the Pub/Sub API Developer Guide.
• For code examples in other languages, see the Pub/Sub API GitHub repository.
Important: Pub/Sub API is newer than the CometD-based Streaming API. You can use Pub/Sub API to publish and subscribe to
platform events and change data capture events. Based on gRPC API and HTTP/2, Pub/Sub API efficiently publishes and delivers
binary event messages and supports multiple programming languages. For more information about Pub/Sub API, see Subscribe
to Platform Event Notifications with Pub/Sub API.
Salesforce sends platform events to CometD clients sequentially in the order they’re received. The order of event notifications is based
on the replay ID of events. A CometD client can receive a batch of events at once. The number of event messages in a batch can vary. If
the client uses a buffer for the received events, ensure that the buffer size is large enough to hold all event messages in the batch. The
buffer size needed depends on the publishing rate and the event message size. At a minimum, set the buffer size to 10 MB, and adjust
it higher if needed.
The process of subscribing to platform event notifications through CometD is similar to subscribing to PushTopics or generic events.
The only difference is the channel name. The platform event channel name is case-sensitive and is in the following format.
/event/Event_Name__e
/event/Channel_Name__chn
Use this CometD endpoint with the API version appended to it.
/cometd/62.0
Example: If you have a platform event named Low Ink, provide this channel name when subscribing.
/event/Low_Ink__e
The message of a delivered platform event looks similar to the following example for Low Ink events.
{
"data": {
"schema": "dffQ2QLzDNHqwB8_sHMxdA",
"payload": {
"CreatedDate": "2017-04-09T18:31:40.517Z",
"CreatedById": "005D0000001cSZs",
62
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
"Printer_Model__c": "XZO-5",
"Serial_Number__c": "12345",
"Ink_Percentage__c": 0.2
},
"event": {
"EventUuid": "2ec0e371-1395-457f-9275-be1b527a72f7",
"replayId": 2
}
},
"channel": "/event/Low_Ink__e"
}
The schema field in the event message contains the ID of the platform event schema. The schema is versioned—when the schema
changes, the schema ID changes as well. For more information about retrieving the event schema, see Get the Event Schema.
Add custom logic to your client to perform some operations after a platform event notification is received. For example, the client can
create a request to order a new cartridge for this printer model.
SEE ALSO:
Streaming API Developer Guide: Message Durability
CometD
Pub/Sub API Developer Guide
Considerations for Publishing and Subscribing to Platform Events with Apex and APIs
63
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
Note:
• After you create a channel, you can't change its ChannelType or EventType field values.
• When you delete a channel by deleting PlatformEventChannel, all its associated members (PlatformEventChannelMember
entities) are also deleted.
• You can’t add the ApiEventStream and ReportEventStream Real-Time Event Monitoring events to a custom channel via Tooling
API because they aren't available in Tooling API. You can add them via Metadata API.
Example Diagram
This diagram shows the object relationships and definitions of the custom channel Order_Channel__chn and its members. The
channel is set up to receive order events for North America, EMEA, and the APAC regions. A custom event is defined for each region:
Order_NorthAmer__e, Order_EMEA__e, Order_APAC__e. Each of these platform events is added to the channel via
PlatformEventChannelMember objects. An order management app can subscribe to the custom channel, Order_Channel__chn,
and receive messages of the three platform events.
Subscribing to a Custom Channel and Getting the Event API Name with Pub/Sub API
When you subscribe to a custom channel, provide the channel name in the format /event/ChannelName__chn, such as
/event/Order_Channel__chn. Your subscriber receives event messages of all events that are part of the channel. If you subscribe
to the custom channel with Pub/Sub API, get the API name of the event received through the event schema. To retrieve the event
schema, call the GetSchema RPC method using the schema ID contained in the received event. The schema name is in the
schema_json field in the response and identifies the event API name. See GetSchema RPC Method in the Pub/Sub API Developer
Guide.
64
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
This example shows a received event with Pub/Sub API with the event name taken from the event schema.
{
"CreatedDate": 1711497484289,
"CreatedById": "0055f000005mc66AAA",
"Order_Number__c": "2",
"City__c": "London",
"Amount__c": 20.0
}
with schema name: Order_EMEA__e
Subscribing to a Custom Channel and Getting the Event API Name with CometD via
the EventApiName Field
When you subscribe to a custom channel, provide the channel name in the format /event/ChannelName__chn, such as
/event/Order_Channel__chn. Your subscriber receives event messages of all events that are part of the channel. In a CometD
client, each event message contains the EventApiName field, which contains the type of the event. For example, this event message
has an EventApiName of Order_EMEA__e, which means that it’s an Order_EMEA__e event.
{
"schema": "e8jMOnID4xDThlaPBMx5gg",
"payload": {
"City__c": "London",
"CreatedById": "005RM000002Qu16YAC",
"Amount__c": 20,
"CreatedDate": "2022-03-29T13:45:19.230Z",
"Order_Number__c": "2"
},
"event": {
"EventApiName": "Order_EMEA__e",
"EventUuid": "218544ad-0472-4315-970f-8825a2802de6",
"replayId": 10306
}
}
The EventApiName field is available in event messages received in CometD clients that use a Streaming API endpoint with API
version 55.0 and later. It isn't available in event messages received in other subscribers, such as Apex triggers, flows, and Pub/Sub API.
It isn't included in change data capture events and events that don't support custom channels. Also, the EventApiName field isn’t
part of the event schema that the REST eventSchema resource or the describe call returns.
IN THIS SECTION:
Create a Custom Channel for Custom Platform Events Using the API
Let’s walk through the steps to create a channel and add two platform events via channel members. Then, you can subscribe to the
channel to validate receiving event messages for platform events.
65
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
Create a Custom Channel for Real-Time Event Monitoring Events Using the API
Let’s walk through the steps to create a channel and add two Real-Time Event Monitoring events via channel members.
List Custom Channels and Channel Members
You can find which channels and channel members are set up in your Salesforce org by performing SOQL queries through Tooling
API.
Create a Custom Channel for Custom Platform Events Using the API
Let’s walk through the steps to create a channel and add two platform events via channel members. Then, you can subscribe to the
channel to validate receiving event messages for platform events.
IN THIS SECTION:
Prerequisite: Define Platform Events
The custom channel examples depend on a predefined custom platform events called Order_NorthAmer__e and Order_EMEA__e.
Before creating the custom channel, define these events in Salesforce.
Create a Custom Channel and Add Platform Events with Tooling API
Create a channel for orders named Order_Channel__chn, and add two platform events as members: Order_NorthAmer__e
and Order_EMEA__e.
Metadata API Example: Create a Custom Channel and Add Platform Events
Instead of Tooling API, you can use Metadata API to create a channel and channel member. We recommend using Metadata API as
part of the application lifecycle management process to develop, test, deploy, and release your apps to production. If you want to
only configure the channel, we recommend using Tooling API with REST.
Subscribe to the Channel
After creating a custom channel and its members, subscribe to the channel using a Pub/Sub API Java client, and receive event
messages.
4. Create four fields. In Custom Fields & Relationships, click New for each field, and follow the wizard.
a. Field type: Text; Field Label: Order Number; Length: 10
b. Field type: Text; Field Label: City; Length: 50
66
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
c. Field type: Number; Field Label: Amount; Length: 16; Decimal Places: 2
5. Repeat these steps for a platform event with the label Order EMEA and the same fields.
Create a Custom Channel and Add Platform Events with Tooling API
Create a channel for orders named Order_Channel__chn, and add two platform events as
USER PERMISSIONS
members: Order_NorthAmer__e and Order_EMEA__e.
You can use your preferred REST API tool to perform these steps. We recommend using Postman To create or update
PlatformEventChannel and
with the Salesforce Platform APIs collection, which contains handy templates for Salesforce API
PlatformEventChannelMember
calls. See Quick Start: Connect Postman to Salesforce in Trailhead. objects:
1. Create the channel using PlatformEventChannel, and set the channelType field to event. • Customize Application
Send a POST request to this URI. To use REST API:
• API Enabled
/services/data/v62.0/tooling/sobjects/PlatformEventChannel
If you're using Postman, expand Event Platform > Custom Channels > Platform Event, and then click Create channel.
3. Add the Order_NorthAmer__e platform event to the channel using PlatformEventChannelMember. The channel member references
the channel it’s part of (Order_Channel__chn) through the eventChannel field. Specify the platform event in the
selectedEntity field. Send a POST request to this URI.
/services/data/v62.0/tooling/sobjects/PlatformEventChannelMember
If you're using Postman, expand Event Platform > Custom Channels > Platform Event, and then click Create channel member.
67
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
"selectedEntity": "Order_NorthAmer__e"
}
}
5. Add the second channel member that specifies the platform event, Order_EMEA__e. Send a POST request to this URI.
/services/data/v62.0/tooling/sobjects/PlatformEventChannelMember
If you're using Postman, expand Event Platform > Custom Channels > Platform Event, and then click Create channel member.
SEE ALSO:
Tooling API Developer Guide: PlatformEventChannel
Tooling API Developer Guide: PlatformEventChannelMember
68
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
Metadata API Example: Create a Custom Channel and Add Platform Events
Instead of Tooling API, you can use Metadata API to create a channel and channel member. We
USER PERMISSIONS
recommend using Metadata API as part of the application lifecycle management process to develop,
test, deploy, and release your apps to production. If you want to only configure the channel, we To deploy and retrieve
recommend using Tooling API with REST. metadata types:
• Customize Application
In this example, you create a channel for orders named Order_Channel__chn, and you add two
platform events as members: Order_NorthAmer__e and Order_EMEA__e. To update metadata types:
• Modify Metadata
To create a channel and channel member with Metadata API, you can use tools such as Visual Studio
Through Metadata API
Code with the Salesforce Extension pack or Salesforce CLI. For more information, see Metadata API Functions
Developer Tools and Quick Start: Metadata API in the Metadata API Developer Guide.
To use Metadata API:
This sample custom channel definition is for the Order_Channel__chn channel. The file • API Enabled
name is Order_Channel__chn.platformEventChannel. To have this channel accept
platform events, event is specified for channelType.
<?xml version="1.0" encoding="UTF-8"?>
<PlatformEventChannel xmlns="http://soap.sforce.com/2006/04/metadata">
<channelType>event</channelType>
<label>Custom Channel for Orders</label>
</PlatformEventChannel>
The sample channel member definition associates the custom platform event to the channel. This channel member specifies the platform
event, Order_NorthAmer__e, and the channel, Order_Channel__chn. The file name is
Order_Channel_chn_Order_NorthAmer_e.platformEventChannelMember.
This channel member specifies the custom platform event, Order_EMEA__e, and the channel, Order_Channel__chn. The file name is
Order_Channel_chn_Order_EMEA_e.platformEventChannelMember.
This package.xml file references the channel and its two channel members.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Order_Channel__chn</members>
<name>PlatformEventChannel</name>
</types>
<types>
<members>Order_Channel_chn_Order_NorthAmer_e</members>
<name>PlatformEventChannelMember</name>
</types>
<types>
<members>Order_Channel_chn_Order_EMEA_e</members>
69
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
<name>PlatformEventChannelMember</name>
</types>
<version>62.0</version>
</Package>
SEE ALSO:
Metadata API Developer Guide: PlatformEventChannel
Metadata API Developer Guide: PlatformEventChannelMember
f. Build the client from the top-level java folder with this command: mvn clean install.
g. To run the Publish RPC example from the java folder, enter ./run.sh genericpubsub.Publish.
70
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
h. Repeat the previous steps to publish an Order_EMEA__e event. Both events have the same fields, so modify the field values in
the createEventMessage method in CommonContext.java.
.set("Order_Number__c", "2")
.set("City__c", "London")
.set("Amount__c", 20.0).build();
j. Build the client from the top-level java folder with this command: mvn clean install.
k. To run the Publish RPC example from the java folder, enter ./run.sh genericpubsub.Publish.
Because Order_Channel__chn includes both the Order_NorthAmer__e and Order_EMEA__e event types, you receive the
event messages of both events in the terminal where your subscriber client is running. This example shows the two received event
messages after subscribing to the filtered channel, /event/Order_Channel__chn. The Pub/Sub API client output includes
the event name, which is obtained from the schema on the received event.
2024-03-08 16:58:09,730 [pool-3-thread-2]
java.lang.Class - Received event with payload:
{
"CreatedDate": 1711497250504,
"CreatedById": "0055f000005mc66AAA",
"Order_Number__c": "1",
"City__c": "Los Angeles",
"Amount__c": 35.0
}
with schema name: Order_NorthAmer__e
If you use a Streaming API (CometD) to subscribe to the channel, the event messages contain the EventApiName as seen in this
example.
{
"schema": "LofZQqy_2SpDbzzZptVpxQ",
"payload": {
"City__c": "Los Angeles",
"CreatedById": "0055f000005mc66AAA",
"Amount__c": 35.0,
"CreatedDate": "2024-03-09T00:27:54.115Z",
"Order_Number__c": "1"
},
"event": {
"EventUuid": "7fffe7b9-106f-4708-bd8d-00a33aa6ab84",
71
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
"replayId": 12319972,
"EventApiName": "Order_NorthAmer__e"
}
}
{
"schema": "LofZQqy_2SpDbzzZptVpxQ",
"payload": {
"City__c": "London",
"CreatedById": "0055f000005mc66AAA",
"Amount__c": 20.0,
"CreatedDate": "2024-03-09T00:27:54.087Z",
"Order_Number__c": "2"
},
"event": {
"EventUuid": "4a502e4c-8cc4-4a6e-818f-45f91efac9a4",
"replayId": 12319973,
"EventApiName": "Order_EMEA__e"
}
}
Create a Custom Channel for Real-Time Event Monitoring Events Using the API
Let’s walk through the steps to create a channel and add two Real-Time Event Monitoring events via channel members.
IN THIS SECTION:
Create a Custom Channel and Add Real-Time Event Monitoring Events with Tooling API
Create a channel for Real-Time Event Monitoring events named Event_Monitoring_Channel__chn by using the
eventType field in PlatformEventChannel. Also, add two Real-Time Event Monitoring events as members: ApiAnomalyEvent and
FileEvent.
Metadata API Example: Create a Custom Channel and Add Real-Time Event Monitoring Events
You can use Metadata API to create a channel and channel member. We recommend using Metadata API as part of the application
lifecycle management process to develop, test, deploy, and release your apps to production. If you want to only configure the
channel, we recommend using Tooling API with REST.
72
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
Create a Custom Channel and Add Real-Time Event Monitoring Events with Tooling API
Create a channel for Real-Time Event Monitoring events named
USER PERMISSIONS
Event_Monitoring_Channel__chn by using the eventType field in
PlatformEventChannel. Also, add two Real-Time Event Monitoring events as members: To create or update
ApiAnomalyEvent and FileEvent. PlatformEventChannel and
PlatformEventChannelMember
You can use your preferred REST API tool to perform these steps. We recommend using Postman objects:
with the Salesforce Platform APIs collection, which contains handy templates for Salesforce API • Customize Application
calls. To set up Postman, see Quick Start: Connect Postman to Salesforce in Trailhead.
To use REST API:
1. Create the channel using PlatformEventChannel, set the channelType field to event • API Enabled
and the eventType field to monitoring. Send a POST request to this URI.
To use Real-Time Event
Monitoring events:
• Salesforce Shield or Event
Monitoring add-on
subscription and the View
Real-Time Event
Monitoring Data user
permission.
/services/data/v62.0/tooling/sobjects/PlatformEventChannel
If you're using Postman, expand Event Platform > Custom Channels > Platform Event, and then click Create channel.
3. Add the Order_NorthAmer__e platform event to the channel using PlatformEventChannelMember. The channel member references
the channel it’s part of (Order_Channel__chn) through the eventChannel field. Specify the platform event in the
selectedEntity field. Send a POST request to this URI.
/services/data/v62.0/tooling/sobjects/PlatformEventChannelMember
If you're using Postman, expand Event Platform > Custom Channels > Platform Event, and then click Create channel member.
73
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
5. Add the second channel member that specifies the platform event, Order_EMEA__e. Send a POST request to this URI.
/services/data/v62.0/tooling/sobjects/PlatformEventChannelMember
If you're using Postman, expand Event Platform > Custom Channels > Platform Event, and click Create channel member.
Before you subscribe to the Event_Monitoring_Channel__chn channel, enable Real-Time Event Monitoring and streaming
for the specific events. See Enable Access to Real-Time Event Monitoring and Manage Real-Time Event Monitoring Events in Salesforce
Help.
74
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
To subscribe to the channel, see Subscribe to the Channel and use /event/Event_Monitoring_Channel__chn for the
TOPIC parameter. After you start the subscription, perform some actions in the Salesforce org to cause some events to be generated.
For example, to receive FileEvent events on the channel, download a document.
SEE ALSO:
Platform Events Developer Guide: ApiAnomalyEvent
Platform Events Developer Guide: FileEvent
Tooling API Developer Guide: PlatformEventChannel
Tooling API Developer Guide: PlatformEventChannelMember
Metadata API Example: Create a Custom Channel and Add Real-Time Event Monitoring Events
You can use Metadata API to create a channel and channel member. We recommend using Metadata
USER PERMISSIONS
API as part of the application lifecycle management process to develop, test, deploy, and release
your apps to production. If you want to only configure the channel, we recommend using Tooling To deploy and retrieve
API with REST. metadata types:
• Customize Application
In this example, you create a channel for Real-Time Event Monitoring events named
Event_Monitoring_Channel__chn by using the eventType field in To update metadata types:
PlatformEventChannel. Also, you add two Real-Time Event Monitoring events as members: • Modify Metadata
ApiAnomalyEvent and FileEvent. Through Metadata API
Functions
To create a channel and channel member with Metadata API, you can use tools such as Visual Studio
To use Metadata API:
Code with the Salesforce Extension pack or Salesforce CLI. See Metadata API Developer Tools and
• API Enabled
Quick Start: Metadata API in the Metadata API Developer Guide.
To use Real-Time Event
This sample custom channel definition is for the Event_Monitoring_Channel__chn Monitoring events:
channel. The file name is • Salesforce Shield or
Event_Monitoring_Channel__chn.platformEventChannel. To have this channel Event Monitoring add-on
accept Real-Time Event Monitoring events, event is specified for channelType and subscription and the
monitoring is specified for eventType. View Real-Time Event
Monitoring Data user
permission.
This channel member definition associates ApiAnomalyEvent to the channel. The file name is
Event_Monitoring_Channel_chn_ApiAnomalyEvent.platformEventChannelMember.
75
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
This sample channel member definition associates FileEvent to the channel. The file name is
Event_Monitoring_Channel_chn_FileEvent.platformEventChannelMember.
This package.xml file references the channel and its two channel members.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Event_Monitoring_Channel__chn</members>
<name>PlatformEventChannel</name>
</types>
<types>
<members>Event_Monitoring_Channel_chn_ApiAnomalyEvent</members>
<name>PlatformEventChannelMember</name>
</types>
<types>
<members>Event_Monitoring_Channel_chn_FileEvent</members>
<name>PlatformEventChannelMember</name>
</types>
<version>62.0</version>
</Package>
Before you subscribe to the Event_Monitoring_Channel__chn channel, enable Real-Time Event Monitoring and streaming
for the specific events. See Enable Access to Real-Time Event Monitoring and Manage Real-Time Event Monitoring Events in Salesforce
Help.
To subscribe to the channel, see Subscribe to the Channel and use /event/Event_Monitoring_Channel__chn for the
TOPIC parameter. After you start the subscription, perform some actions in the Salesforce org to cause some events to be generated.
For example, to receive FileEvent events on the channel, download a document.
SEE ALSO:
Platform Events Developer Guide: ApiAnomalyEvent
Platform Events Developer Guide: FileEvent
Metadata API Developer Guide: PlatformEventChannel
Metadata API Developer Guide: PlatformEventChannelMember
76
Platform Events Developer Guide Group Platform Events into One Stream with a Custom
Channel
/services/data/v62.0/tooling/query?q=<query>
This query returns all the custom channels. The query results in this page are based on the Order_Channel__chn channel.
SELECT Id, DeveloperName, ChannelType, MasterLabel FROM PlatformEventChannel
If you're using Postman, expand Event Platform > Custom Channels, and then click List event channels.
Sample result:
Id
0YLRM0000004CEI4A2
DeveloperName
Order_Channel
ChannelType
event
MasterLabel
Custom Channel for Orders
And this query returns all the channel members.
SELECT Id, DeveloperName,EventChannel, SelectedEntity FROM PlatformEventChannelMember
If you're using Postman, expand Event Platform > Custom Channels, and then click List channel members.
For example, the query returns the two channel members created earlier. The SelectedEntity field references the ID of the custom
platform event.
First channel member:
Id
0v8RM0000000N6uYAE
DeveloperName
Order_Channel_chn_Order_NorthAmer_e
EventChannel
0YLRM0000004CEI4A2
SelectedEntity
01IRM0000006w522AA
Second channel member:
77
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
Id
0v8RM0000004VPJYA2
DeveloperName
Order_Channel_chn_Order_EMEA_e
EventChannel
0YLRM0000004CEI4A2
SelectedEntity
01IRM0000006w572AA
Note:
• This feature is supported for high-volume custom platform events that you define. It isn’t supported for legacy standard-volume
custom platform events or standard platform events, such as real-time event monitoring events.
• This feature is supported in Pub/Sub API and Streaming API (CometD) subscribers but not in other types of subscribers, such
as Apex triggers, flows, and processes.
• If you use Government Cloud and your org was created before January 14, 2022, contact Salesforce to enable this feature.
Government Cloud orgs created on or after January 14, 2022 have this feature enabled. This feature is available in all other
clouds.
IN THIS SECTION:
Platform Event Filters
Using Tooling API or Metadata API, an administrator with the Customize Application permission can configure a complex filter
expression that contains multiple fields.
Filter Expressions in Channel Members
Add a filter expression in a channel member that’s associated with a custom channel. The channel member associates a custom
platform event with the channel and specifies the filter expression. The channel holds the filtered stream of event messages that
match the filter expression for the specified custom platform event.
Subscribe to the Channel and Receive the Filtered Event Stream
After configuring the filter, subscribe to the channel and receive the event messages that match the filter expression. Only Pub/Sub
API and CometD clients support stream filtering. Because Apex triggers, flows, and processes don’t support custom channels, you
can’t use them to subscribe to filtered event streams.
Get Custom Channels and Channel Members
You can find which channels and channel members are set up in your Salesforce org by performing SOQL queries through Tooling
API.
SEE ALSO:
Subscribe to Platform Event Notifications with CometD
Subscribe to Platform Event Notifications with Pub/Sub API
78
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
IN THIS SECTION:
Filter Expression Format
The filter expression format is based on SOQL and supports a subset of SOQL operators and field types. The filter expression can
contain one or more field expressions, joined by a logical operator.
Field Considerations
Keep these considerations in mind for the fields in a filter expression.
Event Delivery Usage for Filtered Streams
The event delivery allocation applies to the number of events delivered after the filter is applied and not before filtering. Because a
filter can reduce the number of events delivered to a subscriber, using a filter helps lower a subscriber's usage of the event delivery
allocation.
Text field values are included within single quotes. Examples of a single-field expression filtering on a Text field:
City__c = 'San Francisco'
City__c LIKE 'San F%'
Example of a multiple-field expression using parentheses and the AND and OR logical operators:
Amount__c > 22.34 AND (City__c = 'San Francisco' OR City__c = 'New York')
Spaces within each field expression are optional. For the entire filter expression, if you use parentheses around each field expression,
spaces are optional between the field expression pairs and the logical operator. Otherwise, include a space between the logical operator
and the field expressions.
79
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
This expression matches messages with City__c values that start with 'Bake' and end with any character, such as 'Baker'.
City__c LIKE 'Bake_'
80
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
In this next expression, the NOT operator negates two conditions evaluated with the AND operator. The filter matches events that have
the city set to a value other than New York or the Amount set to a value other than 100. If an event has both the city set to New York
and the Amount set to 100, it doesn’t match the filter criteria and isn’t delivered.
NOT(City__c='New York' AND Amount__c=100)
If there’s more than one expression, including the expression with the NOT operator, parentheses around NOT and its expression are
required. In this example, two field expressions are joined by the AND operator, and NOT is used only for the first expression. It must be
enclosed within parentheses because there are two expressions. The entire filter expression states that the city isn’t New York and the
Amount value is greater than 10.50.
(NOT(City__c='New York')) AND (Amount__c>10.50)
This example also requires enclosing the NOT operator in parentheses. This filter expression matches events that have a delivery date
greater than 2021-10-21T09:30:11 in the Pacific time zone and whose city isn’t New York or amount isn’t 100.
Delivery_Date__c>2021-10-21T09:30:11-08:00 AND (NOT(City__c='New York' AND Amount__c=100))
SEE ALSO:
Salesforce Object Query Language (SOQL) Reference
Field Considerations
Keep these considerations in mind for the fields in a filter expression.
81
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
Note: If a filter expression was created before Winter ’23, renamed fields work only after you update the filter expression and
save the channel member again.
• Namespace prefix—If a filter expression was created before an org had a namespace and the filter expression didn’t contain the
namespace prefix in the field names, the filter expression is automatically updated with the namespace prefix and continues to work.
• Changing field types—You can’t change the type of a field that’s referenced in a filter expression. If you change it, you get an error.
• Field name case in the filter expression—The names of fields used in a filter expression are case-insensitive. The case of field names
in the filter expression and the platform event schema can differ.
• Missing event fields—If a filter expression references a valid field that isn’t part of a published event message, the field is evaluated
as null or false for a Checkbox field.
82
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
IN THIS SECTION:
Prerequisite: Define a Platform Event
The examples in this section depend on a predefined custom platform event called Order_Event__e. To define this event in Salesforce,
complete these steps.
Add a Filter with Tooling API
Before you can add a filter, create a channel. Use PlatformEventChannel in Tooling API, and specify API version 56.0 or later.
Add a Filter with Metadata API
We recommend using Metadata API as part of the application lifecycle management process to develop, test, deploy, and release
your apps to production. If you want to create the channel and filter expression, we recommend that you use Tooling API with REST.
4. Create these fields. In Custom Fields & Relationships, click New for each field, and follow the wizard.
a. Field type: Text; Field Label: Order Number; Length: 18
b. Field type: Text; Field Label: City; Length: 50
c. Field type: Number; Field Label: Amount; Length: 16; Decimal Places: 2
83
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
/services/data/v62.0/tooling/sobjects/PlatformEventChannel
If you're using Postman, expand Event Platform > Custom Channels > Platform Event, and click Create channel.
2. Use this example request body. To have this channel accept platform events, event is specified for channelType.
{
"FullName": "MyChannel__chn",
"Metadata": {
"channelType": "event",
"label": "Custom Channel for Platform Events"
}
}
3. Add a channel member that specifies the custom platform event and filter expression. This example references the custom platform
event, Order_Event__e. Send a POST request to this URI.
/services/data/v62.0/tooling/sobjects/PlatformEventChannelMember
If you're using Postman, expand Event Platform > Custom Channels > Platform Event, and click Create channel member.
84
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
SEE ALSO:
Tooling API Developer Guide: PlatformEventChannel
Tooling API Developer Guide: PlatformEventChannelMember
85
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
This channel member specifies the custom platform event and filter expression. This sample channel member definition associates the
custom platform event to the channel and adds a filter expression. The file name is
MyChannel_chn_Order_Event_e.platformEventChannelMember.
Note: If the filter expression contains the < and & special characters, they aren’t allowed in XML data in their literal form. Escape
those characters as < and &, or enclose the entire filter expression value within the <![CDATA[...]]> section.
Although no special characters are present in the previous example, <![CDATA[...]]> is included for convenience. For
more information, see CData sections in the Extensible Markup Language (XML) specification.
If your Salesforce org has a namespace, prepend the namespace prefix to each field used in filterExpression and the
selectedEntity value in the PlatformEventChannelMember request body. For example, if the namespace is ns, the request body
in this example becomes:
<?xml version="1.0" encoding="UTF-8"?>
<PlatformEventChannelMember xmlns="http://soap.sforce.com/2006/04/metadata">
<eventChannel>MyChannel__chn</eventChannel>
<filterExpression><![CDATA[(ns__City__c LIKE 'S%' OR ns__City__c='New York') AND
ns__Amount__c>10.50]]>
</filterExpression>
<selectedEntity>ns__Order_Event__e</selectedEntity>
</PlatformEventChannelMember>
86
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
To update a filter expression, redeploy the package with an updated value for the filterExpression field in the
PlatformEventChannelMember component. You can update only the filterExpression field of a channel member. All other
fields aren’t updateable.
SEE ALSO:
Metadata API Developer Guide: PlatformEventChannel
Metadata API Developer Guide: PlatformEventChannelMember
Note: Before subscribing to the channel, follow the steps in the previous sections to create the MyChannel__chn channel,
and configure a filter expression for Order_Event__e with Tooling API or Metadata API.
In this example, we use a Pub/Sub API Java client sample. See Java Quick Start for Publishing and Subscribing to Events in the Pub/Sub
API Developer Guide. If you prefer to use a tool in the Salesforce UI, you can use the empApi Lightning component or the Streaming
Monitor app from AppExchange.
1. Set up the Pub/Sub API Java client and subscribe to the channel.
a. Follow the steps in Java Quick Start for Publishing and Subscribing to Events in the Pub/Sub API Developer Guide.
b. In Step 3: Configure Client Parameters, for the TOPIC argument, provide the custom channel that you created:
/event/MyChannel__chn. The channel name format is /event/ChannelName__chn.
c. From the java folder, run: ./run.sh genericpubsub.Subscribe.
2. Now that you’re subscribed to the custom channel, publish event messages.
a. Open another Terminal window.
b. Navigate to your local pub-sub-api folder.
c. In an IDE, such as Visual Studio Code, open java/src/main/java/utility/CommonContext.java.
d. Modify the createEventMessages method. Replace the code with this snippet. Replace the CreatedById value
with your Salesforce user ID. See Find the Salesforce ID for a User or Profile.
public List<GenericRecord> createEventMessages(Schema schema, final int numEvents)
{
87
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
return events;
}
f. Build the client from the top-level java folder with this command: mvn clean install.
g. To run the PublishStream RPC example and publish five event messages from the java folder, enter ./run.sh
genericpubsub.PublishStream.
As a refresher, here’s the filter expression that we set in the previous section.
(City__c LIKE 'S%' OR City__c='New York') AND Amount__c>10.50
From the event messages published, only the second and fourth event messages match the filter criteria given in the previous
example and are delivered to the client. The other event messages only partially match the criteria, so they aren’t delivered to
the client.
This example shows the two event messages received after subscribing to the filtered channel, /event/MyChannel__chn.
2024-03-26 17:04:38,347 [pool-3-thread-1]
java.lang.Class - Received event with payload:
{
"CreatedDate": 1711497876867,
"CreatedById": "0055f000005mc66AAA",
"Order_Number__c": "100",
"City__c": "New York",
"Amount__c": 20.0
}
with schema name: Order_Event__e
88
Platform Events Developer Guide Filter Your Stream of Platform Events with Custom Channels
/services/data/v62.0/tooling/query?q=<query>
If you're using Postman, expand Event Platform > Custom Channels, and then click List event channels.
Sample result:
Id
0YLRM000000004X4AQ
DeveloperName
MyChannel
ChannelType
event
MasterLabel
Custom Channel for Platform Events
And this query returns all the channel members.
SELECT Id, DeveloperName,EventChannel,FilterExpression, SelectedEntity FROM
PlatformEventChannelMember
If you're using Postman, expand Event Platform > Custom Channels, and then click List channel members.
Sample result (the SelectedEntity field references the ID of the custom platform event):
Id
0v8RM0000000MnNYAU
DeveloperName
MyChannel_chn_Order_Event_e
EventChannel
0YLRM000000004X4AQ
FilterExpression
(City__c LIKE 'S%' OR City__c='New York') AND Amount__c>10.50
SelectedEntity
01IRM0000006mrs2AA
89
Platform Events Developer Guide Obtain a Platform Event’s Subscribers
Note: CometD and Pub/Sub API subscribers to a platform event channel aren’t exposed in the user interface or the API. Flow
Pause element subscribers to a platform event aren’t returned in Metadata API.
IN THIS SECTION:
View and Manage an Event’s Subscribers on the Platform Event’s Detail Page
View the triggers, flows, and processes that are subscribed to a platform event in the Subscriptions related list. Manage subscriptions
for Apex triggers.
Obtain Processes That Subscribe to a Platform Event in Metadata API
Use Metadata API to retrieve all processes subscribed to a platform event.
Obtain an Event’s Subscribers by Querying EventBusSubscriber
The EventBusSubscriber standard object contains information about the trigger and process subscribers of all platform events. You
can query this object using SOQL.
View and Manage an Event’s Subscribers on the Platform Event’s Detail Page
View the triggers, flows, and processes that are subscribed to a platform event in the Subscriptions related list. Manage subscriptions
for Apex triggers.
Note: Only one “Flow Resume” subscriber appears in the Subscriptions related list for all paused flow interviews that are
subscribed to the platform event. Processes and platform event–triggered flows are listed individually.
3. To access a subscriber’s definition, click the subscriber name in the Subscriptions related list. For a trigger, details include its
implementation and API version. For a process, details include its version number and API name.
Note: Why are you seeing flow version details when you click a process? Similar to a flow, a running instance of a process is
a flow interview. The information that you see on the Flow Version page is about the process. You can click the flow API name
of the process to view the list of processes for your org.
90
Platform Events Developer Guide Obtain a Platform Event’s Subscribers
The list shows the replay ID of the event that the system last processed (Last Processed Id field) and the event last published (Last
Published Id field). Knowing which replay ID was last processed is useful when there’s a gap in the events published and processed. For
example, if a trigger contains complex logic that causes a delay in processing large batches of incoming events.
Note: For high-volume platform events, the Last Published Id value isn't available and is always shown as Not Available.
Subscription States
Also, the Subscriptions list shows the state of each subscriber, which can be one of the following.
• Error— The subscriber was disconnected and stopped receiving published events. A trigger reaches this state when it exceeds
the number of maximum retries with the EventBus.RetryableException. Trigger assertion failures and unhandled
exceptions don’t cause the error state. We recommend limiting the retries to fewer than nine times to avoid reaching this state.
When you fix and save the trigger, or for a managed package trigger, if you redeploy the package, the trigger resumes automatically
from the tip, starting from new events. Also, you can resume a trigger subscription in the subscription detail page that you access
from the platform event page.
• Repartitioning—The system is in the process of modifying the trigger's parallel subscription configuration.
• Running—The subscriber is actively listening to events. If you modify the subscriber, the subscription continues to process events.
• Suspended—The subscriber is disconnected and can’t receive events because a Salesforce admin suspended it or due to an
internal error. You can resume a trigger subscription in the subscription detail page that you access from the platform event page.
To resume a process, deactivate it and then reactivate it. If you modify the subscriber, the subscription resumes automatically from
the tip, starting from new events.
You can’t manage subscriptions for flows and processes through the Subscriptions related list.
Note:
• After you click Resume or Resume from Tip, there can be a delay of a few minutes before the subscription resumes.
91
Platform Events Developer Guide Identify and Match Event Messages with the EventUuid Field
• After you modify a subscriber, the subscription resumes automatically. For more information, see the Subscription States
section.
• If you click Resume for a trigger that’s in the error state, the trigger skips the events that were retried with
EventBus.RetryableException. The subscription starts with the unprocessed events sent after the error state was
reached and that are within the retention window.
2. In each .subscription file, look at the referenceData parameter. The value is the API name of a process.
Example: In this .subscription file, referenceData points to version 4 of the Printer_Management process.
Note: If you use Apex to publish events, use Apex publish callbacks to track the final result of the EventBus.publish call.
For more information, see Get the Result of Asynchronous Platform Event Publishing with Apex Publish Callbacks.
The EventUuid field is a universally unique identifier (UUID) that identifies a platform event message. The system populates the
EventUuid field, and you can’t overwrite its value. The EventUuid field is available in CometD clients using API version 52.0 and
later. The API version corresponds to the version that an Apex trigger is saved with or the version specified in a CometD subscriber
92
Platform Events Developer Guide Identify and Match Event Messages with the EventUuid Field
endpoint. The EventUuid field isn’t part of the event schema, which is returned by the REST eventSchema resource or the describe
call result. The EventUuid field is available for high-volume and standard-volume platform events.
For Pub/Sub API clients, the event id field contains the event UUID value. There’s no field named EventUuid. The id field is present
in all Pub/Sub API clients, isn’t versioned, and can be overwritten. For more information, see the PublishStream RPC Method in the
Pub/Sub API documentation.
For all publishing methods except for Pub/Sub API, event publishing is asynchronous. A success status in an immediately returned
SaveResult means that the publish operation is queued in Salesforce. The operation is carried out later when system resources are
available. Some failures, such as validation or limit errors, are returned in the SaveResult, but not asynchronous errors. In rare cases,
enqueued publish operations can fail due to a system error, and the event message isn’t delivered. You can use the EventUuid field
to determine which enqueued event messages failed to publish and then republish them.
Publishing with Pub/Sub API is synchronous and the returned response contains the final publishing status.
If you publish the event in Apex, you can obtain the UUID by calling this method: EventBus.getOperationId(saveResult).
Note: If the event publish request fails to be enqueued in Salesforce, no event UUID is returned in the SaveResult. As a result, the
EventBus.getOperationId(result) Apex method returns null. This behavior applies even to events that have a
prepopulated UUID and that were created via SObjectType.newSObject(recordTypeId, loadDefaults).
This example gets the UUID from the event publish call using Apex.
Prerequisites: Before you can run this example, define a platform event with the label of Order Event and these fields: Order Number
of type Text(10) and Has Shipped of type Checkbox.
// Publish a high-volume event message
Order_Event__e evt = new Order_Event__e(
Order_Number__c='17',
Has_Shipped__c = false);
Database.SaveResult sr = EventBus.publish(evt);
// Inspect immediate result
if (sr.isSuccess() == true) {
System.debug('Successfully enqueued event for publishing.');
// Get the UUID that uniquely identifies this event publish
System.debug('UUID=' + EventBus.getOperationId(sr));
} else {
for(Database.Error err : sr.getErrors()) {
System.debug('Error returned: ' +
93
Platform Events Developer Guide Identify and Match Event Messages with the EventUuid Field
err.getStatusCode() +
' - ' +
err.getMessage());
}
}
Get the Event UUID from Received Event Messages in a CometD Client
In a CometD client, the received event message contains the event UUID in the EventUuid field in the event subsection, as shown
in this JSON event example.
{
"schema": "UIovjRagY-xEDIJ1Ehzafg",
"payload": {
"CreatedDate": "2021-03-04T18:31:40.517Z",
"CreatedById": "005RM00000231cZYAQ",
"Order_Number__c": "17",
"Has_Shipped__c": false
},
"event": {
"EventUuid": "e981b488-81f3-4fcc-bd6f-f7033c9d7ac3",
"replayId": 617
}
}
Get the Event UUID from Received Event Messages in a Pub/Sub API Client
In a Pub/Sub API client, the received event message contains the event UUID value in the id field of the event instance. For example,
you can retrieve the UUID value in your code by accessing the id field on the event instance as follows.
event.id
Get the Event UUID from Received Event Messages in an Apex Trigger
In an Apex trigger, extract the event UUID by accessing the EventUuid field on the event object.
trigger OrderEventTrigger on Order_Event__e (after insert) {
for(Order_Event__e evt: Trigger.New) {
// Get the event UUID
String EventUuid = evt.EventUuid;
System.debug('Received event UUID=' + EventUuid);
// Store the event UUID for matching with published event UUID
// . . .
}
94
Platform Events Developer Guide Testing Your Platform Event in Apex
SEE ALSO:
Publish Event Messages with Apex
IN THIS SECTION:
Event and Event Bus Properties in Test Context
In test context, event messages and the event bus have different properties. State information of events and subscribers is reset and
isn’t persisted.
Deliver Test Event Messages
Deliver test event messages after the Test.stopTest() statement. Alternatively, deliver test event messages at any time with
the Test.getEventBus().deliver() method. Fail test event messages with the Test.getEventBus().fail()
method.
Test Retried Event Messages
An Apex trigger can retry processing of an event message by throwing EventBus.RetryableException. In API version
43.0 and later, you can test retried event messages by calling Test.EventBus.deliver() and inspecting
EventBusSubscriber fields.
SEE ALSO:
Apex Developer Guide : Testing and Code Coverage
95
Platform Events Developer Guide Deliver Test Event Messages
• Event state information in EventBusSubscriber is reset. The last processed replay ID (EventBusSubscriber.Position) and
the last published replay ID (EventBusSubscriber.Tip) are reset to 0.
• When test events are published and processed in subscribers, event state information is updated.
• Subscriber status is reset to Running (EventBusSubscriber.Status).
• You can query EventBusSubscriber to get event state. For example, the following SOQL query gets some information about all trigger
subscribers to the Order_Event__e event.
SELECT Name, Position, Retries, LastError
FROM EventBusSubscriber
WHERE Topic='Order_Event__e' AND Type='ApexTrigger'
After an Apex test finishes executing, state information of events and subscribers reverts to the non-test values.
SEE ALSO:
Event-Driven Software Architecture
Object Reference for the Salesforce Platform: EventBusSubscriber
96
Platform Events Developer Guide Deliver Test Event Messages
bus. Include your validations after the Test.stopTest() statement. For example, you can validate that a subscribed Apex trigger
or a subscribed flow Pause element has performed the expected actions, like creating a Salesforce record.
// Create test events
Test.startTest();
// Publish test events with EventBus.publish()
Test.stopTest();
// Perform validations
Example: This sample test class contains two test methods. The testValidEvent() method checks that the event was
successfully published and fires the associated trigger. The testInvalidEvent() method verifies that publishing an event
with a missing required field fails, and no trigger is fired. The testValidEvent() method creates one Low_Ink__e event.
After Test.stopTest(), it executes a SOQL query to verify that a case record is created, which means that the trigger was
fired. The second test method follows a similar process but for an invalid test.
This example requires that the Low_Ink__e event and the associated trigger are defined in the org.
@isTest
public class EventTest {
@isTest static void testValidEvent() {
Test.startTest();
Test.stopTest();
Test.startTest();
97
Platform Events Developer Guide Deliver Test Event Messages
Database.SaveResult sr = EventBus.publish(inkEvent);
Test.stopTest();
Also, you can call Test.getEventBus().deliver() in an Apex test method outside the Test.startTest() and
Test.stopTest() statement block. Doing so enables you to test event messages with asynchronous Apex.
Test.startTest();
// Do some tests
Test.stopTest();
98
Platform Events Developer Guide Deliver Test Event Messages
Asynchronous Apex also includes queueable Apex and future methods. If a platform event message is published from within those
async Apex jobs, they’re delivered after Test.stopTest(). It’s not necessary to add Test.getEventBus().deliver();.
The next example shows how to deliver a platform event message that a queueable Apex job publishes. After Test.stopTest(),
the queueable job is executed and the event message is delivered.
Test.startTest();
System.enqueueJob(new SampleQueueableApex());
Test.stopTest();
// Queueable Apex job executes here.
// The platform event message published by the job is delivered too.
Note: If further platform events are published by downstream processes, add Test.getEventBus().deliver(); to
deliver the event messages for each process. For example, if a platform event trigger, which processes the event from the Apex
job, publishes another platform event, add a Test.getEventBus().deliver(); statement to deliver the event message.
99
Platform Events Developer Guide Deliver Test Event Messages
Test.startTest();
Test.getEventBus().deliver();
Test.stopTest();
}
}
This example trigger processes Order_Event__e event messages that the test class publishes.
Note: Because this trigger performs a SOQL query for each event notification received, the Apex governor limit for SOQL queries
can be hit.
trigger OrderTrigger on Order_Event__e (after insert) {
// List to hold all cases to be created.
List<Task> tasks = new List<Task>();
100
Platform Events Developer Guide Deliver Test Event Messages
@isTest
public class MyCallbackTest {
@isTest static void testFailedEventsWithFail() {
101
Platform Events Developer Guide Test Retried Event Messages
EventBus.publish(event, cb);
// Fail event
// (invoke onFailure and DO NOT deliver event to subscribers)
Test.getEventBus().fail();
System.debug('tasksFailed[0].Description=' + tasksFailed[0].Description);
System.debug('event.EventUuid=' + event.EventUuid);
System.Assert.isTrue(tasksFailed[0].Description.contains(event.EventUuid),
'EventUuid was not found in the Description field.');
}
}
SEE ALSO:
Apex Developer Guide : Using Limits, startTest, and stopTest
102
Platform Events Developer Guide Test Retried Event Messages
Example: This test method delivers a test event message that fires a trigger. The associated event trigger throws
EventBus.RetryableException twice. The test verifies that the trigger was retried twice by querying
EventBusSubscriber and checking the Retries field value.
Before you can run this test class, define a platform event with the name of Order_Event__e and the following fields:
Order_Number__c of type Text and Has_Shipped__c of type Checkbox. This test class assumes there is an associated
trigger called OrderTriggerRetry that retries the event. The trigger is not provided in this example.
@isTest
public class MyTestClassRetryDoc {
Test.startTest();
Test.stopTest();
}
}
SEE ALSO:
Retry Event Triggers with EventBus.RetryableException
103
Platform Events Developer Guide Encrypting Platform Event Messages at Rest in the Event Bus
Steps:
1. To generate an event bus tenant secret, from Setup, in the Quick Find box, enter Platform Encryption, and then select Key
Management.
2. In the Choose Tenant Secret Type dropdown list, choose Event Bus.
3. Click Generate Tenant Secret or, to upload a customer-supplied tenant secret, click Bring Your Own Key.
104
Platform Events Developer Guide Monitor Platform Event Publishing and Delivery Usage
Note:
• If your org has no tenant secrets, perform Step 3 before Step 2.
• You can generate or rotate an event bus tenant secret once every 7 days.
• You can also generate a tenant secret through SOAP API or REST API using the TenantSecret object and the Type field
value of EventBus. For more information, see TenantSecret in the Object Reference for Salesforce and Lightning Platform.
4. To enable encryption, from Setup, in the Quick Find box, enter Platform Encryption, and then select Encryption Policy.
5. Select Encrypt and deliver change data capture events and platform events.
Note: You can access and control this setting in Metadata API, in PlatformEncryptionSettings. Ensure that the event bus tenant
secret is created before setting enableEventBusEncryption to true.
6. Click Save.
When you enable encryption for platform events, you also enable it for change data capture events. For more information, see Change
Events for Encrypted Salesforce Data in the Change Data Capture Developer Guide.
Important: We recommend that you use Enhanced Usage Metrics. With Enhanced Usage Metrics, you can query usage data at
a granular level. You can break down usage metrics by event name, client ID, event type, and usage type. And you can get usage
data by various time segments, including daily, hourly, and 15-minute periods. See Enhanced Usage Metrics.
Use PlatformEventUsageMetric to get visibility into your event usage and usage trends. The usage data gives you an idea of how close
you are to your allocations and when you need more allocations. The usage metrics stored in PlatformEventUsageMetric are separate
from the REST API limits values. Use the REST API limits to track your monthly delivery and publishing usage against your allocations.
The event delivery usage that the limits API returns is common for platform events and change data capture events in CometD and
Pub/Sub API clients, empApi Lightning components, and event relays. PlatformEventUsageMetric breaks down usage of platform
events and change data capture events so that you can track their usage separately.
Because dates are stored in Coordinated Universal Time (UTC), convert your local dates and times to UTC for the query. For the date
format to use, see Date Formats and Date Literals in the SOQL and SOSL Reference.
105
Platform Events Developer Guide Monitor Platform Event Publishing and Delivery Usage
Usage data is stored for at least 45 days. Usage data is updated hourly and is available only when usage is nonzero for a 24-hour period.
Usage data isn’t available for 1-hour intervals or any other arbitrary interval. The only supported intervals are the last 24 hours and daily
data. Also, usage data isn’t available for standard-volume platform events.
After a Salesforce major upgrade, usage data can be inaccurate for the day and the last 24 hours within the upgrade window. New usage
data overwrites the data for the hour that the 5-minute upgrade occurs in. The new usage data includes metrics that start after the
upgrade for that hour. For more information about Salesforce upgrades, see Salesforce Upgrades and Maintenance in Help and Salesforce
Status.
For platform events, you can query usage data for these metrics. The first value is the metric name value that you supply in the query.
• PLATFORM_EVENTS_PUBLISHED—Number of platform events published
• PLATFORM_EVENTS_DELIVERED—Number of platform events delivered to CometD and Pub/Sub API clients, empApi
Lightning components, and event relays
For change data capture events, you can query usage data for these metrics. The first value is the metric name value that you supply in
the query.
• CHANGE_EVENTS_PUBLISHED—Number of change data capture events published
• CHANGE_EVENTS_DELIVERED—Number of change data capture events delivered to CometD and Pub/Sub API clients, empApi
Lightning components, and event relays
Note: Even though usage data is available for the number of change events published through the
CHANGE_EVENTS_PUBLISHED metric, no event publishing limit is enforced for change events. Publishing allocations apply
only to platform events.
This table lists which events, publishers, and subscribers are included for each metric.
Event delivery metrics: • Custom and standard platform events Subscription methods:
PLATFORM_EVENTS_DELIVERED and that count towards the delivery
CHANGE_EVENTS_DELIVERED • CometD, Pub/Sub API, empApi
allocation. Delivery metrics don't Lightning components, and event relays
include Event Monitoring real-time
• Delivery metrics don’t include event
events and some standard events. To
deliveries to Apex triggers, flows, and
check which standard platform event is
processes.
counted against the delivery allocation,
see Standard Platform Event Object List.
• Change events
106
Platform Events Developer Guide Monitor Platform Event Publishing and Delivery Usage
For the last 24-hour period, the end date is the current date in UTC, with the time rounded down to the previous hour. The start date is
24 hours before the end date. Dates have hourly granularity.
Example: Based on the current date and time of August 4, 2020 11:23 in UTC, the last hour is 11:00. The query includes these
dates.
• Start date in UTC format: 2020-08-03T11:00:00.000Z
• End date in UTC format: 2020-08-04T11:00:00.000Z
This query returns the usage for the number of platform events delivered between August 3, 2020 at 11:00 and August 4, 2020 at
11:00.
SELECT Name, StartDate, EndDate, Value FROM PlatformEventUsageMetric
WHERE Name='PLATFORM_EVENTS_DELIVERED'
AND StartDate=2020-08-03T11:00:00.000Z AND EndDate=2020-08-04T11:00:00.000Z
The query returns this result for the last 24-hour usage.
The time span between StartDate and EndDate is 24 hours for the stored 24-hour usage. You can specify either StartDate or EndDate
in the query and get the same result.
Example: To get usage metrics for a period of 3 days, from July 19 to July 22, 2020, use these start and end dates. Time values
are 0.
• Start date for the query: 2020-07-19T00:00:00.000Z
• End date for the query: 2020-07-22T00:00:00.000Z
This query selects usage metrics for the number of platform events delivered for a 3-day period.
SELECT Name, StartDate, EndDate, Value FROM PlatformEventUsageMetric
WHERE Name='PLATFORM_EVENTS_DELIVERED'
AND StartDate>=2020-07-19T00:00:00.000Z and EndDate<=2020-07-22T00:00:00.000Z
The query returns these results for the specified date range.
107
Platform Events Developer Guide Enhanced Usage Metrics
General Considerations
If you query the Id of PlatformEventUsageMetric, the Id value returned isn’t a valid record ID. For example, this query returns an Id
field value of 000000000000000AAA.
SELECT Id, Name, StartDate, EndDate, Value FROM PlatformEventUsageMetric WHERE
Name='PLATFORM_EVENTS_DELIVERED'
As a result, you can’t use PlatformEventUsageMetric in batch Apex with QueryLocator because QueryLocator requires valid record IDs
to be passed in to the execute method. Using PlatformEventUsageMetric with batch Apex and QueryLocator causes unexpected
results. Instead, use an iterable with batch Apex and PlatformEventUsageMetric. For more information, see Using Batch Apex in the
Platform Events Developer Guide.
IN THIS SECTION:
Enhanced Usage Metrics
In API version 58.0 and later, enable Enhanced Usage Metrics to get granular usage data and time segments in
PlatformEventUsageMetric queries. You can break down usage metrics by event name, client ID, event type, and usage type. And
you can get usage data by granular time segments, including daily, hourly, and 15-minute periods.
SEE ALSO:
Object Reference for Salesforce and Lightning Platform: PlatformEventUsageMetric
Query Example: Get Usage Metrics for the Last 24 Hours Aggregated by Event Name
If you don’t specify the StartDate and EndDate in your query, the query returns data for the last 24 hours by default. The example
query aggregates the results per event because the EventName field is specified in the SELECT statement. Also, the query aggregates
the data per hour as specified by the TimeSegment field. The query also includes the event type and the usage type.
Tip: Before you run this query, use Metadata API to enable Enhanced Usage Metrics. In the PlatformEventSettings metadata type,
set the enableEnhancedUsageMetrics field to true. See PlatformEventSettings in the Metadata API Developer Guide.
SELECT EventName, EventType, UsageType, Value, StartDate, EndDate
FROM PlatformEventUsageMetric
WHERE TimeSegment='Hourly'
108
Platform Events Developer Guide Enhanced Usage Metrics
In this sample result, usage data for published and delivered events is returned for all events: Order_Event__e and AccountChangeEvent.
The query aggregates usage data per hour.
For valid TimeSegment values, check the TimeSegment field of PlatformEventUsageMetric in the Object Reference for the Salesforce
Platform.
You can refine the query results by adding fields in the WHERE clause. To view usage data for only a specific usage type, add the UsageType
field in the WHERE clause. For example, to query for only delivered event usage, add this condition.
WHERE UsageType='DELIVERY'
You can narrow the query by event type. For example, to query for custom platform events only, add this condition.
WHERE EventType='CUSTOM_PLATFORM_EVENT'
You can query usage for one event only. For example:
WHERE EventName='Order_Event__e'
Query Rules
• If StartDate and EndDate aren’t specified in the WHERE clause, the query defaults to the last 24-hour period.
• You must specify the StartDate and EndDate field values in the WHERE clause or neither. If only StartDate or EndDate
are specified, you get an error.
• The maximum time span between StartDate and EndDate is 30 days.
• The minimum time span between StartDate and EndDate is 15 minutes.
• The StartDate field can refer to a date that is no more than 60 days old.
• The TimeSegment field must always be specified in the query’s WHERE clause. Optionally, it can also be part of the SELECT
statement.
• Make sure that the time span between StartDate and EndDate in the WHERE clause is valid for the TimeSegment value
chosen. Check the TimeSegment field of PlatformEventUsageMetric in the Object Reference for the Salesforce Platform.
109
Platform Events Developer Guide Enhanced Usage Metrics
• A query must have at least one of Name, EventType, or EventName fields in either the SELECT or WHERE clause.
• A query that uses EventName or EventType must also specify the UsageType in either the SELECT or WHERE clause.
Query Considerations
• We recommend that you include StartDate and EndDate in the query’s SELECT statement. Including these fields helps you
interpret the query results and map each result with its corresponding time segment.
• To make sure the query covers all time segments between the start date and end date, use the >= and <= logical operators with
StartDate and EndDate in the WHERE clause. For example: StartDate >= DateTime1 AND EndDate <=
DateTime2
• Date fields accept date literals, such as LAST_WEEK, in addition to date values. For more information, see Date Formats and Date
Literals in WHERE in the SOQL and SOSL Reference.
• The maximum number of rows that can be returned in a query for enhanced usage metrics is 2,000. If the query generates more
than 2,000 rows, you get an error and the query returns no results.
• The LIMIT clause isn’t supported.
• SOQL aggregate functions, such as SUM() and MAX(), aren’t supported. For more information, see Aggregate Functions in the
SOQL and SOSL Reference.
Tip: Before you run this query, use Metadata API to enable Enhanced Usage Metrics. In the PlatformEventSettings metadata type,
set the enableEnhancedUsageMetrics field to true. See PlatformEventSettings in the Metadata API Developer Guide.
SELECT EventName, EventType, Client, Value, StartDate, EndDate
FROM PlatformEventUsageMetric
WHERE TimeSegment='Daily'
AND UsageType='DELIVERY'
AND StartDate >= 2023-04-01T00:00:00.000Z
AND EndDate <= 2023-04-03T00:00:00.000Z
In this sample result, usage data is returned for all events: Order_Event__e and AccountChangeEvent. The query aggregates usage data
by client. Two clients receive Order_Event__e events, and the usage data is computed for each. AccountChangeEvent events are received
by one client only.
110
Platform Events Developer Guide Enhanced Usage Metrics
Tip: Before you run this query, use Metadata API to enable Enhanced Usage Metrics. In the PlatformEventSettings metadata type,
set the enableEnhancedUsageMetrics field to true. See PlatformEventSettings in the Metadata API Developer Guide.
SELECT EventName,Client, Value, StartDate, EndDate
FROM PlatformEventUsageMetric
WHERE TimeSegment='Hourly'
AND UsageType='DELIVERY'
AND EventName='Order_Event__e'
AND StartDate >= 2023-04-01T00:00:00.000Z
AND EndDate <= 2023-04-02T00:00:00.000Z
In this sample result, hourly usage data is returned for Order_Event__e on April 1. The query aggregates usage data by client. Two clients
receive Order_Event__e events, and the usage data is computed for each. A partial list of results is included for brevity.
111
Platform Events Developer Guide Platform Event Considerations
In the previous hourly usage example, the time period between the hours of 01:00:00 and 02:00:00 on April 1 has the highest usage. To
drill down into the usage for that day for one event, query for that date.
Tip: Before you run this query, use Metadata API to enable Enhanced Usage Metrics. In the PlatformEventSettings metadata type,
set the enableEnhancedUsageMetrics field to true. See PlatformEventSettings in the Metadata API Developer Guide.
SELECT EventName,Client, Value, StartDate, EndDate
FROM PlatformEventUsageMetric
WHERE TimeSegment='FifteenMinutes'
AND UsageType='DELIVERY'
AND EventName='Order_Event__e'
AND client='client1'
AND StartDate >= 2023-04-01T01:00:00.000Z
AND EndDate <= 2023-04-01T02:00:00.000Z
In this sample result, usage data for every 15 minutes is returned for Order_Event__e for client1 on April 1 between the hours of 01:00:00
and 02:00:00.
SEE ALSO:
Object Reference for the Salesforce Platform: PlatformEventUsageMetric
IN THIS SECTION:
Considerations for Defining and Publishing Platform Events
Take note of the considerations when defining and publishing platform events.
Considerations for Subscribing to Platform Events with Processes and Flows
Before you use processes or flows to subscribe to platform events, familiarize yourself with these considerations.
Considerations for Publishing and Subscribing to Platform Events with Apex and APIs
Before you use Apex or Salesforce APIs to publish and subscribe to platform events, familiarize yourself with these considerations.
Decoupled Publishing and Subscription
When the publish behavior of a platform event is set to Publish Immediately, it’s published outside of a Lightning Platform database
transaction. As a result, the publishing and subscription processes are decoupled—the subscription process can’t assume that an
action made by the publishing transaction is committed before an event message is received. Familiarize yourself with some scenarios
that can occur from the decoupled behavior.
112
Platform Events Developer Guide Considerations for Defining and Publishing Platform Events
113
Platform Events Developer Guide Considerations for Subscribing to Platform Events with
Processes and Flows
114
Platform Events Developer Guide Considerations for Subscribing to Platform Events with
Processes and Flows
Uninstalling Events
Before you uninstall a package that includes a platform event:
• Delete interviews that are waiting for that platform event’s messages
• Deactivate processes that reference the event
Einstein Predictions
AIPredictionEvents are sent for every Einstein prediction result. To trigger your process or flow only by predictions on a specific object,
use event condition filters. For example, if your process acts only on predictions written to Lead records, add a matching condition
to check that the Lead ID field equals the AI Predicted Object ID event reference.
If your process or flow updates a field that is used by an Einstein prediction, Einstein will run the prediction again and write back
new results. The new results generate a new AIPredictionEvent that could trigger your process or flow again, resulting in a loop.
Avoid creating potential loops by only updating fields that aren’t used in Einstein predictions.
Event Processes
These considerations apply only to event processes.
Apex Actions
You can’t use an event reference to set an sObject variable in the Apex class.
Email Alerts Actions
Email alerts can’t use values from platform event messages. For the process to send an email that contains values from the platform
event message that starts the process, use this workaround:
1. Create an autolaunched flow.
2. In the flow, create a variable for each field in the platform event. Be sure to use compatible data types and make the variables
available for input.
3. In the flow, add a Send Email action, and set the action’s input variables with the flow variables.
4. In the process, add a Flows action and specify the autolaunched flow. Use event references to assign each platform event field
to its corresponding flow variable.
Flows Actions
You can’t use an event reference to set a record variable in the flow, even when the platform event is specified as the record variable’s
object. To pass values into the flow from the platform event message that starts the process, use this workaround:
1. In the flow, create a variable for each field in the platform event. Be sure to use compatible data types and make the variables
available for input.
2. In the process, when you add the Flows action, use event references to assign each platform event field to its corresponding
flow variable.
Packaging Event Processes
When you package an event process, the associated object isn’t included automatically. Advise your subscribers to create the object,
or manually add the object to your package.
115
Platform Events Developer Guide Considerations for Publishing and Subscribing to Platform
Events with Apex and APIs
SEE ALSO:
Decoupled Publishing and Subscription
For cases and leads, you can alternatively use assignment rules for setting the owner. For more information, see AssignmentRuleHeader
for SOAP API or Setting DML Options for Apex.
Platform Event Triggers: Changing the Opportunity OwnerId Field
If a platform event trigger updates the opportunity OwnerId field when opportunity splits are enabled, the trigger runs as the default
Automated Process system user. A set of opportunity splits is created that totals 0%. The 0% split is invalid and must be 100% when
an opportunity owner is changed. The 0% split causes validation errors when users attempt to update some opportunity fields, such
as the Amount and Owner fields. To avoid these issues, configure the platform event trigger so that it runs as a different user. For
more information, see Configure the User and Batch Size for Your Platform Event Trigger with PlatformEventSubscriberConfig
No Email Support from a Platform Event Trigger
With the default Automated Process running user, sending an email message from a platform event trigger using the
Messaging.SingleEmailMessage class isn’t supported. The email can’t be sent because the sender is the Automated
116
Platform Events Developer Guide Decoupled Publishing and Subscription
Process entity, which has no email address. To send an email, change the running user of the trigger. For more information, see
Configure the User and Batch Size for Your Platform Event Trigger with PlatformEventSubscriberConfig.
Replaying Past Events
You can replay platform events that were sent in the past. You can replay platform events through Pub/Sub API or Streaming API
(CometD) but not Apex and other subscribers. For more information, see these resources.
• Java Quick Start in the Pub/Sub API Developer Guide.
• Event Message Durability in the Pub/Sub API Developer Guide.
Salesforce Maintenance Activities
On rare occasions, some Salesforce maintenance activities, such as an org migration to a new data center or an instance refresh,
reset the stream of retained high-volume platform events. Because of the stream reset, the events are no longer available for replay.
Also, the Replay ID of events published before the maintenance activity has no relation to the Replay ID of events after the activity.
For more information, see How to Prepare for an Org Migration and Instance Refresh Maintenance.
Site switches don't affect the stream of retained events for subscribers, including Pub/Sub API, Streaming API, empApi Lightning
components, Apex triggers, event relays, and flows. However, Apex triggers that are used as parallel subscriptions are affected if the
trigger lags behind and hasn't finished processing all events when the site switch occurs. In this case, the Apex trigger can't continue
processing unprocessed events from before the site switch. The parallel subscriptions resume from events newly published after
the site switch.
Using MuleSoft’s Salesforce Connector after a Hyperforce Migration
When a Salesforce instance is migrated to Hyperforce, the migration can result in an invalid Replay ID error in the Mule app. This
error can be returned if the Mule app tries to access a Replay ID from the object store that’s no longer valid on the new Hyperforce
instance. See the knowledge article about steps to take to avoid the error.
Millisecond Time Precision in DateTime Fields
For event messages delivered to CometD clients in JSON format, the DateTime fields include the number of milliseconds. The date
format, which is in the ISO 8601 standard, is YYYY-MM-DDTHH:mm:ss.sssZ. In API version 42.0 and earlier, DateTime fields
don’t include the millisecond part of the time, and the DateTime format is YYYY-MM-DDTHH:mm:ssZ.
For event messages delivered to Apex triggers, DateTime fields don’t include millisecond precision, like DateTime fields of Salesforce
objects.
Apex Trigger Subscriptions Disabled in Inactive Salesforce Orgs
If an org becomes inactive, all Apex trigger subscriptions are stopped and disabled. Triggers no longer process incoming event
messages and can't process missed event messages. After the org is reactivated, new Apex trigger subscriptions are started when
a platform event message is published.
SEE ALSO:
Platform Event Allocations
Note: This decoupled behavior doesn’t apply to platform events whose publish behavior is set to Publish After Commit.
117
Platform Events Developer Guide What’s the Difference Between the Salesforce Events?
The example uses Process Builder, but the scenario applies to other methods of publishing and subscribing, such as the API and triggers.
Conversely, if a subscriber creates a Salesforce record after receiving an event message, the new record might not be found immediately
after publishing. The reason is that the event is not processed synchronously after publishing, or the event processing might take a long
time if the logic is complex.
Solution
The solution is to change the publishing behavior of the event to Publish After Commit. With this behavior, the event message is
published after the first process creates the task record and the transaction finishes. The second process is able to find the task record.
Custom Events
You can use the following types of events to generate and deliver custom messages.
118
Platform Events Developer Guide What’s the Difference Between the Salesforce Events?
Data Events
The following types of events are tied to Salesforce records.
Change Data Capture Events
Salesforce publishes Change Data Capture events for record and field changes.
PushTopic Events
PushTopic events track field changes in Salesforce records and are tied to Salesforce records.
Event-Like Features
The following features can trick you into being streaming events, but they’re not.
Event Monitoring Log
Like Real-Time Event Monitoring, you can use Event Monitoring to track user activity, such as logins and running reports. Unlike
Real-Time Events, Event Monitoring doesn’t send real-time notifications. Instead, it stores user activity in a log that you can query.
Transaction Security Policies
A transaction security policy evaluates user activity, such as logins and data exports, and trigger actions in real time. When a policy
is triggered, notifications are sent through email or in-app notifications. You can use standard actions, such as blocking an operation,
or custom actions defined in Apex.
119
Platform Events Developer Guide Examples
Calendar Events
A calendar event is an appointment or meeting that you create and view in the user interface. In SOAP API, the Event object represents
a calendar event. These events are calendar items and not notifications that software systems send.
SEE ALSO:
Standard Platform Event Objects
Examples
Check out platform event apps—an end-to-end example using flows, a Java client, and a sample app that covers a business scenario.
IN THIS SECTION:
End-to-End Example: Printer Supply Automation
This example demonstrates how to make sure that your office printers always have enough paper and ink by using two platform
events and two flows.
Java Client
The sample Java client uses Pub/Sub API to publish and subscribe to platform events. Pub/Sub API provides a single interface to
publish and subscribe to event messages. Based on gRPC and HTTP/2, Pub/Sub API enables efficient delivery of binary event messages
in the Apache Avro format.
Platform Event Samples
Check out a sample that covers common business scenarios and uses platform events along with other Lightning Platform features.
IN THIS SECTION:
Platform Events: Printer Status and Vendor Response
This example uses two platform events: one to hold the information coming from the printer (Printer Status) and one to hold the
information coming from the vendor (Vendor Response).
Flow: Automation for Printer Status Events
When the platform event–triggered flow receives a Printer Status event, the flow finds the asset record that’s associated with the
printer. The flow evaluates whether the printer has low ink or paper, and if so, calls an Apex action to order ink or another action to
order paper.
Flow: Automation for Vendor Response Events
The Install Printer Supplies flow is a platform event–triggered flow that subscribes to the Vendor Response platform event. When
the vendor ships the printer part, they publish the Vendor Response platform event to notify their customer. This flow starts when
it receives the Vendor Response event message. It creates a task for the asset owner to install the new printer part.
120
Platform Events Developer Guide End-to-End Example: Printer Supply Automation
Expected_Delivery_Date Expected Date The date when the vendor expects the order to be delivered
Delivery Date
Order_Status Order Status Text Values: Ordered, Confirmed, Shipped, Delivered, Delayed, Canceled.
Part_Number Part Number Text The part number of the part to order.
Serial_Number Serial Number Text The printer’s unique identifier. This value is sent in the order request
and returned in the vendor response. It’s used to locate the
corresponding asset record.
121
Platform Events Developer Guide End-to-End Example: Printer Supply Automation
122
Platform Events Developer Guide End-to-End Example: Printer Supply Automation
The Get Records element finds the related asset record by matching the asset's serial number with that of the incoming event message.
The Get Records element provides us with the asset record fields that we use later in the flow.
If the ink level is low, the flow calls an Apex action that orders ink. The Apex action calls an invocable method and passes information
about the ink type and the printer serial number as invocable variables.
123
Platform Events Developer Guide End-to-End Example: Printer Supply Automation
After the ink level is evaluated, another Decision element evaluates the paper level.
If the paper level is lower than 10%, the flow calls an Apex action to order paper. The Apex action calls an invocable method and passes
the paper size and serial number as invocable variables.
124
Platform Events Developer Guide End-to-End Example: Printer Supply Automation
The implementation of Apex actions isn’t covered in this example. For more information about invocable Apex actions, see
InvocableMethod Annotation and InvocableVariable Annotation in the Apex Developer Guide. Typically, you call an external service to
place an order. To do so from an Apex action, you use Apex callouts. For more information, see Invoking Callouts Using Apex in the Apex
Developer Guide.
125
Platform Events Developer Guide End-to-End Example: Printer Supply Automation
The Get Records element finds the related asset by matching the asset's serial number with that of the received event message. Next,
the Create Records element creates the installation task for the part.
126
Platform Events Developer Guide End-to-End Example: Printer Supply Automation
In this example, some task fields reference flow resources that are created separately. The InstallationDate is a formula resource and is
defined as follows.
127
Platform Events Developer Guide Java Client
Java Client
The sample Java client uses Pub/Sub API to publish and subscribe to platform events. Pub/Sub API provides a single interface to publish
and subscribe to event messages. Based on gRPC and HTTP/2, Pub/Sub API enables efficient delivery of binary event messages in the
Apache Avro format.
Important: The sample Java client provides enough instructions and code snippets so that you can build your own client. The
examples in the Java client are for learning purposes only. The examples aren’t intended for production use and haven’t undergone
thorough functional and performance testing. You can use these examples as a starting point to build your own client.
Check out Java Quick Start for Publishing and Subscribing to Events in the Pub/Sub API Developer Guide.
Sample App: The E-Bikes App and the Pub/Sub API Demo
E-Bikes is a fictitious electric bicycle manufacturer. E-Bikes manages its products and reseller orders with the E-Bikes app, which offers a
rich user experience. Another app, the E-Bikes Manufacturing app, receives orders sent from the E-Bikes app. The E-Bikes Manufacturing
app is a Node app that uses Pub/Sub API to subscribe to Order__ChangeEvent, the change event that is generated for orders, when a
reseller order is placed in the E-Bikes app. After the manufacturer receives the change event and approves the order, the manufacturing
app publishes a platform event, Manufacturing_Event__e, back to Salesforce.
The Pub/Sub API demo represents the E-Bikes Manufacturing app and is built using the Lightning Web Runtime. The demo is an add-on
to the E-Bikes sample app. The E-Bikes sample app uses Lightning Web Components and integrates with Salesforce Experiences.
Install the E-Bikes app from the ebikes-lwc GitHub repository. After you install the E-Bikes app, install the Pub/Sub API demo from the
ebikes-manufacturing GitHub repository.
Reference
The reference documentation for platform events covers an API object, Apex methods, limits, error codes, and standard platform events.
Check out this object in the Object Reference for the Salesforce Platform.
128
Platform Events Developer Guide Platform Event Allocations
• EventBusSubscriber
Check out these Apex resources in the Apex Reference Guide.
• EventBus Class in the System namespace
• TriggerContext Class in the EventBus namespace
Check out these resources about limits, error codes, and standard platform events.
IN THIS SECTION:
Platform Event Allocations
Learn about the allocations available for platform event definitions, publishing and subscribing to platform events, and event delivery
in Pub/Sub API clients, CometD clients, empApi Lightning components, and event relays.
Platform Event Error Status Codes
When publishing an event message results in an error, a status code is returned in the SaveResult.
Standard Platform Event Objects
Check out the standard platform events that Salesforce publishes.
SEE ALSO:
Salesforce Help: Configure the Process Trigger
Salesforce Help: Flow element: Pause
IN THIS SECTION:
Which Type of Platform Events Do Allocations Apply to?
Platform events can be custom events, which are platform events that you define, or standard events, which are the events that
Salesforce defines, including Real-Time Event Monitoring events.
Common Platform Event Allocations
Common allocations include allocations for platform event definitions, concurrent CometD clients, and allocations for processes and
flows. The common allocations apply to standard-volume and high-volume platform events.
Default Platform Event Allocations for Event Publishing and Delivery
If your org has no add-on licenses, default allocations apply for event publishing and delivery that can’t be exceeded. The default
allocations are enforced to ensure fair sharing of resources in the multitenant environment and to protect the service.
Platform Event Add-On License and Usage-Based Entitlement
To increase your event delivery allocation for Pub/Sub API, CometD, empApi Lightning components, and event relays, purchase
an add-on for additional platform events. The add-on moves your event delivery usage to a monthly model and allows for spikes in
usage. To purchase an add-on, contact your Salesforce Account Representative.
Monitor Event Usage Against Your Allocations
Check your event publishing and delivery usage and maximum allocation in Setup, or using REST API or Apex.
Monitor Hourly Event Delivery Usage with REST API
Get the hourly delivery usage by periodically retrieving the daily event delivery usage using REST API.
129
Platform Events Developer Guide Platform Event Allocations
SEE ALSO:
Considerations for Publishing and Subscribing to Platform Events with Apex and APIs
Apex Publish Callback Limits
Change Data Capture Developer Guide: Change Data Capture Allocations
Maximum number of Process Builder processes and flows that can 4,000 4,000 4,000 5
subscribe to a platform event
Maximum number of active Process Builder processes and flows that 2,000 2,000 2,000 5
can subscribe to a platform event
Maximum number of custom channels that can be created for all 100 100 100 100
events except Real-Time Event Monitoring events
130
Platform Events Developer Guide Platform Event Allocations
Note:
• The concurrent client allocation applies to CometD and to all types of events: platform events, change events, PushTopic
events, and generic events. It doesn’t apply to non-CometD clients, such as Apex triggers, flows, and Process Builder processes.
Flows and Process Builder processes apply only to platform events and not to change events. The empApi Lightning
component uses CometD and consumes the concurrent client allocation like any other CometD client. Each logged-in user
using empApi counts as one concurrent client. If the user has multiple browser tabs using empApi, the streaming connection
is shared and is counted as one client for that user. A client that exceeds the concurrent client allocation receives an error and
can’t subscribe. When one of the clients disconnects and a connection is available, the new client can subscribe. For more
information, see Streaming API Error Codes in the Streaming API Developer Guide.
• Platform events that originate from an installed managed package share the org’s allocation for the maximum number of
platform event definitions.
SEE ALSO:
Enterprise Messaging Platform Events
131
Platform Events Developer Guide Platform Event Allocations
Note: Even though Apex triggers, flows, and Process Builder processes don’t count against the event delivery limit, their event
processing rate depends on the subscriber processing time and volume of events received. A higher processing time and event
volume means that it takes longer for the subscriber to reach the tip of the event stream.
Default Allocations
Event Delivery for Salesforce Order Management: maximum number of delivered event 100 100 100
messages in the last 24 hours, shared by all clients. (Applies to CometD and Pub/Sub
API clients, empApi Lightning components, and event relays only.)
This allocation is provided with the purchase of a Salesforce Order Management license.
132
Platform Events Developer Guide Platform Event Allocations
133
Platform Events Developer Guide Platform Event Allocations
• If you reach the event delivery limit often and your event volume is high, consider purchasing an add-on to increase your event
allocations by contacting your Salesforce Account Representative. The add-on that you purchase moves your event delivery usage
to a monthly model and allows for spikes in usage.
SEE ALSO:
Platform Event Add-On License and Usage-Based Entitlement
Monitor Event Usage Against Your Allocations
Change Data Capture Developer Guide: Change Data Capture Allocations
Salesforce Developers Blog: How to Work Within Platform Events Delivery Limits
Pub/Sub API Developer Guide
Salesforce Help: Event Relay
Streaming API Developer Guide
Table 1: Example: Entitlement with One High-Volume Platform Event Add-On License
Description Performance and Enterprise Edition and
Unlimited Editions Professional Edition
(with API Add-On)
Event Delivery: entitlement for delivered event messages, shared by all clients. Last 24 hours: 150,000 (50 Last 24 hours: 125,000 (25
(Applies to CometD and Pub/Sub API clients, empApi Lightning components, K included with org license K included with org license
and event relays only.) + 100 K from add-on + 100 K from add-on
You can exceed this entitlement by a certain amount before receiving an license) license)
error. Salesforce uses the monthly entitlement for event overage monitoring. Monthly entitlement: 4.5 Monthly entitlement: 3.75
The monthly entitlement is returned in the limits REST API resource. million (1.5 million million (0.75 million
included with org license included with org license
+ 3 million from add-on + 3 million from add-on
license) license)
134
Platform Events Developer Guide Platform Event Allocations
If your org purchased the add-on for additional platform events, the monthly event delivery usage is also displayed in the Event Allocations
section. This usage corresponds to the MonthlyPlatformEvents REST limits value.
Learn about other ways to check event usage with REST API, Apex, and in the Company Information page.
135
Platform Events Developer Guide Platform Event Allocations
Event Publishing: number of event With the REST API limits resource: usage With the REST API limits resource: usage
messages published per hour information is returned in information is returned in
HourlyPublishedPlatformEvents. HourlyPublishedPlatformEvents.
SEE ALSO:
REST API Developer Guide: Limits
REST API Developer Guide: List Org Limits
Apex Reference Guide: OrgLimit Class
...
}
136
Platform Events Developer Guide Platform Event Allocations
...
}
SEE ALSO:
REST API Developer Guide: Limits
REST API Developer Guide: List Org Limits
Important: You can no longer define new standard-volume custom platform events. New platform events are high volume by
default. Standard-volume custom platform events will be retired in Winter ’25. To migrate existing standard-volume events, see
Migrate Standard-Volume Platform Events to High-Volume Platform Events Before Retirement.
Event Publishing: maximum number of event messages published per hour 100,000 100,000 1,000
If you exceed the event delivery allocation, you receive this error: 403::Organization total events daily limit
exceeded. The error is returned in the Bayeux /meta/connect channel when a CometD subscriber first connects or in an existing
subscriber connection. For more information, see Streaming API Error Codes in the Streaming API Developer Guide. Standard-volume
event messages that are generated after exceeding the allocation are stored in the event bus. You can retrieve stored standard-volume
event messages as long as they’re within the 24-hour retention window.
To monitor your standard-volume event delivery usage, use the limits REST API resource, and inspect the
DailyStandardVolumePlatformEvents value. And to monitor the publishing usage, inspect the
HourlyPublishedStandardVolumePlatformEvents value. For more information, see List Organization Limits in the
REST API Developer Guide.
1
To request a higher number of standard-volume events delivered to CometD clients, contact Salesforce to purchase an add-on license.
The add-on license increases your daily limit of delivered events by 100,000 more events. For example, for Unlimited Edition, the add-on
license increases the daily limit of delivered events from 50,000 to 150,000 events. You can purchase multiple add-ons to meet your
137
Platform Events Developer Guide Platform Event Error Status Codes
event requirements for CometD clients. To avoid deployment problems and degradation in service, we recommend that the number
of events delivered to CometD clients not exceed 5 million per day. If you require more external events, contact your Salesforce
representative to understand how the product can scale to meet your needs.
Synchronous Errors
The following error status codes are returned immediately in the publish call result.
LIMIT_EXCEEDED
The number of published platform event messages exceeded the hourly publishing limit or the test limit for event messages published
from an Apex test context.
PLATFORM_EVENT_PUBLISHING_UNAVAILABLE
Publishing platform event messages failed because a service was temporarily unavailable. Try again later.
PLATFORM_EVENT_ENCRYPTION_ERROR
The platform event messages could not be published due to a problem with encryption. A misconfiguration in your Salesforce org
or a general encryption service error can cause this problem.
In Apex, the status code is returned in the Database.SaveResult in the Database.Error object. In SOAP API, the status
code is returned in the SaveResult object. In REST API, the status code is returned in the errors field in the JSON message.
IN THIS SECTION:
Change Data Capture Events
Salesforce Change Data Capture publishes change events, which represent changes to Salesforce records. Changes include record
creation, updates to an existing record, deletion of a record, and undeletion of a record. Change Data Capture events are available
since API version 44.0.
Standard Platform Event Object List
Salesforce publishes standard platform events in response to an action that occurred in the org or to report errors. For example,
LoginEventStream monitors user login activity and BatchApexErrorEvent reports errors encountered in batch Apex jobs. You can
subscribe to a standard platform event using the subscription mechanism that the event supports.
138
Platform Events Developer Guide Standard Platform Event Objects
Example: AccountChangeEvent
Custom Object Change Event Name
<Custom_Object_Name>__ChangeEvent
Example: Employee__ChangeEvent
Subscription Channels
Subscription channels for change events depend on the name of the change event you want to receive messages for. Also, a generic
channel is provided to receive all messages.
Channel for All Change Events
To receive event messages for all objects selected for Change Data Capture, use this channel:
/data/ChangeEvents
Example: AccountChangeEvent
Custom Object Channel
To receive event messages for changes in a custom object, use this channel:
/data/<Custom_Object_Name>__ChangeEvent
Example: Employee__ChangeEvent
139
Platform Events Developer Guide Standard Platform Event Objects
"recordIds": [
"0015f00002J9YYEAA3"
],
"changeType": "CREATE",
"changeOrigin": "com/salesforce/api/soap/60.0;client=SfdcInternalAPI/",
"transactionKey": "0001ade9-3f74-0b99-dbc4-42e73424b774",
"sequenceNumber": 1,
"commitTimestamp": 1712693965000,
"commitNumber": 1082985383811,
"commitUser": "0055f000005mc66AAA",
"nulledFields": [],
"diffFields": [],
"changedFields": []
},
"Name": "Acme",
"Type": null,
"ParentId": null,
"BillingAddress": null,
"ShippingAddress": null,
"Phone": null,
"Fax": null,
"AccountNumber": null,
"Website": null,
"Sic": null,
"Industry": null,
"AnnualRevenue": null,
"NumberOfEmployees": null,
"Ownership": null,
"TickerSymbol": null,
"Description": "Sample account record.",
"Rating": null,
"Site": null,
"OwnerId": "0055f000005mc66AAA",
"CreatedDate": 1712693965000,
"CreatedById": "0055f000005mc66AAA",
"LastModifiedDate": 1712693965000,
"LastModifiedById": "0055f000005mc66AAA",
"Jigsaw": null,
"JigsawCompanyId": null,
"CleanStatus": "Pending",
"AccountSource": null,
"DunsNumber": null,
"Tradestyle": null,
"NaicsCode": null,
"NaicsDesc": null,
"YearStarted": null,
"SicDesc": null,
"DandbCompanyId": null,
"OperatingHoursId": null,
"CustomerPriority__c": null,
"SLA__c": null,
"Active__c": null,
"NumberofLocations__c": null,
"UpsellOpportunity__c": null,
140
Platform Events Developer Guide Standard Platform Event Objects
"SLASerialNumber__c": null,
"SLAExpirationDate__c": null
}
Resources
For more information about Change Data Capture, see Change Data Capture Developer Guide and Pub/Sub API Developer Guide.
IN THIS SECTION:
AIPredictionEvent
Notifies subscribers when an Einstein feature, such as Prediction Builder or Case Classification, has written prediction results back to
a target object and AI prediction field. This object is available in API version 46.0 and later.
AIUpdateRecordEvent
Notifies subscribers when Einstein Case Classification has generated a case field value prediction and potentially updated a case
record. This object is available in API version 47.0 and later.
AppointmentSchedulingEvent
Notifies subscribers when an appointment schedule is added, updated, or deleted. This object is available in API version 50.0 and
later.
AssetCancelInitiatedEvent
Notifies subscribers when the process started by the
/asset-management/assets/collection/actions/initiate-cancellation process is complete. If the
process is successful, use this event to learn about the cancellation order that was created. If the process isn't successful, use the
RevenueTransactionErrorLog records to learn about the errors and how to fix them. This object is available in API version 55.0 and
later.
AssetAmendInitiatedEvent
Notifies subscribers when the process started by the
/asset-management/assets/collection/actions/initiate-amend-quantity REST request is complete.
If the process is successful, use this event to learn about the amendment order that was created. If the process isn't successful, use
the RevenueTransactionErrorLog records to learn about the errors and how to fix them. This object is available in API version 56.0
and later.
AssetRenewInitiatedEvent
Notifies subscribers when the process started by the
/asset-management/assets/collection/actions/initiate-renew REST request is complete. If the process
is successful, use this event to learn about the renewal order that was created. If the process isn't successful, use the
RevenueTransactionErrorLog records to learn about the errors and how to fix them. This object is available in API version 55.0 and
later.
AssetTokenEvent
Notifies subscribers of asset token issuance and registration of a connected device as an Asset. This object is available in API version
39.0 and later.
141
Platform Events Developer Guide Standard Platform Event Objects
BatchApexErrorEvent
Notifies subscribers of errors and exceptions that occur during the execution of a batch Apex class. This object is available in API
version 44.0 and later.
BillingScheduleCreatedEvent
Notifies subscribers when the /actions/standardCreateBillingScheduleFromOrderItem request is complete.
This object is available in API version 55.0 and later.
CommerceDiagnosticEvent
Tracks checkout, pricing, search, and other activity within your Commerce implementation to monitor events and diagnose issues.
This object is available in API version 49.0 and later.
ConsentEvent
Notifies subscribers of changes to consent fields or contact information on all core objects. This object is available in API version 50.0
and later.
ConsentUnsubscribeAllEvent
Notifies subscribers when a user unsubscribes from all communications on a preference form created in Preference Manager. This
object is available in API version 60.0 and later.
CreateAssetOrderEvent
Notifies subscribers that the process started by the /actions/standard/createOrUpdateAssetFromOrder request
is complete. If the process is successful, use this event to learn about the new assets. If the request isn't successful, use this event to
learn about the errors and how to fix them. This object is available in API version 55.0 and later.
CreditInvoiceProcessedEvent
Notifies subscribers when the process started by the
/commerce/invoicing/invoices/{invoiceId}/actions/credit request is complete. This object is available
in API version 55.0 and later.
CreditMemoProcessedEvent
Notifies subscribers when the process started by the /commerce/invoicing/credit-memos request is complete. This
object is available in API version 55.0 and later.
DataObjectDataChgEvent
Notifies subscribers of an action within Data Cloud. This object is available in API version 53.0 and later.
DataObjectMetadataChgEvent
Notifies subscribers of a metadata change within Data Cloud for these objects: Data Lake, Data Model, and Calculated Insight. This
object is available in API version 53.0 and later.
DatasetExportEvent
Notifies subscribers on the export of an Analytics dataset. This object is available in API version 41.0 and later.
DiscoveryPredictionEvent
Notifies subscribers when Einstein Discovery has written prediction history results. This object is available in API version 57.0 and
later.
ExtlRecShrEvent
Tracks the record data published from a vendor’s Salesforce org to a connected partner’s org for Partner Connect. This object is
available in API version 62.0 and later.
ExtlRecShrResultEvent
Tracks the data and the result of the export or update of the external record share published between a vendor and partner system
for Partner Connect. This object is available in API version 62.0 and later.
142
Platform Events Developer Guide Standard Platform Event Objects
FirstBillPaymentSetupEvent
Notifies subscribers when a first bill payment is set up. This object is available in API version 60.0 and later.
FlowExecutionErrorEvent
Notifies subscribers of errors related to screen flow executions. This object is available in API version 47.0 and later.
FlowOrchestrationEvent
Notifies subscribers that a paused instance of an orchestration is ready to be resumed. This object is available in API version 53.0 and
later.
FOStatusChangedEvent
Notifies subscribers of changes to the status of a fulfillment order record. Use this event to trigger flows and processes in your order
workflow. This object is available in API version 48.0 and later.
FulfillOrdItemQtyChgEvent
Notifies subscribers of changes to the quantity of a fulfillment order line item record. Use this event to trigger flows and processes
in your order workflow. This object is available in API version 53.0 and later.
InvoiceProcessedEvent
Notifies subscribers when the process started by the /commerce/billing/invoices request is complete. The process
groups billing schedules by grouping keys and creates one invoice per grouping key. InvoiceProcessedEvent is a top-level
object that contains a list of InvoiceProcessedDetailEvents, where each detail event represents an attempt to create
one invoice. This object is available in API version 55.0 and later.
NegInvcLineProcessedEvent
Notifies subscribers when a negative invoice line is converted to a credit memo. This object is available in API version 56.0 and later.
OmniTrackingEvent
Notifies subscribers about a user interaction with a FlexCard or OmniScript that's tracked for OmniAnalytics. This object is available
in API version 60.0 and later.
OrderStatusChangedEvent
Notifies subscribers of changes to the status of an order record. Use this event to trigger flows and processes in your order workflow.
This object is available in API version 51.0 and later.
OrderSummaryCreatedEvent
Notifies subscribers of the creation of an order summary record. Use this event to trigger flows and processes in your order workflow.
This object is available in API version 48.0 and later.
OrderSumStatusChangedEvent
Notifies subscribers of changes to the status of an order summary record. Use this event to trigger subscribers such as flows in your
order workflow. This object is available in API version 48.0 and later.
PaymentCreationEvent
Notifies subscribers when the process started by the /actions/standard/paymentSale request is complete. This object
is available in API version 55.0 and later.
PendingOrdSumProcEvent
Notifies subscribers that a PendingOrderSummary record was processed. If the process succeeded, an OrderSummary was created
and the PendingOrderSummary can be deleted. Use this event to trigger subscribers such as flows in your order workflow. This
object is available in API version 56.0 and later.
PlatformStatusAlertEvent
Notifies subscribers of alerts that occur during the processing of a user request or service job execution. This object is available in
API version 45.0 and later.
143
Platform Events Developer Guide Standard Platform Event Objects
ProcessExceptionEvent
Notifies subscribers of errors that occur during payment processing (capture, apply, and refund) on an order summary. Use this event
to trigger subscribers such as flows in your order workflow. This object is available in API version 50.0 and later.
QuoteSaveEvent
Notifies subscribers that the process started by the /actions/standard/quotesaveevent request is complete. If the
process is successful, use this event to learn about the updated quote. If the request isn't successful, use this event to learn about
the errors and how to fix them. This object is available in API version 58.0 and later.
QuoteToOrderCompletedEvent
Notifies subscribers when the /actions/standard/createOrderFromQuote REST request is complete. If the request
is successful, use this event to learn about the Order record. If the request isn’t successful, use this event to learn about the errors
associated with the request. This object is available in API version 56.0 and later.
RealtimeAlertEvent
Notifies subscribers of Amazon CloudWatch alarm events from your Service Cloud Voice Amazon Connect instance. This object is
available in API version 54.0 and later.
RemoteKeyCalloutEvent
Notifies subscribers of callouts that fetch encrypted key material from a customer endpoint. This object is available in API versions
45.0 and later.
SearchIndexJobStatusEvent
Notifies subscribers of changes to the status of the Data Cloud search index job, such as index refresh status and index run-time
status. This object is available in API version 60.0 and later.
ServiceAppointmentEvent
Notifies subscribers of the service appointment details that are generated from the event platform. This object is available in API
version 59.0 and later.
VoidInvoiceProcessedEvent
Notifies subscribers when the process started by the
/commerce/invoicing/invoices/{invoiceId}/actions/void request is complete. The request attempts to
void an invoice by crediting an invoice and changing its status to Voided, which prevents further changes. This object is available in
API version 55.0 and later. This object is available in API version 55.0 and later.
WebStoreUserCreatedEvent
Notifies subscribers of the creation of a new user for a WebStore. This object is available in API version 59.0 and later.
Real-Time Event Monitoring Objects
Check out the standard platform event and object pairs for Real-Time Event Monitoring. For most platform events used in Real-Time
Event Monitoring, corresponding objects store the event data. For more information, see Real-Time Event Monitoring in Salesforce
Help.
AIPredictionEvent
Notifies subscribers when an Einstein feature, such as Prediction Builder or Case Classification, has written prediction results back to a
target object and AI prediction field. This object is available in API version 46.0 and later.
Supported Calls
describeSObjects()
144
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/AIPredictionEvent
Fields
Field Details
Confidence Type
double
Properties
Nillable
Description
Relative confidence strength of the generated prediction result. Higher values (near 1.0)
indicate stronger confidence.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
FieldName Type
string
145
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
API name of the AI prediction field that prediction results were written back to. An AI
prediction field is a custom field created for storing and displaying the prediction scores on
records. The name is specified in ObjectName.FieldName format, for example,
Lead.predicted_score__c. For Case Classification prediction results, this field can
be null.
HasError Type
boolean
Properties
Defaulted on create
Description
true if there was an error while gathering information to create an event message, false
otherwise.
InsightId Type
string
Properties
Nillable
Description
The unique ID of the created AIRecordInsight record that generated the event message.
PredictionEntityId Type
string
Properties
Nillable
Description
The unique ID of the created AIInsightValue record associated with the AIRecordInsight that
generated the event message.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
146
Platform Events Developer Guide Standard Platform Event Objects
Field Details
TargetId Type
string
Properties
Nillable
Description
The unique ID of the record Einstein is writing prediction results to.
Usage
When Einstein writes prediction results back to AI prediction fields, record save custom logic, such as Apex triggers, workflow rules, and
assignment rules, aren’t run for efficiency reasons. To add custom logic based on Einstein prediction results, subscribe to AIPredictionEvent
for notifications of prediction result updates. Every time prediction results are written back to a Salesforce record, an AIPredictionEvent
event is created and AIPredictionEvent subscribers are notified.
SEE ALSO:
Object Reference for Salesforce and Lightning Platform : AIRecordInsight
AIUpdateRecordEvent
Notifies subscribers when Einstein Case Classification has generated a case field value prediction and potentially updated a case record.
This object is available in API version 47.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/AIUpdateRecordEvent
147
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
ErrorCode Type
picklist
Properties
Nillable, Restricted picklist
Description
Indicates whether an error occurred in the automatic case update, and describes the nature
of the error. Values are:
• none—No error occurred.
• entity_locked—The case is locked for editing by an approval process.
• no_access—The selected Einstein user or automatic process user doesn’t have
permission to make the update. For example, the user needs permission to update cases
or the case field in question, or needs sharing-based access to the case.
• validation_rule—The update violates a case validation rule.
• other—A different error occurred.
Available in API version 50.0 and later.
ErrorMessage Type
string
Properties
Nillable
Description
Further describes an error that occurred in the automatic case update.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
IsUpdated Type
boolean
Properties
Defaulted on create
148
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Indicates whether the related case (RecordId) was updated by Einstein Case Classification.
If a case value prediction falls below the required confidence level selected in the predictive
model, the case is not updated (false). If the prediction meets the confidence level
requirement, the case field is updated and the case is saved (true). It is only updated if at
least one field has a confidence threshold defined for the field’s Automate Value.
Available in API version 49.0 and later.
RecordId Type
string
Properties
None
Description
The record in which the prediction results are written.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
UpdatedFields Type
complexvalue
Properties
Nillable
Description
Indicates which record fields, if any, were updated in the event.
Available in API version 49.0 and later.
Usage
When Einstein Case Classification generates a case field value prediction, an AIUpdateRecordEvent event message is generated on case
create whether or not Einstein updates the case, and if at least one of the prediction fields has a confidence threshold set in the Automate
Value setting. A prediction will not result in a case update if its confidence level falls below the confidence threshold defined for the
field’s Automate Value setting. Subscribe to AIUpdateRecordEvent to be notified of such changes and to rerun case routing logic.
If all fields have a prediction that meets the confidence threshold criteria and an unexpected error prevents recommendations from
being auto-applied, an AIUpdateRecordEvent is published with a corresponding ErrorCode and Error Message.
149
Platform Events Developer Guide Standard Platform Event Objects
If a case doesn't match the data segment filters for any of the apps, we don't score and auto-apply recommendations or publish any
events.
There are additional considerations to auto-apply recommendations with dependent picklists. Learn More
AppointmentSchedulingEvent
Notifies subscribers when an appointment schedule is added, updated, or deleted. This object is available in API version 50.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/AppointmentSchedulingEvent
Fields
Field Details
AssignedResourceFields Type
AsgnRsrcApptSchdEvent[]
Properties
Nillable
Description
The assigned resources associated with the appointment.
150
Platform Events Developer Guide Standard Platform Event Objects
Field Details
ChangeType Type
string
Properties
Nillable
Description
The operation that caused the change. For example: CREATE, UPDATE, DELETE.
CorrelationId Type
string
Properties
Nillable
Description
The universally unique identifier (UUID) that correlates the appointment with the platform
event.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
ServiceAppointmentFields Type
SvcApptSchdEvent[]
Properties
Nillable
Description
The service appointments associated with the appointment.
151
Platform Events Developer Guide Standard Platform Event Objects
Example
This example event message is for a new appointment with two assigned resources.
{
"schema": "Zog7FKcPWV9DeEIEVHsoug",
"payload": {
"CreatedById": "005xx000001X7dlAAC",
"ChangeType": "CREATE",
"ServiceAppointmentFields": {
"ParentRecordId": "001RM000003rwkfYAA",
"ContactId": "003RM000006EpajYAC",
"Status": "None",
"AdditionalInformation": "Sample additional information",
"ServiceTerritoryId": "0Hhxx0000004mu4",
"Comments": "Sample comment",
"Email": "[email protected]",
"Address": "1 Market Street San Francisco CA 94105 United States",
"WorkTypeId": "08qxx0000004C92",
"WorkTypeBlockTimeBeforeAppointment": 30,
"WorkTypeBlockTimeAfterAppointment": 1,
"WorkTypeBlockTimeBeforeUnit": "minutes",
"WorkTypeBlockTimeAfterUnit": "hours",
"ServiceAppointmentId": "08pxx0000005Ip6",
"ScheduledEndTime": "2020-02-28T00:45:00.000Z",
"Subject": "Apply for Privileged Customer Card",
"AppointmentType": "null",
"StatusCategory": "None",
"DurationInMinutes": 60,
"Phone": "4155551212",
"ScheduledStartTime": "2020-02-27T23:45:00.000Z"
},
"AssignedResourceFields": [
{
"IsPrimaryResource": true,
"ServiceResourceUserName": "Rachel Adams",
"ServiceResourceUserId": "005xx000001X7dl",
"AssignedResourceId": "03rxx0000004gLc",
"ServiceResourceId": "0Hnxx0000004C92",
"ServiceResourceUserEmail": "[email protected]",
"IsRequiredResource": true
},
{
"IsPrimaryResource": false,
"ServiceResourceUserName": "Andrew Collins",
"ServiceResourceUserId": "005xx000001XPNl",
"AssignedResourceId": "03rxx0000004gNE",
"ServiceResourceId": "0Hnxx0000006z8q",
"ServiceResourceUserEmail": "[email protected]",
"IsRequiredResource": false
}
],
"CreatedDate": "2020-02-25T01:57:39.936Z",
"CorrelationId": "d7c0bbGiUObLF6BD3NaG"
},
152
Platform Events Developer Guide Standard Platform Event Objects
"event": {
"replayId": 3
}
}
IN THIS SECTION:
AsgnRsrcApptSchdEvent
Represents the assigned resources that are part of various platform events. This object is included in a streamed notification received
on the channels for the parent platform events. You can’t subscribe to the AsgnRsrcApptSchdEvent channel directly. This object is
available in API version 50.0 and later.
SvcApptSchdEvent
Represents the service appointment event. This object is included in a streamed notification received on the channels for the parent
platform events. You can’t subscribe to the SvcApptSchdEvent channel directly. This object is available in API version 50.0 and later.
AsgnRsrcApptSchdEvent
Represents the assigned resources that are part of various platform events. This object is included in a streamed notification received
on the channels for the parent platform events. You can’t subscribe to the AsgnRsrcApptSchdEvent channel directly. This object is
available in API version 50.0 and later.
Supported Calls
describeSObjects()
Fields
Field Details
AssignedResourceId Type
string
Properties
Nillable
Description
ID of the assigned resource.
ChangedFields Type
complexvalue
Properties
Nillable
Description
A list of fields that changed.
153
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
IsPrimaryResource Type
boolean
Properties
Defaulted on create
Description
Indicates whether the resource is primary.
IsRequiredResource Type
boolean
Properties
Defaulted on create
Description
Indicates whether the resource is required.
ServiceResourceId Type
string
Properties
Nillable
Description
ID of the service resource assigned to the event.
ServiceResourceUserEmail Type
string
Properties
Nillable
Description
Email of the service resource user assigned to the event.
ServiceResourceUserId Type
string
Properties
Nillable
154
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
ID of the user record associated with the service resource assigned to the event.
ServiceResourceUserName Type
string
Properties
Nillable
Description
Username as per the user record associated with the service resource assigned to the event.
Example
This example shows the assigned resources associated with the event.
{
"IsPrimaryResource": true,
"ServiceResourceUserName": "Rachel Adams",
"ServiceResourceUserId": "005xx000001X7dl",
"AssignedResourceId": "03rxx0000004gLc",
"ServiceResourceId": "0Hnxx0000004C92",
"ServiceResourceUserEmail": "[email protected]",
"IsRequiredResource": true
}
SvcApptSchdEvent
Represents the service appointment event. This object is included in a streamed notification received on the channels for the parent
platform events. You can’t subscribe to the SvcApptSchdEvent channel directly. This object is available in API version 50.0 and later.
Supported Calls
describeSObjects()
Fields
Field Details
AdditionalInformation Type
string
Properties
Nillable
155
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Additional information about the service appointment.
Address Type
string
Properties
Nillable
Description
The address of the service appointment.
AppointmentType Type
string
Properties
Nillable
Description
The service appointment type.
ChangedFields Type
complexvalue
Properties
Nillable
Description
List of fields that changed.
Comments Type
string
Properties
Nillable
Description
Comments about the service appointment.
ContactId Type
string
Properties
Nillable
Description
ID of the contact associated with the service appointment.
DurationInMinutes Type
double
Properties
Nillable
156
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The duration of the service appointment in minutes.
Email Type
string
Properties
Nillable
Description
The email associated with the service appointment.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
ParentRecordId Type
string
Properties
Nillable
Description
ID of the parent record associated with the service appointment.
Phone Type
string
Properties
Nillable
Description
The phone number associated with the service appointment.
ScheduledEndTime Type
dateTime
Properties
Nillable
Description
The scheduled end time of the service appointment.
ScheduledStartTime Type
dateTime
157
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The scheduled start time of the service appointment.
ServiceAppointmentId Type
string
Properties
Nillable
Description
ID of the service appointment.
ServiceTerritoryId Type
string
Properties
Nillable
Description
ID of the service territories associated with the service appointment.
Status Type
string
Properties
Nillable
Description
The status of the service appointment.
StatusCategory Type
string
Properties
Nillable
Description
The status category of the service appointment.
Subject Type
string
Properties
Nillable
Description
The subject of the service appointment.
WorkTypeBlockTimeAfterAppointment Type
int
158
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The period of time occurring after the appointment that is typically blocked for this work
type.
WorkTypeBlockTimeAfterUnit Type
string
Properties
Nillable
Description
The unit of the period specified for WorkTypeBlockTimeAfterAppointment. Values include
hour and minute.
WorkTypeBlockTimeBeforeAppointment Type
int
Properties
Nillable
Description
The period of time occurring before the appointment that is typically blocked for this work
type.
WorkTypeBlockTimeBeforeUnit Type
string
Properties
Nillable
Description
The unit of the period specified for WorkTypeBlockTimeBeforeAppointment. Values include
hour and minute.
WorkTypeId Type
string
Properties
Nillable
Description
ID of the work type associated with the service appointment.
159
Platform Events Developer Guide Standard Platform Event Objects
Example
This example shows the service appointment fields associated with the event.
{
"ParentRecordId": "001RM000003rwkfYAA",
"ContactId": "003RM000006EpajYAC",
"Status": "None",
"AdditionalInformation": "Sample additional information",
"ServiceTerritoryId": "0Hhxx0000004mu4",
"Comments": "Sample comment",
"Email": "[email protected]",
"Address": "1 Market Street San Francisco CA 94105 United States",
"WorkTypeId": "08qxx0000004C92",
"WorkTypeBlockTimeBeforeAppointment": 30,
"WorkTypeBlockTimeAfterAppointment": 1,
"WorkTypeBlockTimeBeforeUnit": "minutes",
"WorkTypeBlockTimeAfterUnit": "hours",
"ServiceAppointmentId": "08pxx0000005Ip6",
"ScheduledEndTime": "2020-02-28T00:45:00.000Z",
"Subject": "Apply for Chase Sapphire Preferred Card",
"AppointmentType": "null",
"StatusCategory": "None",
"DurationInMinutes": 60,
"Phone": "4157286216",
"ScheduledStartTime": "2020-02-27T23:45:00.000Z"
}
AssetCancelInitiatedEvent
Notifies subscribers when the process started by the
/asset-management/assets/collection/actions/initiate-cancellation process is complete. If the process
is successful, use this event to learn about the cancellation order that was created. If the process isn't successful, use the
RevenueTransactionErrorLog records to learn about the errors and how to fix them. This object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
160
Platform Events Developer Guide Standard Platform Event Objects
Subscription Channel
/event/AssetCancelInitiatedEvent
Fields
Field Details
AssetCancelErrorDetailEvents Type
AssetCancelErrorDtlEvent[] on page 162
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed. This field is available
in API versions 55.0 and 56.0 only.
CancellationRecordId Type
string
Properties
Nillable
Description
The ID of the cancellation record; for example, the cancellation order. If the process failed,
this field is null.
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
161
Platform Events Developer Guide Standard Platform Event Objects
Field Details
HasErrors Type
boolean
Properties
Defaulted on create
Description
true if errors occurred during the processing; otherwise false.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the
/asset-management/assets/collection/actions/initiate-cancellation
response. Use this ID to identify the event for a specific request.
IN THIS SECTION:
AssetCancelErrorDtlEvent
Contains information about errors that occurred during the processing of an
/asset-management/assets/collection/actions/initiate-cancellation request. This object is included
in an AssetCancelInitiatedEvent message. You can't subscribe to AssetCancelErrorDtlEvent directly. This
object is available in API versions 55.0 and 56.0 only.
AssetCancelErrorDtlEvent
Contains information about errors that occurred during the processing of an
/asset-management/assets/collection/actions/initiate-cancellation request. This object is included
in an AssetCancelInitiatedEvent message. You can't subscribe to AssetCancelErrorDtlEvent directly. This object
is available in API versions 55.0 and 56.0 only.
Supported Calls
describeSObjects()
162
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
ErrorCode Type
string
Properties
Nillable
Description
Reference code for the type of error that occurred.
ErrorMessage Type
string
Properties
Nillable
Description
Information about the error that occurred during processing.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
AssetAmendInitiatedEvent
Notifies subscribers when the process started by the
/asset-management/assets/collection/actions/initiate-amend-quantity REST request is complete. If
the process is successful, use this event to learn about the amendment order that was created. If the process isn't successful, use the
RevenueTransactionErrorLog records to learn about the errors and how to fix them. This object is available in API version 56.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
163
Platform Events Developer Guide Standard Platform Event Objects
Subscriber Supported?
Flows
Processes
Pub/Sub API
Subscription Channel
/event/AssetAmendInitiatedEvent
Fields
Field Details
AmendmentRecordId Type
string
Properties
Nillable
Description
The ID of the amendment record; for example, the amendment order. If the process failed,
this field is null.
AssetAmendErrorDetailEvents Type
AssetAmendErrorDtlEvent[]
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed. This field is available
in API versions 55.0 and 56.0 only.
CorrelationIdentifier Type
string
Properties
Nillable
164
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Reserved for future use.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
HasErrors Type
boolean
Properties
Defaulted on create
Description
true if errors occurred during the processing of this request; otherwise false.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the requestIdentifier parameter in the
/asset-management/assets/collection/actions/initiate-renew
response. Use this ID to identify the event for a specific request.
165
Platform Events Developer Guide Standard Platform Event Objects
IN THIS SECTION:
AssetAmendErrorDtlEvent
Contains information about errors that occurred during the processing of an
/asset-management/assets/collection/actions/initiate-amend-quantity request. This object is
included in an AssetAmendInitiatedEvent message. You can’t subscribe to AssetAmendErrorDtlEvent directly.
This object is available in API version 56.0 only.
AssetAmendErrorDtlEvent
Contains information about errors that occurred during the processing of an
/asset-management/assets/collection/actions/initiate-amend-quantity request. This object is included
in an AssetAmendInitiatedEvent message. You can’t subscribe to AssetAmendErrorDtlEvent directly. This object
is available in API version 56.0 only.
Supported Calls
describeSObjects()
Fields
Field Details
ErrorCode Type
string
Properties
Nillable
Description
Reference code for the type of error that occurred.
ErrorMessage Type
string
Properties
Nillable
Description
Information about the error that occurred during processing.
EventUuid Type
string
166
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
AssetRenewInitiatedEvent
Notifies subscribers when the process started by the
/asset-management/assets/collection/actions/initiate-renew REST request is complete. If the process is
successful, use this event to learn about the renewal order that was created. If the process isn't successful, use the
RevenueTransactionErrorLog records to learn about the errors and how to fix them. This object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/AssetRenewInitiatedEvent
167
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
AssetRenewErrorDetailEvents Type
AssetRenewErrorDtlEvent[] on page 169
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed. This field is available
in API versions 55.0 and 56.0 only.
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
HasErrors Type
boolean
Properties
Defaulted on create
Description
Contains true if errors occurred during the process; otherwise false. The default value
is false.
RenewalRecordId Type
string
Properties
Nillable
Description
The ID of the renewal record; for example, the renewal order. If the process failed, this field
is null.
ReplayId Type
string
168
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the requestIdentifier parameter in the
/asset-management/assets/collection/actions/initiate-renew
response. Use this ID to identify the event for a specific request.
IN THIS SECTION:
AssetRenewErrorDtlEvent
Contains information about errors that occurred during the processing of an
/asset-management/assets/collection/actions/initiate-renew request. This object is included in an
AssetRenewInitiatedEvent message. You can't subscribe to AssetRenewErrorDtlEvent directly. This object is
available in API versions 55.0 and 56.0 only.
AssetRenewErrorDtlEvent
Contains information about errors that occurred during the processing of an
/asset-management/assets/collection/actions/initiate-renew request. This object is included in an
AssetRenewInitiatedEvent message. You can't subscribe to AssetRenewErrorDtlEvent directly. This object is
available in API versions 55.0 and 56.0 only.
Supported Calls
describeSObjects()
169
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
ErrorCode Type
string
Properties
Nillable
Description
Reference code for the type of error that occurred.
ErrorMessage Type
string
Properties
Nillable
Description
Information about the error that occurred during processing.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
AssetTokenEvent
Notifies subscribers of asset token issuance and registration of a connected device as an Asset. This object is available in API version 39.0
and later.
An asset token event records successful completion of an OAuth 2.0 asset token flow for a connected device. An event is published
whenever an access token and actor token (optional) are successfully exchanged for an asset token. This object is designed to support
custom business processes, such as automatic logging of a case when an event occurs. Create Apex triggers that subscribe to an event
and execute after asset token issuance. This object is read only and can’t be retrieved using a SOQL query. Asset token events are not
displayed in the Setup user interface for Platform Events.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
170
Platform Events Developer Guide Standard Platform Event Objects
Subscriber Supported?
Processes
Pub/Sub API
Subscription Channel
/event/AssetTokenEvent
Fields
AssetId Type
reference
Properties
Nillable
Description
ID of the Asset record if the Asset was newly created or an existing Asset was
linked to in the asset token request.
AssetName Type
string
Properties
Nillable
Description
If specified in the actor token, the display name of the existing Asset. This value
is otherwise null.
171
Platform Events Developer Guide Standard Platform Event Objects
ConnectedAppId Type
reference
Properties
Nillable
Description
ID of the connected app associated with the access token for the device.
DeviceId Type
string
Properties
Nillable
Description
ID of the connected device. Value is the did (device ID) claim specified in the
actor token.
DeviceKey Type
textarea
Properties
Nillable
Description
If specified in the actor token, the device-specific RSA public key as a JSON Web
Key (JWK). Value is the jwk claim within the confirmation claim from the actor
token.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
This field is available in API version 52.0 and later.
Expiration Type
dateTime
172
Platform Events Developer Guide Standard Platform Event Objects
Properties
Nillable
Description
The expiration time on or after which the asset token JWT must not be accepted
for processing. A numeric value representing the number of seconds from
1970-01-01T00:00:00Z UTC until the specified UTC date/time, ignoring leap
seconds.
Name Type
string
Properties
Nillable
Description
Display name of the asset token.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position
of the event in the event stream. Replay ID values aren’t guaranteed to be
contiguous for consecutive events. A subscriber can store a replay ID value and
use it on resubscription to retrieve missed events that are within the retention
window.
UserId Type
reference
Properties
Nillable
Description
ID of the user associated with the access token.
Usage
The following example shows how to trigger an action after an asset token event.
trigger AssetTokenEventTrigger on AssetTokenEvent (after insert) {
System.assertEquals(1,Trigger.new.size(),'One record expected');
AssetTokenEvent event = Trigger.new[0];
AssetTokenRecord__c record = new AssetTokenRecord__c();
record.ConnectedAppId__c = event.ConnectedAppId;
record.UserId__c = event.UserId;
record.AssetId__c = event.AssetId;
173
Platform Events Developer Guide Standard Platform Event Objects
record.AssetTokenName__c = event.AssetTokenName;
record.DeviceId__c = event.DeviceId;
record.DeviceKey__c = event.DeviceKey;
record.Expiration__c = event.Expiration;
record.AssetSerialNumber__c = event.AssetSerialNumber;
record.AssetName__c = event.AssetName;
record.ActorTokenPayload__c = event.ActorTokenPayload;
insert(record);
}
BatchApexErrorEvent
Notifies subscribers of errors and exceptions that occur during the execution of a batch Apex class. This object is available in API version
44.0 and later.
Batch Apex classes can fire platform events when encountering an error or exception. Clients listening to the event channel can tell how
often it failed, which records were in scope at the time of failure, and other exception details.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/BatchApexErrorEvent
174
Platform Events Developer Guide Standard Platform Event Objects
Fields
DoesExceedJobScopeMaxLength Type
boolean
Properties
Defaulted on create
Description
True if the JobScope field is truncated due to the message exceeding the character
limit.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
This field is available in API version 52.0 and later.
ExceptionType Type
string
Properties
Nillable
Description
The Apex exception type name. Internal platform errors are represented as the
System.UnexpectedException type.
JobScope Type
textarea
Properties
Nillable
Description
The Record IDs that are in scope if the event was fired from the execute()
method of a batch job. If the batch job uses custom iterators instead of sObjects,
JobScope is the toString() representation of the iterable objects.
Maximum length is 40000 characters.
175
Platform Events Developer Guide Standard Platform Event Objects
Phase Type
string
Properties
Nillable
Description
The phase of the batch job when it encountered an error.
Possible Values
• START
• EXECUTE
• FINISH
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position
of the event in the event stream. Replay ID values aren’t guaranteed to be
contiguous for consecutive events. A subscriber can store a replay ID value and
use it on resubscription to retrieve missed events that are within the retention
window.
RequestId Type
string
Properties
Nillable
Description
The unique ID of the batch job that fired the event. Event monitoring customers
can use this information to correlate the error with logging information.
StackTrace Type
string
Properties
Nillable
176
Platform Events Developer Guide Standard Platform Event Objects
Description
The Apex stacktrace of the exception, if available. Maximum length is 5000
characters.
Usage
BatchApexErrorEvent messages are generated by batch Apex jobs that implement the
Database.RaisesPlatformEvents interface and have unhandled Apex exceptions during processing. For more information,
see the Apex Developer Guide.
BillingScheduleCreatedEvent
Notifies subscribers when the /actions/standardCreateBillingScheduleFromOrderItem request is complete.
This object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/billingschedulecreatedevent
177
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
BillSchdCreatedEventDetail Type
BillSchdCreatedEventDetail[] on page 179
Properties
Nillable
Description
One BillingScheduleCreatedEventDetail entry is created for each order
item in the BillingScheduleCreatedEvent request. One
BillSchdCreatedEventDetail is created for each error that occurred.
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
ID returned in the CreateBillingScheduleFromOrderItem response. Use this
ID to identify the BillingScheduleCreatedEvent for a specific request.
178
Platform Events Developer Guide Standard Platform Event Objects
IN THIS SECTION:
BillSchdCreatedEventDetail
Contains information about each order item in the /actions/standardCreateBillingScheduleFromOrderItem
request and any errors that occurred while processing the request. This object is included in an
BillingScheduleCreatedEvent message. You can't subscribe to BillSchdCreatedEventDetail directly. This
object is available in API version 55.0 and later.
BillSchdCreatedEventDetail
Contains information about each order item in the /actions/standardCreateBillingScheduleFromOrderItem
request and any errors that occurred while processing the request. This object is included in an BillingScheduleCreatedEvent
message. You can't subscribe to BillSchdCreatedEventDetail directly. This object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Fields
Field Details
BillingScheduleId Type
Id
Properties
Nillable
Description
If the request was successful, this field contains the ID of the billing schedule for the order
item.
ErrorCode Type
string
Properties
Nillable
Description
If the request wasn’t successful, this field contains the error code.
ErrorMessage Type
string
Properties
Nillable
Description
If the request wasn’t successful, this field contains the error message.
179
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
IsSuccess Type
boolean
Properties
Nillable
Description
Indicates whether the request to create a billing schedule for the order item was successful.
OrderItemId Type
reference
Properties
Nillable
Description
The ID of the order item used in the
/actions/standardCreateBillingScheduleFromOrderItem REST request.
This field is a relationship field.
Relationship Name
OrderItem
Relationship Type
Lookup
Refers To
OrderItem
CommerceDiagnosticEvent
Tracks checkout, pricing, search, and other activity within your Commerce implementation to monitor events and diagnose issues. This
object is available in API version 49.0 and later.
Supported Calls
create(),describeSObjects()
180
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/CommerceDiagnosticEvent
Fields
Field Details
B2bEdition Type
string
Properties
Create, Nillable
Description
The edition of B2B Commerce. The edition can include Lightning (LB2B), CCRZ, or future
flavors. This field is available in API version 51.0 and later.
B2bVersion Type
string
Properties
Create, Nillable
Description
This field is optional. For a managed package, B2BVersion includes Major, Minor, Patch
revision numbers. For Lightning, B2BVersion includes the optional service version. This
field is available in API version 51.0 and later.
181
Platform Events Developer Guide Standard Platform Event Objects
Field Details
BrowswerDeviceType Type
int
Properties
Create, Nillable
Description
A code used to identify the browser and device type. This field is available in API version 51.0
and later.
The code is in the format “BBVVVXYZ,” with the following signification:
• BB — Two digits that indicate the browser type.
– INTERNET_EXPLORER: “10”
– CHROME: "13"
– FIREFOX: "11"
– SAFARI: "14"
– OPERA: "15"
– ANDROID_WEBKIT: "16"
– NETSCAPE: "17"
– OTHER_WEBKIT: "18"
– OTHER_GECKO: "19"
– OTHER_KHTML: "20"
– OTHER_MOBILE: "21"
– SALESFORCE_DESKTOP: "22"
– BLACKBERRY: "23"
– GOOD_ACCESS: "24"
– EDGE: "25"
– SALESFORCE_MOBILE: "26"
182
Platform Events Developer Guide Standard Platform Event Objects
Field Details
ContextId Type
string
Properties
Create, Nillable
Description
The Key Business Domain Value in which the operation is done. For example, for Cart, the
ContextId is cartId.
ContextId2 Type
string
Properties
Create, Nillable
Description
Another field used to identify a context ID for a given operation.
ContextMap Type
string
Properties
Create, Nillable
Description
A JSON string that captures extra operational context or other diagnostic information.
CorrelationId Type
string
Properties
Create, Nillable
Description
Used to correlate client and server calls, and other async calls to Commerce subsystems.
Calls can take place across several services and operations.
Count Type
int
Properties
Create, Nillable
Description
The number of records impacted by an operation.
EffectiveAccountId Type
string
Properties
Create, Nillable
183
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The Commerce Effective Account ID in the context of an operation.
ErrorCode Type
string
Properties
Create, Nillable
Description
The API error code that appears when an operation fails.
ErrorMessage Type
string
Properties
Create, Nillable
Description
The user-friendly error message that appears when an operation fails.
EventDate Type
dateTime
Properties
Create, Nillable
Description
The date when the event occurred.
EventIdentifier Type
string
Properties
Create, Nillable
Description
The unique ID of the event, which is shared with the corresponding object. For example,
0a4779b0-0da1-4619-a373-0a36991dff90. Use this field value to correlate
the event with its corresponding object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
184
Platform Events Developer Guide Standard Platform Event Objects
Field Details
IsRetry Type
boolean
Properties
Create, Defaulted on create
Description
Describes whether an event occurred during a retried operation (true), or not (false).
Default value is false.
Operation Type
string
Properties
Create, Nillable
Description
The operation where the event originated. For example, CreateCart, EditCart, and
CreateOrder.
OperationStage Type
string
Properties
Create, Nillable
Description
The stage of the operation where the event originated. This value varies depending on the
operation.
OperationStatus Type
string
Properties
Create, Nillable
Description
The status of the operation. Values include:
• Success
• SystemError
• AdminError
• UserError
• DependencyError
OperationTime Type
string
Properties
Create, Nillable
185
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Duration of the operation in minutes and/or seconds.
OsVersion Type
int
Properties
Create, Nillable
Description
Code used to identify the operating system and version. OsVersion is equal to 9999 for
an unknown platform. This field is available in API version 51.0 and later.
RelatedEventIdentifier Type
string
Properties
Create, Nillable
Description
EventIdentifier (UUID) of the related event.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
ServiceName Type
string
Properties
Create, Nillable
Description
The service where the event originated. When Commerce generates the event, possible
values include:
• BuyerGroup
• BuyerAccount
• BuyerManagement
• Cart
• CartAsync
• Checkout
186
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Entitlements
• Order
• Pricing
• ProductEtl
• Products
• ReOrder
• Search
• Storefront
• Integration
• Wishlist
• ExternalManagedAccouts
• EffectiveAccountService
• EffectiveAccountUIService
UserId Type
string
Properties
Create, Nillable
Description
The ID of the user associated with this event.
Username Type
string
Properties
Create, Nillable
Description
Reserved for future use.
WebStoreId Type
string
Properties
Create, Nillable
Description
The ID of the Webstore associated with this event.
WebStoreType Type
string
Properties
Create, Nillable
187
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The type of webstore. For example: B2B, B2C, and OMS. This field is available in API version
51.0 and later.
SEE ALSO:
Subscribing to Platform Events
ConsentEvent
Notifies subscribers of changes to consent fields or contact information on all core objects. This object is available in API version 50.0
and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/ConsentEvent
188
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
AssociatedIds Type
string
Properties
Nillable
Description
A list of IDs associated with the changed record.
Possible IDs are:
• globalPartyId
• individual
• lead
• contact
• personAccount
• user
• contactPoint
• contactPointConsent
• contactPointTypeConsent
ChangeInitiator Type
string
Properties
Nillable
Description
The ID of the user who changed the record.
ChangeTimestamp Type
dateTime
Properties
Nillable
Description
Indicates the date and time the change event occurred.
ChangeType Type
picklist
Properties
Nillable, Restricted picklist
Description
Indicates the type of change made to the record.
Possible values are:
189
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Create
• Delete
• Undelete
• Unknown
• Update
ConsentCaptureSource Type
string
Properties
Nillable
Description
Indicates how consent was captured. For example, if the ConsentCaptureType is a website,
the ConsentCaptureSource is the website URL.
ConsentCaptureType Type
string
Properties
Nillable
Description
Indicates the type of source consent was captured through. For example, a website or online
form.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
NewValues Type
string
Properties
Nillable
Description
Indicates new values that were added to the object, if relevant.
ObjectName Type
string
Properties
Nillable
190
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The name of the object for which the change event was captured.
RecordId Type
string
Properties
Nillable
Description
The ID of the record that was changed.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
ConsentUnsubscribeAllEvent
Notifies subscribers when a user unsubscribes from all communications on a preference form created in Preference Manager. This object
is available in API version 60.0 and later.
Supported Calls
create(), describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
191
Platform Events Developer Guide Standard Platform Event Objects
Subscription Channel
/event/ConsentUnsubscribeAllEvent
Fields
Field Details
EventDetails Type
textarea
Properties
Create
Description
JSON text that contains the details for the unsubscribe all event, such as the timestamp for
when the event happened.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
CreateAssetOrderEvent
Notifies subscribers that the process started by the /actions/standard/createOrUpdateAssetFromOrder request is
complete. If the process is successful, use this event to learn about the new assets. If the request isn't successful, use this event to learn
about the errors and how to fix them. This object is available in API version 55.0 and later.
192
Platform Events Developer Guide Standard Platform Event Objects
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/CreateAssetOrderEvent
Fields
Field Details
AssetDetails Type
CreateAssetOrderDtlEvent on page 195
Properties
Nillable
Description
A list of AssetDetail records created as a result of a successful
createOrUpdateAssetFromOrder request.
Each AssetDetail contains an order item ID, asset ID, and IsSuccess flag. If the request failed,
the AssetDetail also contains an error code and error message.
CorrelationIdentifier Type
string
Properties
Nillable
193
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Reserved for future use.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
IsLastEvent Type
boolean
Properties
Defaulted on create
Description
Indicates whether this event is the final event in the request (true) or not (false). If
true, then there are no more events associated with the request. This field is populated
only in the final event in the request.
The default value is false.
This field is available in API version 62.0 and later.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the /createOrUpdateAssetFromOrder response. Use
this ID to identify the event for a specific request.
194
Platform Events Developer Guide Standard Platform Event Objects
Example: A user successfully runs a createOrUpdateAssetFromOrder request on an order with two order items. The
published createAssetOrderEvent contains this information.
• RequestId: 0001
• AssetDetail
– OrderItemId: 802XX0000000001
– AssetId: 02iXX000000001
– IsSuccess: True
• AssetDetail
– OrderItemId: 802XX0000000001
– AssetId: 02iXX000000002
– IsSuccess: True
Example: A user runs a createOrUpdateAssetFromOrder request on an order with two order items, but doesn't have
Create access on assets. The request fails, and the published createAssetOrderEvent contains this information.
• RequestId: 0002
• AssetDetail
– OrderItemId: 802XX0000000001
– IsSuccess: False
– ErrorCode: INSUFFICIENT_ACCESS
– ErrorMessage: User doesn’t have Create Access to asset.
• AssetDetail
– OrderItemId: 802XX0000000001
– IsSuccess: False
– ErrorCode: INSUFFICIENT_ACCESS
– ErrorMessage: User doesn’t have Create Access to asset.
IN THIS SECTION:
CreateAssetOrderDtlEvent
Contains information about an attempt to create or update an asset as a result of
/actions/standard/createOrUpdateAssetFromOrder. If the request was successful, the event shows information
about the asset. If the request failed, the event shows error information. This object is included in an CreateAssetOrderEvent
message. You can't subscribe to CreateAssetOrderDtlEvent directly. This object is available in API version 55.0 and later.
CreateAssetOrderDtlEvent
Contains information about an attempt to create or update an asset as a result of
/actions/standard/createOrUpdateAssetFromOrder. If the request was successful, the event shows information
about the asset. If the request failed, the event shows error information. This object is included in an CreateAssetOrderEvent
message. You can't subscribe to CreateAssetOrderDtlEvent directly. This object is available in API version 55.0 and later.
195
Platform Events Developer Guide Standard Platform Event Objects
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/CreateAssetOrderDtlEvent
Fields
Field Details
AssetId Type
reference
Properties
Nillable
Description
The ID of the asset that was created or updated.
This field is a relationship field.
Relationship Name
Asset
Relationship Type
Lookup
Refers To
Asset
ErrorCode Type
string
196
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Reference code for the type of error that occurred.
ErrorMessage Type
string
Properties
Nillable
Description
Information about the error that occurred after the request was made.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the request to create the asset for the order item was successful (true) or
not (false).
The default value is false. Available in API version 61.0 and later.
OrderItemId Type
reference
Properties
Description
The ID of the order item used in the request. Available in API version 61.0 and later.
This field is a relationship field.
Relationship Name
OrderItem
Relationship Type
Lookup
Refers To
OrderItem
197
Platform Events Developer Guide Standard Platform Event Objects
Field Details
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
CreditInvoiceProcessedEvent
Notifies subscribers when the process started by the /commerce/invoicing/invoices/{invoiceId}/actions/credit
request is complete. This object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/CreditInvoiceProcessedEvent
198
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
CrMemoProcessErrDtlEvents Type
CreditMemoProcessedErrDtlEvent[]
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed. This field is available
only in API versions 55.0–58.0.
See the ErrorDetails field for error messages and error codes.
CreditMemoId Type
reference
Properties
Nillable
Description
The credit memo created as the result of a successful request.
This field is a relationship field.
Relationship Name
CreditMemo
Relationship Type
Lookup
Refers To
CreditMemo
ErrorDetails Type
string
Properties
Nillable
Description
If the request fails, this field shows error messages, error codes, and the ID of the record on
which the errors occurred. This field is available in API 58.0 and later.
EventUuid Type
string
199
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
InvoiceId Type
reference
Properties
Nillable
Description
The invoice credited as the result of a successful request.
This field is a relationship field.
Relationship Name
Invoice
Relationship Type
Lookup
Refers To
Invoice
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the request was successful.
The default value is 'false'.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
200
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The unique ID returned in the response. Use this ID to identify the event for a specific request.
IN THIS SECTION:
CrMemoProcessErrDtlEvent
Contains information about errors that occurred while creating or applying a credit memo as part of a request. This object is included
in a CreditInvoiceProcessedEvent, CreditMemoProcessedEvent, NegInvcLineProcessedEvent, or
VoidInvoiceProcessedEvent message. You can't subscribe to CrMemoProcessErrDtlEvent directly. This object
is available in API versions 55.0–58.0. In API version 58.0, this field returns a null result. See the ErrorDetails field on the
CreditInvoiceProcessedEvent, CreditMemoProcessedEvent, NegInvcLineProcessedEvent, or
VoidInvoiceProcessedEvent object for error information.
CrMemoProcessErrDtlEvent
Contains information about errors that occurred while creating or applying a credit memo as part of a request. This object is included
in a CreditInvoiceProcessedEvent, CreditMemoProcessedEvent, NegInvcLineProcessedEvent, or
VoidInvoiceProcessedEvent message. You can't subscribe to CrMemoProcessErrDtlEvent directly. This object is
available in API versions 55.0–58.0. In API version 58.0, this field returns a null result. See the ErrorDetails field on the
CreditInvoiceProcessedEvent, CreditMemoProcessedEvent, NegInvcLineProcessedEvent, or
VoidInvoiceProcessedEvent object for error information.
Supported Calls
describeSObjects()
Fields
Field Details
ErrorCode Type
string
Properties
Nillable
Description
Reference code for the type of error that occurred.
ErrorMessage Type
string
Properties
Nillable
201
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Information about the error that occurred during processing.
ErrorSourceId Type
reference
Properties
Nillable
Description
The ID of the record on which the error occurred during the credit memo creation process
and the application process.
This field is a polymorphic relationship field.
Relationship Name
ErrorSource
Relationship Type
Lookup
Refers To
CreditMemo, CreditMemoLine, Invoice, InvoiceLine
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
CreditMemoProcessedEvent
Notifies subscribers when the process started by the /commerce/invoicing/credit-memos request is complete. This object
is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
202
Platform Events Developer Guide Standard Platform Event Objects
Subscriber Supported?
Pub/Sub API
Subscription Channel
/event/CreditMemoProcessedEvent
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
CrMemoProcessErrDtlEvents Type
CreditMemoProcessedErrDtlEvent[] on page 352
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed. This field is available
only in API versions 55.0–58.0.
See the ErrorDetails field for error messages and error codes.
CreditMemoId Type
reference
Properties
Nillable
Description
The credit memo created as the result of a successful request.
This field is a relationship field.
203
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Relationship Name
CreditMemo
Relationship Type
Lookup
Refers To
CreditMemo
ErrorDetails Type
string
Properties
Nillable
Description
If the request fails, this field shows error messages, error codes, and the ID of the record on
which the errors occurred. This field is available in API 58.0 and later.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the Create Standalone Credit Memo action was successful.
The default value is 'false'.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
204
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The unique ID returned in the /commerce/invoicing/credit-memos response.
Use this ID to identify the event for a specific request.
Example: A user successfully runs a /commerce/invoicing/credit-memos, creates one credit memo, and receives
this platform event when the request completes.
{
"IsSuccess": true,
"CrMemoProcessErrDtlEvents": null,
"CreatedById": "005RO000000g4LYYAY",
"CorrelationIdentifier": "50gRO0000000jxc",
"CreatedDate": "2023-03-17T15:09:18Z",
"ErrorDetails": "[]",
"InvoiceId": "3ttRO0000006839YAA",
"CreditMemoId": "50gRO0000000jxcYAA",
"RequestIdentifier": "d488e070-0fd8-4cde-a9fd-d7ca38d040f5"
}
DataObjectDataChgEvent
Notifies subscribers of an action within Data Cloud. This object is available in API version 53.0 and later.
Supported Calls
describeSObjects()
205
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/DataObjectDataChgEvent
Fields
Field Details
ActionDeveloperName Type
string
Properties
Nillable
Description
The developer name associated with this action.
EventCreationDateTime Type
dateTime
Properties
Nillable
Description
The date and time when the event occurred.
EventPrompt Type
picklist
Properties
Nillable, Restricted Picklist
206
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The data manipulation language action that triggered this event.
Possible values are:
• DELETE
• INSERT
• UPDATE
EventPublishDateTime Type
dateTime
Properties
Nillable
Description
The date and time when the event was published.
EventSchemaVersion Type
string
Properties
Nillable
Description
The version of the event schema.
EventType Type
string
Properties
Nillable
Description
The type of event that occurred.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
Offset Type
string
Properties
Nillable
Description
The number of rows to skip before starting to return.
207
Platform Events Developer Guide Standard Platform Event Objects
Field Details
PayloadCurrentValue Type
textarea
Properties
Nillable
Description
Current data values with enriched fields.
PayloadPrevValue Type
textarea
Properties
Nillable
Description
Previous data values with enriched fields. This field is optional depending on the source
object.
PayloadSchema Type
textarea
Properties
Nillable
Description
The schema for the event payload.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
SourceObjectDeveloperName Type
string
Properties
Nillable
Description
The developer name of the object that triggered the data change event.
208
Platform Events Developer Guide Standard Platform Event Objects
DataObjectMetadataChgEvent
Notifies subscribers of a metadata change within Data Cloud for these objects: Data Lake, Data Model, and Calculated Insight. This object
is available in API version 53.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/DataObjectMetadataChgEvent
Fields
Field Details
CurrentValue Type
textarea
Properties
Nillable
Description
The serialized schema of the current metadata.
EventCreationDate Type
dateTime
209
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The date and time when the event occurred.
EventPublishDate Type
dateTime
Properties
Nillable
Description
The date and time when the event published.
EventType Type
string
Properties
Nillable
Description
The type of event that occurred.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
PreviousValue Type
textarea
Properties
Nillable
Description
The serialized schema of the metadata before the change.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
210
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SchemaVersion Type
string
Properties
Nillable
Description
The version of the event schema.
SourceTableDeveloperName Type
string
Properties
Nillable
Description
The source entity name on which the metadata change has occurred.
Trigger Type
string
Properties
Nillable
Description
The trigger data definition language type that caused the event. Examples: DELETE, INSERT,
or UPDATE
DatasetExportEvent
Notifies subscribers on the export of an Analytics dataset. This object is available in API version 41.0 and later.
Supported Calls
create(), describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
211
Platform Events Developer Guide Standard Platform Event Objects
Subscription Channel
/event/DatasetExportEvent
Fields
Field Details
DataflowInstanceId Type
string
Properties
Create, Nillable
Description
The ID of the dataflow instance for the dataset.
DataflowExportId Type
string
Properties
Create, Nillable
Description
The ID of the dataset export.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
Message Type
string
Properties
Create, Nillable
Description
The message for the dataset export.
Owner Type
string
212
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Create, Nillable
Description
The owner of the dataset export.
PublisherInfo Type
string
Properties
Create, Nillable
Description
The publisher information for the dataset export.
PublisherType Type
picklist
Properties
Create, Nillable, Restricted picklist
Description
The publisher type for the dataset export. Values include:
• EinsteinDiscovery
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
Status Type
picklist
Properties
Create, Nillable, Restricted picklist
Description
The status the dataset export. Values include:
• Cancelled
• Completed
• Failed
• InProgess
• New
213
Platform Events Developer Guide Standard Platform Event Objects
DiscoveryPredictionEvent
Notifies subscribers when Einstein Discovery has written prediction history results. This object is available in API version 57.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/DiscoveryPredictionEvent
Fields
Field Details
ActualValue Type
string
Properties
Nillable
Description
The actual value of the outcome field on the Einstein Discovery predicted object.
CreatedBy Type
user
Properties
Nillable
Description
The user that started the Einstein Discovery prediction run.
214
Platform Events Developer Guide Standard Platform Event Objects
Field Details
CreatedById Type
ID
Properties
Nillable
Description
The unique ID of the user that started the Einstein Discovery prediction run.
CreatedDate Type
dateTime
Properties
Nillable
Description
The creation date of the event.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
GoalId Type
string
Properties
Nillable
Description
The unique ID of the Einstein Discovery prediction goal.
HasError Type
boolean
Properties
Defaulted on create
Description
true if there was an error while making the prediction, false otherwise.
ModelId Type
string
Properties
Nillable
Description
The unique ID of the Einstein Discovery model used for the prediction.
215
Platform Events Developer Guide Standard Platform Event Objects
Field Details
PredictedValue Type
string
Properties
Nillable
Description
The predicted value from the Einstein Discovery prediction run.
PredictionTime Type
dateTime
Properties
Nillable
Description
The date and time of the Einstein Discovery prediction run.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RunId Type
string
Properties
Nillable
Description
The unique ID of the Einstein Discovery prediction run.
TargetEntity Type
string
Properties
Nillable
Description
The target entity that Einstein Discovery is writing prediction results to.
TargetField Type
string
Properties
Nillable
216
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The target field that Einstein Discovery is writing the prediction value to.
TargetId Type
string
Properties
Nillable
Description
The unique ID of the target entity Einstein Discovery is writing prediction results to.
ValueType Type
string
Properties
Nillable
Description
The type of the Einstein Discovery prediction value.
ExtlRecShrEvent
Tracks the record data published from a vendor’s Salesforce org to a connected partner’s org for Partner Connect. This object is available
in API version 62.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/ExtlRecShrEvent
217
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
EventOrderInBatch Type
int
Properties
Create, Nillable
Description
Order number of the external record share event in the export batch.
EventType Type
picklist
Properties
Create, Restricted picklist
Description
Event type of the external record sharing event.
Possible values are:
• RecordDataExport
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
ObjectData Type
textarea
Properties
Create, Nillable
Description
Fields and field values of records included in this export.
ObjectType Type
picklist
218
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Create, Nillable, Restricted picklist
Description
Object type of the exported records.
Possible values are:
• ExtlRecShrLead
• ExtlRecShrOpportunity
• Lead
• Opportunity
PublishBatch Type
string
Properties
Create, Nillable
Description
ID of the batch being published.
PublishBatchSize Type
int
Properties
Create, Nillable
Description
Number of records for all events in the batch being published.
PublishingSystem Type
string
Properties
Create, Nillable
Description
ID of the system exporting the records. If the system is a Salesforce org, this value is the org
ID. The vendor system is always a Salesforce org.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
219
Platform Events Developer Guide Standard Platform Event Objects
ExtlRecShrResultEvent
Tracks the data and the result of the export or update of the external record share published between a vendor and partner system for
Partner Connect. This object is available in API version 62.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/ExtlRecShrResultEvent
Fields
Field Details
EventType Type
picklist
Properties
Create, Restricted picklist
Description
Event type of the external record share update or the result of an update or export.
Possible values are:
• RecordDataResult
• RecordDataUpdate
220
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
ObjectData Type
textarea
Properties
Create, Nillable
Description
Data of fields and field values of the records included in this update or result of this update
or export.
PublishingSystem Type
string
Properties
Create, Nillable
Description
ID of the system publishing the record update or result of an update or export. If the system
is a Salesforce org, this value is the org ID. The vendor system is always a Salesforce org.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
FirstBillPaymentSetupEvent
Notifies subscribers when a first bill payment is set up. This object is available in API version 60.0 and later.
Supported Calls
describeSObjects()
221
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Subscription Channel
/event/
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
Description
Correlation ID passed in the invocable action input.
ErrorCode Type
string
Properties
Nillable
Description
Error code for a failed first bill payment setup result.
ErrorMessage Type
string
Properties
Nillable
222
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Error message for a failed first bill payment setup result.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Required. Shows whether the first bill payment is successfully set up.
The default value is false.
OrderSummaryId Type
reference
Properties
Nillable
Description
ID of the OrderSummary in the first bill payment setup process.
This field is a relationship field.
Relationship Name
OrderSummary
Relationship Type
Lookup
Refers To
OrderSummary
ProcessingStage Type
picklist
Properties
Nillable, Restricted picklist
Description
Processing Stage Enum.
Possible values are:
• BillingSchedulesCreation
223
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• InvoiceGeneration
• PaymentApplication
• PaymentMethodAssociation
• PreProcessing
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
Request ID returned as an output of an invocable action.
FlowExecutionErrorEvent
Notifies subscribers of errors related to screen flow executions. This object is available in API version 47.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
224
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
ContextObject Description
Reserved for future use.
ContextRecordId Description
Reserved for future use.
ElementApiName Type
string
Properties
Nillable
Description
The API name of the flow element that was executed when the flow execution error occurred.
ElementType Type
string
Properties
Nillable
Description
The type of flow element.
ErrorId Type
string
Properties
Nillable
Description
The ID of the error.
ErrorMessage Type
string
Properties
Nillable
Description
The message about the error that occurred.
EventDate Type
dateTime
225
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
None
Description
Required. The date and time when the error occurred. This field always contains a value.
EventIdentifier Type
string
Properties
None
Description
Required. The unique ID of the event, which is shared with the corresponding storage object.
For example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to
correlate the event with its storage object. This field always contains a value.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
EventType Type
string
Properties
None
Description
Required. The type of flow event. Valid value is Error—An event that occurs when a flow
execution generates an error. This field always contains a value.
ExtendedErrorCode Type
string
Properties
Nillable
Description
The code that references more details about the error.
FlowApiName Type
string
Properties
None
226
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Required. The API name of the flow that the error occurred for. This field always contains a
value.
FlowExecutionEndDate Description
Reserved for future use.
FlowExecutionStartDate Type
dateTime
Properties
Nillable
Description
The date and time when the error-generating flow execution starts.
FlowNamespace Type
string
Properties
Nillable
Description
The namespace of the error-generating flow.
FlowVersionId Type
string
Properties
None
Description
Required. The ID of the error-generating flow version. This field always contains a value.
InterviewBatchId Description
Reserved for future use.
InterviewGuid Type
string
Properties
None
Description
Required. The globally unique identifier of the error-generating flow interview. This field
always contains a value.
InterviewRequestId Description
Reserved for future use.
227
Platform Events Developer Guide Standard Platform Event Objects
Field Details
InterviewStartDate Type
dateTime
Properties
None
Description
Required. The date and time when the error-generating flow interview starts. This field always
contains a value.
InterviewStartedById Type
reference
Properties
None
Description
Required. The ID of the flow interview when it was started. This field always contains a value.
ProcessType Type
string
Properties
Nillable
Description
The type of the flow. Valid value is:
• Flow—A flow that requires user interaction because it contains one or more screens
or local actions, choices, or dynamic choices. In the UI and Salesforce Help, it’s a screen
flow. Screen flows can be launched from the UI, such as with a flow action, Lightning
page, or web tab.
RelatedRecordId Description
Reserved for future use.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
StageQualifiedApiName Description
Reserved for future use.
228
Platform Events Developer Guide Standard Platform Event Objects
FlowOrchestrationEvent
Notifies subscribers that a paused instance of an orchestration is ready to be resumed. This object is available in API version 53.0 and
later.
A FlowOrchestrationEvent is automatically published when an assigned user completes a screen flow associated with an
interactive step, when an asynchronous background step is completed, or when a MuleSoft step is completed.
Supported Calls
create(), describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Fields
Field Details
EventPayload Type
textarea
Properties
Create, Nillable
Description
Output parameters from the interactive, asynchronous background step, or MuleSoft step
that generated the event.
Setting the payload for manually published flow orchestration events isn't supported.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
229
Platform Events Developer Guide Standard Platform Event Objects
Field Details
OrchestrationInstanceId Type
string
Properties
Create
Description
The orchestration instance being tracked.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
StepInstanceId Type
string
Properties
Create, Nillable
Description
The ID of the step instance that generated the event.
StepStatus Type
picklist
Properties
Create, Nillable, Restricted picklist
Description
The resultant status of the step instance that generated the event. If specified,
StepInstanceId is required.
Possible values are:
• Canceled—For internal use only.
• Completed—The step instance completed.
• Discontinued—For internal use only.
• Error—The step instance or a screen flow associated with the step encountered an
error.
• InProgress—For internal use only.
• NotStarted—For internal use only.
• Suspended—For internal use only.
This field is available in API version 55.0 and later.
230
Platform Events Developer Guide Standard Platform Event Objects
FOStatusChangedEvent
Notifies subscribers of changes to the status of a fulfillment order record. Use this event to trigger flows and processes in your order
workflow. This object is available in API version 48.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/FOStatusChangedEvent
Fields
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
FulfillmentOrderId Type
reference
231
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
ID of the FulfillmentOrder whose status changed.
This value is functionally required, but is nillable because fulfillment order records can be
deleted to comply with data protection and privacy requirements.
NewStatus Type
picklist
Properties
None
Description
Required. The new value of the Status field on the FulfillmentOrder.
Possible values are defined by the Status field picklist on the FulfillmentOrder object. Default
available values are:
• Allocated
• Assigned
• Canceled
• Draft
• Fulfilled
• Pack Complete This value is available in API v57.0 and later.
• Pick Complete
• Pickpack
• Printed
• Rejected
NewStatusCategory Type
picklist
Properties
Restricted picklist
Description
Required. The new value of the StatusCategory field on the FulfillmentOrder.
Possible values are:
• Activated
• Canceled
• Closed
• Draft
• Fulfilling
• Rejected
232
Platform Events Developer Guide Standard Platform Event Objects
Field Details
OldStatus Type
picklist
Properties
Nillable
Description
The previous value of the Status field on the FulfillmentOrder.
Possible values are defined by the Status field picklist on the FulfillmentOrder object. Default
available values are:
• Allocated
• Assigned
• Canceled
• Draft
• Fulfilled
• Pack Complete This value is available in API v57.0 and later.
• Pick Complete
• Pickpack
• Printed
• Rejected
OldStatusCategory Type
picklist
Properties
Nillable, Restricted picklist
Description
The previous value of the StatusCategory field on the FulfillmentOrder.
Possible values are:
• Activated
• Cancelled
• Closed
• Draft
• Fulfilling
• Rejected
OrderSummaryId Type
reference
Properties
Nillable
Description
ID of the OrderSummary associated with the FulfillmentOrder.
233
Platform Events Developer Guide Standard Platform Event Objects
Field Details
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
FulfillOrdItemQtyChgEvent
Notifies subscribers of changes to the quantity of a fulfillment order line item record. Use this event to trigger flows and processes in
your order workflow. This object is available in API version 53.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/FulfillOrdItemQtyChgEvent
234
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
FulfillmentOrderLineItemId Type
reference
Properties
Nillable
Description
ID of the FulfillmentOrderLineItem whose quantity changed.
This value is functionally required, but is nillable because fulfillment order line item records
can be deleted to comply with data protection and privacy requirements.
NewQuantity Type
double
Properties
None
Description
Required. The new value of the Quantity field on the FulfillmentOrderLineItem.
OldQuantity Type
double
Properties
None
Description
The previous value of the Quantity field on the FulfillmentOrderLineItem.
OrderItemSummaryId Type
reference
Properties
Nillable
Description
ID of the OrderItemSummary associated with the FulfillmentOrderLineItem.
ReplayId Type
string
235
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
InvoiceProcessedEvent
Notifies subscribers when the process started by the /commerce/billing/invoices request is complete. The process groups
billing schedules by grouping keys and creates one invoice per grouping key. InvoiceProcessedEvent is a top-level object that
contains a list of InvoiceProcessedDetailEvents, where each detail event represents an attempt to create one invoice. This
object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/InvoiceProcessedEvent
236
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
InvoiceErrorDetailEvent Type
InvoiceErrorDetailEvent[] on page 238
Properties
Nillable
Description
Contains information about errors that occurred during processing.
InvoiceProcessedDetailEvent Type
InvoiceProcessedDetailEvent[] on page 240
Properties
Nillable
Description
A list of InvoiceProcessedDetailEvent records. Each record contains information about an
attempt to create an invoice from one or more billing schedules that share a grouping key.
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the Create Order from Invoice action was successful.
The default value is false.
ReplayId Type
string
237
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the /commerce/billing/invoices response. Use this
ID to identify the event for a specific request.
IN THIS SECTION:
InvoiceErrorDetailEvent
Contains information about errors that occurred during the processing of a /commerce/billing/invoices request. This
object is included in an InvoiceProcessedEvent message. You can't subscribe to InvoiceErrorDetailEvent
directly. This object is available in API version 55.0 and later.
InvoiceProcessedDetailEvent
Notifies subscribers of the results of an attempt to create an invoice from billing schedules as part of
/commerce/billing/invoices. InvoiceProcessedDetailEvent contains the results of an attempt to create an invoice from
one or more billing schedules that share a grouping key. Each InvoiceProcessedDetailEvent for an action is grouped within the parent
object InvoiceProcessedEvent. This object is available in API version 55.0 and later.
InvoiceErrorDetailEvent
Contains information about errors that occurred during the processing of a /commerce/billing/invoices request. This object
is included in an InvoiceProcessedEvent message. You can't subscribe to InvoiceErrorDetailEvent directly. This
object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
238
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
ErrorCode Type
string
Properties
None
Description
Reference code for the type of error that occurred.
ErrorMessage Type
string
Properties
None
Description
Information about the error that occurred during processing.
ErrorSourceId Type
reference
Properties
Nillable
Description
The ID of the record where the error occurred. Can be an invoice or a billing schedule.
This field is a polymorphic relationship field.
Relationship Name
ErrorSource
Relationship Type
Lookup
Refers To
Invoice
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
239
Platform Events Developer Guide Standard Platform Event Objects
InvoiceProcessedDetailEvent
Notifies subscribers of the results of an attempt to create an invoice from billing schedules as part of
/commerce/billing/invoices. InvoiceProcessedDetailEvent contains the results of an attempt to create an invoice from one
or more billing schedules that share a grouping key. Each InvoiceProcessedDetailEvent for an action is grouped within the parent object
InvoiceProcessedEvent. This object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Fields
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
InvoiceErrorDetailEvents Type
InvoiceErrorDetailEvent[]
Properties
Nillable
Description
A list of errors that occurred while attempting to create the invoice.
InvoiceId Type
reference
Properties
Nillable
Description
The ID of the new invoice.
This field is a relationship field that refers to an invoice.
Relationship Name
Invoice
240
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Relationship Type
Lookup
Refers To
Invoice
InvoiceStatus Type
string
Properties
Nillable
Description
The value of the Status field on the invoice.
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the invoice creation attempt was successful.
The default value is false.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
NegInvcLineProcessedEvent
Notifies subscribers when a negative invoice line is converted to a credit memo. This object is available in API version 56.0 and later.
Supported Calls
describeSObjects()
241
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/NegInvcLineProcessedEvent
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
CrMemoProcessErrDtlEvents Type
CrMemoProcessErrDtlEvent
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed. This field is available
only in API versions 55.0–58.0.
See the ErrorDetails field for error messages and error codes.
CreditMemoId Type
reference
242
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The ID of the credit memo created as a result of the successful conversion of a negative
invoice line.
This field is a relationship field.
Relationship Name
CreditMemo
Relationship Type
Lookup
Refers To
CreditMemo
ErrorDetails Type
string
Properties
Nillable
Description
If the request fails, this field shows error messages, error codes, and the ID of the record on
which the errors occurred. This field is available in API 58.0 and later.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
InvoiceId Type
reference
Properties
Nillable
Description
ID of the invoice that this event is in reference to.
This field is a relationship field.
Relationship Name
Invoice
Relationship Type
Lookup
Refers To
Invoice
243
Platform Events Developer Guide Standard Platform Event Objects
Field Details
IsAutomatedNegativeInvoiceLineConversion Type
boolean
Properties
Defaulted on create
Description
Indicates whether this event is generated either by an automated process to convert negative
invoice lines to credit memos or by a manual process.
If true, the event was generated by an automatic process. If false, the event was
generated by a manual process.
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates that the negative invoice lines were converted successfully to credit memos.
The default value is false.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
This field is always empty.
Example: A user successfully submits a negative invoice line, which creates one credit memo, and generates this platform event
when the request completes.
{
CrMemoProcessErrDtlEvents: null
CreatedById: "005xx000001X8efAAC"
CreatedDate: "2022-08-11T16:44:34.652Z"
244
Platform Events Developer Guide Standard Platform Event Objects
CreditMemoId: "50gxx000000gwFyAAI"
ErrorDetails:."[]"
..InvoiceId: "3ttxx0000001Vg5AAE"
IsSuccess: true
RequestIdentifier: null
OmniTrackingEvent
Notifies subscribers about a user interaction with a FlexCard or OmniScript that's tracked for OmniAnalytics. This object is available in
API version 60.0 and later.
Note: This platform event is part of OmniStudio Standard, not OmniStudio for Vlocity.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/OmniTrackingEvent
Fields
Field Details
ActionContainerName Type
string
245
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The full name of the FlexCard or OmniScript for which user interactions are tracked.
ComponentType Type
picklist
Properties
Restricted picklist
Description
Required.
The type of component for which user interactions are tracked.
Possible values are:
• Flexcard—A context-sensitive display of Salesforce data and clickable actions.
• Omniscript—A multi-page wizard that guides a user through a business process.
EventName Type
string
Properties
None
Description
Required. The name of the user interaction or user inferface response, such as Card Load,
Card Unload, or UI Action.
EventPayload Type
textarea
Properties
None
Description
Required. The request payload sent for the user interaction, which typically includes data
from the FlexCard or OmniScript.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
ReplayId Type
string
246
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
Timestamp Type
dateTime
Properties
None
Description
Required. The timestamp indicating when the event occurred.
TrackingCategory Type
string
Properties
None
Description
Required. A category for this event and other events with a similar business purpose.
TrackingGroup Type
string
Properties
None
Description
Required. The name of the related OmniTrackingGroup object.
OrderStatusChangedEvent
Notifies subscribers of changes to the status of an order record. Use this event to trigger flows and processes in your order workflow.
This object is available in API version 51.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
247
Platform Events Developer Guide Standard Platform Event Objects
Subscriber Supported?
Flows
Processes
Pub/Sub API
Subscription Channel
/event/OrderStatusChangedEvent
Fields
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
NewStatus Type
picklist
Properties
Restricted picklist
Description
The order's status after the status change.
Possible values are:
• Activated
• Draft
NewStatusCode Type
picklist
Properties
Restricted picklist
Description
The order StatusCode after the status change.
248
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Possible values are:
• Activated
• Canceled
• Draft
• Expired
OldStatus Type
picklist
Properties
Restricted picklist
Description
The order's status before the status change.
Possible values are:
• Activated
• Draft
OldStatusCode Type
picklist
Properties
Restricted picklist
Description
The order StatusCode before the status change.
Possible values are:
• Activated
• Canceled
• Draft
• Expired
OrderId Type
reference
Properties
Nillable
Description
ID of the order whose status was changed. Used only if the order is an Original Order.
RelatedOrderId Type
reference
Properties
Nillable
249
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
ID of the order whose status was changed. Used only if the order isn't an Original Order.
RelatedOrderType Type
picklist
Properties
Nillable, Restricted picklist
Description
The type of related order. Shown only if the order with the changed status isn't an
OriginalOrder.
Possible values are:
• Change Order
• Reduction Order
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
Usage
To use OrderStatusChangedEvent, Enable Order Events must be enabled in the Order Settings page.
When an order is created and activated in one transaction, OldStatus is Draft and NewStatus is Activated.
When an order's status is updated multiple times in one transaction, OldStatus is the status at the beginning of the transaction
before any changes. NewStatus is the final status after all updates.
OrderSummaryCreatedEvent
Notifies subscribers of the creation of an order summary record. Use this event to trigger flows and processes in your order workflow.
This object is available in API version 48.0 and later.
Supported Calls
describeSObjects()
250
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/OrderSummaryCreatedEvent
Fields
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
OrderId Type
reference
Properties
Nillable
Description
ID of the original order associated with the created OrderSummary.
OrderSummaryId Type
reference
251
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
ID of the created OrderSummary
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
OrderSumStatusChangedEvent
Notifies subscribers of changes to the status of an order summary record. Use this event to trigger subscribers such as flows in your order
workflow. This object is available in API version 48.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/OrderSumStatusChangedEvent
252
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
NewStatus Type
picklist
Properties
Defaulted on create, Nillable
Description
Required. The new value of the Status field on the OrderSummary.
Possible values are based on the OrderSummary statuses defined in your org. The default
value is Created.
OldStatus Type
picklist
Properties
Defaulted on create, Nillable
Description
Required. The previous value of the Status field on the OrderSummary.
Possible values are based on the OrderSummary statuses defined in your org. The default
value is Created.
OrderId Type
reference
Properties
Nillable
Description
ID of the original order associated with the OrderSummary.
This field is a relationship field.
Relationship Name
Order
253
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Relationship Type
Lookup
Refers To
Order
OrderSummaryId Type
reference
Properties
Nillable
Description
The ID of the OrderSummary that changed.
This value is functionally required, but is nillable because order summary records can be
deleted to comply with data protection and privacy requirements.
This field is a relationship field.
Relationship Name
OrderSummary
Relationship Type
Lookup
Refers To
OrderSummary
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
PaymentCreationEvent
Notifies subscribers when the process started by the /actions/standard/paymentSale request is complete. This object is
available in API version 55.0 and later.
Supported Calls
describeSObjects()
254
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/PaymentCreationEvent
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
ErrorCode Type
string
Properties
Nillable
Description
Error code sent from the payment gateway after a request encountered an error.
ErrorMessage Type
textarea
255
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Message sent from the payment gateway after a request encountered an error.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the request was successful.
The default value is 'false'.
PaymentGatewayLogId Type
reference
Properties
Nillable
Description
The payment gateway log containing information about the communication with the
payment gateway.
This is a relationship field.
Relationship Name
PaymentGatewayLog
Relationship Type
Lookup
Refers To
PaymentGatewayLog
PaymentId Type
reference
Properties
Nillable
Description
The payment created as the result of a successful request.
256
Platform Events Developer Guide Standard Platform Event Objects
Field Details
This is a relationship field.
Relationship Name
Payment
Relationship Type
Lookup
Refers To
Payment
PaymentStatus Type
picklist
Properties
Nillable, Restricted picklist
Description
The status of the payment created after a successful request. This field reflects the status
upon payment creation, and isn’t updated after further changes to the payment’s status.
Possible values are:
• Canceled
• Draft
• Failed
• Pending
• Processed
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the /actions/standard/paymentSale response. Use
this ID to identify the event for a specific request.
257
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Type Type
picklist
Properties
Nillable, Restricted picklist
Description
Indicates whether the payment was made for a payment capture request or payment sale
request.
Possible values are:
• Capture
• Sale
PendingOrdSumProcEvent
Notifies subscribers that a PendingOrderSummary record was processed. If the process succeeded, an OrderSummary was created and
the PendingOrderSummary can be deleted. Use this event to trigger subscribers such as flows in your order workflow. This object is
available in API version 56.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/PendingOrdSumProcEvent
258
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
ErrorCode Type
string
Properties
Nillable
Description
If the OrderSummary creation returned an error, this field contains the error code.
ErrorMessage Type
string
Properties
Nillable
Description
If the OrderSummary creation returned an error, this field contains the error message.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
ExternalReferenceIdentifier Type
picklist
Properties
Defaulted on create
Description
Unique identifier copied from the PendingOrderSummary to the OrderSummary.
This value is set to B2C realm ID + "_" + B2C instance ID + "@" + B2C
Commerce catalog/domain ID + "@" + B2C Commerce order number.
IsSuccess Type
reference
Properties
Nillable
Description
Indicates whether the OrderSummary was created.
OrderSummaryId Type
reference
259
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The ID of the OrderSummary that was created from the PendingOrderSummary.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
PlatformStatusAlertEvent
Notifies subscribers of alerts that occur during the processing of a user request or service job execution. This object is available in API
version 45.0 and later.
For example, suppose that a formula is evaluated as part of processing user requests. A platform event message can be generated during
the processing of a user request when an error is encountered from evaluating an invalid formula.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/PlatformStatusAlertEvent
260
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
ApiErrorCode Type
string
Properties
Nillable
Description
The API error code.
ComponentName Type
string
Properties
Nillable
Description
Name of the component in which the alert occurred.
EventDate Type
datetime
Properties
Nillable
Description
Date and time when the event occurred. Example: 2018-12-18 21:59:48
EventIdentifier Type
string
Properties
Nillable
Description
Unique identifier of the event. This field is reserved for future use and is always null in API
version 45.0.
EventUuid Type
string
Properties
Nillable
261
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
ExtendErrorCode Type
string
Properties
Nillable
Description
Extended error code which provides more details about the issue.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
EventIdentifier (uuid) of the related event. This field is reserved for future use and is always
null in API version 45.0.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestId Type
string
Properties
Nillable
Description
The unique ID of the service job that fired the event. It can be used to correlate the alert with
logging information.
ServiceJobId Type
string
Properties
Nillable
262
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Service-specific job ID, if one exists. For Next Best Action, the service job ID is
executionToken. This field can be used to correlate the alert with logging information.
ServiceName Type
string
Properties
Nillable
Description
Name of the service that triggered the alert.
StatusType Type
string
Properties
Nillable
Description
Status of the event.
SubComponentName Type
string
Properties
Nillable
Description
Name of the subcomponent where the alert occurs.
Subject Type
string
Properties
Nillable
Description
Short description of the alert.
UserId Type
reference
Properties
Nillable
Description
ID of the user who caused the event.
Username Type
string
263
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Username of the user who caused the event.
Usage
The following example shows how to process platform status alert events. Only internal services can publish these events. This Apex
trigger example fires when a platform event message is published and creates a Chatter post on the admin profile with event details.
trigger PlatformStatusAlertEventTrigger on PlatformStatusAlertEvent (after insert) {
List<Feeditem> posts = new List<Feeditem>();
Id profileId = [select Id from User where User.Profile.Name = 'System Administrator'
limit 1].Id;
for(PlatformStatusAlertEvent e : trigger.new) {
Feeditem post = New Feeditem();
post.ParentId= profileId;
post.Body = 'Alert occured in the service: ' + e.ServiceName + '\n' +
'APIErrorCode: ' + e.APIErrorCode + '\n' +
'ComponentName: ' + e.ComponentName + '\n' +
'EventDate: ' + e.EventDate + '\n'+
'EventIdentifier: ' + e.EventIdentifier + '\n' +
'ExtendedErrorCode: '+ e.ExtendedErrorCode + '\n' +
'RelatedEventIdentifier: ' + e.RelatedEventIdentifier + '\n' +
'ReplayId: ' + e.ReplayId + '\n' +
'RequestId: ' + e.RequestId + '\n' +
'ServiceJobId: ' + e.ServiceJobId + '\n' +
'ServiceName: ' + e.ServiceName + '\n'+
'StatusType: ' + e.StatusType + '\n' +
'SubComponentName: ' + e.SubComponentName + '\n' +
'Subject: '+ e.Subject + '\n' +
'UserId: ' + e.UserId + '\n' +
'Username: ' + e.Username + '\n';
posts.add(post);
}
if (posts.size() > 0) {
insert(posts);
}
}
Example: The code example ultimately displays as a Chatter post that contains the following:
Alert occurred in the service: Next Best Action Strategy
APIErrorCode: INVALID_OPERATION
ComponentName: Strategy_for_error_event_demo
EventDate: 2018-12-18 21:59:48
EventIdentifier: null
264
Platform Events Developer Guide Standard Platform Event Objects
ExtendedErrorCode: FORMULA_EXPRESSION_INVALID
RelatedEventIdentifier: null
ReplayId: 63
RequestId: TID:89715900005e40b69a
ServiceJobId: 1014fd4e-4a19-4910-be36-377a7f2f1b75
ServiceName: Next Best Action Strategy
StatusType: Error
SubComponentName: filter_node1
Subject: Something went wrong with filter element 'filter_node1': 'Unknown function ISBLANC. Check spelling.'
UserId: 005RM000001ZnzAYAS
Username: [email protected]
ProcessExceptionEvent
Notifies subscribers of errors that occur during payment processing (capture, apply, and refund) on an order summary. Use this event
to trigger subscribers such as flows in your order workflow. This object is available in API version 50.0 and later.
Supported Calls
create(), describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/ProcessExceptionEvent
265
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
AttachedToId Type
reference
Properties
Create
Description
ID of the object associated with the ProcessException.
This field is a polymorphic relationship field.
Relationship Name
AttachedTo
Relationship Type
Lookup
Refers To
CreditMemo, FulfillmentOrder, Invoice, Order, OrderItem, OrderItemSummary,
OrderPaymentSummary, OrderSummary, Payment, PaymentAuthorization, Refund,
ReturnOrder, WebCart, WebStore
BackgroundOperationId Type
reference
Properties
Create, Nillable
Description
The operation where the exception occurred.
This field is a relationship field.
Relationship Name
BackgroundOperation
Relationship Type
Lookup
Refers To
BackgroundOperation
Description Type
textarea
Properties
Create, Nillable
Description
Detailed description of the ProcessException.
EventUuid Type
string
266
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
This field is available in API version 52.0 and later.
ExceptionType Type
picklist
Properties
Create
Description
Process type that caused the exception.
Possible values are:
• Commerce Inventory Delete Reservation Failed This value is
reserved for future use.
• Commerce Inventory Update Reservation Failed This value is
reserved for future use.
• OM Apply Failed
• OM Capture Failed
• OM Refund Failed
• OM RMA Failed This value is available in API v52.0 and later.
• Place Order Failed This value is available in API v57.0 and later.
ExternalReference Type
string
Properties
Create, Nillable
Description
Description of external entities associated with the ProcessException.
Message Type
string
Properties
Create
Description
Short description of the ProcessException
OrderSummaryId Type
reference
Properties
Create, Nillable
267
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
ID of the OrderSummary associated with the ProcessException. The ProcessException
component is displayed on this OrderSummary.
This field is a relationship field.
Relationship Name
OrderSummary
Relationship Type
Lookup
Refers To
OrderSummary
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
Severity Type
picklist
Properties
Create, Defaulted on create, Nillable
Description
Severity of the ProcessException. Each severity value corresponds to one severity category.
You can customize the severity picklist to represent your business processes. If you customize
the severity picklist, include at least one severity value for each severity category.
Severity is set to Null when creating events for payment failures.
Possible values are:
• High
• Low
• Null
The default value is High.
QuoteSaveEvent
Notifies subscribers that the process started by the /actions/standard/quotesaveevent request is complete. If the process
is successful, use this event to learn about the updated quote. If the request isn't successful, use this event to learn about the errors and
how to fix them. This object is available in API version 58.0 and later.
268
Platform Events Developer Guide Standard Platform Event Objects
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
QuoteId Type
reference
Properties
Nillable
269
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The ID of the quote associated with this event. This field is a relationship field.
Relationship Name
Quote
Relationship Type
Lookup
Refers To
Quote
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the /quotesaveevent response. Use this ID to identify the
event for the specific request.
Status Type
picklist
Properties
Defaulted on create, Nillable, Restricted picklist
Description
The default value is NotStarted.
Possible values are:
• CompletedWithPricing
• CompletedWithTax
• CompletedWithoutPricing
• NotStarted
• PriceCalculationFailed
• PriceCalculationInProgress
• PriceCalculationQueued
270
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• SaveFailedOrIncomplete
• Saving
• TaxCalculationFailed
• TaxCalculationInProgress
• TaxCalculationSuccess
• TaxCalculationWaiting
QuoteToOrderCompletedEvent
Notifies subscribers when the /actions/standard/createOrderFromQuote REST request is complete. If the request is
successful, use this event to learn about the Order record. If the request isn’t successful, use this event to learn about the errors associated
with the request. This object is available in API version 56.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/QuoteToOrderCompletedEvent
Field Details
CorrelationIdentifier Type
string
271
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Reserved for future use.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
HasErrors Type
boolean
Properties
Defaulted on create
Description
Contains true if errors occurred during the process; otherwise false. The default value
is false.
OrderId Type
string
Properties
Nillable
Description
The ID of the order created from the quote. If the process failed, this field is null.
QuoteToOrderErrorDetailEvents Type
QuoteToOrderErrDtlEvent[]
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
272
Platform Events Developer Guide Standard Platform Event Objects
Field Details
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the actions/standard/createOrderFromQuote
response. Use this ID to identify the event for a specific request.
IN THIS SECTION:
QuoteToOrderErrDtlEvent
Contains information about any errors that occurred while processing the /actions/standard/createOrderFromQuote
REST request. One QuoteToOrderErrDtlEvent record is created for each error that occurred. This object is included in an
QuoteToOrderCompletedEvent message. You can't subscribe to QuoteToOrderErrDtlEvent directly. This object
is available in API version 56.0 and later.
QuoteToOrderErrDtlEvent
Contains information about any errors that occurred while processing the /actions/standard/createOrderFromQuote
REST request. One QuoteToOrderErrDtlEvent record is created for each error that occurred. This object is included in an
QuoteToOrderCompletedEvent message. You can't subscribe to QuoteToOrderErrDtlEvent directly. This object is
available in API version 56.0 and later.
Supported Calls
describeSObjects()
Fields
Field Details
ErrorCode Type
string
Properties
Nillable
Description
The error code; for example, INVALID_INPUT.
273
Platform Events Developer Guide Standard Platform Event Objects
Field Details
ErrorMessage Type
textarea
Properties
Filter, Group, Nillable, Sort
Description
Information about the error that occurred during processing.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
PrimaryRecordId Type
reference
Properties
Description
The record on which the error occurred; for example, the order that was created by the
request.
Relationship Name
PrimaryRecord
Relationship Type
Lookup
Refers To
Asset, Invoice, Order
RelatedRecordId Type
reference
Properties
Nillable
Description
Optional. A secondary record on which the error occurred; for example, the order item.
Relationship Name
RelatedRecord
Relationship Type
Lookup
Refers To
InvoiceLine, OrderItem
274
Platform Events Developer Guide Standard Platform Event Objects
Field Details
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RealtimeAlertEvent
Notifies subscribers of Amazon CloudWatch alarm events from your Service Cloud Voice Amazon Connect instance. This object is available
in API version 54.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/RealtimeAlertEvent
275
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
Description Type
string
Properties
None
Description
Required. Description of the alert fired.
EventDateTime Type
datetime
Properties
None
Description
Date and time when the alert occurred. For example: 2020-12-18 21:59:48.
Name Type
string
Properties
None
Description
Required. Name of the alert fired.
Payload Type
string
Properties
None
Description
More information and data associated with the alert.
Severity Type
string
Properties
None
Description
Required. Severity of the triggered alarm. Possible values:
• Critical
• Warning
• Information
When using Amazon CloudWatch with Service Cloud Voice, the following alarm states map
to severity values:
276
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• ALARM maps to Critical
• INSUFFICIENT_DATA maps to Warning
• OK maps to Information
Source Type
string
Properties
None
Description
Required. The source of the alert. For example, this value can be the service name: AWS
Cloudwatch.
Usage
The following example shows how to process RealtimeAlert events. This Apex trigger example fires when a platform event message is
published and creates a Chatter post on the admin profile with event details.
trigger RealtimeAlertEventTrigger on RealtimeAlertEvent (after insert) {
Id profileId = [select Id from User where User.Profile.Name = 'System Administrator'
limit 1].Id;
for(RealtimeAlertEvent e : trigger.new) {
Feeditem Post = New Feeditem();
Post.ParentId= profileId;
Post.Body = 'Alert occurred in the service: ' + e.Source + '\n' +
'Name: ' + e.Description + '\n' +
'Severity: ' + e.EventDateTime + '\n' +
'Payload: ' + e.Payload + '\n' +
'EventDate: ' + e.EventDateTime + '\n' +
'Description: ' + e.Name + '\n';
insert Post;
}
}
Example: The code example displays as a Chatter post that contains the following:
Alert occurred in the service: aws cloudwatch alarm
Name: alert description
Severity: 2021-11-05 11:11:11
Payload: payload
EventDate: 2021-11-05 11:11:11
Description: alert name
RemoteKeyCalloutEvent
Notifies subscribers of callouts that fetch encrypted key material from a customer endpoint. This object is available in API versions 45.0
and later.
277
Platform Events Developer Guide Standard Platform Event Objects
The RemoteKeyCalloutEvent captures events related to the success or failure of a callout that fetches encrypted key material
from an end point. Based on the Platform Events framework, a RemoteKeyCalloutEvent is published every time a callout is
made to an external key service. This event lets you monitor your cache-only key callouts in real time, and receive alerts about any errors
that might occur. You can subscribe to events with after insert Apex triggers and store events in custom objects, security information
event management (SIEM), or other back-end systems.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/RemoteKeyCalloutEvent
Fields
Field Details
Details Type
textarea
Properties
Nillable
Description
A JSON representation with more information about the StatusCode. Not all status codes
(for example, SUCCESS) show a populated Details field. Populated Details fields include
key-value pairs that you can use to make Apex triggers and other programmatic assertions.
278
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
ReplayID Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
When Replay Detection for Cache-Only Keys is enabled, a unique marker automatically
generated and sent with every callout. This marker includes the key identifier, a nonce
generated for that callout instance, and the nonce required from the endpoint.
Available in API version 45.0 and later.
StatusCode Type
picklist
Properties
Nillable, Restricted picklist
Description
A code that characterizes the error. The full list of status codes is available in the WSDL file
for your org.
TenantSecretID Type
reference
Properties
Nillable
Description
The record ID of the tenant secret associated with the published event.
279
Platform Events Developer Guide Standard Platform Event Objects
Usage
To view a RemoteKeyCalloutEvent and perform custom actions after your callout, create an after insert Apex trigger in Dev
Console. These triggers let you assign custom actions for your event. You can set in-app alerts and send email alerts to people who
maintain your key service, including users who don’t have a Salesforce login.
For longer-term monitoring, you can store RemoteKeyCalloutEvent data in custom objects and custom fields, SIEM, or other
back-end systems. Then use business rules to send alerts. For example, you can set an alert that sends admins an email when something
is wrong with a key service.
Here’s an example of an after insert trigger that stores RemoteKeyCalloutEvent results in a custom object called Key Service
Callout Log. The custom object also draws data from the TenantSecret object.
If you use this trigger sample, adjust the field API names to suit your needs.
TenantSecretIds.add(event.TenantSecretId);
}
if(TenantSecretIds != null && !TenantSecretIds.isEmpty())
TenantSecrets = new Map<ID, TenantSecret>([SELECT Type, Version, Status FROM
TenantSecret where Id In: TenantSecretIds]);
280
Platform Events Developer Guide Standard Platform Event Objects
log.Version__c = TenantSecrets.get(event.TenantSecretId).Version;
log.Tenant_Secret_Status__c = TenantSecrets.get(event.TenantSecretId).Status;
}
l.add(log);
}
insert l;
}
To troubleshoot callout errors, review the StatusCode and Details fields. These fields give you information about remote key
callout errors or exceptions in raw JSON format. Successful, empty callout, and timeout responses return empty Details fields.
DESTROY_HTTP_CODE The remote key service returned an HTTP To find out what went wrong, review the
error: {000}. A successful HTTP response HTTP response code.
returns a 200 code.
EMPTY_RESPONSE The remote key service callout returned an Contact your remote key service.
empty response. Contact your remote key
service for help.
ERROR_HTTP_CODE The remote key service returned an To find out what went wrong, review the
unsupported HTTP response code: {000}. A HTTP response code.
successful HTTP response returns a 200
code.
ILLEGAL_PARAMETERS_IN_JWE_HEADER Your JWE header must use {0}, but no Remove the unsupported parameters from
others. Found: {1}. your JWE header.
INCORRECT_ALGORITHM_IN_JWE_HEADER The remote key service returned a JWE The algorithm for encrypting the content
header that specified an unsupported encryption key in your JWE header must be
algorithm (alg): {algorithm}. in RSA-OAEP format.
INCORRECT_DATA_ENCRYPTION_KEY_SIZE Data encryption keys encoded in a JWE Make sure that your data encryption key is
must be 32 bytes. Yours is {value} bytes. 32 bytes.
INCORRECT_ENCRYPTION_ALGORITHM_IN_JWE_HEADER The remote key service returned a JWE The algorithm for encrypting the data
header that specified an unsupported encryption key in your JWE header must be
encryption algorithm (enc): {your enc}. in A256GCM format.
INCORRECT_KEYID_IN_JSON The remote key service returned JSON with Check that you set up your named
an incorrect key ID. Expected: {valid keyID}. credential properly and are using the correct
Actual: {invalid keyID}. BYOK-compatible certificate.
INCORRECT_KEYID_IN_JWE_HEADER The remote key service returned a JWE Check that you set up your named
header with an incorrect key ID. Expected: credential properly and are using the correct
{valid keyID}. Actual: {invalid keyID}. BYOK-compatible certificate.
281
Platform Events Developer Guide Standard Platform Event Objects
MALFORMED_DATA_ENCRYPTION_KEY The content encryption key couldn’t decrypt Check that you set up your named
the data encryption key that was returned credential properly and are using the correct
in the remote key service’s JWE. The data BYOK-compatible certificate. Named
encryption key is either malformed, or credentials must call out to an HTTPS
encrypted with a different content endpoint.
encryption key.
MALFORMED_JSON_RESPONSE We can’t parse the JSON returned by your Contact your remote key service.
remote key service. Contact your remote
key service for help.
MALFORMED_JWE_RESPONSE The remote key service returned a Contact your remote key service.
malformed JWE token that can’t be
decoded. Contact your remote key service
for help.
MISSING_PARAMETERS_IN_JWE_HEADER Your JWE header is missing one or more Make sure that your JWE header includes
parameters. Required: {0}. Found:{1}. all required values. For example, if Replay
Detection is enabled, the JWE header must
include the nonce value extracted from the
cache-only key callout.
POTENTIAL_REPLAY_ATTACK_DETECTED The remote key service returned a JWE Make sure that your JWE header includes
header with an incorrect nonce value. the RequestID included in the callout.
Expected: {0}. Actual: {1}
RESPONSE_TIMEOUT The remote key service callout took too long If your key service is unavailable after
and timed out. Try again. multiple callout attempts, contact your
remote key service.
UNKNOWN_ERROR The remote key service callout failed and Contact your remote key service.
returned an error: {000}.
UNKNOWN_ERROR The remote key service callout failed and The certificate for your cache-only key
returned an error: expired. Update your cache-only key
java.security.cert.CertificateExpiredException: material to use an active BYOK-compatible
NotAfter: {date and time of expiration} certificate.
282
Platform Events Developer Guide Standard Platform Event Objects
SEE ALSO:
Apex Developer Guide: Triggers
Apex Developer Guide: Add an Apex Trigger
SOAP API Developer Guide: Custom Objects
Salesforce Help: Cache-Only Key Service
SearchIndexJobStatusEvent
Notifies subscribers of changes to the status of the Data Cloud search index job, such as index refresh status and index run-time status.
This object is available in API version 60.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
283
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
ApiName Type
string
Properties
Nillable
Description
The search index API name.
ErrorCode Type
string
Properties
Nillable
Description
Reference code for the type of error that occurred.
EventCreationDate Type
dateTime
Properties
Nillable
Description
The date and time when the event occurred.
EventPublishDate Type
dateTime
Properties
Nillable
Description
The date and time when the event was published.
EventType Type
string
Properties
Nillable
Description
The type of event that occurred.
EventUuid Type
string
Properties
Nillable
284
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
A universally unique identifier (UUID) that identifies a platform event message.
IndexRefreshedOn Type
dateTime
Properties
Nillable
Description
The date and time of the last refresh on the index.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RuntimeStatus Type
string
Properties
Nillable
Description
The last run status of the search index such as Ready, In Progress, or Failed.
SchemaVersion Type
string
Properties
Nillable
Description
The version of the event schema.
ServiceAppointmentEvent
Notifies subscribers of the service appointment details that are generated from the event platform. This object is available in API version
59.0 and later.
Supported Calls
describeSObjects()
285
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/ServiceAppointmentEvent
Fields
Field Details
AsgnRsrcApptSchdDtlEvent Type
AsgnRsrcApptSchdEvent[]
Properties
Nillable
Description
One or multiple assigned resource records related to the scheduler appointment event.
ChangeType Type
string
Properties
Nillable
Description
The operation that caused the change. For example: CREATE, UPDATE, DELETE.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
286
Platform Events Developer Guide Standard Platform Event Objects
Field Details
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
ServiceApptSchduleEvent Type
SvcApptSchdEvent[]
Properties
Nillable
Description
The service appointment related to the scheduler appointment event.
VoidInvoiceProcessedEvent
Notifies subscribers when the process started by the /commerce/invoicing/invoices/{invoiceId}/actions/void
request is complete. The request attempts to void an invoice by crediting an invoice and changing its status to Voided, which prevents
further changes. This object is available in API version 55.0 and later. This object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/VoidInvoiceProcessedEvent
287
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
CrMemoProcessErrDtlEvents Type
CrMemoProcessErrDtlEvent[]
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed. This field is available
only in API versions 55.0–58.0.
See the ErrorDetails field for error messages and error codes.
CreditMemoId Type
reference
Properties
Nillable
Description
The credit memo created to void the invoice as the result of a successful request.
This field is a relationship field.
Relationship Name
CreditMemo
Relationship Type
Lookup
Refers To
CreditMemo
ErrorDetails Type
string
288
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
If the request fails, this field shows error messages, error codes, and the ID of the record on
which the errors occurred. This field is available in API 58.0 and later.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
InvoiceId Type
reference
Properties
Nillable
Description
The invoice that was voided as the result of a successful request.
This field is a relationship field.
Relationship Name
Invoice
Relationship Type
Lookup
Refers To
Invoice
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the request was successful.
The default value is 'false'.
ReplayId Type
string
Properties
Nillable
289
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the
/commerce/billing/invoices/{invoiceId}/actions/void response.
Use this ID to identify the event for a specific request.
WebStoreUserCreatedEvent
Notifies subscribers of the creation of a new user for a WebStore. This object is available in API version 59.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
290
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
ActionSource Type
picklist
Properties
Restricted picklist
Description
The source of the published event.
Possible values are:
• InviteToReorderPortal
• Others
AddedById Type
reference
Properties
Nillable
Description
The ID of the user who invited the new user to the WebStore.
This field is a relationship field.
Relationship Name
AddedBy
Relationship Type
Lookup
Refers To
User
AddedUserId Type
reference
Properties
Nillable
Description
The ID of the user created for the WebStore.
This field is a relationship field.
Relationship Name
AddedUser
Relationship Type
Lookup
Refers To
User
291
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
WebStoreId Type
reference
Properties
Nillable
Description
The ID of the WebStore.
This field is a relationship field.
Relationship Name
WebStore
Relationship Type
Lookup
Refers To
WebStore
Note: Real-Time Event Monitoring objects sometimes contain sensitive data. Assign object permissions to Real-Time Events
accordingly in profiles or permission sets.
292
Platform Events Developer Guide Standard Platform Event Objects
BulkApiResultEvent BulkApiResultEventStore
CredentialStuffingEvent CredentialStuffingEventStore
FileEvent FileEventStore
GuestUserAnomalyEvent GuestUserAnomalyEventStore
LightningUriEventStream LightningUriEvent
ListViewEventStream ListViewEvent
LoginAsEventStream LoginAsEvent
LoginEventStream LoginEvent
LogoutEventStream LogoutEvent
MobileEmailEvent MobileEmailEventStore
MobileEnforcedPolicyEvent MobileEnfPolicyEventStore
MobileScreenshotEvent MobileScreenshotEventStore
MobileTelephonyEvent MobileTelephonyEventStore
PermissionSetEvent PermissionSetEventStore
ReportAnomalyEvent ReportAnomalyEventStore
ReportEventStream ReportEvent
SessionHijackingEvent SessionHijackingEventStore
UriEventStream UriEvent
Note: Real-Time Event monitoring objects that were introduced as part of the beta release in API version 46.0 follow a naming
convention that is no longer used in later API versions. In particular:
• The name format of a platform event object was ObjectNameEventStream.
• The name format of the corresponding big object used for storage was ObjectNameEvent.
New event objects introduced after API version 46.0 use the following standard platform event naming convention.
• The name format of a platform event object is ObjectNameEvent.
• The name format of the corresponding object used for storage is ObjectNameEventStore.
293
Platform Events Developer Guide Standard Platform Event Objects
ApiAnomalyEvent
Track anomalies in how users make API calls. This object is available in API version 50.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Fields
Field Details
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Nillable
294
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The time when the anomaly was reported. For example, 2020-01-20T19:12:26.965Z.
Milliseconds is the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
Operation Type
string
Properties
Nillable
Description
The API call that generated the event. For example, Query.
PolicyId Type
reference
Properties
Nillable
295
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies
are processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values include:
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
QueriedEntities Type
string
Properties
Nillable
Description
The type of entities associated with the event.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
296
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The unique ID of a single transaction. A transaction can contain one or more events. Each
event in a given transaction has the same REQUEST_ID. For example,
3nWgxWbDKWWDIk0FKfF5D.
RowsProcessed Type
double
Properties
Nillable
Description
Total row count for the current operation. For example, 2500.
Score Type
double
Properties
Nillable
Description
A number from 0 through 100 that represents the anomaly score for the API execution or
export tracked by this event. The anomaly score shows how the user's current API activity is
different from their typical activity. A low score indicates that the user's current API activity
is similar to their usual activity. A high score indicates that it's different.
SecurityEventData Type
textarea
Properties
Nillable
Description
The set of features about the API activity that triggered this anomaly event.
Let’s say, for example, that a user typically downloads 10 accounts but then they deviate
from that pattern and download 1,000 accounts. This event is triggered and the contributing
features are captured in this field. Potential features include row count, column count, average
row size, the day of week, and the browser’s user agent used for the report activity. The data
captured in this field also shows how much a particular feature contributed to this anomaly
event being triggered, represented as a percentage. The data is in JSON format.
Example
This example shows that the average row count contributed more than 95% to the anomaly
being triggered. Other anomalous features, such as the autonomous system, day of the week
the report was run, the browser used, and the number of columns, contributed much less.
[
{
297
Platform Events Developer Guide Standard Platform Event Objects
Field Details
"featureName": "rowCount",
"featureValue": "1937568",
"featureContribution": “95.00 %"
},
{
"featureName": "autonomousSystem",
"featureValue": "Bigleaf Networks, Inc.",
"featureContribution": “1.62 %"
},
{
"featureName": "dayOfWeek",
"featureValue": "Sunday",
"featureContribution": “1.42 %"
},
{
"featureName": "userAgent",
"featureValue": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132
Safari/537.36}",
"featureContribution": “1.21 %"
},
{
"featureName": "periodOfDay",
"featureValue": “Evening”,
"featureContribution": “.09 %"
},
{
"featureName": "averageRowSize",
"featureValue": "744",
"featureContribution": “0.08 %"
},
{
"featureName": "screenResolution",
"featureValue": "900x1440",
"featureContribution": “0.07 %"
}
]
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example,
vMASKIU6AxEr+Op5.
SourceIp Type
string
298
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
Summary Type
textarea
Properties
Nillable
Description
A text summary of the API anomaly that caused this event to be created.
Example
• API was exported from an infrequent network (BigLeaf
Networks Inc.)
• API was generated with an unusually high number of rows
(111141)
Uri Type
string
Properties
Nillable
Description
The URI of the page that’s receiving the request.
UserAgent Type
string
Properties
Nillable
Description
UserAgent used in HTTP request, post-processed by the server.
UserId Type
reference
Properties
Nillable
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
299
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
ApiAnomalyEventStore
Tracks anomalies in how users make API calls. ApiAnomalyEventStore is an object that stores the event data of ApiAnomalyEvent. This
object is available in API version 50.0 and later.
Supported Calls
describeLayout()describeSObjects(), getDeleted(), getUpdated(), query()
Fields
Field Details
ApiAnomalyEventNumber Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
The unique number automatically assigned to the event when it's created. You can't change
the format or value for this field.
EvaluationTime Type
double
Properties
Filter, Nillable, Sort
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
300
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Filter, Sort
Description
Required. The time when the anomaly was reported. For example,
2020-01-20T19:12:26.965Z. Milliseconds is the most granular setting.
EventIdentifier Type
string
Properties
Filter, Group, Sort
Description
Required. The unique ID of the event. For example,
0a4779b0-0da1-4619-a373-0a36991dff90.
LastReferencedDate Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed a record related to this record.
LastViewedDate Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed this record. If this value is null, it’s
possible that this record was referenced (LastReferencedDate) and not viewed.
LoginKey Type
string
Properties
Filter, Group, Nillable, Sort
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
Operation Type
string
Properties
Nillable
301
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The API call that generated the event. For example, Query.
PolicyId Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies
are processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The result of the transaction policy. Possible values include:
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
QueriedEntities Type
string
Properties
Nillable
Description
The type of entities associated with the event.
RequestIdentifier Type
string
Properties
Nillable
302
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The unique ID of a single transaction. A transaction can contain one or more events. Each
event in a given transaction has the same REQUEST_ID. For example,
3nWgxWbDKWWDIk0FKfF5D.
RowsProcessed Type
double
Properties
Nillable
Description
Total row count for the current operation. For example, 2500.
Score Type
double
Properties
Filter, Nillable, Sort
Description
A number from 0 through 100 that represents the anomaly score for the API execution or
export tracked by this event. The anomaly score shows how the user's current API activity is
different from their typical activity. A low score indicates that the user's current API activity
is similar to their usual activity, a high score indicates that it's different.
SecurityEventData Type
textarea
Properties
Nillable
Description
The set of features about the API activity that triggered this anomaly event.
Let’s say, for example, that a user typically downloads 10 accounts but then they deviate
from that pattern and download 1,000 accounts. This event is triggered and the contributing
features are captured in this field. Potential features include row count, column count, average
row size, the day of week, and the browser’s user agent used for the report activity. The data
captured in this field also shows how much a particular feature contributed to this anomaly
event being triggered, represented as a percentage. The data is in JSON format.
Example
This example shows that the average row count contributed more than 95% to the anomaly
being triggered. Other anomalous attributes, such as the autonomous system, day of the
week the report was run, the browser used, and the number of columns, contributed much
less.
[
{
"featureName": "rowCount",
"featureValue": "1937568",
303
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SessionKey Type
string
Properties
Filter, Group, Nillable, Sort
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example,
vMASKIU6AxEr+Op5.
SourceIp Type
string
Properties
Filter, Group, Nillable, Sort
304
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
Summary Type
textarea
Properties
Nillable
Description
A text summary of the report anomaly that caused this event to be created.
Example
• Report was exported from an infrequent network (BigLeaf
Networks Inc.)
• Report was generated with an unusually high number of
rows (111141)
Uri Type
string
Properties
Nillable
Description
The URI of the page that’s receiving the request.
UserAgent Type
string
Properties
Nillable
Description
UserAgent used in HTTP request, post-processed by the server.
UserId Type
reference
Properties
Nillable
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Nillable
305
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The origin username in the format of [email protected] at the time the event was
created.
Associated Object
This object has the following associated object. It’s available in the same API version as this object.
ApiAnomalyEventStoreFeed
Feed tracking is available for the object.
ApiEvent
Tracks these user-initiated read-only API calls: query(), queryMore(), and count(). Captures API requests through SOAP API
and Bulk API for the Enterprise and Partner WSDLs. Tooling API calls and API calls originating from a Salesforce mobile app aren’t captured.
You can use ApiEvent in a transaction security policy. ApiEvent is a big object that stores the event data of ApiEventStream. This object
is available in API version 46.0 and later.
Supported Calls
describeSObjects(), query()
Fields
Field Details
AdditionalInfo Type
string
Properties
Nillable
Description
JSON serialization of additional information that’s captured from the HTTP headers during
an API request. For example, {"field1": "value1", "field2": "value2"}.
For usage tips and examples, see the Working With the AdditionalInfo Field section.
ApiType Type
string
Properties
Nillable
306
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The API that was used. Values include:
• Bulk
• REST
• SOAP Enterprise
• SOAP Partner
• N/A
ApiVersion Type
double
Properties
Nillable
Description
The version number of the API.
Application Type
string
Properties
Nillable
Description
The application used to access the org. For example, CRM Analytics or Salesforce Developers
Connector.
Client Type
string
Properties
Nillable
Description
The service that executed the API event. If you’re using an unrecognized client, this field
returns “Unknown” or a blank value.
ConnectedAppId Type
reference
Properties
Nillable
Description
The 15-character ID of the connected app associated with the API call. For example,
0H4RM00000000Kr0AI. The ConnectedAppID field populates when a call triggers an
OAuth 2.0 authentication process, which identifies the connected app that’s authorized to
access Salesforce data on behalf of a user. When a user associated with the call already has
an active authentication token, the ConnectedAppID is set to a null value.
307
Platform Events Developer Guide Standard Platform Event Objects
Field Details
ElapsedTime Type
int
Properties
Nillable
Description
The amount of time it took for the request to complete in milliseconds. The measurement
of this value begins before the query executes and ends when the query completes. It doesn’t
include the amount of time it takes to return the result over the network.
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Filter, Sort
Description
The time when the specified API event was captured (after query execution takes place). For
example, 2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique ID of the event. For example, 0a4779b0-0da1-4619-a373-0a36991dff90.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular series of API events.
This field is also available on the LoginEvent, AuthSession, and LoginHistory objects, making
it easier to trace events back to a user’s original authentication. For example,
0YaB000002knVQLKA2.
308
Platform Events Developer Guide Standard Platform Event Objects
Field Details
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
Operation Type
picklist
Properties
Nillable, Restricted Picklist
Description
The API call that generated the event. Possible values are Query, QueryAll, or
QueryMore.
Platform Type
string
Properties
Nillable
Description
The operating system on the login machine. For example, iPhone, Mac OS, Linux, or Unknown.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. For this event, possible values are:
• Block - The user was blocked from performing the operation that triggered the policy.
• Error - The policy caused an undefined error when it executed.
309
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction - The policy didn't trigger.
• Notified - A notification was sent to the recipient.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
QueriedEntities Type
string
Properties
Nillable
Description
The entities in the SOQL query. For example, Opportunity, Lead, Account, or Case. Can also
include custom objects. For relationship queries, the value of this field contains all entities
involved in the query.
Examples
• For SELECT Contact.FirstName, Contact.Account.Name from
Contact, the value of QueriedEntities is Account, Contact.
• For SELECT Account.Name, (SELECT Contact.FirstName,
Contact.LastName FROM Account.Contacts) FROM Account, the
value of QueriedEntities is Account, Contact.
• For SELECT Id, Name, Account.Name FROM Contact WHERE
Account.Industry = 'media', the value of QueriedEntities is
Account, Contact.
Query Type
string
Properties
Nillable
Description
The SOQL query. For example, SELECT id FROM Lead.
Records Type
json
Properties
Nillable
310
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
A JSON string that represents the queried objects’ metadata. This metadata includes the
number of results of a query per entity type and the entity IDs.
Example
{ "totalSize" : 1,
"done" : true,
"records" : [ {
"attributes" : {
"type" : "Account"
},
"Id" : "001xx000003DMvCAAW",
"Contacts" : {
"totalSize" : 3,
"done" : true,
"records" : [ {
"attributes" : {
"type" : "Contact"
},
"Id" : "003xx000004U7xKAAS"
}, {
"attributes" : {
"type" : "Contact"
},
"Id" : "003xx000004U7xLAAS"
}, {
"attributes" : {
"type" : "Contact"
},
"Id" : "003xx000004U7xMAAS"
} ]
}
} ]
}
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
311
Platform Events Developer Guide Standard Platform Event Objects
Field Details
RowsProcessed Type
double
Properties
Nillable
Description
The total number of rows of data returned from the API query when the user executed the
query.
For big objects, if the total number of returned rows is greater than the API batch size,
RowsProcessed is -1.
RowsReturned Type
double
Properties
Nillable
Description
The number of rows of data returned in the current API batch.
If RowsProcessed is less than the API batch size, RowsReturned is equal to
RowsProcessed. If RowsProcessed is greater than the API batch size,
RowsReturned equals either the API batch size or the number of rows in the last batch.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE - A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW - The user’s security level for the current session meets the lowest requirements.
This low level isn’t available, or used, in the Salesforce UI. User sessions through the UI
are either standard or high assurance. You can set this level using the API, but users
assigned this level experience unpredictable and reduced functionality.
312
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• STANDARD - The user’s security level for the current session meets the Standard
requirements set in the current organization Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The IP from which the API events originated. A Salesforce internal IP (such as from an API
event originating from AppExchange) is shown as “Salesforce.com IP”.
UserAgent Type
string
Properties
Nillable
Description
The platform or environment in which the API call originated. This field could include
information about the operating system, application, or web protocol. For example,
Mozilla/5.0 (iPhone; CPU iPhone OS 13_0 like Mac OS X)
AppleWebKit/605.1.15 (KHTML, like Gecko)
UserId Type
reference
Properties
Nillable
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
313
Platform Events Developer Guide Standard Platform Event Objects
314
Platform Events Developer Guide Standard Platform Event Objects
config.setRequestHeader(entry.getKey(), entry.getValue());
}
// Set the username and password if your proxy must be authenticated
config.setProxyUsername(proxyUsername);
config.setProxyPassword(proxyPassword);
try {
QueryResult queryResult = connection.query("SELECT Id, Name FROM Account");
// etc.
} catch (ConnectionException ce) {
ce.printStackTrace();
}
For the user interface, use proxy servers to intercept call and add required information.
SEE ALSO:
Big Objects Implementation Guide
ApiEventStream
Tracks these user-initiated read-only API calls: query(), queryMore(), and count(). Captures API requests through SOAP API
and Bulk API for the Enterprise and Partner WSDLs. Tooling API calls and API calls originating from a Salesforce mobile app aren’t captured.
This object is available in API version 46.0 and later.
315
Platform Events Developer Guide Standard Platform Event Objects
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/ApiEventStream
Fields
Field Details
AdditionalInfo Type
string
Properties
Nillable
Description
JSON serialization of additional information that’s captured from the HTTP headers during
an API request. For example, {"field1": "value1", "field2": "value2"}.
ApiType Type
string
Properties
Nillable
Description
The API that was used. Values include:
316
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Bulk
• REST
• SOAP Enterprise
• SOAP Partner
• N/A
ApiVersion Type
double
Properties
Nillable
Description
The version number of the API.
Application Type
string
Properties
Nillable
Description
The application used to access the org. For example, CRM Analytics or Salesforce Developers
Connector.
Client Type
string
Properties
Nillable
Description
The service that executed the API event. If you’re using an unrecognized client, this field
returns “Unknown” or a blank value.
ConnectedAppId Type
string
Properties
Nillable
Description
The 15-character ID of the connected app associated with the API call. For example,
0H4RM00000000Kr0AI. The ConnectedAppID field populates when a call triggers an
OAuth 2.0 authentication process, which identifies the connected app that’s authorized to
access Salesforce data on behalf of a user. When a user associated with the call already has
an active authentication token, the ConnectedAppID is set to a null value.
ElapsedTime Type
int
317
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The amount of time it took for the request to complete in milliseconds. The measurement
of this value begins before the query executes and ends when the query completes. It doesn’t
include the amount of time it takes to return the result over the network.
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Nillable
Description
The time when the specified API event was captured (after query execution takes place). For
example, 2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
LoginHistoryId Type
reference
318
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular series of API events.
This field is also available on the LoginEvent, AuthSession, and LoginHistory objects, making
it easier to trace events back to a user’s original authentication. For example,
0YaB000002knVQLKA2.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
Operation Type
picklist
Properties
Nillable, Restricted Picklist
Description
The API call that generated the event. Possible values are Query, QueryAll, or
QueryMore.
Platform Type
string
Properties
Nillable
Description
The operating system on the login machine. For example, iPhone, Mac OS, Linux, or Unknown.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY.
PolicyOutcome Type
picklist
319
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. For this event, possible values are:
• Block - The user was blocked from performing the operation that triggered the policy.
• Error - The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction - The policy didn't trigger.
• Notified - A notification was sent to the recipient.
QueriedEntities Type
string
Properties
Nillable
Description
The entities in the SOQL query. For example, Opportunity, Lead, Account, or Case. Can also
include custom objects. For relationship queries, the value of this field contains all entities
involved in the query.
Examples
• For SELECT Contact.FirstName, Contact.Account.Name from
Contact, the value of QueriedEntities is Account, Contact.
• For SELECT Account.Name, (SELECT Contact.FirstName,
Contact.LastName FROM Account.Contacts) FROM Account, the
value of QueriedEntities is Account, Contact.
• For SELECT Id, Name, Account.Name FROM Contact WHERE
Account.Industry = 'media', the value of QueriedEntities is
Account, Contact.
Query Type
textarea
Properties
Nillable
Description
The SOQL query. For example, SELECT id FROM Lead.
320
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Records Type
json
Properties
Nillable
Description
A JSON string that represents the queried objects’ metadata. This metadata includes the
number of results of a query per entity type and the entity IDs. The Records field is set to
a null value for BULK API queries. Bulk API queries from ApiEventStream can exceed
bandwidth limitations due to the size of the Records field. To reduce the payload size,
the Records field is set to a null value.
Example
{ "totalSize" : 1,
"done" : true,
"records" : [ {
"attributes" : {
"type" : "Account"
},
"Id" : "001xx000003DMvCAAW",
"Contacts" : {
"totalSize" : 3,
"done" : true,
"records" : [ {
"attributes" : {
"type" : "Contact"
},
"Id" : "003xx000004U7xKAAS"
}, {
"attributes" : {
"type" : "Contact"
},
"Id" : "003xx000004U7xLAAS"
}, {
"attributes" : {
"type" : "Contact"
},
"Id" : "003xx000004U7xMAAS"
} ]
}
} ]
}
RelatedEventIdentifier Type
string
Properties
Nillable
321
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RowsProcessed Type
double
Properties
Nillable
Description
The total number of rows of data returned from the API query when the user executed the
query.
For big objects, if the total number of returned rows is greater than the API batch size,
RowsProcessed is -1.
RowsReturned Type
double
Properties
Nillable
Description
The number of rows of data returned in the current API batch.
If RowsProcessed is less than the API batch size, RowsReturned is equal to
RowsProcessed. If RowsProcessed is greater than the API batch size,
RowsReturned equals either the API batch size or the number of rows in the last batch.
SessionKey Type
string
322
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE - A high assurance session was used for resource access. For example,
when the user tries to access a resource such as a connected app, report, or dashboard
that requires a high-assurance session level.
• LOW - The user’s security level for the current session meets the lowest requirements.
This low level is not available, nor used, in the Salesforce UI. User sessions through the
UI are either standard or high assurance. You can set this level using the API, but users
assigned this level experience unpredictable and reduced functionality.
• STANDARD - The user’s security level for the current session meets the Standard
requirements set in the current organization Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The IP from which the API events originated. A Salesforce internal IP (such as from an API
event originating from AppExchange) is shown as “Salesforce.com IP”.
UserAgent Type
string
Properties
Nillable
Description
The platform or environment in which the API call originated. This field could include
information about the operating system, application, or web protocol. For example,
Mozilla/5.0 (iPhone; CPU iPhone OS 13_0 like Mac OS X)
AppleWebKit/605.1.15 (KHTML, like Gecko)
323
Platform Events Developer Guide Standard Platform Event Objects
Field Details
UserId Type
reference
Properties
Nillable
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
BulkApiResultEvent
Tracks when a user downloads the results of a Bulk API or Bulk API 2.0 request.
Supported Calls
describeSObjects()
Fields
Field Details
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
324
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventDate Type
dateTime
Properties
Nillable
Description
The time when the anomaly was reported. For example, 2020-01-20T19:12:26.965Z.
Milliseconds is the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular login instance. This
field is also available on the LoginHistory, AuthSession, and LoginHistory objects, making it
easier to trace events back to a user’s original authentication.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
325
Platform Events Developer Guide Standard Platform Event Objects
Field Details
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies
are processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values include:
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
Query Type
string
Properties
Nillable
Description
The SOQL query. For example, SELECT Id FROM Account
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
326
Platform Events Developer Guide Standard Platform Event Objects
Field Details
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example,
vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
Note: This low level isn't available or used in the Salesforce UI. User sessions
through the UI are either standard or high assurance. You can set this level using
the API, but users who are assigned this level experience unpredictable and
reduced functionality in their Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the current organization Session Security Levels.
327
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
UserId Type
reference
Properties
Nillable
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
BulkApiResultEventStore
Tracks when a user downloads the results of a Bulk API request. BulkApiResultEventStore is a big object that stores the event data of
BulkApiResultEvent. This object is available in API version 50.0 and later.
Supported Calls
describeSObjects(), query()
Fields
Field Details
EvaluationTime Type
double
328
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Nillable
Description
The time when the anomaly was reported. For example, 2020-01-20T19:12:26.965Z.
Milliseconds is the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event. For example,
0a4779b0-0da1-4619-a373-0a36991dff90.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular login instance. This
field is also available on the LoginHistory, AuthSession, and LoginHistory objects, making it
easier to trace events back to a user’s original authentication.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
PolicyId Type
reference
329
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies
are processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values include:
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
Query Type
string
Properties
Nillable
Description
The SOQL query. For example, SELECT Id FROM Account
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
330
Platform Events Developer Guide Standard Platform Event Objects
Field Details
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example,
vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
Note: This low level is not available or used in the Salesforce UI. User sessions
through the UI are either standard or high assurance. You can set this level using
the API, but users assigned this level experience unpredictable and reduced
functionality in their Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the current organization Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
UserId Type
reference
331
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
ConcurLongRunApexErrEvent
Notifies subscribers of errors that occur when a Salesforce org exceeds the concurrent long-running Apex limit. If a high volume of these
events occur concurrently in an org, we may rate limit the events based on resource availability. Event log files, which are the predecessor
of Real-time Event Monitoring, provide a list of Apex-related events. For more information, see Apex-related EventLogFile events. This
object is available in API version 49.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/ConcurLongRunApexErrEvent
332
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
CurrentValue Type
int
Properties
Nillable
Description
The current count of concurrent long-running Apex requests in the org.
EventDate Type
dateTime
Properties
Nillable
Description
The time when the Apex request failed to start and generated the error. For example,
2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object, if any.
For example, 0a4779b0-0da1-4619-a373-0a36991dff90.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
LimitValue Type
int
Properties
Nillable
Description
The limit value that was exceeded.
LoginKey Type
string
333
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring.
Quiddity Type
string
Properties
Nillable
Description
The type of outer execution associated with this event.
Example
• A–QueryLocator Batch Apex (Batch Apex jobs run faster when the start method returns
a QueryLocator object that doesn't include related records via a subquery. See Best
Practices in Using Batch Apex.)
• B– Bulk API and Bulk API 2.0
• BA–Batch Apex (for debugger)
• C–Scheduled Apex
• E–Inbound Email Service
• F–Future
• H–Apex REST
• I–Invocable Action
• K–Quick Action
• L–Lightning
• M–Remote Action
• Q–Queuable
• R–Synchronous uncategorized (default value for transactions not specified elsewhere)
• S–Serial Batch Apex
• TA–Tests Async
• TD–Tests Deployment
• TS–Tests Synchronous
• V–Visualforce
• W–SOAP Webservices
• X–Execute Anonymous
ReplayId Type
string
334
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestId Type
string
Properties
Nillable
Description
The unique ID of the Apex request that fired the event.
RequestUri Type
string
Properties
Nillable
Description
The URI of the Apex request that failed to start and generated the error.
Example
/apex/ApexClassName
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. You can use this value to identify all user events within a session.
When a user logs out and logs in again, a new session is started.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE - A high assurance session was used for resource access. For example,
when the user tries to access a resource such as a connected app, report, or dashboard
that requires a high-assurance session level.
335
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• LOW - The user’s security level for the current session meets the lowest requirements.
Note: This low level is not available, nor used, in the Salesforce UI. User sessions
through the UI are either standard or high assurance. You can set this level using
the API, but users assigned this level experience unpredictable and reduced
functionality in their Salesforce org.
• STANDARD - The user’s security level for the current session meets the Standard
requirements set in the current organization Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The IP address from which the Apex request originated.
UserId Type
reference
Properties
Nillable
Description
The unique ID of the user associated with the Apex request.
Username Type
string
Properties
Nillable
Description
The username of the user associated with the Apex request.
CredentialStuffingEvent
Tracks when a user successfully logs into Salesforce during an identified credential stuffing attack. Credential stuffing refers to large-scale
automated login requests using stolen user credentials. This object is available in API version 49.0 and later.
Supported Calls
describeSObjects()
336
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/CredentialStuffingEvent
Fields
Field Details
AcceptLanguage Type
string
Properties
Nillable
Description
List of HTTP Headers that specify the natural language, such as English, that the client
understands.
Example
zh, en-US;q=0.8, en;q=0.6
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
337
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventDate Type
dateTime
Properties
Nillable
Description
The time when the hijacking event was reported. For example,
2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
LoginType Type
picklist
Properties
Nillable, Restricted picklist
Description
The type of login used to access the session. See the LoginType field of LoginHistory in the
Object Reference guide for the list of possible values.
338
Platform Events Developer Guide Standard Platform Event Objects
Field Details
LoginUrl Type
string
Properties
Nillable
Description
The URL of the login page. For example, MyDomainName.my.salesforce.com.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Error - The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction - The policy didn't trigger.
• Notified - A notification was sent to the recipient.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
339
Platform Events Developer Guide Standard Platform Event Objects
Field Details
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
Score Type
double
Properties
Nillable
Description
Indicates that a user successfully logged into Salesforce during an identified credential stuffing
attack. The value of this field is always 1.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the unauthorized user that successfully logged in after the credential
stuffing attack. For example, 126.7.4.2.
Summary Type
textarea
Properties
Nillable
Description
A text summary of the threat that caused this event to be created.
Example
Successful login from Credential Stuffing attack.
UserAgent Type
textarea
Properties
Nillable
340
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The User-Agent header of the HTTP request of the unauthorized login. For example,
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108
Safari/537.36.
UserId Type
reference
Properties
Nillable
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
CredentialStuffingEventStore
Tracks when a user successfully logs into Salesforce during an identified credential stuffing attack. Credential stuffing refers to large-scale
automated login requests using stolen user credentials. CredentialStuffingEventStore is an object that stores the event data of
CredentialStuffingEvent. This object is available in API version 49.0 and later.
Supported Calls
describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query()
Fields
Field Details
AcceptLanguage Type
string
Properties
Filter, Group, Nillable, Sort
341
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
List of HTTP Headers that specify the natural language, such as English, that the client
understands.
Example
zh, en-US;q=0.8, en;q=0.6
CredentialStuffingEventNumber Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
The unique number automatically assigned to the event when it's created. You can't change
the format or value for this field.
EvaluationTime Type
double
Properties
Filter, Nillable, Sort
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Filter, Sort
Description
Required. The time when the hijacking event was reported. For example,
2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Filter, Group, Sort
Description
Required. The unique ID of the event. For example,
0a4779b0-0da1-4619-a373-0a36991dff90.
LastReferencedDate Type
dateTime
Properties
Filter, Nillable, Sort
342
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The timestamp for when the current user last viewed a record related to this record.
LastViewedDate Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed this record. If this value is null, it’s
possible that this record was referenced (LastReferencedDate) and not viewed.
LoginKey Type
string
Properties
Filter, Group, Nillable, Sort
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
LoginType Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The type of login used to access the session. See the LoginType field of LoginHistory in the
Object Reference guide for the list of possible values.
LoginUrl Type
string
Properties
Filter, Group, Nillable, Sort
Description
The URL of the login page. For example, MyDomainName.my.salesforce.com.
PolicyId Type
reference
Properties
Filter, Group, Nillable, Sort
343
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The result of the transaction policy. Possible values are:
• Error - The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction - The policy didn't trigger.
• Notified - A notification was sent to the recipient.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
Score Type
double
Properties
Filter, Nillable, Sort
Description
Indicates that a user successfully logged into Salesforce during an identified credential stuffing
attack. The value of this field is always 1.
SessionKey Type
string
Properties
Filter, Group, Nillable, Sort
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SourceIp Type
string
344
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Filter, Group, Nillable, Sort
Description
The source IP address of the unauthorized user that successfully logged in after the credential
stuffing attack. For example, 126.7.4.2.
Summary Type
textarea
Properties
Nillable
Description
A text summary of the threat that caused this event to be created.
Example
Successful login from Credential Stuffing attack.
UserAgent Type
textarea
Properties
Nillable
Description
The User-Agent header of the HTTP request of the unauthorized login. For example,
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108
Safari/537.36.
UserId Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Filter, Group, Nillable, Sort
Description
The origin username in the format of [email protected] at the time the event was
created.
345
Platform Events Developer Guide Standard Platform Event Objects
Associated Object
This object has the following associated object. It’s available in the same API version as this object.
CredentialStuffingEventStoreFeed
Feed tracking is available for the object.
CreditInvoiceProcessedEvent
Notifies subscribers when the process started by the /commerce/invoicing/invoices/{invoiceId}/actions/credit
request is complete. This object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/CreditInvoiceProcessedEvent
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
346
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Reserved for future use.
CrMemoProcessErrDtlEvents Type
CreditMemoProcessedErrDtlEvent[]
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed. This field is available
only in API versions 55.0–58.0.
See the ErrorDetails field for error messages and error codes.
CreditMemoId Type
reference
Properties
Nillable
Description
The credit memo created as the result of a successful request.
This field is a relationship field.
Relationship Name
CreditMemo
Relationship Type
Lookup
Refers To
CreditMemo
ErrorDetails Type
string
Properties
Nillable
Description
If the request fails, this field shows error messages, error codes, and the ID of the record on
which the errors occurred. This field is available in API 58.0 and later.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
347
Platform Events Developer Guide Standard Platform Event Objects
Field Details
InvoiceId Type
reference
Properties
Nillable
Description
The invoice credited as the result of a successful request.
This field is a relationship field.
Relationship Name
Invoice
Relationship Type
Lookup
Refers To
Invoice
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the request was successful.
The default value is 'false'.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the response. Use this ID to identify the event for a specific request.
348
Platform Events Developer Guide Standard Platform Event Objects
IN THIS SECTION:
CrMemoProcessErrDtlEvent
Contains information about errors that occurred while creating or applying a credit memo as part of a request. This object is included
in a CreditInvoiceProcessedEvent, CreditMemoProcessedEvent, NegInvcLineProcessedEvent, or
VoidInvoiceProcessedEvent message. You can't subscribe to CrMemoProcessErrDtlEvent directly. This object
is available in API versions 55.0–58.0. In API version 58.0, this field returns a null result. See the ErrorDetails field on the
CreditInvoiceProcessedEvent, CreditMemoProcessedEvent, NegInvcLineProcessedEvent, or
VoidInvoiceProcessedEvent object for error information.
CreditMemoProcessedEvent
Notifies subscribers when the process started by the /commerce/invoicing/credit-memos request is complete. This object
is available in API version 55.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/CreditMemoProcessedEvent
Fields
Field Details
CorrelationIdentifier Type
string
349
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Reserved for future use.
CrMemoProcessErrDtlEvents Type
CreditMemoProcessedErrDtlEvent[] on page 352
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed. This field is available
only in API versions 55.0–58.0.
See the ErrorDetails field for error messages and error codes.
CreditMemoId Type
reference
Properties
Nillable
Description
The credit memo created as the result of a successful request.
This field is a relationship field.
Relationship Name
CreditMemo
Relationship Type
Lookup
Refers To
CreditMemo
ErrorDetails Type
string
Properties
Nillable
Description
If the request fails, this field shows error messages, error codes, and the ID of the record on
which the errors occurred. This field is available in API 58.0 and later.
EventUuid Type
string
Properties
Nillable
350
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
A universally unique identifier (UUID) that identifies a platform event message.
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the Create Standalone Credit Memo action was successful.
The default value is 'false'.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the /commerce/invoicing/credit-memos response.
Use this ID to identify the event for a specific request.
Example: A user successfully runs a /commerce/invoicing/credit-memos, creates one credit memo, and receives
this platform event when the request completes.
{
"IsSuccess": true,
"CrMemoProcessErrDtlEvents": null,
"CreatedById": "005RO000000g4LYYAY",
"CorrelationIdentifier": "50gRO0000000jxc",
"CreatedDate": "2023-03-17T15:09:18Z",
"ErrorDetails": "[]",
"InvoiceId": "3ttRO0000006839YAA",
"CreditMemoId": "50gRO0000000jxcYAA",
"RequestIdentifier": "d488e070-0fd8-4cde-a9fd-d7ca38d040f5"
}
351
Platform Events Developer Guide Standard Platform Event Objects
CrMemoProcessErrDtlEvent
Contains information about errors that occurred while creating or applying a credit memo as part of a request. This object is included
in a CreditInvoiceProcessedEvent, CreditMemoProcessedEvent, NegInvcLineProcessedEvent, or
VoidInvoiceProcessedEvent message. You can't subscribe to CrMemoProcessErrDtlEvent directly. This object is
available in API versions 55.0–58.0. In API version 58.0, this field returns a null result. See the ErrorDetails field on the
CreditInvoiceProcessedEvent, CreditMemoProcessedEvent, NegInvcLineProcessedEvent, or
VoidInvoiceProcessedEvent object for error information.
Supported Calls
describeSObjects()
Fields
Field Details
ErrorCode Type
string
Properties
Nillable
Description
Reference code for the type of error that occurred.
352
Platform Events Developer Guide Standard Platform Event Objects
Field Details
ErrorMessage Type
string
Properties
Nillable
Description
Information about the error that occurred during processing.
ErrorSourceId Type
reference
Properties
Nillable
Description
The ID of the record on which the error occurred during the credit memo creation process
and the application process.
This field is a polymorphic relationship field.
Relationship Name
ErrorSource
Relationship Type
Lookup
Refers To
CreditMemo, CreditMemoLine, Invoice, InvoiceLine
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
GuestUserAnomalyEvent
Tracks data access anomalies that are caused by guest user permission misconfiguration. This object is available in API version 60.0 and
later.
Supported Calls
describeSObjects()
353
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Fields
Field Details
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds.
EventDate Type
dateTime
Properties
Nillable
Description
A date value that represents the aggregate timeframe when the guest user's actions occurred.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object.
EventUuid Type
string
Properties
Nillable
354
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
A universally unique identifier (UUID) that identifies a platform event message.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY.
Relationship Name
Policy
Relationship Type
Lookup
Refers To
TransactionSecurityPolicy
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values include:
• Error—The policy caused an undefined error when it was executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
355
Platform Events Developer Guide Standard Platform Event Objects
Field Details
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestedEntities Type
textarea
Properties
Nillable
Description
Objects queried by the guest user. For example:
[\" Topic \"].
Score Type
double
Properties
Nillable
Description
Specifies how significantly the guest user behavior deviates from the other guest users. It’s
formatted as a number between 0 and 1.
SecurityEventData Type
textarea
Properties
Nillable
Description
The content data of the security event. This field is reserved for future use.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session.
356
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SoqlCommands Type
textarea
Properties
Nillable
Description
SOQL commands run by the guest user.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
Summary Type
textarea
Properties
Nillable
Description
A text summary of the threat that caused this event to be created. The summary lists the
browser fingerprint features that most contributed to the threat detection along with their
contribution to the total score.
TotalControllerEvents Type
int
Properties
Nillable
Description
The number of times controllers were triggered.
UserAgent Type
string
Properties
Nillable
Description
User Agent for this event.
UserId Type
reference
Properties
Nillable
357
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The origin user’s unique ID. For example, 005000000000123.
This field is a polymorphic relationship field.
Relationship Name
User
Relationship Type
Lookup
Refers To
User
Username Type
string
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
UserType Type
string
Properties
Nillable
Description
Type of user of this event. For example, a guest user.
GuestUserAnomalyEventStore
Tracks data access anomalies that are caused by guest user permission misconfiguration. GuestUserAnomalyEventStore is an object that
stores the event data of GuestUserAnomalyEvent. This object is available in API version 60.0 and later.
Supported Calls
describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query()
358
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
EvaluationTime Type
double
Properties
Filter, Nillable, Sort
Description
The amount of time it took to evaluate the policy in milliseconds.
EventDate Type
dateTime
Properties
Filter, Sort
Description
A date value that represents the aggregate timeframe when the guest user's actions occurred.
EventIdentifier Type
string
Properties
Filter, Group, Sort
Description
The unique ID of the event, which is shared with the corresponding storage object.
GuestUserAnomalyEventNumber Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
The unique number automatically assigned to the event when it's created. You can't change
the format or value for this field.
LastReferencedDate Type
dateTime
Properties
Filter, Nillable, Sort
Description
The date the event was last referenced.
LastViewedDate Type
dateTime
Properties
Filter, Nillable, Sort
359
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The date the event was last viewed.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
PolicyId Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY.
Relationship Name
Policy
Relationship Type
Lookup
Refers To
TransactionSecurityPolicy
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values include:
• Error—The policy caused an undefined error when it was executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
360
Platform Events Developer Guide Standard Platform Event Objects
Field Details
RequestedEntities Type
textarea
Properties
Nillable
Description
Objects queried by the guest user. For example:
[\" Topic \"].
Score Type
double
Properties
Filter, Nillable, Sort
Description
Specifies how significantly the guest user behavior deviates from the other guest users. It is
formatted as a number between 0 and 1.
SecurityEventData Type
textarea
Properties
Nillable
Description
The content data of the security event. This field is reserved for future use.
SessionKey Type
string
Properties
Filter, Group, Nillable, Sort
Description
The user’s unique session ID. Use this value to identify all user events within a session.
SoqlCommands Type
textarea
Properties
Nillable
Description
SOQL commands run by the guest user.
SourceIp Type
string
Properties
Filter, Group, Nillable, Sort
361
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
Summary Type
textarea
Properties
Nillable
Description
A text summary of the threat that caused this event to be created. The summary lists the
browser fingerprint features that most contributed to the threat detection along with their
contribution to the total score.
TotalControllerEvents Type
int
Properties
Filter, Group, Nillable, Sort
Description
The number of times controllers were triggered.
UserAgent Type
string
Properties
Filter, Nillable, Sort
Description
User Agent for this event.
UserId Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The origin user’s unique ID. For example, 005000000000123.
This field is a polymorphic relationship field.
Relationship Name
User
Relationship Type
Lookup
Refers To
User
362
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Username Type
string
Properties
Filter, Group, Nillable, Sort
Description
The origin username in the format of [email protected] at the time the event was
created.
UserType Type
string
Properties
Filter, Group, Nillable, Sort
Description
Type of user of this event. For example, a guest user.
PaymentCreationEvent
Notifies subscribers when the process started by the /actions/standard/paymentSale request is complete. This object is
available in API version 55.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/PaymentCreationEvent
363
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
ErrorCode Type
string
Properties
Nillable
Description
Error code sent from the payment gateway after a request encountered an error.
ErrorMessage Type
textarea
Properties
Nillable
Description
Message sent from the payment gateway after a request encountered an error.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the request was successful.
The default value is 'false'.
364
Platform Events Developer Guide Standard Platform Event Objects
Field Details
PaymentGatewayLogId Type
reference
Properties
Nillable
Description
The payment gateway log containing information about the communication with the
payment gateway.
This is a relationship field.
Relationship Name
PaymentGatewayLog
Relationship Type
Lookup
Refers To
PaymentGatewayLog
PaymentId Type
reference
Properties
Nillable
Description
The payment created as the result of a successful request.
This is a relationship field.
Relationship Name
Payment
Relationship Type
Lookup
Refers To
Payment
PaymentStatus Type
picklist
Properties
Nillable, Restricted picklist
Description
The status of the payment created after a successful request. This field reflects the status
upon payment creation, and isn’t updated after further changes to the payment’s status.
Possible values are:
• Canceled
• Draft
• Failed
365
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Pending
• Processed
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the /actions/standard/paymentSale response. Use
this ID to identify the event for a specific request.
Type Type
picklist
Properties
Nillable, Restricted picklist
Description
Indicates whether the payment was made for a payment capture request or payment sale
request.
Possible values are:
• Capture
• Sale
VoidInvoiceProcessedEvent
Notifies subscribers when the process started by the /commerce/invoicing/invoices/{invoiceId}/actions/void
request is complete. The request attempts to void an invoice by crediting an invoice and changing its status to Voided, which prevents
further changes. This object is available in API version 55.0 and later. This object is available in API version 55.0 and later.
Supported Calls
describeSObjects()
366
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/VoidInvoiceProcessedEvent
Fields
Field Details
CorrelationIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
CrMemoProcessErrDtlEvents Type
CrMemoProcessErrDtlEvent[]
Properties
Nillable
Description
Contains a list of error messages and error codes if the request failed. This field is available
only in API versions 55.0–58.0.
See the ErrorDetails field for error messages and error codes.
CreditMemoId Type
reference
367
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The credit memo created to void the invoice as the result of a successful request.
This field is a relationship field.
Relationship Name
CreditMemo
Relationship Type
Lookup
Refers To
CreditMemo
ErrorDetails Type
string
Properties
Nillable
Description
If the request fails, this field shows error messages, error codes, and the ID of the record on
which the errors occurred. This field is available in API 58.0 and later.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
InvoiceId Type
reference
Properties
Nillable
Description
The invoice that was voided as the result of a successful request.
This field is a relationship field.
Relationship Name
Invoice
Relationship Type
Lookup
Refers To
Invoice
368
Platform Events Developer Guide Standard Platform Event Objects
Field Details
IsSuccess Type
boolean
Properties
Defaulted on create
Description
Indicates whether the request was successful.
The default value is 'false'.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RequestIdentifier Type
string
Properties
Nillable
Description
The unique ID returned in the
/commerce/billing/invoices/{invoiceId}/actions/void response.
Use this ID to identify the event for a specific request.
FileEvent
Tracks when a user downloads a document. This information includes events performed on files. This object is available in API version
57.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
369
Platform Events Developer Guide Standard Platform Event Objects
Subscriber Supported?
Processes
Pub/Sub API
Subscription Channel
/event/FileEvent
Fields
Field Details
CanDownloadPdf Type
boolean
Properties
Defaulted on create
Description
Indicates whether the downloaded PDF was converted from another file type. The default
value is false.
ContentSize Type
int
Properties
Nillable
Description
The size of the document, in bytes.
DocumentId Type
string
Properties
Nillable
Description
The 18-character ID of the document that’s being downloaded. The ID is a reference to the
ContentDocument object.
370
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the transaction security policy in milliseconds.
EventDate Type
dateTime
Properties
Filter, Sort
Description
The time when the file event was reported. For example,
2020-01-20T19:12:26.965Z. Milliseconds is the most granular setting.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
FileAction Type
string
Properties
Nillable
Description
The action taken on the file. Valid values are:
• API_DOWNLOAD
• PREVIEW
• UI_DOWNLOAD
• UPLOAD
371
Platform Events Developer Guide Standard Platform Event Objects
Field Details
This field is available in API version 58.0 and later.
FileName Type
string
Properties
Nillable
Description
The name of the file, including the file extension.
FileSource Type
string
Properties
Nillable
Description
Origin of the document. Valid values are:
• S—Document is located within Salesforce. Label is Salesforce.
• E—Document is located outside of Salesforce. Label is External.
• L—Document is located on a social network and accessed via Social Customer Service.
Label is Social Customer Service.
FileType Type
string
Properties
Nillable
Description
The content type of the file. For example, PDF.
IsLatestVersion Type
boolean
Properties
Defaulted on create
Description
Indicates whether the file is the most current version (true) or not (false). The default value
is false.
LoginKey Type
string
Properties
Nillable
372
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY.
This is a relationship field.
Relationship Name
Policy
Relationship Type
Lookup
Refers To
TransactionSecurityPolicy
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Block—The user was blocked from performing the operation that triggered the policy.
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
ProcessDuration Type
double
Properties
Nillable
373
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The amount of time to download the file, in milliseconds.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example,
vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
374
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
This low level isn't available or used in the Salesforce UI. User sessions through the UI
are either standard or high assurance. You can set this level using the API, but users who
are assigned this level experience unpredictable and reduced functionality in their
Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the current organization Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
UserId Type
reference
Properties
Nillable
Description
The origin user’s unique ID. For example, 005B0000001vURv.
This is a polymorphic relationship field.
Relationship Name
User
Relationship Type
Lookup
Refers To
User
Username Type
string
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
VersionId Type
string
375
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The specific version of a document in Salesforce CRM Content or Salesforce Files. The ID is a
reference to the ContentVersion object.
VersionNumber Type
string
Properties
Nillable
Description
The version number of the file.
FileEventStore
Tracks when a user downloads, previews, or uploads a file. FileEventStore is a big object that stores the event data of FileEvent. This
object is available in API version 57.0 and later.
Supported Calls
describeSObjects(), query()
Fields
Field Details
CanDownloadPdf Type
boolean
Properties
Defaulted on create
Description
Indicates whether the downloaded PDF was converted from another file type. The default
value is false.
ContentSize Type
int
Properties
Nillable
376
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The size of the document, in bytes
DocumentId Type
reference
Properties
Nillable
Description
The 18-character ID of the document that’s being downloaded. The ID is a reference to the
ContentDocument object.
This is a relationship field.
Relationship Name
Document
Relationship Type
Lookup
Refers To
ContentDocument
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the transaction security policy in milliseconds.
EventDate Type
dateTime
Properties
Filter, Sort
Description
The time when the file event was reported. For example,
2020-01-20T19:12:26.965Z. Milliseconds is the most granular setting.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
377
Platform Events Developer Guide Standard Platform Event Objects
Field Details
FileAction Type
string
Properties
Nillable
Description
The action taken on the file. Valid values are:
• API_DOWNLOAD
• PREVIEW
• UI_DOWNLOAD
• UPLOAD
This field is available in API version 58.0 and later.
FileName Type
string
Properties
Nillable
Description
The name of the file, including the file extension.
FileSource Type
string
Properties
Nillable
Description
Origin of the document. Valid values are:
• S—Document is located within Salesforce. Label is Salesforce.
• E—Document is located outside of Salesforce. Label is External.
• L—Document is located on a social network and accessed via Social Customer Service.
Label is Social Customer Service.
FileType Type
string
Properties
Nillable
Description
The content type of the file.
IsLatestVersion Type
boolean
378
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Defaulted on create
Description
Indicates whether the file is the most current version (true) or not (false). The default value
is false.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY.
This is a relationship field.
Relationship Name
Policy
Relationship Type
Lookup
Refers To
TransactionSecurityPolicy
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Block—The user was blocked from performing the operation that triggered the policy.
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
379
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
ProcessDuration Type
double
Properties
Nillable
Description
The amount of time to download the file, in milliseconds.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example,
vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
380
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
This low level isn't available or used in the Salesforce UI. User sessions through the UI
are either standard or high assurance. You can set this level using the API, but users who
are assigned this level experience unpredictable and reduced functionality in their
Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the current organization Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
UserId Type
reference
Properties
Nillable
Description
The origin user’s unique ID. For example, 005B0000001vURv.
This is a polymorphic relationship field.
Relationship Name
User
Relationship Type
Lookup
Refers To
User
Username Type
string
Properties
Nillable
381
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The origin username in the format of [email protected] at the time the event was
created.
VersionId Type
reference
Properties
Nillable
Description
The specific version of a document in Salesforce CRM Content or Salesforce Files. The ID is a
reference to the ContentVersion object.
This is a relationship field.
Relationship Name
Version
Relationship Type
Lookup
Refers To
ContentVersion
VersionNumber Type
string
Properties
Nillable
Description
The version number of the file.
IdentityProviderEventStore
Tracks problems and successes with inbound SAML or OpenID Connect authentication requests from another app provider. It also records
outbound SAML responses when Salesforce is acting as an identity provider. IdentityProviderEventStore is a big object. This object is
available in API version 51.0 and later.
Supported Calls
describeSObjects(), query()
382
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
AppId Type
reference
Properties
Nillable
Description
The ID of the app provider seeking authentication.
AuthSessionId Type
reference
Properties
Nillable
Description
The ID of the authentication session.
ErrorCode Type
picklist
Properties
Restricted picklist
Description
The error code for the authentication issue.
Possible values are:
• AppAccessDenied—Error: App access denied
• AppBlocked—Error: App blocked
• ClientUnapproved—Error: Invalid grant
• CodeExpired—Error: Expired authorization code
• InternalError—Error: Internal Error
• InvalidAuthnRequest—Error: Unable to parse AuthnRequest from service
provider
• InvalidClientCredentials—Error: Invalid client credentials
• InvalidCode—Error: Invalid authorization code
• InvalidDeviceId—Error: Invalid device ID
• InvalidIdpEndpoint—Error: Invalid Identity Provider Endpoint URL
• InvalidIssuer—Error: Invalid Issuer
• InvalidScope—Error: One or more invalid scopes
• InvalidSessionLevel—Error: Invalid session level
• InvalidSettings—Error: IdP certificate is invalid or doesn’t exist
• InvalidSignature—Error: Invalid Signature
• InvalidSp—Error: Misconfigured or invalid service provider
383
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• InvalidSpokeSp—Error: Invalid spoke SP settings
• InvalidUserCredentials—Error: Invalid user credentials
• NoAccess—Error: User doesn’t have access to this service provider
• NoCustomAttrValue—Error: User doesn’t have a value for the subject custom
attribute
• NoCustomField—Error: Custom field not found
• NoSpokeId—Error: No Spoke ID found
• NoSubdomain—Error: My Domain isn’t configured
• NoUserFedId—Error: User doesn’t have a Federation Identifier selected
• OauthError—OAuth Error
• Success
• UnableToResolve—Error: Unable to resolve request into a Service Provider
• UnknownError—Unknown Error
EventDate Type
dateTime
Properties
Filter, Sort
Description
The date and time of the event.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique identifier for each record in IdentityProviderEventStore.
HasLogoutUrl Type
boolean
Properties
Defaulted on create
Description
Whether a logout URL has been assigned to the app. Users are redirected to this URL when
they log out. The default value is false.
IdentityUsed Type
string
Properties
Nillable
384
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The identity (username) of the user being authenticated.
InitiatedBy Type
picklist
Properties
Restricted picklist
Description
The code describing how the authentication request was initiated.
Possible values are:
• IdP—IdP-Initiated SAML
• OauthAuthorize—OAuth Authorization
• OauthTokenExchange—OAuth Token Exchange
• SP—SP-Initiated SAML
• Unused
SamlEntityUrl Type
string
Properties
Description
The authentication URL of the SAML provider.
SsoType Type
picklist
Properties
Nillable, Restricted picklist
Description
The type of SSO.
Possible values are:
• Oidc
• Saml
UserId Type
reference
Properties
Nillable
385
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The ID of the user seeking authentication.
SEE ALSO:
Big Objects Implementation Guide
IdentityVerificationEvent
Tracks user identity verification events in your org. IdentityVerificationEvent is a big object that stores the event data when users are
prompted to verify their identity. Available in API version 47.0 and later.
Supported Calls
describeSObjects(), query()
Fields
Field Details
Activity Type
picklist
Properties
Nillable, Restricted picklist
Description
The action the user attempted that requires identity verification. Possible values include:
• AccessReports—The user attempted to access reports or dashboards.
• Apex—The user attempted to access a Salesforce resource with a verification Apex method.
• ChangeEmail—The user attempted to change an email address.
• ConnectSms—The user attempted to connect a phone number.
• ConnectToopher—The user attempted to connect Salesforce Authenticator.
• ConnectTotp—The user attempted to connect a one-time password generator.
• ConnectU2F—The user attempted to register a U2F security key.
• ConnectWebAuthRoaming—The user attempted to register a WebAuthn security key.
• ConnectedApp—The user attempted to access a connected app.
386
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• EnableLL—The user attempted to enroll in Lightning Login.
• ExportPrintReports—The user attempted to export or print reports or dashboards.
• ExternalClientApp— The user attempted to access an external client app.
• ExtraVerification—ExtraVerification—Reserved for future use.
• ListView—The user attempted to access a list view.
• Login—The user attempted to log in.
• Registration—Reserved for future use.
• TempCode—The user attempted to generate a temporary verification code.
City Type
string
Properties
Nillable
Description
The city where the user’s IP address is physically located. This value isn’t localized.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
Country Type
string
Properties
Nillable
Description
The country where the user’s IP address is physically located. This value isn’t localized.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
CountryIso Type
string
Properties
Nillable
Description
The ISO 3166 code for the country where the user’s IP address is physically located. For more
information, see Country Codes - ISO 3166.
EventDate Type
dateTime
Properties
Filter, Sort
Description
The date and time of the identity verification attempt, for example, 7/19/2025, 3:19:13
PM PDT. The time zone is based on GMT.
387
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventGroup Type
string
Properties
Nillable
Description
ID of the verification attempt. Verification can involve several attempts and use different verification
methods. For example, in a user’s session, a user enters an invalid verification code (first attempt).
The user then enters the correct code and successfully verifies identity (second attempt). Both
attempts are part of a single verification and, therefore, have the same ID.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique ID of the event, which is shared with the corresponding storage object. For example,
0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate the event with
its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is available
in API version 52.0 and later.
Latitude Type
double
Properties
Nillable
Description
The latitude where the user’s IP address is physically located.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so that you can correlate user activity with a particular login instance.
388
Platform Events Developer Guide Standard Platform Event Objects
Field Details
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with a login
event and ends with either a logout event or the user session expiring.
Longitude Type
double
Properties
Nillable
Description
The longitude where the user’s IP address is physically located.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
Policy Type
picklist
Properties
Nillable, Restricted picklist
Description
The identity verification security policy or setting.
• CustomApex—Identity verification made by a verification Apex method.
• DeviceActivation—Identity verification required for users logging in from an
unrecognized device or new IP address. This verification is part of Salesforce’s risk-based
authentication.
• EnableLightningLogin— Identity verification required for users enrolling in Lightning
Login. This verification is triggered when the user attempts to enroll. Users are eligible to enroll
if they have the Lightning Login User user permission and the org has enabled Allow Lightning
Login in Session Settings.
• ExtraVerification—Reserved for future use.
• HighAssurance—High assurance session required for resource access. This verification is
triggered when the user tries to access a resource, such as a connected app, report, or dashboard,
that requires a high-assurance session level.
• LightningLogin—Identity verification required for internal users logging in via Lightning
Login. This verification is triggered when the enrolled user attempts to log in. Users are eligible
to log in if they have the Lightning Login User user permission and have successfully enrolled
in Lightning Login. Also, from Session Settings in Setup, Allow Lightning Login must be enabled.
• PageAccess—Identity verification required for users attempting to perform an action, such
as changing an email address or adding a verification method for multi-factor authentication
(MFA).
389
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Passwordless Login—Identity verification required for customers attempting to log
in to an Experience Cloud site that is set up for passwordless login. The admin controls which
registered verification methods can be used, for example, email, SMS, Salesforce Authenticator,
or TOTP.
• ProfilePolicy—Session security level required at login. This verification is triggered by
the Session security level required at login setting on the user’s profile.
• TwoFactorAuthentication—Multi-factor authentication (formerly called two-factor
authentication) required at login. This verification is triggered by the Multi-Factor Authentication
for User Interface Logins user permission assigned to a custom profile. Or the user permission
is included in a permission set that is assigned to a user.
PostalCode Type
string
Properties
Nillable
Description
The postal code where the user’s IP address is physically located. This value isn’t localized.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
Remarks Type
string
Properties
Nillable
Description
The text users see on the page or in Salesforce Authenticator when prompted to verify their identity.
For example, if identity verification is required for users to log in, they see “You’re trying to Log In
to Salesforce.” In this case, the Remarks value is “Log In to Salesforce.” But if the Activity value is
Apex, the Remarks value is a custom description specified in the Apex method. If users are verifying
their identity using Salesforce Authenticator, the custom description also appears in the app. If the
custom description isn’t specified, the Remarks value is the name of the Apex method. The label is
Activity Message.
ResourceId Type
reference
Properties
Nillable
Description
If the Activity value is ConnectedApp, the ResourceId value is the ID of the connected
app. The label is Connected App ID.
SessionKey Type
string
390
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When a user
logs out and logs in again, a new session is started.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps and
reporting. Possible values are:
• HIGH_ASSURANCE—Used for resource access. For example, when the user tries to access
a resource such as a connected app, report, or dashboard that requires a high-assurance session
level.
• LOW—Indicates that the user’s security level for the current session meets the lowest
requirements.
Note: This low level is not available or used in the Salesforce UI. User sessions through
the UI are either standard or high assurance. You can set this level using the API, but
users assigned this level experience unpredictable and reduced functionality in their
Salesforce org.
• STANDARD—Indicates that the user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The IP address of the machine from which the user attempted the action that requires identity
verification. For example, the IP address of the machine from where the user tried to log in or access
reports. If it’s a non-login action that required verification, the IP address can be different from the
address from where the user logged in. This address can be an IPv4 or IPv6 address.
Status Type
picklist
Properties
Nillable, Restricted picklist
Description
The status of the identity verification attempt.
391
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• AutomatedSuccess—Salesforce approved the request for access because the request
came from a trusted location. After a user enables location services in Salesforce, the user can
designate trusted locations. When the user trusts a location for a particular activity, such as
logging in from a recognized device, that activity is approved from the trusted location for as
long as the location is trusted.
• Denied—The user denied the approval request in the authenticator app.
• FailedGeneralError—An error caused by something other than an invalid verification
code, too many verification attempts, or authenticator app connectivity.
• FailedInvalidCode—The user entered an invalid verification code.
• FailedInvalidPassword—The user entered an invalid password.
• FailedPasswordLockout—The user attempted to enter a password too many times.
• FailedTooManyAttempts—The user attempted to verify identity too many times. For
example, the user entered an invalid verification code repeatedly.
• InProgress—Salesforce challenged the user to verify identity and is waiting for either the
user to respond or for Salesforce to send an automated response.
• Initiated—Salesforce initiated identity verification but hasn’t yet challenged the user.
• ReportedDenied—The user denied the approval request in the authenticator app, such
as Salesforce Authenticator, and also flagged the approval request to report to an administrator.
• Succeeded—The user’s identity was verified.
Subdivision Type
string
Properties
Nillable
Description
The name of the subdivision where the user’s IP address is physically located. In the United States,
this value is usually the state name (for example, Pennsylvania). This value isn’t localized.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
UserId Type
reference
Properties
Nillable
Description
ID of the user verifying identity.
Username Type
string
Properties
Nillable
392
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The username of the user challenged for identity verification in [email protected] format.
VerificationMethod Type
picklist
Properties
Nillable, Restricted picklist
Description
The method by which the user attempted to verify identity in the verification event.
• BuiltInAuthenticator—Reserved for future use.
• Email—Salesforce sent an email with a verification code to the address associated with the
user’s account.
• EnableLL—Salesforce Authenticator sent a notification to the user’s mobile device to enroll
in Lightning Login.
• LL—Salesforce Authenticator sent a notification to the user’s mobile device to approve login
via Lightning Login.
• Password—Salesforce prompted for a password.
• SalesforceAuthenticator—Salesforce Authenticator sent a notification to the user’s
mobile device to verify account activity.
• Sms—Salesforce sent a text message with a verification code to the user’s mobile device. SMS
messaging requires a Salesforce add-on license for Identity Verification Credits.
• TempCode—A Salesforce admin or a user with the Manage Multi-Factor Authentication in
User Interface permission generated a temporary verification code for the user.
• Totp—An authenticator app generated a time-based, one-time password (TOTP) on the user’s
mobile device.
• U2F—A U2F security key-generated required credentials for the user.
• WebAuthnRoamingAuthenticator—A WebAuthn security key generated the required
credentials for the user.
393
Platform Events Developer Guide Standard Platform Event Objects
LightningUriEvent
Detects when a user creates, accesses, updates, or deletes a record in Lightning Experience only. LightningUriEvent is a big object that
stores the event data of LightningUriEventStream. This object is available in API version 46.0 and later.
Supported Calls
describeSObjects(), query()
Fields
Field Details
AppName Type
string
Properties
Nillable
Description
The name of the application that the user accessed.
ConnectionType Type
string
Properties
Nillable
Description
The type of connection.
Possible Values
• CDMA1x
• CDMA
• EDGE
• EVDO0
• EVDOA
• EVDOB
• GPRS
394
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• HRPD
• HSDPA
• HSUPA
• LTE
• WIFI
DeviceId Type
string
Properties
Nillable
Description
The unique identifier used to identify a device when tracking events. DEVICE_ID is a
generated value that’s created when the mobile app is initially run after installation.
DeviceModel Type
string
Properties
Nillable
Description
The name of the device model.
DevicePlatform Type
string
Properties
Nillable
Description
The type of application experience in name:experience:form format.
Possible Values
Name
• APP_BUILDER
• CUSTOM
• S1
• SFX
Experience
• BROWSER
• HYBRID
Form
• DESKTOP
• PHONE
• TABLET
395
Platform Events Developer Guide Standard Platform Event Objects
Field Details
DeviceSessionId Type
string
Properties
Nillable
Description
The unique identifier of the user’s session based on page load time. When the user reloads
a page, a new session is started.
Duration Type
double
Properties
Nillable
Description
The duration in milliseconds since the page start time.
EffectivePageTime Type
double
Properties
Nillable
Description
Indicates how many milliseconds it took for the page to load before a user could interact
with the page’s functionality. Multiple factors can affect effective page time, such as network
speed, hardware performance, or page complexity.
EffectivePageTimeDeviationErrorType Type
string
Properties
Nillable
Description
Indicates the origin of an error. This field is populated when
EffectivePageTimeDeviationReason contains the PageHasError value. This field is
available in API version 58.0 and later.
Possible Values
• Custom—An error originating from the customer's system or network.
• System—An error originating in Salesforce.
EffectivePageTimeDeviationReason Type
string
Properties
Nillable
396
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The reason for deviation in page loading time. This field is available in API version 58.0 and
later.
Possible Values
• PageInDom—The page was loaded from a cache.
• PageHasError—An undefined page loading error occurred.
• PageNotLoaded—If a customer navigates away from a page while loading processes
are in progress, the page doesn't finish loading.
• PreviousPageNotLoaded—When navigating to a new page, and the previous
page hasn't completed loading, the next page is considered to have a deviation.
Incomplete loading processes on a previous page can affect how the next page loads.
• InteractionsBeforePageLoaded—A user interacts with a page element
before the page is fully loaded.
• PageInBackgroundBeforeLoaded—A background loading process runs on a
page. Background processes can run when users don't interact with a page, such as
when they navigate to another browser tab.
EventDate Type
dateTime
Properties
Nillable
Description
The time when the specified URI event was captured (after query execution takes place). For
example, 2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique ID of the event. For example,
0a4779b0-0da1-4619-a373-0a36991dff90.
HasEffectivePageTimeDeviation Type
boolean
Description
When a deviation is detected, EffectivePageTimeDeviation records true. The
default value is false.
LoginKey Type
string
397
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
8gHOMQu+xvjCmRUt.
Operation Type
picklist
Properties
Nillable, Restricted picklist
Description
The operation being performed on the entity. For example, Read, Create, Update,
or Delete.
Create and update operations are captured in pairs; that is, expect two event records for
each operation. The first record represents the start of the operation, and the second record
represents whether the operation was successful or not.
If there isn’t a second event recorded for a create or update operation, the user canceled the
operation or the operation failed with client-side validation. For example, when a required
field is empty.
OsName Type
string
Properties
Nillable
Description
The operating system name.
OsVersion Type
string
Properties
Nillable
Description
The operating system version.
PageStartTime Type
dateTime
Properties
Nillable
Description
The time when the page was initially loaded, measured in milliseconds.
398
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Example
1471564788642
PageUrl Type
url
Properties
Nillable
Description
Relative URL of the top-level Lightning Experience or Salesforce mobile app page that the
user opened. The page can contain one or more Lightning components. Multiple record IDs
can be associated with PageUrl.
Example
/sObject/0064100000JXITSAA5/view
PreviousPageAppName Type
string
Properties
Nillable
Description
The internal name of the previous application that the user accessed from the App Launcher.
PreviousPageEntityId Type
reference
Properties
Nillable
Description
The unique previous page entity identifier of the event.
PreviousPageEntityType Type
string
Properties
Nillable
Description
The previous page entity type of the event.
PreviousPageUrl Type
url
Properties
Nillable
Description
The relative URL of the previous Lightning Experience or Salesforce mobile app page that
the user opened.
399
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Example
/sObject/006410000
QueriedEntities Type
string
Properties
Nillable
Description
The API name of the objects referenced by the URI.
RecordId Type
reference
Properties
Nillable
Description
The id of the record being viewed or edited. For example, 001RM000003cjx6YAA.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event.
SdkAppType Type
string
Properties
Nillable
Description
The mobile SDK application type.
Possible Values
• HYBRID
• HYBRIDLOCAL
• HYBRIDREMOTE
• NATIVE
• REACTNATIVE
SdkAppVersion Type
string
400
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The version of the mobile SDK the application uses.
SdkVersion Type
string
Properties
Nillable
Description
The mobile SDK application version number.
Example
5.0
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
This low level isn’t available, or used, in the Salesforce UI. User sessions through the UI
are either standard or high assurance. You can set this level using the API, but users
assigned this level experience unpredictable and reduced functionality.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
SourceIp Type
string
401
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The source IP address of the client logging in. For example, 126.7.4.2.
UserAgent Type
string
Properties
Nillable
Description
The type of client used to make the request (for example, the browser, application, or API)
as a string. This field is available in API version 58.0 and later.
UserId Type
reference
Properties
Nillable
Description
The user’s unique ID. For example, 005RM000001ctYJYAY.
Username Type
string
Properties
Nillable
Description
The username in the format of [email protected] at the time the event was created.
UserType Type
picklist
Properties
Nillable, Restricted picklist
Description
The category of user license. Each UserType is associated with one or more UserLicense
records. Each UserLicense is associated with one or more profiles. Valid values are:
• CsnOnly—Users whose access to the application is limited to Chatter. This user type
includes Chatter Free and Chatter moderator users.
• CspLitePortal—CSP Lite Portal license. Users whose access is limited because
they’re organization customers, and they access the application through a customer
portal or Experience Cloud site.
• CustomerSuccess—Customer Success license. Users whose access is limited
because they’re organization customers and access the application through a customer
portal.
402
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Guest
• PowerCustomerSuccess—Power Customer Success license. Users whose access
is limited because they’re organization customers and access the application through a
customer portal. Users with this license type can view and edit data they directly own
or data owned by or shared with users below them in the customer portal role hierarchy.
• PowerPartner—Power Partner license. Users whose access is limited because they’re
partners and typically access the application through a partner portal or site.
• SelfService
• Standard—Standard user license. This user type also includes Salesforce Platform
and Salesforce Platform One user licenses.
• Filtered on EventDate—you can filter solely on EventDate, but single filters on other fields fail. You can also use a comparison
operator in this query type.
– Valid—you can filter solely on EventDate, but single filters on other fields fail. You can also use a comparison operator in
this query type.
SELECT EntityType, UserName, UserType
FROM LightningUriEvent
WHERE EventDate>=2014-11-27T14:54:16.000Z
403
Platform Events Developer Guide Standard Platform Event Objects
SEE ALSO:
UriEvent
Big Objects Implementation Guide
LightningUriEventStream
Detects when a user creates, accesses, updates, or deletes a record in Lightning Experience only. This object is available in API version
46.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/LightningUriEventStream
404
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
AppName Type
string
Properties
Nillable
Description
The name of the application that the user accessed.
ConnectionType Type
string
Properties
Nillable
Description
The type of connection.
Possible Values
• CDMA1x
• CDMA
• EDGE
• EVDO0
• EVDOA
• EVDOB
• GPRS
• HRPD
• HSDPA
• HSUPA
• LTE
• WIFI
DeviceId Type
string
Properties
Nillable
Description
The unique identifier used to identify a device when tracking events. DEVICE_ID is a
generated value that’s created when the mobile app is initially run after installation.
DeviceModel Type
string
405
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The name of the device model.
DevicePlatform Type
string
Properties
Nillable
Description
The type of application experience in name:experience:form format.
Possible Values
Name
• APP_BUILDER
• CUSTOM
• S1
• SFX
Experience
• BROWSER
• HYBRID
Form
• DESKTOP
• PHONE
• TABLET
DeviceSessionId Type
string
Properties
Nillable
Description
The unique identifier of the user’s session based on page load time. When the user reloads
a page, a new session is started.
Duration Type
double
Properties
Nillable
Description
The duration in milliseconds since the page start time.
406
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EffectivePageTime Type
double
Properties
Nillable
Description
Indicates how many milliseconds it took for the page to load before a user could interact
with the page’s functionality. Multiple factors can affect effective page time, such as network
speed, hardware performance, or page complexity.
EffectivePageTimeDeviationErrorType Type
string
Properties
Nillable
Description
Indicates the origin of an error. This field is populated when
EffectivePageTimeDeviationReason contains the PageHasError value. This field is
available in API version 58.0 and later.
Possible Values
• Custom—An error originating from the customer's system or network.
• System—An error originating in Salesforce.
EffectivePageTimeDeviationReason Type
string
Properties
Nillable
Description
The reason for deviation in page loading time. This field is available in API version 58.0 and
later.
Possible Values
• PageInDom—The page was loaded from a cache.
• PageHasError—An undefined page loading error occurred.
• PageNotLoaded—If a customer navigates away from a page while loading processes
are in progress, the page doesn't finish loading.
• PreviousPageNotLoaded—When navigating to a new page, and the previous
page hasn't completed loading, the next page is considered to have a deviation.
Incomplete loading processes on a previous page can affect how the next page loads.
• InteractionsBeforePageLoaded—A user interacts with a page element
before the page is fully loaded.
• PageInBackgroundBeforeLoaded—A background loading process runs on a
page. Background processes can run when users don't interact with a page, such as
when they navigate to another browser tab.
407
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventDate Type
dateTime
Properties
Nillable
Description
The time when the specified URI event was captured (after query execution takes place). For
example, 2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
HasEffectivePageTimeDeviation Type
boolean
Description
When a deviation is detected, EffectivePageTimeDeviation records true. The
default value is false.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring.For example,
8gHOMQu+xvjCmRUt
Operation Type
picklist
408
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable, Restricted picklist
Description
The operation being performed on the entity. For example, Read, Create, Update,
or Delete.
Create and update operations are captured in pairs; that is, expect two event records for
each operation. The first record represents the start of the operation, and the second record
represents whether the operation was successful or not.
If there isn’t a second event recorded for a create or update operation, then the user canceled
the operation, or the operation failed with client-side validation (for example, when a required
field is empty).
OsName Type
string
Properties
Nillable
Description
The operating system name.
OsVersion Type
string
Properties
Nillable
Description
The operating system version.
PageStartTime Type
dateTime
Properties
Nillable
Description
The time when the page was initially loaded, measured in milliseconds.
Example
1471564788642
PageUrl Type
url
Properties
Nillable
409
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Relative URL of the top-level Lightning Experience or Salesforce mobile app page that the
user opened. The page can contain one or more Lightning components. Multiple record IDs
can be associated with PageUrl.
Example
/sObject/0064100000JXITSAA5/view
PreviousPageAppName Type
string
Properties
Nillable
Description
The internal name of the previous application that the user accessed from the App Launcher.
PreviousPageEntityId Type
string
Properties
Nillable
Description
The unique previous page entity identifier of the event.
PreviousPageEntityType Type
string
Properties
Nillable
Description
The previous page entity type of the event.
PreviousPageUrl Type
url
Properties
Nillable
Description
The relative URL of the previous Lightning Experience or Salesforce mobile app page that
the user opened.
Example
/sObject/006410000
QueriedEntities Type
string
Properties
Nillable
410
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The API name of the objects referenced by the URI.
RecordId Type
string
Properties
Nillable
Description
The id of the record being viewed or edited. For example, 001RM000003cjx6YAA.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
SdkAppType Type
string
Properties
Nillable
Description
The mobile SDK application type.
Possible Values
• HYBRID
• HYBRIDLOCAL
• HYBRIDREMOTE
• NATIVE
• REACTNATIVE
411
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SdkAppVersion Type
string
Properties
Nillable
Description
The version of the mobile SDK the application uses.
SdkVersion Type
string
Properties
Nillable
Description
The mobile SDK application version number.
Example
5.0
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
This low level is not available, nor used, in the Salesforce UI. User sessions through the
UI are either standard or high assurance. You can set this level using the API, but users
assigned this level experience unpredictable and reduced functionality in their Salesforce
org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
412
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client logging in. For example, 126.7.4.2.
UserAgent Type
string
Properties
Nillable
Description
The type of client used to make the request (for example, the browser, application, or API)
as a string. This field is available in API version 58.0 and later.
UserId Type
reference
Properties
Nillable
Description
The user’s unique ID. For example, 005RM000001ctYJYAY.
Username Type
string
Properties
Nillable
Description
The username in the format of [email protected] at the time the event was created.
UserType Type
picklist
Properties
Nillable, Restricted picklist
Description
The category of user license. Each UserType is associated with one or more UserLicense
records. Each UserLicense is associated with one or more profiles. Valid values are:
• CsnOnly—Users whose access to the application is limited to Chatter. This user type
includes Chatter Free and Chatter moderator users.
• CspLitePortal—CSP Lite Portal license. Users whose access is limited because
they are organization customers and access the application through a customer portal
or an Experience Cloud site.
413
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• CustomerSuccess—Customer Success license. Users whose access is limited
because they are organization customers and access the application through a customer
portal.
• Guest
• PowerCustomerSuccess—Power Customer Success license. Users whose access
is limited because they are organization customers and access the application through
a customer portal. Users with this license type can view and edit data they directly own
or data owned by or shared with users below them in the customer portal role hierarchy.
• PowerPartner—Power Partner license. Users whose access is limited because they
are partners and typically access the application through a partner portal or site.
• SelfService
• Standard—Standard user license. This user type also includes Salesforce Platform
and Salesforce Platform One user licenses.
SEE ALSO:
UriEventStream
ListViewEvent
Tracks when users access data with list views using Lightning Experience, Salesforce Classic, or the API. It doesn’t track list views of Setup
entities. You can use ListViewEvent in a transaction security policy. ListViewEvent is a big object that stores the event data of
ListViewEventStream. This object is available in API version 46.0 and later.
Supported Calls
describeSObjects(), query()
Fields
Note: For some default list views (such as the list view that displays when a user clicks the Groups tab in Salesforce Classic), the
DeveloperName, ListViewId, and Name fields are blank because the list view wasn’t explicitly created by a user.
Field Details
AppName Type
string
Properties
Nillable
414
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The name of the application that the user accessed. Possible values include one:one
(browser) and native:bridge (mobile app).
ColumnHeaders Type
string
Properties
Nillable
Description
Comma-separated values of column headers of the list view. These values are the API names,
not the labels shown in the UI. For example, Name, BillingState, Phone,Type,
Owner.Alias, CaseNumber, Contact.Name, Subject, Status,
Priority, CreatedDate, Owner.NameOrAlias.
DeveloperName Type
string
Properties
Nillable
Description
The unique name of the object in the API. This name contains only underscores and
alphanumeric characters, and is unique in your org. If blank, the list view is a default list view
(such as the list view that displays when a user clicks the Groups tab in Salesforce Classic)
and not explicitly created by a user. For example, AllAccounts or AllOpenLeads.
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the transaction security policy, in milliseconds. This
field isn’t populated until all transaction security policies are processed for the real-time
event.
EventDate Type
dateTime
Properties
Filter, Sort
Description
The time when the specified list view event was captured. For example,
2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
415
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Filter, Sort
Description
The unique ID of the event. For example,
0a4779b0-0da1-4619-a373-0a36991dff90.
EventSource Type
string
Properties
Nillable, Restricted picklist
Description
The source of the event. Possible values are:
• API—The user generated the list view from an API call.
• Classic—The user generated the list view from a page in the Salesforce Classic UI.
• Lightning—The user generated the list view from a page in the Lightning Experience
UI.
ExecutionIdentifier Type
string
Properties
Nillable
Description
When list view execution data is divided into multiple list view events, use this unique
identifier to correlate the multiple data chunks. For example, each chunk might have the
same ExecutionIdentifier of a50a4025-84f2-425d-8af9-2c780869f3b5, enabling
you to link them together to get all the data for the list view execution. The Sequence
field contains the incremental sequence numbers that indicate the order of the multiple
events.
For more information, see Sequence.
FilterCriteria Type
json
Properties
Nillable
Description
A JSON string that represents the list view’s filter criteria at the time the event was captured.
Example
Here’s a JSON string that represents filter criteria for an accounts list view. The list view shows
only accounts of type “Prospect”.
{"whereCondition":
{"type":"soqlCondition","field":"Type",
416
Platform Events Developer Guide Standard Platform Event Objects
Field Details
"operator":"equals","values":["'Prospect'"]}
}
ListViewId Type
reference
Properties
Nillable
Description
The ID of the list view associated with this event. If blank, the list view is a default list view
(such as the list view that displays when a user clicks the Groups tab in Salesforce Classic)
and not explicitly created by a user. For example, 00BB0000001c73kMAA.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular series of list view
events. This field is also available in the LoginEvent, AuthSession, and LoginHistory objects,
making it easier to trace events back to a user’s original authentication. For example,
0YaB000002knVQLKA2.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
Name Type
string
Properties
Nillable
Description
The display name of the list view. If blank, the list view is a default list view (such as the list
view that displays when a user clicks the Groups tab in Salesforce Classic) and not explicitly
created by a user. For example, All Accounts and All Open Leads.
NumberOfColumns Type
int
417
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The number of columns in the list view.
OrderBy Type
string
Properties
Nillable
Description
The column that the list view is sorted by. For example, if a list view of accounts is sorted
alphabetically by name, the OrderBy value is [Name ASC NULLS FIRST, Id
ASC NULLS FIRST]. If the list is sorted alphabetically by type, the OrderBy value is
[Type ASC NULLS FIRST, Id ASC NULLS FIRST].
OwnerId Type
reference
Properties
Nillable
Description
The ID of the org or user who owns the list view. If the list view wasn’t saved, this value is
the same as UserId. For example, 005B0000001vURvIAM.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction security policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Block—The user was blocked from performing the operation that triggered the policy.
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
418
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• FailedInvalidPassword—The user entered an invalid password.
• FailedPasswordLockout—The user entered an invalid password too many
times.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
• TwoFAAutomatedSuccess—Salesforce Authenticator approved the request for
access because the request came from a trusted location. After users enable location
services in Salesforce Authenticator, they can designate trusted locations. When a user
trusts a location for a particular activity, such as logging in from a recognized device,
that activity is approved from the trusted location for as long as the location is trusted.
• TwoFADenied—The user denied the approval request in the authenticator app, such
as Salesforce Authenticator.
• TwoFAFailedGeneralError—An error caused by something other than an
invalid verification code, too many verification attempts, or authenticator app connectivity.
• TwoFAFailedInvalidCode—The user provided an invalid verification code.
• TwoFAFailedTooManyAttempts—The user attempted to verify identity too
many times. For example, the user entered an invalid verification code repeatedly.
• TwoFAInitiated—Salesforce initiated identity verification but hasn’t yet challenged
the user.
• TwoFAInProgress—Salesforce challenged the user to verify identity and is waiting
for the user to respond or for Salesforce Authenticator to send an automated response.
• TwoFANoAction—The policy specifies multi-factor authentication (formerly called
two-factor authentication) as an action, but the user is already in a high-assurance session.
• TwoFARecoverableError—Salesforce can’t reach the authenticator app to verify
identity, but will retry.
• TwoFAReportedDenied—The user denied the approval request in the authenticator
app, such as Salesforce Authenticator, and also flagged the approval request to report
to an administrator.
• TwoFASucceeded—The user’s identity was verified.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
QueriedEntities Type
string
Properties
Nillable
419
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The type of entities in the list view. For example, Opportunity, Lead, Account,
or Case. Can also include custom objects.
Records Type
json
Properties
Nillable
Description
A JSON string that represents the list view’s data. For example,
{"totalSize":1,"rows":[{"datacells":["005B0000001vURv","001B000000fewai"]}]}.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
RowsProcessed Type
double
Properties
Nillable
Description
The total number of rows returned in the list view. When list data is divided into multiple list
view events, this value is the same for all data chunks.
Scope Type
string
Properties
Nillable
Description
Represents the filter criteria for the list view. Possible values are:
• Delegated—Records delegated to another user for action; for example, a delegated
task.
420
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Everything—All records, for example All Opportunities.
• Mine—Records owned by the user running the list view, for example My Opportunities.
• MineAndMyGroups—Records owned by the user running the list view, and records
assigned to the user’s queues.
• MyTerritory—Records in the territory of the user seeing the list view. This option
is available if territory management is enabled for your org.
• MyTeamTerritory—Records in the territory of the team of the user seeing the list
view. This option is available if territory management is enabled for your org.
• Queue—Records assigned to a queue.
• Team—Records assigned to a team.
Sequence Type
int
Properties
Nillable
Description
Incremental sequence number that indicates the order of multiple events that result from
a given list view execution.
When a list view execution returns many records, Salesforce splits this data into chunks based
on the size of the records, and then creates multiple correlated ListViewEvents. The field
values in each of these correlated ListViewEvents are the same, except for Records, which
contains the different data chunks, and Sequence, which identifies each chunk in order.
Every list view execution has a unique ExecutionIdentifier value to differentiate
it from other list view executions. To view all the data chunks from a single list view execution,
use the Sequence and ExecutionIdentifier fields in combination.
For more information, ExecutionIdentifier.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
421
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
Note: This low level is not available, nor used, in the Salesforce UI. User sessions
through the UI are either standard or high assurance. You can set this level using
the API, but users assigned this level will experience unpredictable and reduced
functionality in their Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
UserId Type
reference
Properties
Nillable
Description
The user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Nillable
Description
The username in the format of [email protected] at the time the event was created.
422
Platform Events Developer Guide Standard Platform Event Objects
Example: Find all list views that users ran against Patent__c
SELECT EventDate, EventIdentifier, PolicyOutcome, EvaluationTime, ListViewId, Name FROM
ListViewEvent WHERE QueriedEntities='Patent__c'
SEE ALSO:
Big Objects Implementation Guide
ListViewEventStream
Tracks actions related to list views in Lightning Experience, Salesforce Classic, or the API. For example, the event captures when a user
runs or exports a list view. It doesn’t capture list view events of Setup entities. This object is available in API version 46.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/ListViewEventStream
Fields
Note: For some default list views (such as the list view that displays when a user clicks the Groups tab in Salesforce Classic), the
DeveloperName, ListViewId, and Name fields are blank because the list view wasn’t explicitly created by a user.
423
Platform Events Developer Guide Standard Platform Event Objects
Field Details
AppName Type
string
Properties
Nillable
Description
The name of the application that the user accessed. Possible values include one:one
(browser) and native:bridge (mobile app).
ColumnHeaders Type
string
Properties
Nillable
Description
Comma-separated values of column headers of the list view. These values are the API names,
not the labels shown in the UI. For example, Name, BillingState, Phone,Type,
Owner.Alias, CaseNumber, Contact.Name, Subject, Status,
Priority, CreatedDate, Owner.NameOrAlias.
DeveloperName Type
string
Properties
Nillable
Description
The unique name of the object in the API. This name contains only underscores and
alphanumeric characters, and is unique in your org. If blank, the list view is a default list view
(such as the list view that displays when a user clicks the Groups tab in Salesforce Classic)
and not explicitly created by a user. For example, AllAccounts or AllOpenLeads.
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the transaction security policy, in milliseconds. This
field isn’t populated until all transaction security policies are processed for the real-time
event.
EventDate Type
dateTime
Properties
Filter, Sort
424
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The time when the specified list view event was captured. For example,
2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
EventSource Type
string
Properties
Nillable, Restricted picklist
Description
The source of the event. Possible values are:
• API—The user generated the list view from an API call.
• Classic—The user generated the list view from a page in the Salesforce Classic UI.
• Lightning—The user generated the list view from a page in the Lightning Experience
UI.
ExecutionIdentifier Type
string
Properties
Nillable
Description
When list view execution data is divided into multiple list view events, use this unique
identifier to correlate the multiple data chunks. For example, each chunk might have the
same ExecutionIdentifier of a50a4025-84f2-425d-8af9-2c780869f3b5, enabling
you to link them together to get all the data for the list view execution. The Sequence
425
Platform Events Developer Guide Standard Platform Event Objects
Field Details
field contains the incremental sequence numbers that indicate the order of the multiple
events.
For more information, see Sequence.
FilterCriteria Type
json
Properties
Nillable
Description
A JSON string that represents the list view’s filter criteria at the time the event was captured.
Example
Here’s a JSON string that represents filter criteria for an accounts list view. The list view shows
only accounts of type “Prospect”.
{"whereCondition":
{"type":"soqlCondition","field":"Type",
"operator":"equals","values":["'Prospect'"]}
}
ListViewId Type
reference
Properties
Nillable
Description
The ID of the list view associated with this event. If blank, the list view is a default list view
(such as the list view that displays when a user clicks the Groups tab in Salesforce Classic)
and not explicitly created by a user. For example, 00BB0000001c73kMAA.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular series of list view
events. This field is also available in the LoginEvent, AuthSession, and LoginHistory objects,
making it easier to trace events back to a user’s original authentication. For example,
0YaB000002knVQLKA2.
LoginKey Type
string
Properties
Nillable
426
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
Name Type
string
Properties
Nillable
Description
The display name of the list view. If blank, the list view is a default list view (such as the list
view that displays when a user clicks the Groups tab in Salesforce Classic) and not explicitly
created by a user. For example, All Accounts and All Open Leads.
NumberOfColumns Type
int
Properties
Nillable
Description
The number of columns in the list view.
OrderBy Type
string
Properties
Nillable
Description
The column that the list view is sorted by. For example, if a list view of accounts is sorted
alphabetically by name, the OrderBy value is [Name ASC NULLS FIRST, Id
ASC NULLS FIRST]. If the list is sorted alphabetically by type, the OrderBy value is
[Type ASC NULLS FIRST, Id ASC NULLS FIRST].
OwnerId Type
reference
Properties
Nillable
Description
The ID of the org or user who owns the list view. If the list view wasn’t saved, this value is
the same as UserId. For example, 005B0000001vURvIAM.
PolicyId Type
reference
427
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The ID of the transaction security policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Block—The user was blocked from performing the operation that triggered the policy.
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• FailedInvalidPassword—The user entered an invalid password.
• FailedPasswordLockout—The user entered an invalid password too many
times.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
• TwoFAAutomatedSuccess—Salesforce Authenticator approved the request for
access because the request came from a trusted location. After users enable location
services in Salesforce Authenticator, they can designate trusted locations. When a user
trusts a location for a particular activity, such as logging in from a recognized device,
that activity is approved from the trusted location for as long as the location is trusted.
• TwoFADenied—The user denied the approval request in the authenticator app, such
as Salesforce Authenticator.
• TwoFAFailedGeneralError—An error caused by something other than an
invalid verification code, too many verification attempts, or authenticator app connectivity.
• TwoFAFailedInvalidCode—The user provided an invalid verification code.
• TwoFAFailedTooManyAttempts—The user attempted to verify identity too
many times. For example, the user entered an invalid verification code repeatedly.
• TwoFAInitiated—Salesforce initiated identity verification but hasn’t yet challenged
the user.
• TwoFAInProgress—Salesforce challenged the user to verify identity and is waiting
for the user to respond or for Salesforce Authenticator to send an automated response.
428
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• TwoFANoAction—The policy specifies multi-factor authentication (formerly called
two-factor authentication) as an action, but the user is already in a high-assurance session.
• TwoFARecoverableError—Salesforce can’t reach the authenticator app to verify
identity, but will retry.
• TwoFAReportedDenied—The user denied the approval request in the authenticator
app, such as Salesforce Authenticator, and also flagged the approval request to report
to an administrator.
• TwoFASucceeded—The user’s identity was verified.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
QueriedEntities Type
string
Properties
Nillable
Description
The type of entities in the list view. For example, Opportunity, Lead, Account,
or Case. Can also include custom objects.
Records Type
json
Properties
Nillable
Description
A JSON string that represents the list view’s data. For example,
{"totalSize":1,"rows":[{"datacells":["005B0000001vURv","001B000000fewai"]}]}.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
ReplayId Type
string
429
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
RowsProcessed Type
double
Properties
Nillable
Description
The total number of rows returned in the list view. When list data is divided into multiple list
view events, this value is the same for all data chunks.
Scope Type
string
Properties
Nillable
Description
Represents the filter criteria for the list view. Possible values are:
• Delegated—Records delegated to another user for action; for example, a delegated
task.
• Everything—All records, for example All Opportunities.
• Mine—Records owned by the user running the list view, for example My Opportunities.
• MineAndMyGroups—Records owned by the user running the list view, and records
assigned to the user’s queues.
• MyTerritory—Records in the territory of the user seeing the list view. This option
is available if territory management is enabled for your org.
• MyTeamTerritory—Records in the territory of the team of the user seeing the list
view. This option is available if territory management is enabled for your org.
• Queue—Records assigned to a queue.
• Team—Records assigned to a team.
Sequence Type
int
Properties
Nillable
Description
Incremental sequence number that indicates the order of multiple events that result from
a given list view execution.
430
Platform Events Developer Guide Standard Platform Event Objects
Field Details
When a list view execution returns many records, Salesforce splits this data into chunks based
on the size of the records, and then creates multiple correlated ListViewEventStreams. The
field values in each of these correlated ListViewEventStreams are the same, except for
Records, which contains the different data chunks, and Sequence, which identifies
each chunk in order. Every list view execution has a unique ExecutionIdentifier
value to differentiate it from other list view executions. To view all the data chunks from a
single list view execution, use the Sequence and ExecutionIdentifier fields in
combination.
For more information, see ExecutionIdentifier.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
Note: This low level is not available, nor used, in the Salesforce UI. User sessions
through the UI are either standard or high assurance. You can set this level using
the API, but users assigned this level will experience unpredictable and reduced
functionality in their Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
431
Platform Events Developer Guide Standard Platform Event Objects
Field Details
UserId Type
reference
Properties
Nillable
Description
The user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Nillable
Description
The username in the format of [email protected] at the time the event was created.
LoginAsEvent
LoginAsEvent tracks when an admin logs in as another user in your org. In Real-Time Event Monitoring, it captures events for org admins
and Experience Cloud sites only. LoginAsEvent is a big object that stores the event data of LoginAsEventStream. This object is available
in API version 46.0 and later.
Supported Calls
describeSObjects(), query()
Fields
Field Details
Application Type
string
Properties
Nillable
Description
The application name in English. For example, Salesforce Internal Application, or Microsoft SOAP
Toolkit.
Browser Type
string
432
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The browser name and version if known. Possible values for the browser name are:
• Chrome
• Firefox
• Safari
• Unknown
For example, “Chrome 77”.
DelegatedOrganizationId Type
string
Properties
Nillable
Description
Organization Id of the admin who performs logs in as another user. For example, 00Dxx0000001gEH
DelegatedUsername Type
string
Properties
Nillable
Description
Username of the admin who logs in as another user. For example, [email protected]
EventDate Type
dateTime
Properties
Filter, Sort
Description
The time and date of the event. For example, 2020-01-20T19:12:26.965Z. Milliseconds
are the most granular setting.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique identifier for each record in LoginAsEvent. Use this field as the primary key in your
queries.
433
Platform Events Developer Guide Standard Platform Event Objects
Field Details
LoginAsCategory Type
picklist
Properties
Nillable, Restricted picklist
Description
Represents how the user logs in as another user. Possible values are:
• OrgAdmin—An administrator logs in to Salesforce as an individual user. Depending on your
org settings, the individual user grants login access to the administrator.
• Community—A user who has been granted access to a Salesforce Experience Cloud site logs
in.
LoginHistoryId Type
reference
Properties
Nillable
Description
The ID from the LoginHistory entity associated with this login event. Tracks a user session so you
can correlate user activity with a particular login instance. For example, 0Yaxx0000000019.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with a login
event and ends with either a logout event or the user session expiring. For example,
8gHOMQu+xvjCmRUt.
LoginType Type
picklist
Properties
Nillable, Restricted picklist
Description
The event’s type of login. For example, “Application.”
Platform Type
string
Properties
Nillable
Description
The platform name and version that are used during the login event. If no platform name is available,
“Unknown” is returned. Platform names are in English. For example, “Mac OSX”.
434
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When a user
logs out and logs in again, a new session is started. For LoginAsEvent, this field is usually null because
the event is captured before a session is created.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps and
reporting. Possible values are:
• HIGH_ASSURANCE - A high assurance session was used for resource access. For example, when
the user tries to access a resource such as a connected app, report, or dashboard that requires
a high-assurance session level.
• LOW - The user’s security level for the current session meets the lowest requirements.
Note: This low level is available, nor used, in the Salesforce UI. User sessions through
the UI are either standard or high assurance. You can set this level using the API, but
users assigned this level experience unpredictable and reduced functionality in their
Salesforce org.
• STANDARD - The user’s security level for the current session meets the Standard requirements
set in the current organization Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client logging in. For example, 126.7.4.2.
TargetUrl Type
string
Properties
Nillable
Description
The URL redirected to after logging in as another user succeeds.
435
Platform Events Developer Guide Standard Platform Event Objects
Field Details
UserId Type
reference
Properties
Nillable
Description
Unique ID that identifies the user who is being logged in as by the admin. For example,
005000000000123.
Username Type
string
Properties
Nillable
Description
Username of the user who is being logged in as by the admin, in the format of
[email protected].
UserType Type
picklist
Properties
Nillable, Restricted picklist
Description
The category of user license of the user who is being logged in as by the admin. Each UserType
is associated with one or more UserLicense records. Each UserLicense is associated with one or
more profiles. Valid values are:
• CsnOnly—Users whose access to the application is limited to Chatter. This user type includes
Chatter Free and Chatter moderator users.
• CspLitePortal—CSP Lite Portal license. Users whose access is limited because they’re
organization customers and access the application through a customer portal or an Experience
Cloud site.
• CustomerSuccess—Customer Success license. Users whose access is limited because
they’re organization customers and access the application through a customer portal.
• Guest—Users whose access is limited so that your customers can view and interact with your
site without logging in.
• PowerCustomerSuccess—Power Customer Success license. Users whose access is
limited because they’re organization customers and access the application through a customer
portal. Users with this license type can view and edit data they directly own or data owned by
or shared with users below them in the customer portal role hierarchy.
• PowerPartner—Power Partner license. Users whose access is limited because they’re
partners and typically access the application through a partner portal or site.
• SelfService—Users whose access is limited because they’re organization customers and
access the application through a self-service portal.
436
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Standard—Standard user license. This user type also includes Salesforce Platform and
Salesforce Platform One user licenses, and admins for this org.
Note: Date functions such as convertTimezone() aren’t supported. For example, SELECT
CALENDAR_YEAR(EventDate), Count(EventIdentifier) FROM LoginAsEvent GROUP BY
CALENDAR_YEAR(EventDate) returns an error. You can use date literals in your queries and some date and date/time
functions like TODAY, YESTERDAY, and LAST_n_DAYS:1. However, these functions use comparison operators behind the
scenes. This means you can only use them in the final expression of a WHERE clause.
LoginAsEvent allows filtering over two ordered fields: EventDate and EventIdentifier. There’s a catch here; your query
doesn’t work unless you use the correct order and combination of these fields. The following list provides some examples of valid and
invalid queries:
• Unfiltered
– Valid—Contains no WHERE clause, so no special rules apply.
SELECT Application, Browser, EventDate, EventIdentifier, LoginHistoryId, UserId
FROM LoginAsEvent
• Filtered on EventDate
– Valid—You can filter solely on EventDate, but single filters on other fields fail. You can also use a comparison operator in
this query type.
SELECT Application, Browser, EventDate, EventIdentifier, LoginHistoryId, UserId
FROM LoginAsEvent
WHERE EventDate<=2014-11-27T14:54:16.000Z
437
Platform Events Developer Guide Standard Platform Event Objects
– Invalid—Filtering only on EventDate with <= or >= operator and EventIdentifier field isn’t supported.
SELECT Application, Browser, EventDate, EventIdentifier, LoginHistoryId, UserId
FROM LoginAsEvent
WHERE EventDate<=2014-11-27T14:54:16.000Z and
EventIdentifier='f0b28782-1ec2-424c-8d37-8f783e0a3754'
SEE ALSO:
Big Objects Implementation Guide
LoginAsEventStream
LoginAsEvent tracks when an admin logs in as another user in your org. In Real-Time Event Monitoring, it captures events for org admins
and Experience Cloud site only. This object is available in API version 46.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/LoginAsEventStream
438
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
Application Type
string
Properties
Nillable
Description
The application name in English. For example, Salesforce Internal Application, or Microsoft SOAP
Toolkit.
Browser Type
string
Properties
Nillable
Description
The browser name and version if known. Possible values for the browser name are:
• Chrome
• Firefox
• Safari
• Unknown
For example, “Chrome 77”.
DelegatedOrganizationId Type
string
Properties
Nillable
Description
Organization Id of the user who is logging in as another user. For example, 00Dxx0000001gEH
DelegatedUsername Type
string
Properties
Nillable
439
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Username of the admin who is logging in as another user. For example, [email protected]
EventDate Type
dateTime
Properties
Filter, Sort
Description
The time and date of the event. For example, 2020-01-20T19:12:26.965Z. Milliseconds
are the most granular setting.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique ID of the event, which is shared with the corresponding storage object. For example,
0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate the event with
its storage object. Also, use this field as the primary key in your queries.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is available
in API version 52.0 and later.
LoginAsCategory Type
picklist
Properties
Nillable, Restricted picklist
Description
Represents how the user logs in as another user. Possible values are:
• OrgAdmin—An administrator logs in to Salesforce as an individual user. Depending on your
org settings, the individual user grants login access to the administrator.
• Community—A user who has been granted access to a Salesforce Experience Cloud site logs
in.
LoginHistoryId Type
reference
440
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular login instance. The ID from
the LoginHistory entity associated with this login event. For example, 0Yaxx0000000019.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with a login
event and ends with either a logout event or the user session expiring. For example,
8gHOMQu+xvjCmRUt.
LoginType Type
picklist
Properties
Nillable, Restricted picklist
Description
The type of login used to access the session. See the LoginType field of LoginHistory in the Object
Reference guide for the list of possible values.
Platform Type
string
Properties
Nillable
Description
The platform name and version that are used during the login event. If no platform name is available,
“Unknown” is returned. Platform names are in English. For example, “Mac OSX”.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event in
the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive events. A
subscriber can store a replay ID value and use it on resubscription to retrieve missed events that
are within the retention window.
SessionKey Type
string
441
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When a user
logs out and logs in again, a new session is started. For LoginAsEvent, this field is usually null because
the event is captured before a session is created.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps and
reporting. Possible values are:
• HIGH_ASSURANCE - A high assurance session was used for resource access. For example, when
the user tries to access a resource such as a connected app, report, or dashboard that requires
a high-assurance session level.
• LOW - The user’s security level for the current session meets the lowest requirements.
Note: This low level is not available, nor used, in the Salesforce UI. User sessions through
the UI are either standard or high assurance. You can set this level using the API, but
users assigned this level experience unpredictable and reduced functionality in their
Salesforce org.
• STANDARD - The user’s security level for the current session meets the Standard requirements
set in the current organization Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client logging in. For example, 126.7.4.2.
TargetUrl Type
string
Properties
Nillable
Description
The URL redirected to after logging in as another user succeeds.
UserId Type
reference
442
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Unique ID that identifies the user who is being logged in as by the admin. For example,
005000000000123.
Username Type
string
Properties
Nillable
Description
Username of the user who is being logged in as by the admin, in the format of
[email protected].
UserType Type
picklist
Properties
Nillable, Restricted picklist
Description
The category of user license of the user who is being logged in as by the admin. Each UserType
is associated with one or more UserLicense records. Each UserLicense is associated with one or
more profiles. Valid values:
• CsnOnly—Users whose access to the application is limited to Chatter. This user type includes
Chatter Free and Chatter moderator users.
• CspLitePortal—CSP Lite Portal license. Users whose access is limited because they’re organization
customers and access the application through a customer portal or an Experience Cloud site.
• CustomerSuccess—Customer Success license. Users whose access is limited because they’re
organization customers and access the application through a customer portal.
• Guest
• PowerCustomerSuccess—Power Customer Success license. Users whose access is limited
because they’reare organization customers and access the application through a customer
portal. Users with this license type can view and edit data they directly own or data owned by
or shared with users below them in the customer portal role hierarchy.
• PowerPartner—Power Partner license. Users whose access is limited because they’re partners
and typically access the application through a partner portal or site.
• SelfService
• Standard—Standard user license. This user type also includes Salesforce Platform and Salesforce
Platform One user licenses, and admins for this org.
443
Platform Events Developer Guide Standard Platform Event Objects
LoginEvent
LoginEvent tracks the login activity of users who log in to Salesforce. You can use LoginEvent in a transaction security policy. LoginEvent
is a big object that stores the event data of LoginEventStream. This object is available in API version 36.0 and later.
Supported Calls
describeSObjects(), query()
Note: LoginEvent doesn't track login activity after login rates exceed the limit. This condition applies to all users, including
integration users and internal users who log in to Salesforce.
Fields
Field Details
AdditionalInfo Type
string
Properties
Nillable
Description
JSON serialization of additional information that’s captured from the HTTP headers during a login
request. For example, {"field1": "value1","field2": "value2"}.
See Working with AdditionalInfo on page 454.
ApiType Type
string
Properties
Nillable
Description
The type of API that’s used to log in. Values include:
• SOAP Enterprise
• SOAP Partner
• REST API
ApiVersion Type
string
Properties
Nillable
Description
The version number of the API. If no version number is available, “Unknown” is returned.
444
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Application Type
string
Properties
Nillable
Description
The application used to access the org. Possible values include:
• AppExchange
• Browser
• Salesforce for iOS
• Salesforce Developers API Explorer
• N/A
AuthMethodReference Type
string
Properties
Nillable
Description
The authentication method used by a third-party identification provider for an OpenID Connect
single sign-on protocol. This field is available in API version 51.0 and later.
AuthServiceId Type
reference
Properties
Nillable
Description
The 18-character ID for an authentication service for a login event. For example, you can use this
field to identify the SAML or authentication provider configuration with which the user logged in.
Browser Type
string
Properties
Nillable
Description
The browser name and version if known. Possible values for the browser name are:
• Chrome
• Firefox
• Safari
• Unknown
For example, “Chrome 77”.
445
Platform Events Developer Guide Standard Platform Event Objects
Field Details
CipherSuite Type
picklist
Properties
Nillable, Restricted picklist
Description
The TLS cipher suite used for the login. Values are OpenSSL-style cipher suite names, with hyphen
delimiters, for example, ECDHE-RSA-AES256-GCM-SHA384. Available in API version 37.0
and later.
City Type
string
Properties
Nillable
Description
The city where the user’s IP address is physically located. This value isn’t localized. This field is
available in API version 47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
ClientVersion Type
string
Properties
Nillable
Description
The version number of the login client. If no version number is available, “Unknown” is returned.
Country Type
string
Properties
Nillable
Description
The country where the user’s IP address is physically located. This value isn’t localized.This field is
available in API version 47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
CountryIso Type
string
Properties
Nillable
Description
The ISO 3166 code for the country where the user’s IP address is physically located. For more
information, see Country Codes - ISO 3166. This field is available in API version 37.0 and later.
446
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the transaction security policy, in milliseconds. This field is
available in API version 46.0 and later.
EventDate Type
dateTime
Properties
Filter, Sort
Description
The login time of the specified event. For example, 2020-01-20T19:12:26.965Z.
Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique identifier for each record in LoginEvent. Use this field as the primary key in your queries.
Available in API version 42.0 and later.
ForwardedForIp Type
string
Properties
Filter, Group, Nillable, Sort
Description
The value in the X-Forwarded-For header of HTTP requests sent by the client. For logins that
use one or more HTTP proxies, the X-Forwarded-For header is sometimes used to store the
origin IP and all proxy IPs.
The ForwardedForIp field stores whatever value the client sends, which might not be an IP
address. The maximum length is 256 characters. Longer values are truncated. The
ForwardedForIp field isn’t populated for logins completed via OAuth flows or single sign-on
(SSO).
Available in API version 61.0 and later.
HttpMethod Type
picklist
Properties
Nillable, Restricted picklist
447
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The HTTP method of the login request; possible values are GET, POST, and Unknown.
LoginGeoId Type
reference
Properties
Nillable
Description
The Salesforce ID of the LoginGeo object associated with the login user’s IP address. For example,
04FB000001TvhiPMAR.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular login instance. This field is
also available on the LoginHistory, AuthSession, and other objects, making it easier to trace events
back to a user’s original authentication. For example, 0YaB000002knVQLKA2.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with a login
event and ends with either a logout event or the user session expiring. This field is available in API
version 46.0 and later. For example, lUqjLPQTWRdvRG4.
LoginLatitude Type
double
Properties
Nillable
Description
The latitude where the user’s IP address is physically located.This field is available in API version
47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
LoginLongitude Type
double
Properties
Nillable
448
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The longitude where the user’s IP address is physically located.This field is available in API version
47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
LoginSubType Type
picklist
Properties
Nillable, Restricted picklist,
Description
The type of login flow used. See the LoginSubType field of LoginHistory in the Object Reference
guide for the list of possible values.
Label is Login Subtype.
LoginType Type
picklist
Properties
Nillable, Restricted picklist
Description
The type of login used to access the session. See the LoginType field of LoginHistory in the Object
Reference guide for the list of possible values.
LoginUrl Type
string
Properties
Nillable
Description
The URL of the login host from which the request is coming. For example,
yourInstance.salesforce.com.
NetworkId Type
reference
Properties
Nillable
Description
The ID of the Experience Cloud site that the user is logging in to. This field is available if Salesforce
Experience Cloud is enabled for your organization.
Platform Type
string
449
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The operating system name and version that are used during the login event. If no platform name
is available, “Unknown” is returned. For example, Mac OSX or iOS/Mac.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction security policy associated with this event. This field is available in API
version 46.0 and later. For example, 0NIB000000000KOOAY.
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Block—The user was blocked from performing the operation that triggered the policy.
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the policy
didn’t trigger.
• FailedInvalidPassword—The user entered an invalid password.
• FailedPasswordLockout—The user entered an invalid password too many times.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was blocked
from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the user isn't
blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
• TwoFAAutomatedSuccess—Salesforce Authenticator approved the request for access
because the request came from a trusted location. After users enable location services in
Salesforce Authenticator, they can designate trusted locations. When a user trusts a location
for a particular activity, that activity is approved from the trusted location for as long as the
location is trusted. An example of a particular activity is logging in from a recognized device.
• TwoFADenied—The user denied the approval request in the authenticator app, such as
Salesforce Authenticator.
• TwoFAFailedGeneralError—An error caused by something other than an invalid
verification code, too many verification attempts, or authenticator app connectivity.
450
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• TwoFAFailedInvalidCode—The user provided an invalid verification code.
• TwoFAFailedTooManyAttempts—The user attempted to verify identity too many
times. For example, the user entered an invalid verification code repeatedly.
• TwoFAInitiated—Salesforce initiated identity verification but hasn’t yet challenged the
user.
• TwoFAInProgress—Salesforce challenged the user to verify identity and is waiting for
the user to respond or for Salesforce Authenticator to send an automated response.
• TwoFANoAction—The policy specifies multi-factor authentication (formerly called two-factor
authentication) as an action, but the user is already in a high-assurance session.
• TwoFARecoverableError—Salesforce can’t reach the authenticator app to verify identity,
but will retry.
• TwoFAReportedDenied—The user denied the approval request in the authenticator app,
such as Salesforce Authenticator, and also flagged the approval request to report to an
administrator.
• TwoFASucceeded—The user’s identity was verified.
This field is available in API version 46.0 and later.
PostalCode Type
string
Properties
Nillable
Description
The postal code where the user’s IP address is physically located. This value isn’t localized.This field
is available in API version 47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra authentication,
such as multi-factor authentication. In this case, Salesforce generates more events and sets the
RelatedEventIdentifier field of the new events to the value of the EventIdentifier
field of the original event. Use this field with the EventIdentifier field to correlate all the
related events. If no extra authentication is required, this field is blank.
RemoteIdentifier Type
string
451
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Reserved for future use.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When a user
logs out and logs in again, a new session is started. For LoginEvent, this field is often null because
the event is captured before a session is created. For example, vMASKIU6AxEr+Op5. This field is
available in API version 46.0 and later.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps and
reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For example,
when the user tries to access a resource such as a connected app, report, or dashboard that
requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
Note: This low level isn’t available, nor used, in the Salesforce UI. User sessions through
the UI are either standard or high assurance. You can set this level using the API, but
users assigned this level experience unpredictable and reduced functionality in their
Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard requirements
set in the org’s Session Security Levels.
This field is available in API version 42.0 and later.
SourceIp Type
string
Properties
Nillable
Description
The IP address of the incoming client request that first reaches Salesforce during a login. For example,
126.7.4.2. For clients that redirect through one or more HTTP proxies, this field stores the IP
452
Platform Events Developer Guide Standard Platform Event Objects
Field Details
address of the first proxy to reach Salesforce. To better identify the origin IP for these cases, check
the ForwardedForIp field instead.
Status Type
string
Properties
Nillable
Description
Displays the status of the attempted login. Status is either success or a reason for failure.
Subdivision Type
string
Properties
Nillable
Description
The name of the subdivision where the user’s IP address is physically located. In the U.S., this value
is usually the state name (for example, Pennsylvania). This value isn’t localized.This field is available
in API version 47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
TlsProtocol Type
picklist
Properties
Nillable, Restricted picklist
Description
The TLS protocol version used for the login. Available in API version 37.0 and later. Valid values are:
• TLS 1.0
• TLS 1.1
• TLS 1.2
• TLS 1.3
• Unknown
UserId Type
reference
Properties
Nillable
Description
The user’s unique ID. For example, 005000000000123.
Username Type
string
453
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The username in the format of [email protected].
UserType Type
picklist
Properties
Nillable, Restricted picklist
Description
The category of user license. Each UserType is associated with one or more UserLicense records.
Each UserLicense is associated with one or more profiles. Valid values are:
• CsnOnly—Users whose access to the application is limited to Chatter. This user type includes
Chatter Free and Chatter moderator users.
• CspLitePortal—CSP Lite Portal license. Users whose access is limited because they’re
organization customers and access the application through a customer portal or Experience
Cloud site.
• CustomerSuccess—Customer Success license. Users whose access is limited because
they’re organization customers and access the application through a customer portal.
• Guest
• PowerCustomerSuccess—Power Customer Success license. Users whose access is
limited because they’re organization customers and access the application through a customer
portal. Users with this license type can view and edit data they directly own or data owned by
or shared with users below them in the customer portal role hierarchy.
• PowerPartner—Power Partner license. Users whose access is limited because they’re
partners and typically access the application through a partner portal or site.
• SelfService
• Standard—Standard user license. This user type also includes Salesforce Platform and
Salesforce Platform One user licenses.
This field is available only in the Real-Time Event Monitoring in API version 42.0 and later.
454
Platform Events Developer Guide Standard Platform Event Objects
455
Platform Events Developer Guide Standard Platform Event Objects
}
// Set the username and password if your proxy must be authenticated
9
LoginEvent
config.setProxyUsername(proxyUsername);
config.setProxyPassword(proxyPassword);
try {
EnterpriseConnection connection = new EnterpriseConnection(config);
// etc.
} catch (ConnectionException ce) {
ce.printStackTrace();
}
Note: Date functions such as convertTimezone() aren’t supported. For example, SELECT
CALENDAR_YEAR(EventDate), Count(EventIdentifier) FROM LoginEvent GROUP BY
CALENDAR_YEAR(EventDate) returns an error. You can use date literals in your queries and some date and date/time
functions like TODAY, YESTERDAY, and LAST_n_DAYS:1. However, these functions use comparison operators behind the
scenes, which means you can only use them in the final expression of a WHERE clause.
LoginEvent allows filtering over two ordered fields: EventDate and EventIdentifier. There’s a catch here; your query doesn’t
work unless you use the correct order and combination of these fields. The following list provides some examples of valid and invalid
queries:
• Unfiltered
– Valid—Contains no WHERE clause, so no special rules apply.
SELECT Application, Browser, EventDate, EventIdentifier, LoginUrl, UserId
FROM LoginEvent
• Filtered on EventDate
– Valid—You can filter solely on EventDate, but single filters on other fields fail. You can also use a comparison operator in
this query type.
SELECT Application, Browser, EventDate, EventIdentifier, LoginUrl, UserId
FROM LoginEvent
WHERE EventDate<=2014-11-27T14:54:16.000Z
456
Platform Events Developer Guide Standard Platform Event Objects
– Invalid—Filtering only on EventDate with <= or >= operator and EventIdentifier field isn’t supported.
SELECT Application, Browser, EventDate, EventIdentifier, LoginUrl, UserId
FROM LoginEvent
WHERE EventDate<=2014-11-27T14:54:16.000Z and
EventIdentifier='f0b28782-1ec2-424c-8d37-8f783e0a3754'
SEE ALSO:
LoginEventStream
Big Objects Implementation Guide
LoginEventStream
LoginEventStream tracks login activity of users who log in to Salesforce. This object is available in API version 46.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
457
Platform Events Developer Guide Standard Platform Event Objects
Subscription Channel
/event/LoginEventStream
Fields
Field Details
AdditionalInfo Type
string
Properties
Nillable
Description
JSON serialization of additional information that’s captured from the HTTP headers during a login
request. For example, {"field1": "value1","field2": "value2"}.
ApiType Type
string
Properties
Nillable
Description
The type of API that’s used to log in. Values include:
• SOAP Enterprise
• SOAP Partner
• REST API
ApiVersion Type
string
Properties
Nillable
Description
The version number of the API. If no version number is available, “Unknown” is returned.
Application Type
string
458
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The application used to access the org. Possible values include:
• AppExchange
• Browser
• Salesforce for iOS
• Salesforce Developers API Explorer
• N/A
AuthMethodReference Type
string
Properties
Nillable
Description
The authentication method used by a third-party identification provider for an OpenID Connect
single sign-on protocol. This field is available in API version 51.0 and later.
AuthServiceId Type
string
Properties
Nillable
Description
The 18-character ID for an authentication service for a login event. For example, you can use this
field to identify the SAML or authentication provider configuration with which the user logged in.
Browser Type
string
Properties
Nillable
Description
The browser name and version if known. Possible values for the browser name are:
• Chrome
• Firefox
• Safari
• Unknown
For example, “Chrome 77”.
CipherSuite Type
picklist
459
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable, Restricted picklist
Description
The TLS cipher suite used for the login. Values are OpenSSL-style cipher suite names, with hyphen
delimiters, for example, ECDHE-RSA-AES256-GCM-SHA384. Available in API version 37.0
and later.
City Type
string
Properties
Nillable
Description
The city where the user’s IP address is physically located. This value isn’t localized. This field is
available in API version 47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
ClientVersion Type
string
Properties
Nillable
Description
The version number of the login client. If no version number is available, “Unknown” is returned.
Country Type
string
Properties
Nillable
Description
The country where the user’s IP address is physically located. This value isn’t localized.This field is
available in API version 47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
CountryIso Type
string
Properties
Nillable
Description
The ISO 3166 code for the country where the user’s IP address is physically located. For more
information, see Country Codes - ISO 3166.
460
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the transaction security policy, in milliseconds.
EventDate Type
dateTime
Properties
Nillable
Description
The login time of the specified event. For example, 2020-01-20T19:12:26.965Z.
Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
(none)
Description
The unique ID of the event, which is shared with the corresponding storage object. For example,
0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate the event with
its storage object. Also, use this field as the primary key in your queries. Available in API version 42.0
and later.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is available
in API version 52.0 and later.
ForwardedForIp Type
string
Properties
Filter, Group, Nillable, Sort
Description
The value in the X-Forwarded-For header of HTTP requests sent by the client. For logins that
use one or more HTTP proxies, the X-Forwarded-For header is sometimes used to store the
origin IP and all proxy IPs.
461
Platform Events Developer Guide Standard Platform Event Objects
Field Details
The ForwardedForIp field stores whatever value the client sends, which might not be an IP
address. The maximum length is 256 characters. Longer values are truncated. The
ForwardedForIp field isn’t populated for logins completed via OAuth flows or single sign-on
(SSO).
Available in API version 61.0 and later.
HttpMethod Type
picklist
Properties
Nillable, Restricted picklist
Description
The HTTP method of the login request; possible values are GET, POST, and Unknown.
LoginGeoId Type
string
Properties
Nillable
Description
The Salesforce ID of the LoginGeo object associated with the login user’s IP address. For example,
04FB000001TvhiPMAR.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular login instance. This field is
also available on the LoginHistory, AuthSession, and LoginHistory objects, making it easier to trace
events back to a user’s original authentication. For example, 0YaB000002knVQLKA2.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with a login
event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
LoginLatitude Type
double
462
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The latitude where the user’s IP address is physically located.This field is available in API version
47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
LoginLongitude Type
double
Properties
Nillable
Description
The longitude where the user’s IP address is physically located.This field is available in API version
47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
LoginSubType Type
picklist
Properties
Nillable, Restricted picklist
Description
The type of login flow used. See the LoginSubType field of LoginHistory in the Object Reference
guide for the list of possible values.
Label is Login Subtype.
LoginType Type
picklist
Properties
Nillable, Restricted picklist
Description
The type of login used to access the session. See the LoginType field of LoginHistory in the Object
Reference guide for the list of possible values.
LoginUrl Type
string
Properties
Nillable
Description
The URL of the login host from which the request is coming. For example,
yourInstance.salesforce.com.
463
Platform Events Developer Guide Standard Platform Event Objects
Field Details
NetworkId Type
string
Properties
Nillable
Description
The ID of the Experience Cloud site that the user is logging in to. This field is available if Salesforce
Experience Cloud is enabled for your organization.
Platform Type
string
Properties
Nillable
Description
The operating system name and version that are used during the login event. If no platform name
is available, “Unknown” is returned. For example, Mac OSX or iOS/Mac.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction security policy associated with this event. For example,
0NIB000000000KOOAY.
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Block—The user was blocked from performing the operation that triggered the policy.
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the policy
didn’t trigger.
• FailedInvalidPassword—The user entered an invalid password.
• FailedPasswordLockout—The user entered an invalid password too many times.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was blocked
from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the user isn't
blocked from performing the operation.
• NoAction—The policy didn't trigger.
464
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Notified—A notification was sent to the recipient.
• TwoFAAutomatedSuccess—Salesforce Authenticator approved the request for access
because the request came from a trusted location. After users enable location services in
Salesforce Authenticator, they can designate trusted locations. When a user trusts a location
for a particular activity, that activity is approved from the trusted location for as long as the
location is trusted. An example of a particular activity is logging in from a recognized device.
• TwoFADenied—The user denied the approval request in the authenticator app, such as
Salesforce Authenticator.
• TwoFAFailedGeneralError—An error caused by something other than an invalid
verification code, too many verification attempts, or authenticator app connectivity.
• TwoFAFailedInvalidCode—The user provided an invalid verification code.
• TwoFAFailedTooManyAttempts—The user attempted to verify identity too many
times. For example, the user entered an invalid verification code repeatedly.
• TwoFAInitiated—Salesforce initiated identity verification but hasn’t yet challenged the
user.
• TwoFAInProgress—Salesforce challenged the user to verify identity and is waiting for
the user to respond or for Salesforce Authenticator to send an automated response.
• TwoFANoAction—The policy specifies multi-factor authentication (formerly called two-factor
authentication) as an action, but the user is already in a high-assurance session.
• TwoFARecoverableError—Salesforce can’t reach the authenticator app to verify identity,
but will retry.
• TwoFAReportedDenied—The user denied the approval request in the authenticator app,
such as Salesforce Authenticator, and also flagged the approval request to report to an
administrator.
• TwoFASucceeded—The user’s identity was verified.
PostalCode Type
string
Properties
Nillable
Description
The postal code where the user’s IP address is physically located. This value isn’t localized.This field
is available in API version 47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
465
Platform Events Developer Guide Standard Platform Event Objects
Field Details
This field is populated only when the activity that this event monitors requires extra authentication,
such as multi-factor authentication. In this case, Salesforce generates more events and sets the
RelatedEventIdentifier field of the new events to the value of the EventIdentifier
field of the original event. Use this field with the EventIdentifier field to correlate all the
related events. If no extra authentication is required, this field is blank.
RemoteIdentifier Type
string
Properties
Nillable
Description
Reserved for future use.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event in
the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive events. A
subscriber can store a replay ID value and use it on resubscription to retrieve missed events that
are within the retention window.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When a user
logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps and
reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For example,
when the user tries to access a resource such as a connected app, report, or dashboard that
requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
466
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Note: This low level isn’t available, nor used, in the Salesforce UI. User sessions through
the UI are either standard or high assurance. You can set this level using the API, but
users assigned this level experience unpredictable and reduced functionality in their
Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard requirements
set in the org’s Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The IP address of the incoming client request that first reaches Salesforce during a login. For example,
126.7.4.2. For clients that redirect through one or more HTTP proxies, this field stores the IP
address of the first proxy to reach Salesforce. To better identify the origin IP for these cases, check
the ForwardedForIp field instead.
Status Type
string
Properties
Nillable
Description
Displays the status of the attempted login. Status is either success or a reason for failure.
Subdivision Type
string
Properties
Nillable
Description
The name of the subdivision where the user’s IP address is physically located. In the U.S., this value
is usually the state name (for example, Pennsylvania). This value isn’t localized.This field is available
in API version 47.0 and later.
Note: Due to the nature of geolocation technology, the accuracy of this field can vary.
TlsProtocol Type
picklist
Properties
Nillable, Restricted picklist
Description
The TLS protocol version used for the login. Valid values are:
• TLS 1.0
467
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• TLS 1.1
• TLS 1.2
• TLS 1.3
• Unknown
UserId Type
reference
Properties
Nillable
Description
The user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Nillable
Description
The username in the format of [email protected].
UserType Type
picklist
Properties
Nillable, Restricted picklist
Description
The category of user license. Each UserType is associated with one or more UserLicense records.
Each UserLicense is associated with one or more profiles. Valid values are:
• CsnOnly—Users whose access to the application is limited to Chatter. This user type includes
Chatter Free and Chatter moderator users.
• CspLitePortal—CSP Lite Portal license. Users whose access is limited because they’re
organization customers and access the application through a customer portal or an Experience
Cloud site.
• CustomerSuccess—Customer Success license. Users whose access is limited because
they’re organization customers and access the application through a customer portal.
• Guest
• PowerCustomerSuccess—Power Customer Success license. Users whose access is
limited because they’re organization customers and access the application through a customer
portal. Users with this license type can view and edit data they directly own or data owned by
or shared with users below them in the customer portal role hierarchy.
• PowerPartner—Power Partner license. Users whose access is limited because they’re
partners and typically access the application through a partner portal or site.
• SelfService
468
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Standard—Standard user license. This user type also includes Salesforce Platform and
Salesforce Platform One user licenses.
SEE ALSO:
LoginEvent
LogoutEvent
Tracks user UI logouts. A logout event records a successful user logout from your org’s UI. LogoutEvent is a big object that stores the
event data of LogoutEventStream. This object is available in API version 46.0 and later.
Use LogoutEvent data to implement custom logic during logout. For example, you can revoke all refresh tokens for a user at logout.
Note: LogoutEvent records logouts, not timeouts. Timeouts don't cause a LogoutEventStream object to be published. An exception
is when a user is automatically logged out of the org after their session times out because the org has the Force logout on session
timeout setting enabled. In this case, a logout event is recorded. However, if users close their browser during a session, regardless
of whether the Force logout on session timeout setting is enabled, a logout event isn't recorded.
Supported Calls
describeSObjects(), query()
Fields
EventIdentifier Type
string
Properties
Filter, Sort
469
Platform Events Developer Guide Standard Platform Event Objects
Description
The unique ID of the event. For example,
0a4779b0-0da1-4619-a373-0a36991dff90.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. It starts with
a login event and ends with either a logout event or the user session expiring.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. You can use this value to identify all user events
within a session. When a user logs out and logs in again, a new session is started.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Indicates the session-level security of the session that the user is logging out of
for this event. Session-level security controls user access to features that support
it, such as connected apps and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource
access. For example, when the user tries to access a resource such as a
connected app, report, or dashboard that requires a high-assurance session
level.
• LOW—The user’s security level for the current session meets the lowest
requirements.
Note: This low level is not available, nor used, in the Salesforce UI.
User sessions through the UI are either standard or high assurance.
You can set this level using the API, but users assigned this level will
experience unpredictable and reduced functionality in their Salesforce
org.
• STANDARD—The user’s security level for the current session meets the
Standard requirements set in the org’s Session Security Levels.
470
Platform Events Developer Guide Standard Platform Event Objects
UserId Type
reference
Properties
Nillable
Description
Represents the ID of the user associated with the logout event.
Username Type
string
Properties
Nillable
Description
Represents the username of the user associated with the logout event.
Note: Date functions such as convertTimezone() aren’t supported. For example, SELECT
CALENDAR_YEAR(EventDate), Count(EventIdentifier) FROM LogoutEvent GROUP BY
CALENDAR_YEAR(EventDate) returns an error. You can use date literals in your queries and some date and date/time
functions like TODAY, YESTERDAY, and LAST_n_DAYS:1. However, these functions use comparison operators behind the
scenes. This means you can only use them in the final expression of a WHERE clause.
LogoutEvent allows filtering over two ordered fields: EventDate and EventIdentifier. There’s a catch here; your query won’t
work unless you use the correct order and combination of these fields. The following list provides some examples of valid and invalid
queries:
• Unfiltered
– Valid—Contains no WHERE clause, so no special rules apply.
SELECT EventDate, EventIdentifier, SourceIp, UserId
FROM LogoutEvent
• Filtered on EventDate
471
Platform Events Developer Guide Standard Platform Event Objects
– Valid—You can filter solely on EventDate, but single filters on other fields fail. You can also use a comparison operator in
this query type.
SELECT EventDate, EventIdentifier, SourceIp, UserId
FROM LogoutEvent
WHERE EventDate<=2014-11-27T14:54:16.000Z
– Invalid—Filtering only on EventDate with <= or >= operator and EventIdentifier field isn’t supported.
SELECT EventDate, EventIdentifier, SourceIp, UserId
FROM LogoutEvent
WHERE EventDate<=2014-11-27T14:54:16.000Z and
EventIdentifier='f0b28782-1ec2-424c-8d37-8f783e0a3754'
SEE ALSO:
Big Objects Implementation Guide
LogoutEventStream
Tracks user UI logout. A logout event records a successful user logout from your org’s UI. This object is read only, and you can’t retrieve
it using a SOQL query. This object is available in API version 41.0 and later.
When LogoutEventStream is enabled, Salesforce publishes logout events, and you can add an Apex trigger to subscribe to those events.
You can then implement custom logic during logout. For example, you can revoke all refresh tokens for a user at logout.
472
Platform Events Developer Guide Standard Platform Event Objects
Note: LogoutEventStream records logouts, not timeouts. Timeouts don't cause a LogoutEventStream object to be published. An
exception is when a user is automatically logged out of the org after their session times out because the org has the Force logout
on session timeout setting enabled. In this case, a logout event is recorded. However, if users close their browser during a session,
regardless of whether the Force logout on session timeout setting is enabled, a logout event isn't recorded.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/LogoutEventStream
Fields
EventIdentifier Type
string
473
Platform Events Developer Guide Standard Platform Event Objects
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage
object. For example, 0a4779b0-0da1-4619-a373-0a36991dff90.
Use this field to correlate the event with its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
This field is available in API version 52.0 and later.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. It starts with
a login event and ends with either a logout event or the user session expiring.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position
of the event in the event stream. Replay ID values aren’t guaranteed to be
contiguous for consecutive events. A subscriber can store a replay ID value and
use it on resubscription to retrieve missed events that are within the retention
window.
SessionKey Type
string
474
Platform Events Developer Guide Standard Platform Event Objects
Properties
Nillable
Description
The user’s unique session ID. You can use this value to identify all user events
within a session. When a user logs out and logs in again, a new session is started.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Indicates the session-level security of the session that the user is logging out of
for this event. Session-level security controls user access to features that support
it, such as connected apps and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource
access. For example, when the user tries to access a resource such as a
connected app, report, or dashboard that requires a high-assurance session
level.
• LOW—The user’s security level for the current session meets the lowest
requirements.
Note: This low level is not available, nor used, in the Salesforce UI.
User sessions through the UI are either standard or high assurance.
You can set this level using the API, but users assigned this level
experience unpredictable and reduced functionality in their Salesforce
org.
• STANDARD—The user’s security level for the current session meets the
Standard requirements set in the org’s Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client logging out. For example, 126.7.4.2.
UserId Type
reference
Properties
Nillable
Description
Represents the ID of the user associated with the logout event.
475
Platform Events Developer Guide Standard Platform Event Objects
Usage
In this example, the subscriber inserts a custom logout event record during logout.
trigger LogoutEventTrigger on LogoutEventStream (after insert) {
LogoutEventStream event = Trigger.new[0];
LogoutEvent__c record = new LogoutEvent__c();
record.EventIdentifier__c = event.EventIdentifier;
record.UserId__c = event.UserId;
record.Username__c = event.Username;
record.EventDate__c = event.EventDate;
record.RelatedEventIdentifier__c = event.RelatedEventIdentifier;
record.SessionKey__c = event.SessionKey;
record.LoginKey__c = event.LoginKey;
insert(record);
}
MobileEmailEvent
Tracks your users’ email activity in a Salesforce mobile app with Enhanced Mobile Security. This object is available in API version 47.0
and later.
Use the Mobile Security SDK to publish these events. Learn more with the Mobile Application Security help documentation.
Supported Calls
create(),describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
476
Platform Events Developer Guide Standard Platform Event Objects
Subscription Channel
/event/MobileEmailEvent
Fields
Field Details
AppPackageIdentifier Type
string
Properties
Create
Description
Generic package identifier for the app.
AppVersion Type
string
Properties
Create
Description
Version number of the application.
DeviceIdentifier Type
string
Properties
Create
Description
Unique identifier for the device. Generated by Apple® or Google™.
DeviceModel Type
string
Properties
Create
Description
Model name of the device.
477
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EmailAddress Type
string
Properties
Create
Description
Email address of the email recipient.
EventDate Type
dateTime
Properties
Create, Nillable
Description
The date of the mobile event. For example, 2020-01-20T19:12:26.965Z. Milliseconds
are the most granular setting.
EventDescription Type
string
Properties
Create, Nillable
Description
Description of the mobile event.
EventIdentifier Type
string
Properties
Create, Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object, if any.
For example, 0a4779b0-0da1-4619-a373-0a36991dff90.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
OsName Type
string
Properties
Create
478
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Name of the operating system.
OsVersion Type
string
Properties
Create
Description
Version number of the operating system.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
UserId Type
reference
Properties
Create, Namepointing
Description
ID of the user who triggered the event.
WebkitVersion Type
string
Properties
Create, Nillable
Description
Version of WebKit™ used to render web components.
MobileEmailEventStore
Tracks your users’ email activity in a Salesforce mobile app with Enhanced Mobile App Security. MobileEmailEventStore is a standard
object that stores the event data of MobileEmailEvent. This object is available in API version 48.0 and later.
Use the Mobile Security SDK to have this event generated. See Mobile Application Security in Salesforce Help.
479
Platform Events Developer Guide Standard Platform Event Objects
Supported Calls
create(), describeSObjects(), query()
Fields
Field Details
AppPackageIdentifier Type
string
Properties
Create
Description
Generic package identifier for the app.
AppVersion Type
string
Properties
Create
Description
Version number of the application.
DeviceIdentifier Type
string
Properties
Create
Description
Unique identifier for the device. Generated by Apple® or Google™.
DeviceModel Type
string
Properties
Create
Description
Model name of the device.
EmailAddress Type
string
480
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Create
Description
Email address of the email recipient.
EventDate Type
dateTime
Properties
Create, Filter, Sort
Description
The date of the mobile event. For example, 2020-01-20T19:12:26.965Z. Milliseconds
are the most granular setting.
EventDescription Type
string
Properties
Create, Nillable
Description
Description of the mobile event.
EventIdentifier Type
string
Properties
Create, Filter, Sort
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
OsName Type
string
Properties
Create
Description
Name of the operating system.
OsVersion Type
string
Properties
Create
Description
Version number of the operating system.
481
Platform Events Developer Guide Standard Platform Event Objects
Field Details
UserId Type
reference
Properties
Create
Description
Id of the user who triggered the event.
This field is a polymorphic relationship field.
Relationship Name
User
Refers To
User
Username Type
string
Properties
Create, Nillable
Description
The username in the format of [email protected] at the time the event was created.
WebkitVersion Type
string
Properties
Create, Nillable
Description
Version of WebKit™ used to render web components.
MobileEnforcedPolicyEvent
Tracks enforcement of Enhanced Mobile Security policy events on a Salesforce mobile app with Enhanced Mobile Security. Events are
created on first launch of the mobile app and user rechecks, and are batched and published when the app is in the background. This
object is available in API version 47.0 and later.
Use the Mobile Security SDK to publish these events. Learn more with the Mobile Application Security help documentation.
Supported Calls
create(), describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
482
Platform Events Developer Guide Standard Platform Event Objects
Subscriber Supported?
Flows
Processes
Pub/Sub API
Subscription Channel
/event/MobileEnforcedPolicyEvent
Fields
Field Details
AppPackageIdentifier Type
string
Properties
Create
Description
Generic package identifier for the application.
AppVersion Type
string
Properties
Create
Description
Version number of the application.
DeviceIdentifier Type
string
Properties
Create
483
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Unique identifier for the device. Generated by Apple® or Google™.
DeviceModel Type
string
Properties
Create
Description
Model name of the device.
EnforcedAction Type
json
Properties
Create
Description
Action that the policy enforced.
Possible values are:
• Warn
• Error
• Critical Error
EventDate Type
dateTime
Properties
Create, Nillable
Description
Date of the mobile event. For example, 2020-01-20T19:12:26.965Z. Milliseconds
are the most granular setting.
EventDescription Type
string
Properties
Create, Nillable
Description
Description of the mobile event.
EventIdentifier Type
string
Properties
Create, Nillable
484
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The unique ID of the event, which is shared with the corresponding storage object, if any.
For example, 0a4779b0-0da1-4619-a373-0a36991dff90.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
OsName Type
string
Properties
Create
Description
Operating system name iOS or Android.
OsVersion Type
string
Properties
Create
Description
Operating system version number.
PolicyResults Type
json
Properties
Create
Description
Collection of the results of all policies enforced at the time of the event.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
485
Platform Events Developer Guide Standard Platform Event Objects
Field Details
UserId Type
reference
Properties
Create, Namepointing
Description
ID of the user for whom policies were enforced.
WebkitVersion Type
string
Properties
Create, Nillable
Description
Version of WebKit™ used to render web components.
MobileEnfPolicyEventStore
Tracks enforcement of Enhanced Mobile App Security policy events on a Salesforce mobile app with Enhanced Mobile App Security.
Events are created on first launch of the mobile app and user rechecks, and are batched and published when the app is in the background.
MobileEnfPolicyEventStore is a standard object that stores the event data of MobileEnforcedPolicyEvent. This object is available in API
version 48.0 and later.
Use the Mobile Security SDK to have this event generated. See Mobile Application Security in Salesforce Help.
Supported Calls
create(), describeSObjects(), query()
Fields
Field Details
AppPackageIdentifier Type
string
Properties
Create
Description
Generic package identifier for the app.
486
Platform Events Developer Guide Standard Platform Event Objects
Field Details
AppVersion Type
string
Properties
Create
Description
Version number of the application.
DeviceIdentifier Type
string
Properties
Create
Description
Unique identifier for the device. Generated by Apple® or Google™.
DeviceModel Type
string
Properties
Create
Description
Model name of the device.
EnforcedAction Type
json
Properties
Create
Description
Action that the policy enforced. Possible values are:
• Warn
• Error
• Critical Error
EventDate Type
dateTime
Properties
Create, Filter, Sort
Description
Date of the mobile event. For example, 2020-01-20T19:12:26.965Z. Milliseconds
are the most granular setting.
EventDescription Type
string
487
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Create, Nillable
Description
Description of the mobile event.
EventIdentifier Type
string
Properties
Create, Filter, Sort
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
OsName Type
string
Properties
Create
Description
Operating system name.
OsVersion Type
string
Properties
Create
Description
Operating system version number.
PolicyResults Type
json
Properties
Create
Description
Collection of the results of all policies enforced at the time of the event.
UserId Type
reference
Properties
Create
Description
Id of the user for whom policies were enforced.
488
Platform Events Developer Guide Standard Platform Event Objects
Field Details
This field is a polymorphic relationship field.
Relationship Name
User
Refers To
User
Username Type
string
Properties
Create, Nillable
Description
The username in the format of [email protected] at the time the event was created.
WebkitVersion Type
string
Properties
Create, Nillable
Description
Version of WebKit™ used to render web components.
MobileScreenshotEvent
Tracks your users’ screenshots in a Salesforce mobile app with Enhanced Mobile Security. This object is available in API version 47.0 and
later.
Use the Mobile Security SDK to publish these events. Learn more with the Mobile Application Security help documentation.
Supported Calls
create(), describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
489
Platform Events Developer Guide Standard Platform Event Objects
Subscription Channel
/event/MobileScreenshotEvent
Fields
Field Details
AppPackageIdentifier Type
string
Properties
Create
Description
Generic package identifier for the application.
AppVersion Type
string
Properties
Create
Description
Version number of the application.
DeviceIdentifier Type
string
Properties
Create
Description
Unique identifier for the device. Generated by Apple® or Google™.
DeviceModel Type
string
Properties
Create
Description
Model name of the device.
490
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventDate Type
dateTime
Properties
Create, Nillable
Description
Date of the mobile event. For example, 2020-01-20T19:12:26.965Z. Milliseconds
are the most granular setting.
EventDescription Type
string
Properties
Create, Nillable
Description
Description of the mobile event.
EventIdentifier Type
string
Properties
Create, Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object, if any.
For example, 0a4779b0-0da1-4619-a373-0a36991dff90.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
OsName Type
string
Properties
Create
Description
Name of the operating system.
OsVersion Type
string
Properties
Create
491
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Version number of the operating system.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
ScreenDescription Type
string
Properties
Create
Description
Description of what was viewable on the screen when the user took a screenshot, such as
Chatter Feed or Record Detail View.
UserId Type
reference
Properties
Create, Namepointing
Description
ID of the user who triggered the event.
WebkitVersion Type
string
Properties
Create, Nillable
Description
Version of WebKit™ used to render web components.
MobileScreenshotEventStore
Tracks your users’ screenshots in a Salesforce mobile app with Enhanced Mobile App Security. MobileScreenshotEventStore is a standard
object that stores the event data of MobileScreenshotEvent. This object is available in API version 48.0 and later.
Use the Mobile Security SDK to have this event generated. See Mobile Application Security in Salesforce Help.
492
Platform Events Developer Guide Standard Platform Event Objects
Supported Calls
create(), describeSObjects(), query()
Fields
Field Details
AppPackageIdentifier Type
string
Properties
Create
Description
Generic package identifier for the app.
AppVersion Type
string
Properties
Create
Description
Version number of the application.
DeviceIdentifier Type
string
Properties
Create
Description
Unique identifier for the device. Generated by Apple® or Google™.
DeviceModel Type
string
Properties
Create
Description
Model name of the device.
EventDate Type
dateTime
493
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Create, Filter, Sort
Description
The date of the mobile event. For example, 2020-01-20T19:12:26.965Z. Milliseconds
are the most granular setting.
EventDescription Type
string
Properties
Create, Nillable
Description
Description of the mobile event.
EventIdentifier Type
string
Properties
Create, Filter, Sort
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
OsName Type
string
Properties
Create
Description
Name of the operating system.
OsVersion Type
string
Properties
Create
Description
Version number of the operating system.
ScreenDescription Type
string
Properties
Create
494
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Description of what was viewable on the screen when the user took a screenshot, such as
Chatter Feed or Record Detail View.
UserId Type
reference
Properties
Create
Description
Id of the user who triggered the event.
This field is a polymorphic relationship field.
Relationship Name
User
Refers To
User
Username Type
string
Properties
Create, Nillable
Description
The username in the format of [email protected] at the time the event was created.
WebkitVersion Type
string
Properties
Create, Nillable
Description
Version of WebKit™ used to render web components.
MobileTelephonyEvent
Tracks your users’ phone calls and text messages in a Salesforce mobile app with Enhanced Mobile Security. This object is available in
API version 47.0 and later.
Use the Mobile Security SDK to publish these events. Learn more with the Mobile Application Security help documentation.
Supported Calls
create(), describeSObjects()
495
Platform Events Developer Guide Standard Platform Event Objects
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/MobileTelephonyEvent
Fields
Field Details
AppPackageIdentifier Type
string
Properties
Create
Description
Generic package identifier for the application.
AppVersion Type
string
Properties
Create
Description
Version number of the application.
DeviceIdentifier Type
string
496
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Create
Description
Unique identifier for the device. Generated by Apple® or Google™.
DeviceModel Type
string
Properties
Create
Description
Model name of the device.
EventDate Type
dateTime
Properties
Create, Nillable
Description
Date of the mobile event. For example, 2020-01-20T19:12:26.965Z. Milliseconds
are the most granular setting.
EventDescription Type
string
Properties
Create, Nillable
Description
Description of the mobile event.
EventIdentifier Type
string
Properties
Create, Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object, if any.
For example, 0a4779b0-0da1-4619-a373-0a36991dff90.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
497
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Operation Type
picklist
Properties
Create, Restricted picklist
Description
Type of operation that triggered the event.
Possible values are:
• PhoneCall
• SMS
OsName Type
string
Properties
Create
Description
Name of the operating system.
OsVersion Type
string
Properties
Create
Description
Version number of the operating system.
PhoneNumber Type
string
Properties
Create
Description
Phone number for the recipient of the phone call or text message.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
498
Platform Events Developer Guide Standard Platform Event Objects
Field Details
UserId Type
reference
Properties
Create, Namepointing
Description
ID of the user who triggered the event.
WebkitVersion Type
string
Properties
Create, Nillable
Description
Version of WebKit™ used to render web components.
MobileTelephonyEventStore
Tracks your users’ phone calls and text messages in a Salesforce mobile app with Enhanced Mobile App Security.
MobileTelephonyEventStore is a standard object that stores the event data of MobileTelephonyEvent. This object is available in API
version 48.0 and later.
Use the Mobile Security SDK to have this event generated. See Mobile Application Security in Salesforce Help.
Supported Calls
create(), describeSObjects(), query()
Fields
Field Details
AppPackageIdentifier Type
string
Properties
Create
Description
Generic package identifier for the app.
499
Platform Events Developer Guide Standard Platform Event Objects
Field Details
AppVersion Type
string
Properties
Create
Description
Version number of the application.
DeviceIdentifier Type
string
Properties
Create
Description
Unique identifier for the device. Generated by Apple® or Google™.
DeviceModel Type
string
Properties
Create
Description
Model name of the device.
EventDate Type
dateTime
Properties
Create, Filter, Sort
Description
The date of the mobile event. For example, 2020-01-20T19:12:26.965Z. Milliseconds
are the most granular setting.
EventDescription Type
string
Properties
Create, Nillable
Description
Description of the mobile event.
EventIdentifier Type
string
Properties
Create, Filter, Sort
500
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
Operation Type
picklist
Properties
Create, Restricted picklist
Description
Type of operation that triggered the event.
Possible values are:
• PhoneCall
• SMS
OsName Type
string
Properties
Create
Description
Name of the operating system.
OsVersion Type
string
Properties
Create
Description
Version number of the operating system.
PhoneNumber Type
string
Properties
Create
Description
Phone number for the recipient of the phone call or text message.
UserId Type
reference
Properties
Create
501
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Id of the user who triggered the event.
This field is a polymorphic relationship field.
Relationship Name
User
Refers To
User
Username Type
string
Properties
Create, Nillable
Description
The username in the format of [email protected] at the time the event was created.
WebkitVersion Type
string
Properties
Create, Nillable
Description
Version of WebKit™ used to render web components.
PermissionSetEvent
Tracks changes to permission sets and permission set groups. This event initiates when a permission is added to, or removed from a
permission set. This event also initiates when a permission set containing a critical permission is assigned or unassigned. This object is
available in API version 52.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
502
Platform Events Developer Guide Standard Platform Event Objects
Subscriber Supported?
Processes
Pub/Sub API
Fields
Field Details
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds.
EventDate Type
dateTime
Properties
Nillable
Description
The time when the anomaly was reported. For example, 2020-01-20T19:12:26.965Z.
Milliseconds is the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventSource Type
picklist
Properties
Nillable, Restricted picklist
Description
The source of the event. Possible values are:
503
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• API—The user made changes to a permission set or permission set group from an API
call.
• Classic—The user made changes to a permission set or permission set group from
a page in the Salesforce Classic UI.
• Lightning—The user made changes to a permission set or permission set group
from a page in the Lightning Experience UI.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message.
HasExternalUsers Type
boolean
Properties
Nillable
Description
When true, external users are impacted by the operation that triggered a permission change.
The default value is false.
ImpactedUserIds Type
json
Properties
Nillable
Description
A comma-separated list of IDs of the users affected by the event. A maximum of 1,000 user
IDs are included.
For example, if a permission set assigned to two users is updated, the users’ IDs are recorded
in this field.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular series of permission
set events. This field is also available in the LoginEvent, AuthSession, and LoginHistory objects,
making it easier to trace events back to a user’s original authentication. For example,
0YaB000002knVQLKA2.
This is a relationship field.
504
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Relationship Name
LoginHistory
Relationship Type
Lookup
Refers To
LoginHistory
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
Operation Type
picklist
Properties
Nillable, Restricted picklist
Description
The type of operation that triggers a permission change.
Possible values are:
• AssignedToUsers—A permission set or permission set group is assigned to one
or more users.
• CriticalPerms—This deprecated value indicates the critical permissions are
enabled.
• PermsDisabled—Permissions are disabled.
• PermsEnabled—Permissions are enabled.
• UnassignedFromUsers—A permission set or permission set group is unassigned
from one or more users.
ParentIdList Type
json
Properties
Nillable
Description
The IDs of the affected permission sets or permission set groups.
ParentNameList Type
json
505
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The names of the affected permission sets or permission set groups.
PermissionExpirationList Type
json
Properties
Nillable
Description
A comma separated list of timestamps from the PermissionSetAssignment.ExpirationDate
field that specifies when added permissions will be revoked. This value is null when no
expiration timestamp is specified or permissions are removed for the impacted users.
PermissionList Type
json
Properties
Nillable
Description
The list of permissions that are enabled or disabled in the event.
PermissionType Type
string
Properties
Nillable
Description
The type of permission that is updated in the event. Possible values are:
• ObjectPermission
• UserPermission
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction security policy associated with this event. For example,
0NIB000000000KOOAY.
This is a relationship field.
Relationship Name
Policy
506
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Relationship Type
Lookup
Refers To
TransactionSecurityPolicy
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy.
Possible values are:
• Block—The user was blocked from performing the operation that triggered the policy.
• EndSession—The user’s session is terminated.
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• FailedInvalidPassword—The user entered an invalid password.
• FailedPasswordLockout—The user entered an invalid password too many
times.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
• TwoFAAutomatedSuccess—Salesforce Authenticator approved the request for
access because the request came from a trusted location. After users enable location
services in Salesforce Authenticator, they can designate trusted locations. When a user
trusts a location for a particular activity, such as logging in from a recognized device,
that activity is approved from the trusted location for as long as the location is trusted.
• TwoFADenied—The user denied the approval request in the authenticator app, such
as Salesforce Authenticator.
• TwoFAFailedGeneralError—An error caused by something other than an
invalid verification code, too many verification attempts, or authenticator app connectivity.
• TwoFAFailedInvalidCode—The user provided an invalid verification code.
• TwoFAFailedTooManyAttempts—The user attempted to verify identity too
many times. For example, the user entered an invalid verification code repeatedly.
• TwoFAInProgress—Salesforce challenged the user to verify identity and is waiting
for the user to respond or for Salesforce Authenticator to send an automated response.
507
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• TwoFAInitiated—Salesforce initiated identity verification but hasn’t yet challenged
the user.
• TwoFANoAction—The policy specifies multi-factor authentication (formerly called
two-factor authentication) as an action, but the user is already in a high-assurance session.
• TwoFARecoverableError—Salesforce can’t reach the authenticator app to verify
identity, but will retry.
• TwoFAReportedDenied—The user denied the approval request in the authenticator
app, such as Salesforce Authenticator, and also flagged the approval request to report
to an administrator.
• TwoFASucceeded—The user’s identity was verified.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example,
vMASKIU6AxEr+Op5.
508
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
Note: This low level isn’t available or used in the Salesforce UI. User sessions
through the UI are either standard or high assurance. You can set this level using
the API, but users assigned this level experience unpredictable and reduced
functionality in their Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
UserCount Type
string
Properties
Nillable
Description
The number of users affected by the event. This field has a maximum value of 1,000. If the
user appears more than 1,000 times, the value remains at 1,000.
UserId Type
reference
Properties
Nillable
Description
The user’s unique ID. For example, 005000000000123.
This is a polymorphic relationship field.
509
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Relationship Name
User
Relationship Type
Lookup
Refers To
User
Username Type
string
Properties
Nillable
Description
The username in the format of [email protected] at the time the event was created.
PermissionSetEventStore
Tracks changes to permission sets and permission set groups. This event initiates when a permission is added to, or removed from a
permission set. This event also initiates when a permission set containing a critical permission is assigned or unassigned.
PermissionSetEventStore is a big object that stores the event data of PermissionSetEvent. This object is available in API version 52.0 and
later.
Supported Calls
describeSObjects(), query()
Fields
Field Details
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds.
EventDate Type
dateTime
510
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Filter, Sort
Description
The time when the anomaly was reported. For example, 2020-01-20T19:12:26.965Z.
Milliseconds is the most granular setting.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventSource Type
picklist
Properties
Nillable, Restricted picklist
Description
The source of the event. Possible values are:
• API—The user changed a permission set or permission set group from an API call.
• Classic—The user made changes to a permission set or permission set group from
a page in the Salesforce Classic UI.
• Lightning—The user made changes to a permission set or permission set group
from a page in the Lightning Experience UI.
HasExternalUsers Type
boolean
Properties
Nillable
Description
When true, external users are impacted by the operation that triggered a permission change.
The default value is false.
ImpactedUserIds Type
json
Properties
Nillable
Description
A comma-separated list of IDs of the users affected by the event. A maximum of 1,000 user
IDs are included.
511
Platform Events Developer Guide Standard Platform Event Objects
Field Details
For example, if a permission set assigned to two users is updated, the users’ IDs are recorded
in this field.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so you can correlate user activity with a particular series of permission
set events. This field is also available in the LoginEvent, AuthSession, and LoginHistory objects,
making it easier to trace events back to a user’s original authentication. For example,
0YaB000002knVQLKA2.
This is a relationship field.
Relationship Name
LoginHistory
Relationship Type
Lookup
Refers To
LoginHistory
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
Operation Type
picklist
Properties
Nillable, Restricted picklist
Description
The type of operation that triggers a permission change.
Possible values are:
• AssignedToUsers—A permission set or permission set group is assigned to one
or more users.
• CriticalPerms—This deprecated value indicates the critical permissions that are
enabled.
• PermsDisabled—Permissions are disabled.
• PermsEnabled—Permissions are enabled.
512
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• UnassignedFromUsers—A permission set or permission set group is unassigned
from one or more users.
ParentIdList Type
json
Properties
Nillable
Description
The IDs of the affected permission sets or permission set groups.
ParentNameList Type
json
Properties
Nillable
Description
The names of the affected permission sets or permission set groups.
PermissionExpirationList Type
json
Properties
Nillable
Description
A comma separated list of timestamps from the PermissionSetAssignment.ExpirationDate
field that specifieswhen added permissions will be revoked. This value is null when no
expiration timestamp is specified or permissions are removed for the impacted users.
PermissionList Type
json
Properties
Nillable
Description
The list of permissions that are enabled or disabled in the event.
PermissionType Type
string
Properties
Nillable
Description
The type of permission that is updated in the event. Possible values are:
• ObjectPermission
• UserPermission
513
Platform Events Developer Guide Standard Platform Event Objects
Field Details
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction security policy associated with this event. For example,
0NIB000000000KOOAY.
This is a relationship field.
Relationship Name
Policy
Relationship Type
Lookup
Refers To
TransactionSecurityPolicy
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy.
Possible values are:
• Block—The user was blocked from performing the operation that triggered the policy.
• EndSession—The user’s session is terminated.
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• FailedInvalidPassword—The user entered an invalid password.
• FailedPasswordLockout—The user entered an invalid password too many
times.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
• TwoFAAutomatedSuccess—Salesforce Authenticator approved the request for
access because the request came from a trusted location. After users enable location
services in Salesforce Authenticator, they can designate trusted locations. When a user
trusts a location for a particular activity, such as logging in from a recognized device,
that activity is approved from the trusted location for as long as the location is trusted.
514
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• TwoFADenied—The user denied the approval request in the authenticator app, such
as Salesforce Authenticator.
• TwoFAFailedGeneralError—An error caused by something other than an
invalid verification code, too many verification attempts, or authenticator app connectivity.
• TwoFAFailedInvalidCode—The user provided an invalid verification code.
• TwoFAFailedTooManyAttempts—The user attempted to verify identity too
many times. For example, the user entered an invalid verification code repeatedly.
• TwoFAInProgress—Salesforce challenged the user to verify identity and is waiting
for the user to respond or for Salesforce Authenticator to send an automated response.
• TwoFAInitiated—Salesforce initiated identity verification but hasn’t yet challenged
the user.
• TwoFANoAction—The policy specifies multi-factor authentication (formerly called
two-factor authentication) as an action, but the user is already in a high-assurance session.
• TwoFARecoverableError—Salesforce can’t reach the authenticator app to verify
identity, but will retry.
• TwoFAReportedDenied—The user denied the approval request in the authenticator
app, such as Salesforce Authenticator, and also flagged the approval request to report
to an administrator.
• TwoFASucceeded—The user’s identity was verified.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example,
vMASKIU6AxEr+Op5.
515
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
Note: This low level isn’t available or used in the Salesforce UI. User sessions
through the UI are either standard or high assurance. You can set this level using
the API, but users assigned this level experience unpredictable and reduced
functionality in their Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
UserCount Type
string
Properties
Nillable
Description
The number of users affected by the event. This field has a maximum value of 1,000. If the
user appears more than 1,000 times, the value remains at 1,000.
UserId Type
reference
Properties
Nillable
Description
The user’s unique ID. For example, 005000000000123.
This is a polymorphic relationship field.
516
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Relationship Name
User
Relationship Type
Lookup
Refers To
User
Username Type
string
Properties
Nillable
Description
The username in the format of [email protected] at the time the event was created.
ReportAnomalyEvent
Tracks anomalies in how users run or export reports, including unsaved reports. This object is available in API version 49.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/ReportAnomalyEvent
517
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Nillable
Description
The time when the anomaly was reported. For example, 2020-01-20T19:12:26.965Z.
Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
LoginKey Type
string
Properties
Nillable
518
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
A relationship field.
Relationship Name
Policy
Relationship Type
Lookup
Refers To
TransactionSecurityPolicy
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Error - The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction - The policy didn't trigger.
• Notified - A notification was sent to the recipient.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
ReplayId Type
string
519
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
Report Type
string
Properties
Nillable
Description
The report ID for the report for which this anomaly event was detected. For example,
00OD0000001leVCMAY.
If this anomaly resulted from a user executing an unsaved report, the value of this field is
null.
Score Type
double
Properties
Nillable
Description
A number from 0 through 100 that represents the anomaly score for the report execution
or export tracked by this event. The anomaly score shows how the user's current report
activity is different from their typical activity. A low score indicates that the user's current
report activity is similar to their usual activity. A high score indicates that it's different.
SecurityEventData Type
textarea
Properties
Nillable
Description
The set of features about the report activity that triggered this anomaly event.
Let’s say, for example, that a user typically downloads 10 accounts but then they deviate
from that pattern and download 1,000 accounts. This event is triggered and the contributing
features are captured in this field. Potential features include row count, column count, average
row size, the day of week, and the browser’s user agent used for the report activity. The data
captured in this field also shows how much a particular feature contributed to this anomaly
event being triggered, represented as a percentage. The data is in JSON format.
520
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Example
This example shows that the average row count contributed more than 95% to the anomaly
being triggered. Other anomalous features, such as the autonomous system, day of the week
the report was run, the browser used, and the number of columns, contributed much less.
[
{
"featureName": "rowCount",
"featureValue": "1937568",
"featureContribution": “95.00 %"
},
{
"featureName": "autonomousSystem",
"featureValue": "Bigleaf Networks, Inc.",
"featureContribution": “1.62 %"
},
{
"featureName": "dayOfWeek",
"featureValue": "Sunday",
"featureContribution": “1.42 %"
},
{
"featureName": "userAgent",
"featureValue": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132
Safari/537.36}",
"featureContribution": “1.21 %"
},
{
"featureName": "periodOfDay",
"featureValue": “Evening”,
"featureContribution": “.09 %"
},
{
"featureName": "averageRowSize",
"featureValue": "744",
"featureContribution": “0.08 %"
},
{
"featureName": "screenResolution",
"featureValue": "900x1440",
"featureContribution": “0.07 %"
}
]
SessionKey Type
string
Properties
Nillable
521
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2. Session
information contained in the fields SessionKey, LoginKey, SessionLevel, and SourceIp isn’t
captured in any report resulting from an asynchronous operation.
Summary Type
textarea
Properties
Nillable
Description
A text summary of the report anomaly that caused this event to be created.
Example
• Report was exported from an infrequent network (BigLeaf
Networks Inc.)
• Report was generated with an unusually high number of
rows (111141)
UserId Type
reference
Properties
Nillable
Description
The origin user’s unique ID. For example, 005000000000123.
A polymorphic relationship field.
Relationship Name
User
Relationship Type
Lookup
Refers To
User
Username Type
string
522
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
ReportAnomalyEventStore
Tracks anomalies in how users run or export reports, including unsaved reports. ReportAnomalyEventStore is an object that stores the
event data of ReportAnomalyEvent. This object is available in API version 49.0 and later.
Supported Calls
describeLayout()describeSObjects(), getDeleted(), getUpdated(), query()
Fields
Field Details
EvaluationTime Type
double
Properties
Filter, Nillable, Sort
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Filter, Sort
Description
Required. The time when the anomaly was reported. For example,
2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
523
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Filter, Group, Sort
Description
Required. The unique ID of the event. For example,
0a4779b0-0da1-4619-a373-0a36991dff90.
LastReferencedDate Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed a record related to this record.
LastViewedDate Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed this record. If this value is null, it’s
possible that this record was referenced (LastReferencedDate) and not viewed.
LoginKey Type
string
Properties
Filter, Group, Nillable, Sort
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
PolicyId Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
PolicyOutcome Type
picklist
524
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The result of the transaction policy. Possible values are:
• Error - The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction - The policy didn't trigger.
• Notified - A notification was sent to the recipient.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
Report Type
string
Properties
Filter, Group, Nillable, Sort
Description
The report ID for the report for which this anomaly event was detected. For example,
00OD0000001leVCMAY.
If this anomaly resulted from a user executing an unsaved report, the value of this field is
null.
ReportAnomalyEventNumber Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
The unique number automatically assigned to the event when it's created. You can't change
the format or value for this field.
Score Type
double
Properties
Filter, Nillable, Sort
Description
A number from 0 through 100 that represents the anomaly score for the report execution
or export tracked by this event. The anomaly score shows how the user's current report
525
Platform Events Developer Guide Standard Platform Event Objects
Field Details
activity is different from their typical activity. A low score indicates that the user's current
report activity is similar to their usual activity, a high score indicates that it's different.
SecurityEventData Type
textarea
Properties
Nillable
Description
The set of features about the report activity that triggered this anomaly event.
Let’s say, for example, that a user typically downloads 10 accounts but then they deviate
from that pattern and download 1,000 accounts. This event is triggered and the contributing
features are captured in this field. Potential features include row count, column count, average
row size, the day of week, and the browser’s user agent used for the report activity. The data
captured in this field also shows how much a particular feature contributed to this anomaly
event being triggered, represented as a percentage. The data is in JSON format.
Example
This example shows that the average row count contributed more than 95% to the anomaly
being triggered. Other anomalous attributes, such as the autonomous system, day of the
week the report was run, the browser used, and the number of columns, contributed much
less.
[
{
"featureName": "rowCount",
"featureValue": "1937568",
"featureContribution": “95.00 %"
},
{
"featureName": "autonomousSystem",
"featureValue": "Bigleaf Networks, Inc.",
"featureContribution": “1.62 %"
},
{
"featureName": "dayOfWeek",
"featureValue": "Sunday",
"featureContribution": “1.42 %"
},
{
"featureName": "userAgent",
"featureValue": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132
Safari/537.36}",
"featureContribution": “1.21 %"
},
{
"featureName": "periodOfDay",
"featureValue": “Evening”,
"featureContribution": “.09 %"
},
526
Platform Events Developer Guide Standard Platform Event Objects
Field Details
{
"featureName": "averageRowSize",
"featureValue": "744",
"featureContribution": “0.08 %"
},
{
"featureName": "screenResolution",
"featureValue": "900x1440",
"featureContribution": “0.07 %"
}
]
SessionKey Type
string
Properties
Filter, Group, Nillable, Sort
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SourceIp Type
string
Properties
Filter, Group, Nillable, Sort
Description
The source IP address of the client that logged in. For example, 126.7.4.2. Session
information contained in the fields SessionKey, LoginKey, SessionLevel, and SourceIp isn’t
captured in any report resulting from an asynchronous operation.
Summary Type
textarea
Properties
Nillable
Description
A text summary of the report anomaly that caused this event to be created.
Example
• Report was exported from an infrequent network (BigLeaf
Networks Inc.)
• Report was generated with an unusually high number of
rows (111141)
UserId Type
reference
527
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Filter, Group, Nillable, Sort
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
Properties
Filter, Group, Nillable, Sort
Description
The origin username in the format of [email protected] at the time the event was
created.
Associated Object
This object has the following associated object. It’s available in the same API version as this object.
ReportAnomalyEventStoreFeed
Feed tracking is available for the object.
ReportEvent
Tracks when reports are run in your org. You can use ReportEvent in a transaction security policy. ReportEvent is a big object that stores
the event data of ReportEventStream. This object is available in API version 46.0 and later.
Supported Calls
describeSObjects(), query()
Fields
Field Details
ColumnHeaders Type
string
Properties
Nillable
Description
Comma-separated values of column headers of the report. Values listed are object names,
field names, and field values except where aliases are used. For example, [Opportunity.Name,
528
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Opportunity.Type, Opportunity.Owner.UserRole.RollupDescription,
Opportunity.Account.Name, Opportunity.Account.NumberOfEmployees, AGE].
DashboardId Type
reference
Properties
Nillable
Description
The ID of the dashboard that the report was part of. For example, 01ZB0000000PmoQ.
This is a relationship field.
Relationship Name
Dashboard
Relationship Type
Lookup
Refers To
Dashboard
DashboardName Type
string
Properties
Nillable
Description
The title of the dashboard that the report was part of.
Description Type
string
Properties
Nillable
Description
The description of the report.
DisplayedFieldEntities Type
string
Properties
Nillable
Description
The API values of the fields that are displayed on the report, including the names of the
entities of the grouped column fields. For example, [ACCOUNTS, OWNERS].
EvaluationTime Type
double
529
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Filter, Sort
Description
The time when the specified report event was captured (after query execution takes place).
For example, 2020-01-20T19:12:26.965Z. Milliseconds are the most granular
setting.
EventIdentifier Type
string
Properties
Filter, Sort
Description
The unique ID of the event. For example, 0a4779b0-0da1-4619-a373-0a36991dff90.
EventSource Type
picklist
Properties
Nillable, Restricted Picklist
Description
The source of the event. Possible values are:
• API—The user generated the report from an API call.
• Classic—The user generated the report from the Salesforce Classic UI.
• Lightning—The user generated the report from Lightning Experience.
ExecutionIdentifier Type
string
Properties
Nillable
Description
When report data is divided into multiple report events, use this unique identifier to correlate
the multiple data chunks. For example, if each chunk has the same
ExecutionIdentifier of a50a4025-84f2-425d-8af9-2c780869f3b5,you can link them
together to get all the data for the report execution. The Sequence field contains the
incremental sequence numbers that indicate the order of the multiple events.
530
Platform Events Developer Guide Standard Platform Event Objects
Field Details
For more information, see Sequence.
ExportFileFormat Type
string
Properties
Nillable
Description
If the user exported the report, this value indicates the format of the exported report. Possible
values are:
• CSV
• Excel
Format Type
picklist
Properties
Defaulted on create, Nillable, Restricted picklist
Description
The format of the report. Possible values are:
• Matrix
• MultiBlock
• Summary
• Tabular
GroupedColumnHeaders Type
string
Properties
Nillable
Description
Comma-separated values of grouped column fields in summary, matrix, and joined reports.
For example, [USERNAME, ACCOUNT.NAME, TYPE, DUE_DATE,
LAST_UPDATE, ADDRESS1_STATE].
IsScheduled Type
boolean
Properties
Defaulted on create
Description
If TRUE, the report was scheduled. If FALSE, the report wasn’t scheduled.
LoginHistoryId Type
reference
531
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
Tracks a user session so that you can correlate user activity with a particular series of report
events. This field is also available on the LoginEvent, AuthSession, and LoginHistory objects,
making it easier to trace events back to a user’s original authentication. This value is null if
the event that was generated was from a dashboard refresh, a multi-block report, or a
scheduled report. For example, 0YaB000002knVQLKA2.
This is a relationship field.
Relationship Name
LoginHistory
Relationship Type
Lookup
Refers To
LoginHistory
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. This value is
null if the event that was generated was from a dashboard refresh, a multi-block report, or
a scheduled report. For example, lUqjLPQTWRdvRG4.
Name Type
string
Properties
Nillable
Description
The display name of the report. The value is null for report previews.
NumberOfColumns Type
int
Properties
Nillable
Description
The number of columns in the report.
Operation Type
picklist
532
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable, Restricted Picklist
Description
The context in which the report executed, such as from a UI (Classic, Lightning, Mobile),
through an API (synchronous, asynchronous, Apex), or through a dashboard. Session
information contained in the fields SessionKey, LoginKey, SessionLevel, and
SourceIp isn’t captured in any report resulting from an asynchronous operation. Possible
values are:
• ChartRenderedInEmbeddedAnalyticsApp—Report executed from a
rendered chart in an embedded Analytics app.
• ChartRenderedOnHomePage—Report executed from a rendered chart on the
home page.
• ChartRenderedOnVisualforcePage—Report executed from a rendered chart
on a VisualForce Page.
• DashboardComponentPreviewed—Report executed from a Lightning dashboard
component preview.
• DashboardComponentUpdated—Report executed when a user refreshed a
dashboard component.
• ProbeQuery—Report executed from a probe query.
• ReportAddedToCampaign—Report was added from an Add to Campaign action.
• ReportExported—Report executed from a printable view or report export that
wasn’t asynchronous nor an API export.
• ReportExportedAsynchronously—Report was exported asynchronously.
• ReportExportedUsingExcelConnector—Report was exported using the
Excel connector.
• ReportOpenedFromMobileDashboard—Report executed when a user clicked
a dashboard component on a mobile device and drilled down to a report.
• ReportPreviewed—Report executed when a user got preview results while using
the report builder.
• ReportResultsAddedToEinsteinDiscovery—Report executed
synchronously from Einstein Discovery.
• ReportResultsAddedToWaveTrending—Report executed when a user
trended a report in CRM Analytics.
• ReportRunAndNotificationSent—Report executed through the notifications
API.
• ReportRunFromClassic—Report executed from the Run Report option of
Salesforce Classic.
• ReportRunFromLightning—Report executed from the Run option in Lightning
Experience from a non-mobile browser.
• ReportRunFromMobile—Report executed from the Run Report option of the
mobile Salesforce app.
533
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• ReportRunFromReportingSnapshot—Report executed through Snapshot
Analytics.
• ReportRunFromRestApi—Report executed from REST API.
• ReportRunUsingApexAsynchronousApi—Report executed from the
asynchronous Apex API.
• ReportRunUsingApexSynchronousApi—Report executed from the
synchronous Apex API.
• ReportRunUsingAsynchronousApi—Report executed from an asynchronous
API.
• ReportRunUsingSynchronousApi—Report executed from a synchronous API.
• ReportScheduled—Report was scheduled.
• Test—Report execution resulted from a test.
• Unknown—Report execution origin is unknown.
OwnerId Type
reference
Properties
Nillable
Description
The ID of the folder, organization, or user who owns the report. If the report wasn’t saved,
this value is the same as UserId. For example, 005B0000001vURv.
This is a polymorphic relationship field.
Relationship Name
Owner
Relationship Type
Lookup
Refers To
Folder, Organization, User
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
This is a relationship field.
Relationship Name
Policy
534
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Relationship Type
Lookup
Refers To
TransactionSecurityPolicy
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Block—The user was blocked from performing the operation that triggered the policy.
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• FailedInvalidPassword—The user entered an invalid password.
• FailedPasswordLockout—The user entered an invalid password too many
times.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user wasn’t blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
• TwoFAAutomatedSuccess—Salesforce Authenticator approved the request for
access because the request came from a trusted location. After users enable location
services in Salesforce Authenticator, they can designate trusted locations. When a user
trusts a location for a particular activity, that activity is approved from the trusted location
for as long as the location is trusted. Logging in from a recognized device is an example.
• TwoFADenied—The user denied the approval request in the authenticator app, such
as Salesforce Authenticator.
• TwoFAFailedGeneralError—An error caused by something other than an
invalid verification code, too many verification attempts, or authenticator app connectivity.
• TwoFAFailedInvalidCode—The user provided an invalid verification code.
• TwoFAFailedTooManyAttempts—The user attempted to verify identity too
many times. For example, the user entered an invalid verification code repeatedly.
• TwoFAInitiated—Salesforce initiated identity verification but hasn’t yet challenged
the user.
• TwoFAInProgress—Salesforce challenged the user to verify identity and is waiting
for the user to respond or for Salesforce Authenticator to send an automated response.
535
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• TwoFANoAction—The policy specifies multi-factor authentication (formerly called
two-factor authentication) as an action, but the user is already in a high-assurance session.
• TwoFARecoverableError—Salesforce can’t reach the authenticator app to verify
identity, but retries.
• TwoFAReportedDenied—The user denied the approval request in the authenticator
app, such as Salesforce Authenticator, and flagged the approval request to report to an
administrator.
• TwoFASucceeded—The user’s identity was verified.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
QueriedEntities Type
string
Properties
Nillable
Description
The entities in the SOQL query. For example, Opportunity, Lead, Account, or Case. Can also
include custom objects. For relationship queries, the value of this field contains all entities
involved in the query. If the query returns 0 records, then the value of this field is null.
Examples
• For SELECT Contact.FirstName, Contact.Account.Name from
Contact, the value of QueriedEntities is Account, Contact.
• For SELECT Account.Name, (SELECT Contact.FirstName,
Contact.LastName FROM Account.Contacts) FROM Account, the
value of QueriedEntities is Account, Contact.
• For SELECT Id, Name, Account.Name FROM Contact WHERE
Account.Industry = 'media', the value of QueriedEntities is
Account, Contact.
Records Type
json
Properties
Nillable
Description
A JSON string that represents the report’s data. For example,
{"totalSize":1,"rows":[{"datacells":["005B0000001vURv","001B000000fewai"]}]}.
RelatedEventIdentifier Type
string
Properties
Nillable
536
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
ReportId Type
reference
Properties
Nillable
Description
The ID of the report associated with this event. For example, 00OB00000032FHdMAM.
This is a relationship field.
Relationship Name
Report
Relationship Type
Lookup
Refers To
Report
RowsProcessed Type
double
Properties
Nillable
Description
The total number of rows returned in the report. When report data is divided into multiple
report events, this value is the same for all data chunks. For more information, see
ExecutionIdentifier.
Scope Type
string
Properties
Nillable
Description
Defines the scope of the data on which the user ran the report. For example, users can run
the report against all opportunities, opportunities they own, or opportunities their team
owns. Possible values are:
• user—User owns the objects the report was run against.
537
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• team—Team owns the objects the report was run against.
• organization—Report was run against all applicable objects.
Sequence Type
int
Properties
Nillable
Description
Incremental sequence number that indicates the order of multiple events that result from
a given report execution.
When a report execution returns many records, Salesforce splits this data into chunks based
on the size of the records, and then creates separate multiple ReportEventStreams. The field
values in each of these correlated ReportEventStreams are the same, except for Records
and Sequence. Records contains the different data chunks. Sequence identifies
each chunk in order. Every report execution has a unique ExecutionIdentifier
value to differentiate it from other report executions. To view all the data chunks from a
single report execution, use the Sequence and ExecutionIdentifier fields in
combination.
When a report executes, we provide the first 1,000 events with data in the Records field.
Use the ReportId field to view the full report.
For more information, see ExecutionIdentifier.
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. This value is null if the event that
was generated was from a dashboard refresh, a multi-block report, or a scheduled report.
For example, vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
538
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• LOW—The user’s security level for the current session meets the lowest requirements.
This low level isn’t available, nor used, in the Salesforce UI. User sessions through the UI
are either standard or high assurance. You can set this level using the API, but users
assigned this level experience unpredictable and reduced functionality in their Salesforce
org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
This value is null if the event that was generated was from a dashboard refresh, a multi-block
report, or a scheduled report.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
UserId Type
reference
Properties
Filter, Sort
Description
The origin user’s unique ID. For example, 005B0000001vURv.
This is a polymorphic relationship field.
Relationship Name
User
Relationship Type
Lookup
Refers To
User
Username Type
string
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
539
Platform Events Developer Guide Standard Platform Event Objects
• EventIdentifier can have a range query when the order is EventDate, EventIdentifier.
Note: As a beta feature, the UserId filter in ReportEvent is a preview and isn’t part of the “Services” under your Main Services
Agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally
available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame
or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as
is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions,
Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content
apply equally to your use of this feature.
This list provides some examples of valid and invalid queries.
• Unfiltered query
– Valid—Contains no WHERE clause, so no special rules apply.
SELECT DashboardId,Description,DisplayedFieldEntities,EventDate,Format,UserId
FROM ReportEvent
– Valid—Filter on UserId (Beta) and EventDate. EventDate can also have a range filter if the order of the filter is UserId
(Beta), EventDate.
SELECT DashboardId,Description,DisplayedFieldEntities,EventDate,Format,UserId
FROM ReportEvent
WHERE UserId='005B0000001vURv' AND EventDate<=TODAY
540
Platform Events Developer Guide Standard Platform Event Objects
• Filter on EventDate
– Valid—You can filter on EventDate using date literals. Or you can include a range query when you filter on EventDate
alone.
SELECT DashboardId,Description,DisplayedFieldEntities,EventDate,Format,UserId
FROM ReportEvent
WHERE EventDate<=TODAY
– Invalid—Filtering on EventDate with <= or >= operator and EventIdentifier field isn’t supported.
SELECT DashboardId,Description,DisplayedFieldEntities,EventDate,Format,UserId
FROM ReportEvent
WHERE EventDate<=2014-11-27T14:54:16.000Z AND
EventIdentifier='f0b28782-1ec2-424c-8d37-8f783e0a3754'
SEE ALSO:
Big Objects Implementation Guide
ReportEventStream
Tracks report-related actions, such as when a user runs or exports a report. This object is available in API version 46.0 and later.
541
Platform Events Developer Guide Standard Platform Event Objects
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/ReportEventStream
Fields
Field Details
ColumnHeaders Type
string
Properties
Nillable
Description
Comma-separated values of column headers of the report. Values listed are object names,
field names, and field values except where aliases are used. For example, [Opportunity.Name,
Opportunity.Type, Opportunity.Owner.UserRole.RollupDescription,
Opportunity.Account.Name, Opportunity.Account.NumberOfEmployees, AGE].
DashboardId Type
string
Properties
Nillable
542
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The ID of the dashboard that the report was part of. For example, 01ZB0000000PmoQ.
DashboardName Type
string
Properties
Nillable
Description
The title of the dashboard that the report was part of.
Description Type
string
Properties
Nillable
Description
The description of the report.
DisplayedFieldEntities Type
string
Properties
Nillable
Description
The API values of the fields that are displayed on the report, including the names of the
entities of the grouped column fields. For example, [ACCOUNTS, OWNERS].
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Nillable
Description
The time when the specified report event was captured (after query execution takes place).
For example, 2020-01-20T19:12:26.965Z. Milliseconds are the most granular
setting.
543
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event. For example, 0a4779b0-0da1-4619-a373-0a36991dff90.
EventSource Type
picklist
Properties
Nillable, Restricted Picklist
Description
The source of the event. Possible values are:
• API—The user generated the report from an API call.
• Classic—The user generated the report from the Salesforce Classic UI.
• Lightning—The user generated the report from Lightning Experience.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
ExecutionIdentifier Type
string
Properties
Nillable
Description
When report data is divided into multiple report events, use this unique identifier to correlate
the multiple data chunks. For example, if each chunk has the same
ExecutionIdentifier of a50a4025-84f2-425d-8af9-2c780869f3b5, you can link them
together to get all the data for the report execution. The Sequence field contains the
incremental sequence numbers that indicate the order of the multiple events.
For more information, see Sequence.
ExportFileFormat Type
string
Properties
Nillable
544
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
If the user exported the report, this value indicates the format of the exported report. Possible
values are:
• CSV
• Excel
Format Type
picklist
Properties
Defaulted on create, Nillable, Restricted picklist
Description
The format of the report. Possible values are:
• Matrix
• MultiBlock
• Summary
• Tabular
GroupedColumnHeaders Type
string
Properties
Nillable
Description
Comma-separated values of grouped column fields in summary, matrix, and joined reports.
For example, [USERNAME, ACCOUNT.NAME, TYPE, DUE_DATE,
LAST_UPDATE, ADDRESS1_STATE].
IsScheduled Type
boolean
Properties
Defaulted on create
Description
If TRUE, the report was scheduled. If FALSE, the report wasn’t scheduled.
LoginHistoryId Type
reference
Properties
Nillable
Description
Tracks a user session so that you can correlate user activity with a particular series of report
events. This field is also available on the LoginHistory, AuthSession, and LoginHistory objects,
making it easier to trace events back to a user’s original authentication. This value is null if
545
Platform Events Developer Guide Standard Platform Event Objects
Field Details
the event that was generated was from a dashboard refresh, a multi-block report, or a
scheduled report. For example, 0YaB000002knVQLKA2.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. This value is
null if the event that was generated was from a dashboard refresh, a multi-block report, or
a scheduled report. For example, lUqjLPQTWRdvRG4.
Name Type
string
Properties
Nillable
Description
The display name of the report. The value is null for report previews.
NumberOfColumns Type
int
Properties
Nillable
Description
The number of columns in the report.
Operation Type
picklist
Properties
Nillable, Restricted Picklist
Description
The context in which the report executed, such as from a UI (Classic, Lightning, Mobile),
through an API (synchronous, asynchronous, Apex), or through a dashboard. Possible values
are:
• ChartRenderedInEmbeddedAnalyticsApp—Report executed from a
rendered chart in an embedded Analytics app.
• ChartRenderedOnHomePage—Report executed from a rendered chart on the
home page.
• ChartRenderedOnVisualforcePage—Report executed from a rendered chart
on a VisualForce Page.
546
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• DashboardComponentPreviewed—Report executed from a Lightning dashboard
component preview.
• DashboardComponentUpdated—Report executed when a user refreshed a
dashboard component. Because the report resulted from an asynchronous operation,
session information, contained in the fields SessionKey, LoginKey,
SessionLevel, and SourceIp, isn’t captured.
• ProbeQuery—Report executed from a probe query.
• ReportAddedToCampaign—Report was added from an Add to Campaign action.
• ReportExported—Report executed from a printable view or report export that
wasn’t asynchronous nor an API export.
• ReportExportedAsynchronously—Report was exported asynchronously.
• ReportExportedUsingExcelConnector—Report was exported using the
Excel connector.
• ReportOpenedFromMobileDashboard—Report executed when a user clicked
a dashboard component on a mobile device and drilled down to a report.
• ReportPreviewed—Report executed when a user got preview results while using
the report builder.
• ReportResultsAddedToEinsteinDiscovery—Report executed
synchronously from Einstein Discovery.
• ReportResultsAddedToWaveTrending—Report executed when a user
trended a report in Einstein Analytics.
• ReportRunAndNotificationSent—Report executed through the notifications
API.
• ReportRunFromClassic—Report executed from the Run Report option of
Salesforce Classic.
• ReportRunFromLightning—Report executed from the Run option in Lightning
Experience from a non-mobile browser.
• ReportRunFromMobile—Report executed from the Run Report option of the
mobile Salesforce app.
• ReportRunFromReportingSnapshot—Report executed through Snapshot
Analytics.
• ReportRunFromRestApi—Report executed from REST API.
• ReportRunUsingApexAsynchronousApi—Report executed from the
asynchronous Apex API.
• ReportRunUsingApexSynchronousApi—Report executed from the
synchronous Apex API.
• ReportRunUsingAsynchronousApi—Report executed from an asynchronous
API.
• ReportRunUsingSynchronousApi—Report executed from a synchronous API.
• ReportScheduled—Report was scheduled.
• Test—Report execution resulted from a test.
• Unknown—Report execution origin is unknown.
547
Platform Events Developer Guide Standard Platform Event Objects
Field Details
OwnerId Type
string
Properties
Nillable
Description
The ID of the folder, organization, or user who owns the report. This value is blank if the
report wasn’t saved. For example, 005B0000001vURvIAM.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Block—The user was blocked from performing the operation that triggered the policy.
• Error—The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• FailedInvalidPassword—The user entered an invalid password.
• FailedPasswordLockout—The user entered an invalid password too many
times.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user wasn't blocked from performing the operation.
• NoAction—The policy didn't trigger.
• Notified—A notification was sent to the recipient.
• TwoFAAutomatedSuccess—Salesforce Authenticator approved the request for
access because the request came from a trusted location. After users enable location
services in Salesforce Authenticator, they can designate trusted locations. When a user
trusts a location for a particular activity, such as logging in from a recognized device,
that activity is approved from the trusted location for as long as the location is trusted.
548
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• TwoFADenied—The user denied the approval request in the authenticator app, such
as Salesforce Authenticator.
• TwoFAFailedGeneralError—An error caused by something other than an
invalid verification code, too many verification attempts, or authenticator app connectivity.
• TwoFAFailedInvalidCode—The user provided an invalid verification code.
• TwoFAFailedTooManyAttempts—The user attempted to verify identity too
many times. For example, the user entered an invalid verification code repeatedly.
• TwoFAInitiated—Salesforce initiated identity verification but hasn’t yet challenged
the user.
• TwoFAInProgress—Salesforce challenged the user to verify identity and is waiting
for the user to respond or for Salesforce Authenticator to send an automated response.
• TwoFANoAction—The policy specifies multi-factor authentication (formerly called
two-factor authentication) as an action, but the user is already in a high-assurance session.
• TwoFARecoverableError—Salesforce can’t reach the authenticator app to verify
identity, but will retry.
• TwoFAReportedDenied—The user denied the approval request in the authenticator
app, such as Salesforce Authenticator, and also flagged the approval request to report
to an administrator.
• TwoFASucceeded—The user’s identity was verified.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
QueriedEntities Type
string
Properties
Nillable
Description
The entities in the SOQL query. For example, Opportunity, Lead, Account, or Case. Can also
include custom objects. For relationship queries, the value of this field contains all entities
involved in the query. If the query returns 0 records, then the value of this field is null.
Examples
• For SELECT Contact.FirstName, Contact.Account.Name from
Contact, the value of QueriedEntities is Account, Contact.
• For SELECT Account.Name, (SELECT Contact.FirstName,
Contact.LastName FROM Account.Contacts) FROM Account, the
value of QueriedEntities is Account, Contact.
• For SELECT Id, Name, Account.Name FROM Contact WHERE
Account.Industry = 'media', the value of QueriedEntities is
Account, Contact.
Records Type
json
549
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
A JSON string that represents the report’s data. For example,
{"totalSize":1,"rows":[{"datacells":["005B0000001vURv","001B000000fewai"]}]}.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event. For example,
bd76f3e7-9ee5-4400-9e7f-54de57ecd79c.
This field is populated only when the activity that this event monitors requires extra
authentication, such as multi-factor authentication. In this case, Salesforce generates more
events and sets the RelatedEventIdentifier field of the new events to the value
of the EventIdentifier field of the original event. Use this field with the
EventIdentifier field to correlate all the related events. If no extra authentication is
required, this field is blank.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
ReportId Type
string
Properties
Nillable
Description
The ID of the report associated with this event. For example, 00OB00000032FHdMAM.
RowsProcessed Type
double
Properties
Nillable
550
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The total number of rows returned in the report. When report data is divided into multiple
report events, this value is the same for all data chunks. For more information, see
ExecutionIdentifier.
Scope Type
string
Properties
Nillable
Description
Defines the scope of the data on which the user ran the report. For example, users can run
the report against all opportunities, opportunities they own, or opportunities their team
owns. Possible values are:
• user—User owns the objects the report was run against.
• team—Team owns the objects the report was run against.
• organization—Report was run against all applicable objects.
Sequence Type
int
Properties
Nillable
Description
Incremental sequence number that indicates the order of multiple events that result from
a given report execution.
When a report execution returns many records, Salesforce splits this data into chunks based
on the size of the records, and then creates multiple correlated ReportEventStreams. The
field values in each of these correlated ReportEventStreams are the same, except for
Records, which contains the different data chunks, and Sequence, which identifies
each chunk in order. Every report execution has a unique ExecutionIdentifier
value to differentiate it from other report executions. To view all the data chunks from a
single report execution, use the Sequence and ExecutionIdentifier fields in
combination.
When a report executes, we provide the first 1,000 events with data in the Records field.
Use the ReportId field to view the full report.
For more information, see Sequence.
SessionKey Type
string
Properties
Nillable
551
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. This value is null if the event that
was generated was from a dashboard refresh, a multi-block report, or a scheduled report.
For example, vMASKIU6AxEr+Op5.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
This low level isn’t available, nor used, in the Salesforce UI. User sessions through the UI
are either standard or high assurance. You can set this level using the API, but users
assigned this level experience unpredictable and reduced functionality in their Salesforce
org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
This value is null if the event that was generated was from a dashboard refresh, a multi-block
report, or a scheduled report.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
UserId Type
reference
Properties
Nillable
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
552
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
SessionHijackingEvent
Tracks when unauthorized users gain ownership of a Salesforce user’s session with a stolen session identifier. To detect such an event,
Salesforce evaluates how significantly a user’s current browser fingerprint diverges from the previously known fingerprint using a
probabilistically inferred significance of change. This object is available in API version 49.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
Subscription Channel
/event/SessionHijackingEvent
553
Platform Events Developer Guide Standard Platform Event Objects
Fields
Field Details
CurrentIp Type
string
Properties
Nillable
Description
The IP address of the newly observed fingerprint that deviates from the previous fingerprint.
The difference between the current and previous values is one indicator that a session
hijacking attack has occurred. See the PreviousIp field for the previous IP address. If the
IP address didn’t contribute to the observed fingerprint deviation, the value of this field is
the same as the PreviousIp field value. For example, 126.7.4.2.
CurrentPlatform Type
string
Properties
Nillable
Description
The platform of the newly observed fingerprint that deviates from the previous fingerprint.
The difference between the current and previous values is one indicator that a session
hijacking attack has occurred. See the PreviousPlatform field for the previous platform.
If the platform didn’t contribute to the observed fingerprint deviation, the value of this field
is the same as the PreviousPlatform field value. For example, MacIntel or Win32.
CurrentScreen Type
string
Properties
Nillable
Description
The screen of the newly observed fingerprint that deviates from the previous fingerprint.
The difference between the current and previous values is one indicator that a session
hijacking attack has occurred. See the PreviousScreen field for the previous screen. If
the screen didn’t contribute to the observed fingerprint deviation, the value of this field is
the same as the PreviousScreen field value. For example, (900.0,1440.0) or
(720,1280).
CurrentUserAgent Type
textarea
Properties
Nillable
Description
The user agent of the newly observed fingerprint that deviates from the previous fingerprint.
The difference between the current and previous values is one indicator that a session
554
Platform Events Developer Guide Standard Platform Event Objects
Field Details
hijacking attack has occurred. See the PreviousUserAgent field for the previous user
agent. If the user agent didn’t contribute to the observed fingerprint deviation, the value of
this field is the same as the PreviousUserAgent field value. For example,
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100
Safari/537.36.
CurrentWindow Type
string
Properties
Nillable
Description
The browser window of the newly observed fingerprint that deviates from the previous
fingerprint. The difference between the current and previous values is one indicator that a
session hijacking attack has occurred. See the PreviousWindow field for the previous
window. If the window didn’t contribute to the observed fingerprint deviation, the value of
this field is the same as the PreviousWindow field value. For example,
(1200.0,1920.0).
EvaluationTime Type
double
Properties
Nillable
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Nillable
Description
The time when the anomaly was detected. For example, 2020-01-20T19:12:26.965Z.
Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
555
Platform Events Developer Guide Standard Platform Event Objects
Field Details
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
PolicyId Type
reference
Properties
Nillable
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
A relationship field.
Relationship Name
Policy
Relationship Type
Lookup
Refers To
TransactionSecurityPolicy
PolicyOutcome Type
picklist
Properties
Nillable, Restricted picklist
Description
The result of the transaction policy. Possible values are:
• Error - The policy caused an undefined error when it executed.
556
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction - The policy didn't trigger.
• Notified - A notification was sent to the recipient.
This field isn’t populated until all transaction security policies are processed for the real-time
event.
PreviousIp Type
string
Properties
Nillable
Description
The IP address of the previous fingerprint. The IP address of the newly observed fingerprint
deviates from this value. The difference between the current and previous values is one
indicator that a session hijacking attack has occurred. See the CurrentIp field for the
newly observed IP address. For example, 128.7.5.2.
PreviousPlatform Type
string
Properties
Nillable
Description
The platform of the previous fingerprint. The platform of the newly observed fingerprint
deviates from this value. The difference between the current and previous values is one
indicator that a session hijacking attack has occurred. See the CurrentPlatform field
for the newly observed platform. For example, Win32 or iPhone.
PreviousScreen Type
string
Properties
Nillable
Description
The screen of the previous fingerprint. The screen of the newly observed fingerprint deviates
from this value. The difference between the current and previous values is one indicator that
a session hijacking attack has occurred. See the CurrentScreen field for the newly
observed screen. For example, (1200.0,1920.0).
PreviousUserAgent Type
textarea
557
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The user agent of the previous fingerprint. The user agent of the newly observed fingerprint
deviates from this value. The difference between the current and previous values is one
indicator that a session hijacking attack has occurred. See the CurrentUserAgent field
for the newly observed user agent. For example, Mozilla/5.0 (iPhone; CPU
iPhone OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML,
like Gecko).
PreviousWindow Type
string
Properties
Nillable
Description
The browser window of the previous fingerprint. The window of the newly observed
fingerprint deviates from this value. The difference between the current and previous values
is one indicator that a session hijacking attack has occurred. See the CurrentWindow
field for the newly observed window. For example, (1600.0,1920.0).
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
Score Type
double
Properties
Nillable
Description
Specifies how significant the new browser fingerprint deviates from the previous one. The
score is a number from 0.0 (lowest amount of deviation) through 1.0 (highest amount of
deviation). The event exposes five field pairs (such as CurrentIp and PreviousIp)
to view the before and after data for the five most interesting browser features that
contributed to this anomaly. See the SecurityEventData field for all contributing
features in JSON format.
Salesforce detects session hijacking by comparing browser fingerprints in a given user session
and evaluating how significantly a newly observed fingerprint deviates from the existing
558
Platform Events Developer Guide Standard Platform Event Objects
Field Details
one. A large deviation score (0.8 or more) between two intra-session fingerprints indicates
that two different browsers are active in the same session. The presence of two active browsers
usually means that session hijacking has occurred.
SecurityEventData Type
string
Properties
Nillable
Description
The set of browser fingerprint features about the session hijacking that triggered this event.
See the Threat Detection documentation for the list of possible features.
For example, let’s say that a user’s current browser fingerprint diverges from their previously
known fingerprint. If Salesforce concludes their session was hijacked, it fires this event and
the contributing features are captured in this field in JSON format. Each feature describes a
particular browser fingerprint property, such as the browser user agent, window, or platform.
The data includes the current and previous values for each feature.
Example
[
{
"featureName": "userAgent",
"featureContribution": "0.45 %",
"previousValue": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142",
559
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
Summary Type
textarea
Properties
Nillable
Description
A text summary of the threat that caused this event to be created. The summary lists the
browser fingerprint features that most contributed to the threat detection along with their
contribution to the total score.
Example
• Changes to (userAgent, platform, ipAddress) were not
expected based on this user's profile. These top 3
deviations contributed (1, 1, 0.922) to the total score,
respectively
• Changes to (ipAddress, userAgent, platform, languages,
color) were not expected based on this user's profile.
These top 5 deviations contributed (1, 0.695, 0.695,
0.25, 0.223) to the total score, respectively
UserId Type
reference
Properties
Nillable
560
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The origin user’s unique ID. For example, 005000000000123.
A polymorphic relationship field.
Relationship Name
User
Relationship Type
Lookup
Refers To
User
Username Type
string
Properties
Nillable
Description
The origin username in the format of [email protected] at the time the event was
created.
SessionHijackingEventStore
Tracks when unauthorized users gain ownership of a Salesforce user’s session with a stolen session identifier. To detect such an event,
Salesforce evaluates how significantly a user’s current browser fingerprint diverges from the previously known fingerprint using a
probabilistically inferred significance of change. SessionHijackingEventStore is an object that stores the event data of SessionHijackingEvent.
This object is available in API version 49.0 and later.
Supported Calls
describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query()
Fields
Field Details
CurrentIp Type
string
Properties
Filter, Group, Nillable, Sort
561
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
The IP address of the newly observed fingerprint that deviates from the previous fingerprint.
The difference between the current and previous values is one indicator that a session
hijacking attack has occurred. See the PreviousIp field for the previous IP address. If the
IP address didn’t contribute to the observed fingerprint deviation, the value of this field is
the same as the PreviousIpfield value. For example, 126.7.4.2.
CurrentPlatform Type
string
Properties
Filter, Group, Nillable, Sort
Description
The platform of the newly observed fingerprint that deviates from the previous fingerprint.
The difference between the current and previous values is one indicator that a session
hijacking attack has occurred. See the PreviousPlatform field for the previous platform.
If the platform didn’t contribute to the observed fingerprint deviation, the value of this field
is the same as the PreviousPlatform field value. For example, MacIntel or Win32.
CurrentScreen Type
string
Properties
Filter, Group, Nillable, Sort
Description
The screen of the newly observed fingerprint that deviates from the previous fingerprint.
The difference between the current and previous values is one indicator that a session
hijacking attack has occurred. See the PreviousScreen field for the previous screen. If
the screen didn’t contribute to the observed fingerprint deviation, the value of this field is
the same as the PreviousScreen field value. For example, (900.0,1440.0) or
(720,1280).
CurrentUserAgent Type
textarea
Properties
Nillable
Description
The user agent of the newly observed fingerprint that deviates from the previous fingerprint.
The difference between the current and previous values is one indicator that a session
hijacking attack has occurred. See the PreviousUserAgent field for the previous user
agent. If the user agent didn’t contribute to the observed fingerprint deviation, the value of
this field is the same as the PreviousUserAgent field value. For example,
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100
Safari/537.36.
562
Platform Events Developer Guide Standard Platform Event Objects
Field Details
CurrentWindow Type
string
Properties
Filter, Group, Nillable, Sort
Description
The browser window of the newly observed fingerprint that deviates from the previous
fingerprint. The difference between the current and previous values is one indicator that a
session hijacking attack has occurred. See the PreviousWindow field for the previous
window. If the window didn’t contribute to the observed fingerprint deviation, the value of
this field is the same as the PreviousWindow field value. For example,
(1200.0,1920.0).
EvaluationTime Type
double
Properties
Filter, Nillable, Sort
Description
The amount of time it took to evaluate the policy in milliseconds. This field isn’t populated
until all transaction security policies are processed for the real-time event.
EventDate Type
dateTime
Properties
Filter, Sort
Description
Required. The time when the anomaly was detected. For example,
2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Filter, Group, Sort
Description
Required. The unique ID of the event. For example,
0a4779b0-0da1-4619-a373-0a36991dff90.
LastReferencedDate Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed a record related to this record.
563
Platform Events Developer Guide Standard Platform Event Objects
Field Details
LastViewedDate Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed this record. If this value is null, it’s
possible that this record was referenced (LastReferencedDate) and not viewed.
LoginKey Type
string
Properties
Filter, Group, Nillable, Sort
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
lUqjLPQTWRdvRG4.
PolicyId Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID of the transaction policy associated with this event. For example,
0NIB000000000KOOAY. This field isn’t populated until all transaction security policies are
processed for the real-time event.
PolicyOutcome Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The result of the transaction policy. Possible values are:
• Error - The policy caused an undefined error when it executed.
• ExemptNoAction—The user is exempt from transaction security policies, so the
policy didn’t trigger.
• MeteringBlock—The policy took longer than 3 seconds to process, so the user was
blocked from performing the operation.
• MeteringNoAction—The policy took longer than 3 seconds to process, but the
user isn't blocked from performing the operation.
• NoAction - The policy didn't trigger.
• Notified - A notification was sent to the recipient.
564
Platform Events Developer Guide Standard Platform Event Objects
Field Details
This field isn’t populated until all transaction security policies are processed for the real-time
event.
PreviousIp Type
string
Properties
Filter, Group, Nillable, Sort
Description
The IP address of the previous fingerprint. The IP address of the newly observed fingerprint
deviates from this value. The difference between the current and previous values is one
indicator that a session hijacking attack has occurred. See the CurrentIp field for the
newly observed IP address. For example, 128.7.5.2.
PreviousPlatform Type
string
Properties
Filter, Group, Nillable, Sort
Description
The platform of the previous fingerprint. The platform of the newly observed fingerprint
deviates from this value. The difference between the current and previous values is one
indicator that a session hijacking attack has occurred. See the CurrentPlatform field
for the newly observed platform. For example, Win32 or iPhone.
PreviousScreen Type
string
Properties
Filter, Group, Nillable, Sort
Description
The screen of the previous fingerprint. The screen of the newly observed fingerprint deviates
from this value. The difference between the current and previous values is one indicator that
a session hijacking attack has occurred. See the CurrentScreen field for the newly
observed screen. For example, (1200.0,1920.0).
PreviousUserAgent Type
textarea
Properties
Nillable
Description
The user agent of the previous fingerprint. The user agent of the newly observed fingerprint
deviates from this value. The difference between the current and previous values is one
indicator that a session hijacking attack has occurred. See the CurrentUserAgent field
for the newly observed user agent. For example, Mozilla/5.0 (iPhone; CPU
565
Platform Events Developer Guide Standard Platform Event Objects
Field Details
iPhone OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML,
like Gecko).
PreviousWindow Type
string
Properties
Filter, Group, Nillable, Sort
Description
The browser window of the previous fingerprint. The window of the newly observed
fingerprint deviates from this value. The difference between the current and previous values
is one indicator that a session hijacking attack has occurred. See the CurrentWindow
field for the newly observed window. For example, (1600.0,1920.0).
Score Type
double
Properties
Filter, Nillable, Sort
Description
Specifies how significant the new browser fingerprint deviates from the previous one. The
score is a number from 0.0 (lowest amount of deviation) through 1.0 (highest amount of
deviation). The event exposes five field pairs (such as CurrentIp and PreviousIp)
to view the before and after data for the five most interesting browser features that
contributed to this anomaly. See the SecurityEventData field for all contributing
features in JSON format.
Salesforce detects session hijacking by comparing browser fingerprints in a given user session
and evaluating how significantly a newly observed fingerprint deviates from the existing
one. A large deviation score (0.8 or more) between two intra-session fingerprints indicates
that two different browsers are active in the same session. The presence of two active browsers
usually means that session hijacking has occurred.
SecurityEventData Type
textarea
Properties
Nillable
Description
The set of browser fingerprint features about the session hijacking that triggered this event.
See the Threat Detection documentation for the list of possible features.
For example, let’s say that a user’s current browser fingerprint diverges from their previously
known fingerprint. If Salesforce concludes their session was hijacked, it fires this event and
the contributing features are captured in this field in JSON format. Each feature describes a
particular browser fingerprint property, such as the browser user agent, window, or platform.
The data includes the current and previous values for each feature.
566
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Example
[
{
"featureName": "userAgent",
"featureContribution": "0.45 %",
"previousValue": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142",
SessionHijackingEventNumber Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
The unique number assigned by the system after the event is received in Salesforce. This ID
is different than the replayID field on the streaming event SessionHijackingEvent. You can't
change the format or value for this field.
567
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SessionKey Type
string
Properties
Filter, Group, Nillable, Sort
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started. For example, vMASKIU6AxEr+Op5.
SourceIp Type
string
Properties
Filter, Group, Nillable, Sort
Description
The source IP address of the client that logged in. For example, 126.7.4.2.
Summary Type
textarea
Properties
Nillable
Description
A text summary of the threat that caused this event to be created. The summary lists the
browser fingerprint features that most contributed to the threat detection along with their
contribution to the total score.
Example
• Changes to (userAgent, platform, ipAddress) were not
expected based on this user's profile. These top 3
deviations contributed (1, 1, 0.922) to the total score,
respectively
• Changes to (ipAddress, userAgent, platform, languages,
color) were not expected based on this user's profile.
These top 5 deviations contributed (1, 0.695, 0.695,
0.25, 0.223) to the total score, respectively
UserId Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The origin user’s unique ID. For example, 005000000000123.
Username Type
string
568
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Filter, Group, Nillable, Sort
Description
The origin username in the format of [email protected] at the time the event was
created.
Associated Object
This object has the following associated object. It’s available in the same API version as this object.
SessionHijackingEventStoreFeed
Feed tracking is available for the object.
UriEvent
Detects when a user creates, accesses, updates, or deletes a record in Salesforce Classic only. Doesn't detect record operations done
through a Visualforce page or Visualforce page views. UriEvent and is a big object that stores the event data of UriEventStream. This
object is available in API version 46.0 and later.
Supported Calls
describeSObjects(), query()
Fields
Field Details
EventDate Type
dateTime
Properties
Filter. Sort
Description
The time when the specified URI event was captured (after query execution takes place). For
example, 2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
569
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Filter, Sort
Description
The unique ID of the event. For example,
0a4779b0-0da1-4619-a373-0a36991dff90.
LoginKey Type
string
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
8gHOMQu+xvjCmRUt.
Message Type
string
Properties
Nillable
Description
The failure message if the operation being performed on the entity failed
(OperationStatus=FAILURE).
Name Type
string
Properties
Nillable
Description
The value of the record being viewed/edited.
Operation Type
picklist
Properties
Nillable, Restricted picklist
Description
The operation being performed on the entity. For example, Read, Create, Update.
or Delete.
Create and update operations are captured in pairs; that is, expect two event records for
each operation. The first record represents the start of the operation, and the second record
represents whether the operation was successful or not.
570
Platform Events Developer Guide Standard Platform Event Objects
Field Details
If there isn’t a second event recorded for a create or update operation, then the user canceled
the operation, or the operation failed with client-side validation (for example, when a required
field is empty).
OperationStatus Type
picklist
Properties
Nillable, Restricted picklist
Description
Whether the operation performed on the entity (such as create) succeeded or failed. When
the operation starts, the value is always INITIATED. Possible values are:
• Failure—The operation failed.
• Initiated—The operation started.
QueriedEntities Type
string
Properties
Nillable
Description
The API name of the objects referenced by the URI.
RecordId Type
reference
Properties
Nillable
Description
The ID of the record being viewed or edited. For example, 001RM000003cjx6YAA.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event.
SessionKey Type
string
571
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
Note: This low level is not available, nor used, in the Salesforce UI. User sessions
through the UI are either standard or high assurance. You can set this level using
the API, but users assigned this level will experience unpredictable and reduced
functionality in their Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client logging in. For example, 126.7.4.2.
UserId Type
reference
Properties
Nillable
Description
The user’s unique ID. For example, 005RM000001ctYJYAY.
UserName Type
string
572
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The username in the format of [email protected] at the time the event was created.
UserType Type
picklist
Properties
Nillable, Restricted picklist
Description
The category of user license. Each UserType is associated with one or more UserLicense
records. Each UserLicense is associated with one or more profiles. Valid values are:
• CsnOnly—Users whose access to the application is limited to Chatter. This user type
includes Chatter Free and Chatter moderator users.
• CspLitePortal—CSP Lite Portal license. Users whose access is limited because
they are organization customers and access the application through a customer portal
or Experience Cloud site.
• CustomerSuccess—Customer Success license. Users whose access is limited
because they are organization customers and access the application through a customer
portal.
• Guest
• PowerCustomerSuccess—Power Customer Success license. Users whose access
is limited because they are organization customers and access the application through
a customer portal. Users with this license type can view and edit data they directly own
or data owned by or shared with users below them in the customer portal role hierarchy.
• PowerPartner—Power Partner license. Users whose access is limited because they
are partners and typically access the application through a partner portal or site.
• SelfService
• Standard—Standard user license. This user type also includes Salesforce Platform
and Salesforce Platform One user licenses.
573
Platform Events Developer Guide Standard Platform Event Objects
• Filtered on EventDate—you can filter solely on EventDate, but single filters on other fields fail. You can also use a comparison
operator in this query type.
– Valid—you can filter solely on EventDate, but single filters on other fields fail. You can also use a comparison operator in
this query type.
SELECT EntityType, UserName, UserType
FROM UriEvent
WHERE EventDate>=2014-11-27T14:54:16.000Z
SEE ALSO:
LightningUriEvent
Big Objects Implementation Guide
UriEventStream
Detects when a user creates, accesses, updates, or deletes a record in Salesforce Classic only. Doesn't detect record operations done
through a Visualforce page or Visualforce page views. This object is available in API version 46.0 and later.
Supported Calls
describeSObjects()
Supported Subscribers
Subscriber Supported?
Apex Triggers
Flows
Processes
Pub/Sub API
574
Platform Events Developer Guide Standard Platform Event Objects
Subscription Channel
/event/UriEventStream
Fields
Field Details
EventDate Type
dateTime
Properties
Nillable
Description
The time when the specified URI event was captured (after query execution takes place). For
example, 2020-01-20T19:12:26.965Z. Milliseconds are the most granular setting.
EventIdentifier Type
string
Properties
Nillable
Description
The unique ID of the event, which is shared with the corresponding storage object. For
example, 0a4779b0-0da1-4619-a373-0a36991dff90. Use this field to correlate
the event with its storage object.
EventUuid Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is
available in API version 52.0 and later.
LoginKey Type
string
575
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Properties
Nillable
Description
The string that ties together all events in a given user’s login session. The session starts with
a login event and ends with either a logout event or the user session expiring. For example,
8gHOMQu+xvjCmRUt
Message Type
string
Properties
Nillable
Description
The failure message if the operation being performed on the entity failed
(OperationStatus=Failure).
Name Type
string
Properties
Nillable
Description
The value of the record being viewed or edited.
Operation Type
picklist
Properties
Nillable, Restricted picklist
Description
The operation being performed on the entity. For example, Read, Create, Update,
or Delete.
Create and update operations are captured in pairs; that is, expect two event records for
each operation. The first record represents the start of the operation, and the second record
represents whether the operation was successful or not. The two records are correlated by
RelatedEventIdentifier.
If there isn’t a second event recorded for a create or update operation, then the user canceled
the operation, or the operation failed with client-side validation (for example, when a required
field is empty).
OperationStatus Type
picklist
Properties
Nillable, Restricted picklist
576
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Description
Whether the operation performed on the entity (such as create) succeeded or failed. When
the operation starts, the value is always INITIATED. Possible values are:
• Failure—The operation failed.
• Initiated—The operation started.
QueriedEntities Type
string
Properties
Nillable
Description
The API name of the objects referenced by the URI.
RecordId Type
string
Properties
Nillable
Description
The id of the record being viewed or edited. For example, 001RM000003cjx6YAA.
RelatedEventIdentifier Type
string
Properties
Nillable
Description
Represents the EventIdentifier of the related event.
ReplayId Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event
in the event stream. Replay ID values aren’t guaranteed to be contiguous for consecutive
events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed
events that are within the retention window.
577
Platform Events Developer Guide Standard Platform Event Objects
Field Details
SessionKey Type
string
Properties
Nillable
Description
The user’s unique session ID. Use this value to identify all user events within a session. When
a user logs out and logs in again, a new session is started.
SessionLevel Type
picklist
Properties
Nillable, Restricted picklist
Description
Session-level security controls user access to features that support it, such as connected apps
and reporting. Possible values are:
• HIGH_ASSURANCE—A high assurance session was used for resource access. For
example, when the user tries to access a resource such as a connected app, report, or
dashboard that requires a high-assurance session level.
• LOW—The user’s security level for the current session meets the lowest requirements.
Note: This low level is not available, nor used, in the Salesforce UI. User sessions
through the UI are either standard or high assurance. You can set this level using
the API, but users assigned this level will experience unpredictable and reduced
functionality in their Salesforce org.
• STANDARD—The user’s security level for the current session meets the Standard
requirements set in the org’s Session Security Levels.
SourceIp Type
string
Properties
Nillable
Description
The source IP address of the client logging in. For example, 126.7.4.2.
UserId Type
reference
Properties
Nillable
Description
The user’s unique ID. For example, 005RM000001ctYJYAY.
This is a polymorphic relationship field.
578
Platform Events Developer Guide Standard Platform Event Objects
Field Details
Relationship Name
User
Relationship Type
Lookup
Refers To
User
UserName Type
string
Properties
Nillable
Description
The username in the format of [email protected] at the time the event was created.
UserType Type
picklist
Properties
Nillable, Restricted picklist
Description
The category of user license. Each UserType is associated with one or more UserLicense
records. Each UserLicense is associated with one or more profiles. Valid values are:
• CsnOnly—Users whose access to the application is limited to Chatter. This user type
includes Chatter Free and Chatter moderator users.
• CspLitePortal—CSP Lite Portal license. Users whose access is limited because
they are organization customers and access the application through a customer portal
or an Experience Cloud site.
• CustomerSuccess—Customer Success license. Users whose access is limited
because they are organization customers and access the application through a customer
portal.
• Guest
• PowerCustomerSuccess—Power Customer Success license. Users whose access
is limited because they are organization customers and access the application through
a customer portal. Users with this license type can view and edit data they directly own
or data owned by or shared with users below them in the customer portal role hierarchy.
• PowerPartner—Power Partner license. Users whose access is limited because they
are partners and typically access the application through a partner portal or site.
• SelfService
579
Platform Events Developer Guide Standard Platform Event Objects
Field Details
• Standard—Standard user license. This user type also includes Salesforce Platform
and Salesforce Platform One user licenses.
SEE ALSO:
LightningUriEventStream
580