Configure Events & Actions

The Events & Actions section in the Admin Portal lets you create, edit, and delete event listeners and their actions.

Event listeners

The Event Listeners section shows how many listeners you created, their type and status, and how many actions they trigger. Hover to see the linked action name. For details, see create event listeners.

Event listeners list: type, status, and linked actions with hover names

Actions

The Actions section shows how many actions you created, their type and status, and how many listeners link to them. Hover to see the linked listener name. For details, see create actions.

Actions list: type, status, and linked listeners with hover names

Create event listener

To create an event listener:

  1. Open Admin Portal and choose Events & Actions.

  2. Select your app and keyset.

  3. Click + Add Event Listener and select the event source. For sources, see Event source.

    Event source selector: choose Messages, Users, Channels, Mobile Push, or Membership

  4. Choose the event producer and event type.

    Available producers and types

    If you don't see the event type you need, choose a different event source.

  5. Select a filter type. The flow may vary based on the selected source and type.

    NameDescription
    No filter
    Triggers actions for all messages.
    Basic filters
    Predetermined UI conditions.
    Advanced JSONPath
    JSONPath conditions over payload fields.
  6. Pair the listener with an existing action without leaving Event Listeners. In Add Action, pick the action.

  7. Click Save Changes.

Filter types

There are three filter types:

No filter

No setup necessary. Triggers actions for all messages.

Basic filters

After choosing Basic filters, you see two dropdowns—Filters and Conditions—and a Value input.

  1. From Filters, pick a filter.

    NameDescription
    Channel
    Trigger an action after a message is published on a specific channel.
    Sender ID
    Trigger an action after a message is published by a specific sender.
  2. From Conditions, pick a condition.

    NameDescription
    Exact Match
    Trigger an action only if there is an exact match.
    Contains
    Trigger an action if the specified value is found.
  3. In Value, enter the value that must match. For example, an exact match on channel Matrix triggers an action for every message in Matrix.

Advanced JSONPath

JSONPath supports more advanced conditions than Basic filters.

You can use JSONPath to define the following conditions:

Condition nameData typeDescription
channel
string
Name of the channel the message was sent to.
message
any
Message content.
meta
any
Custom metadata.
uuid
string
Sender ID.
User ID / UUID

User ID is also referred to as UUID/uuid in some APIs and server responses but holds the value of the userId parameter you set during initialization.

To recreate the Basic filters example, use:
$.[?(@.channel == "Matrix")]. This triggers an action when a message is published to the Matrix channel.

Create action

Choose the action category and follow its steps.

NameDescription
Webhook
Integrate with a third‑party service.
Amazon SQS
Use a third‑party message queue.
Amazon Kinesis
Use a real‑time streaming service.
Amazon S3
Use third‑party object storage.
Apache Kafka
Export events to Apache Kafka.
IFTTT Webhook
Automate actions across services and devices.
AMQP Action
Export events to AMQP.

Webhook payload example

The JSON below shows a webhook payload triggered when the message Wake up, Neo... is sent by Client-w5h0y on channel Matrix.

User ID / UUID

User ID is also referred to as UUID/uuid in some APIs and server responses but holds the value of the userId parameter you set during initialization.

{
"event": {
"channel": "Matrix",
"eventCategory": "message",
"eventType": "message.publish",
"eventId": "a2748829-a16e-4ce7-b3ed-67021d2c7c65",
"eventPayload": {
"message": "{\"text\":\"Wake up, Neo...\"}",
"meta": {}
},
"iso8601timestamp": "2023-11-28T12:31:32Z",
"subscribeKey": "sub-c-95c7895c-b977-4728-bebe-f2e5db1b4f90",
"timetoken": "17011746925168240",
"senderId": "Client-w5h0y"
},
show all 32 lines

For webhook payloads, see Webhooks.

Last updated on