Message Events

message:create

The message:create event is sent to connected clients for users that have joined a channel and subscribed to the channel. The event is sent when a new message is sent to the channel.

An example payload for this event:

{
  "event": "message:create",
  "data": {
    "user": {
      "name": "Group User",
      "id": "9ded74f9-42e4-4e70-86aa-44ba4cd2c782",
      "email": "groupuser@example.com",
      "avatar_url": "https://gravatar.com/avatar/06aaff5772de7ecffbfae48831b2190d?s=200"
    },
    "updated_at": "2015-12-29T09:24:10.814329Z",
    "type": "text",
    "id": "e79d7808-0328-6c36-4412-4981ee285968",
    "duration": 0.0,
    "data": {
      "text": "This is a message"
    },
    "created_at": "2015-12-29T09:24:10.814331Z",
    "channel_id": "2115543f-c236-4f81-a548-719b0929c465"
  }
}

message:update

The message:update event is sent to connected clients for users that have joined a channel and subscribed to the channel. The event is sent when a message is updated.

An example payload for this event:

{
  "event": "message:update",
  "data": {
    "user": {
      "name": "Group User",
      "id": "9ded74f9-42e4-4e70-86aa-44ba4cd2c782",
      "email": "groupuser@example.com",
      "avatar_url": "https://gravatar.com/avatar/06aaff5772de7ecffbfae48831b2190d?s=200"
    },
    "updated_at": "2015-12-29T09:27:10.614332Z",
    "type": "text",
    "id": "e79d7808-0328-6c36-4412-4981ee285968",
    "duration": 0.0,
    "data": {
      "text": "This text has been updated"
    },
    "created_at": "2015-12-29T09:24:10.814331Z",
    "channel_id": "2115543f-c236-4f81-a548-719b0929c465"
  }
}

message:retry

The message:retry event is sent to connected clients for users that have joined a channel and subscribed to the channel. The event is sent when a message is reuploaded. This happens when the client uploads new audio for an existing message, usually when the complete audio message could not be uploaded on the first try.

An example payload for this event:

{
  "event": "message:retry",
  "data": {
    "user": {
      "name": "Group User",
      "id": "9ded74f9-42e4-4e70-86aa-44ba4cd2c782",
      "email": "groupuser@example.com",
      "avatar_url": "https://gravatar.com/avatar/06aaff5772de7ecffbfae48831b2190d?s=200"
    },
    "updated_at": "2015-12-29T09:27:10.614332Z",
    "type": "voice",
    "id": "e79d7808-0328-6c36-4412-4981ee285968",
    "duration": 0.0,
    "data": {},
    "created_at": "2015-12-29T09:24:10.814331Z",
    "channel_id": "2115543f-c236-4f81-a548-719b0929c465"
  }
}

message:delete

The message:delete event is sent to connected clients that have joined a channel and subscribed to the channel. The event is sent when a message is deleted from the channel.

An example payload for this event:

{
  "event": "message:delete",
  "data": {
    "id": "e79d7808-0328-6c36-4412-4981ee285968",
    "channel_id": "2115543f-c236-4f81-a548-719b0929c465"
  }
}