When it fires

Fires for folders created via the widget, flow actions, Apex, the REST API, or storage-side sync. Source surface is in origin.

Payload

FieldTypeDescription
resourceIdstringThe new folder’s CloudFiles ID.
librarystringLibrary the folder was created in.
recordIdstringLinked CRM record, if any.
originstringwidget · flow · apex · api · sync
occurredAtdatetimeUTC timestamp.

Consuming the event

In Salesforce, subscribe via Platform Events or the CloudFiles Event custom object (Intercepting CloudFiles Events). In HubSpot, use workflow triggers. Over HTTP, register a webhook.

trigger OnCloudFilesEvent on cloudfiles__Event__e (after insert) {
  for (cloudfiles__Event__e e : Trigger.new) {
    if (e.cloudfiles__Type__c == 'folder.created') {
      // notify, stamp the record, etc.
    }
  }
}