Events & Actions Payloads

Events & Actions (E&A) payloads vary by event type and by whether the response includes E&A metadata.

Envelopes

See the Envelope section for E&A metadata details.

Payloads are grouped by source, producer, and event type. Examples include both no‑envelope and enveloped variants.

Messages

This section lists event producers for Messages.

Pub/Sub

Message sent

{
"dataSchema": "pubnub.com/schemas/events/messages.pubsub.publish?v=1.0.0",
"data": [
{
"timestamp": "2025-06-05T12:53:15.888Z",
"message": "Message Test",
"meta": null,
"senderId": "Jack-device",
"channel": "Channel-Barcelona",
"timetoken": "17491279958880737"
}
]
}

Message Actions

Message action created

{
"dataSchema": "pubnub.com/schemas/events/messages.pubsub.publish?v=1.0.0",
"data": [
{
"timestamp": "2025-06-05T13:23:06.404Z",
"message": "Test Message",
"meta": null,
"senderId": "Test Message Actions User",
"timetoken": "17491297864048155"
}
]
}

Message action deleted

{
"dataSchema": "pubnub.com/schemas/events/messages.action.deleted?v=1.0.0",
"data": [
{
"id": "580022c7-a3df-4fc2-aa00-556813236ec4",
"channel": "test_channel_1",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"messageTimetoken": "17491299520205486",
"timestamp": "2025-06-05T13:31:38.148778Z",
"type": "Reaction",
"value": "true",
"userId": "Test Message Actions User"
}
]
}

Files

File sent

{
"dataSchema": "pubnub.com/schemas/events/messages.pubsub.publish?v=1.0.0",
"data": [
{
"channel": "file-transfer-demo"
"fileId": "3ec34dbc-3b6f-443f-8991-427a327abd7e",
"fileName": "testfile1.txt",
"message": {
"example": "message"
},
"meta": null,
"senderId": "Test Files User",
"timestamp": "2025-06-05T13:18:17.665Z",
"timetoken": "17491294976652491"
}
show all 17 lines

Users

This section lists all event producers from the Users source.

Presence

User state changed in channel

{
"dataSchema": "pubnub.com/schemas/events/presence.channel.user.state.in.changed?v=1.0.0",
"data": [
{
"id": "889e9b63-0d4d-4d3c-808d-b226f5dc6504",
"channel": "Channel-Barcelona",
"userId": "Jack-device",
"data": {
"action": "state-change",
"uuid": "Jack-device",
"timestamp": "1749128108",
"precise_timestamp": "1749128108494",
"data": "{\"state\":\"test-state\"}",
"occupancy": "0"
},
show all 20 lines

CRUD

User created

{
"schema": "https://www.pubnub.com/schemas/edp.ena.event?schema-instance+json",
"event": {
"id": "8493d90b-e8b9-45af-83ba-c0e0ee97cf7d",
"timestamp": "2025-06-05T13:13:53Z",
"payload": {
"schema": "pubnub.com/schemas/events/user.created?v=1.0.0",
"data": [
{
"id": "8493d90b-e8b9-45af-83ba-c0e0ee97cf7d",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"timestamp": "2025-06-05T13:13:53.210517866Z",
"eTag": "b56e86ea3f6742950553768b9816adc2",
"userId": "User_id4",
"name": "User Name4",
show all 38 lines

User updated

{
"dataSchema": "pubnub.com/schemas/events/user.updated?v=1.0.0",
"data": [
{
"id": "7044631a-f86e-4df3-9303-9bb490f4b64f",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"timestamp": "2025-06-05T13:35:14.735278571Z",
"eTag": "87e4956864cd39abe4ceaea8a22f375b",
"userId": "User_id",
"fields": {
"name": "User Name Updated"
}
}
]
}

User deleted

{
"dataSchema": "pubnub.com/schemas/events/user.deleted?v=1.0.0",
"data": [
{
"id": "df0cdbe6-7505-49e2-9a24-9307174b1d38",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"timestamp": "2025-06-16T09:09:16.475127588Z",
"userId": "User_id6"
}
]
}

Channels

This section lists all event producers from the Channels source.

CRUD

Channel created

{
"dataSchema": "pubnub.com/schemas/events/channel.created?v=1.0.0",
"data": [
{
"id": "e2467259-b0f0-4e64-ac9f-b9a44cd8a7c4",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"timestamp": "2025-06-16T09:10:24.844778615Z",
"eTag": "1e5c41f43cca3f3643524175268cddf6",
"channelId": "channel_1",
"name": "channel_1",
"description": "",
"type": "",
"status": ""
}
]
show all 16 lines

Channel updated

{
"dataSchema": "pubnub.com/schemas/events/channel.updated?v=1.0.0",
"data": [
{
"id": "7ca8f612-ca63-406e-add3-4510bf55558b",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"timestamp": "2025-06-16T09:11:03.439309673Z",
"eTag": "eab2bd4c72aadf93e06d9d9084668e6a",
"channelId": "channel_1",
"fields": {
"space": "channel_12"
}
}
]
}

Channel deleted

{
"dataSchema": "pubnub.com/schemas/events/channel.deleted?v=1.0.0",
"data": [
{
"id": "63982247-db79-43b9-bf3a-39e647f23292",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"timestamp": "2025-06-16T09:11:15.215130220Z",
"channelId": "channel_1"
}
]
}

Presence

First user subscribed to channel

{
"dataSchema": "pubnub.com/schemas/events/pubnub.com/schemas/events/presence.channel.state.active?v=1.0.0",
"data": [
{
"id": "0dc3f00a-06d2-4849-b511-ea9e1817c461",
"timestamp": "2025-06-16T09:11:26.809Z",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"channel": "Channel-Barcelona"
}
]
}

Last user left channel

{
"event": {
"id": "a4cd34f6-afb2-4399-84cc-eaffa9dfc481",
"payload": {
"dataSchema": "pubnub.com/schemas/events/presence.channel.state.inactive?v=1.0.0",
"data": [
{
"id": "a4cd34f6-afb2-4399-84cc-eaffa9dfc481",
"timestamp": "2025-06-16T10:52:49.629Z",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"channel": "Channel-Barcelona"
}
]
}
},
show all 35 lines

User started subscription to channel

{
"dataSchema": "pubnub.com/schemas/events/presence.user.channel.joined?v=1.0.0",
"data": [
{
"id": "a36773df-d828-4d40-99ab-26b8ebe46e41",
"channel": "Channel-Barcelona",
"userId": "Jack-device",
"occupancy": 2,
"data": {
"occupancy": "2",
"action": "join",
"timestamp": "1750065086",
"precise_timestamp": "1750065086809",
"uuid": "Jack-device"
},
show all 20 lines

User stopped subscription to channel

{
"dataSchema": "pubnub.com/schemas/events/pubnub.com/schemas/events/presence.user.channel.left?v=1.0.0",
"data": [
{
"id": "2cf3a1cb-6039-4745-a2e0-7c0b40051bb4",
"channel": "Channel-Barcelona",
"userId": "Amanda-device",
"occupancy": 1,
"data": {
"uuid": "Amanda-device",
"precise_timestamp": "1750065124663",
"timestamp": "1750065124",
"occupancy": "1",
"action": "leave"
},
show all 20 lines

User timed out while subscribing to channel

{
"channelId": "meeting-9xs243ia-attendees",
"userId": "b631fe64-4d84-488e-8315-827f91400d1e",
"occupancy": 0,
"data": {}
}

Interval occupancy counted

{
"dataSchema": "pubnub.com/schemas/events/presence.channel.occupancy.counted?v=1.0.0",
"data": [
{
"id": "56fa7b98-56b5-433b-a4f4-247e72729d3a",
"channel": "Channel-Barcelona",
"occupancy": 7,
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"timestamp": "2025-06-16T09:27:37.080Z"
}
]
}

Mobile Push Notifications

This section lists all event producers from the Mobile Push Notifications source.

Devices

Device removed

{
"id": "12345",
"action": "remove",
"device": "device_token_abc",
"platform": "ios",
"timestamp": "2024-06-10T12:34:56Z",
"subKey": "sub-c-xyz",
"oldDevice": "old_device_token_def"
}

Push error

{
"id": "52301823-51f5-47d7-962c-16ac657f752a",
"channel": "pn-in.dFVj.lpxY",
"devices": "",
"platform": "apns",
"timestamp": "2025-06-18T04:16:59.353913Z",
"subKey": "sub-c-a5015666-3dd3-42df-8074-d37d647e8fe9",
"state": "error",
"payload": "APNS payload error: APNS notification exceeds max size"
}

Memberships

This section lists all event producers from the Memberships source.

CRUD

Membership created

{
"dataSchema": "pubnub.com/schemas/events/membership.created?v=1.0.0",
"data": [
{
"id": "2ca7fef7-6896-4a51-953d-7e4aeb16ec45",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"timestamp": "2025-06-16T09:15:46.035118335Z",
"eTag": "Afah2qS199e74QE",
"channelId": "100",
"userId": "user-123",
"type": "",
"status": ""
}
]
}

Membership updated

{
"dataSchema": "pubnub.com/schemas/events/membership.updated?v=1.0.0",
"data": [
{
"id": "579e8253-f846-437a-abbd-1d353f07d2cb",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"timestamp": "2025-06-16T09:16:04.950644238Z",
"eTag": "Ad6Y0N6U1IqLDw",
"channelId": "123",
"userId": "user-123",
"fields": {
"status": "dfgasd"
}
}
]
show all 16 lines

Membership deleted

{
"dataSchema": "pubnub.com/schemas/events/membership.deleted?v=1.0.0",
"data": [
{
"id": "7323e044-953d-4bd5-9518-62bf5d3f3502",
"subKey": "sub-c-b0451d-1337-4b42-bee0-1905c7c02db",
"timestamp": "2025-06-16T09:16:17.948145898Z",
"channelId": "123",
"userId": "user-123"
}
]
}
Last updated on