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

1{
2 "dataSchema": "pubnub.com/schemas/events/messages.pubsub.publish?v=1.0.0",
3 "data": [
4 {
5 "timestamp": "2025-06-05T12:53:15.888Z",
6 "message": "Message Test",
7 "meta": null,
8 "senderId": "Jack-device",
9 "channel": "Channel-Barcelona",
10 "timetoken": "17491279958880737"
11 }
12 ]
13}

Message Actions

Message action created

1{
2 "dataSchema": "pubnub.com/schemas/events/messages.pubsub.publish?v=1.0.0",
3 "data": [
4 {
5 "timestamp": "2025-06-05T13:23:06.404Z",
6 "message": "Test Message",
7 "meta": null,
8 "senderId": "Test Message Actions User",
9 "timetoken": "17491297864048155"
10 }
11 ]
12}

Message action deleted

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

Files

File sent

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

Users

This section lists all event producers from the Users source.

Presence

User state changed in channel

1{
2 "dataSchema": "pubnub.com/schemas/events/presence.channel.user.state.in.changed?v=1.0.0",
3 "data": [
4 {
5 "id": "889e9b63-0d4d-4d3c-808d-b226f5dc6504",
6 "channel": "Channel-Barcelona",
7 "userId": "Jack-device",
8 "data": {
9 "action": "state-change",
10 "uuid": "Jack-device",
11 "timestamp": "1749128108",
12 "precise_timestamp": "1749128108494",
13 "data": "{\"state\":\"test-state\"}",
14 "occupancy": "0"
15 },
show all 20 lines

CRUD

User created

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

User updated

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

User deleted

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

Channels

This section lists all event producers from the Channels source.

CRUD

Channel created

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

Channel updated

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

Channel deleted

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

Presence

First user subscribed to channel

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

Last user left channel

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

User started subscription to channel

1{
2 "dataSchema": "pubnub.com/schemas/events/presence.user.channel.joined?v=1.0.0",
3 "data": [
4 {
5 "id": "a36773df-d828-4d40-99ab-26b8ebe46e41",
6 "channel": "Channel-Barcelona",
7 "userId": "Jack-device",
8 "occupancy": 2,
9 "data": {
10 "occupancy": "2",
11 "action": "join",
12 "timestamp": "1750065086",
13 "precise_timestamp": "1750065086809",
14 "uuid": "Jack-device"
15 },
show all 20 lines

User stopped subscription to channel

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

User timed out while subscribing to channel

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

Interval occupancy counted

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

Mobile Push Notifications

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

Devices

Device removed

1{
2 "id": "12345",
3 "action": "remove",
4 "device": "device_token_abc",
5 "platform": "ios",
6 "timestamp": "2024-06-10T12:34:56Z",
7 "subKey": "sub-c-xyz",
8 "oldDevice": "old_device_token_def"
9}

Push error

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

Memberships

This section lists all event producers from the Memberships source.

CRUD

Membership created

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

Membership updated

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

Membership deleted

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