Skip to main content

Export message events

POST 

/messageevent.export

Obtain a daily message event export containing DMs and group chats within your account.

For customers with archival enabled (please reach out to a Roam ArchiTech to get this process started), at the end of every day, we export all message events for a particular day as a JSON Lines file. This file contains all messages sent:

  • by a Roam user who is a member of your organization
  • into a chat containing (at the time of export) at least one Roam user who is a member of your organization
  • by a bot integration that is part of your organization

This file also contains message edit and deletion events that meet the above criteria. We specifically exclude waves, room invitations, and other non-message content (that may appear as chats within the Roam application) from the export.

Required scope: admin:compliance:read

Message Event Structure

Each line within the file is a JSON object containing the following fields:

  • eventType: a string that is one of “sent”, “edited”, or “deleted”
  • chatId: a UUIDv4 identifier for a particular chat. All messages within the same chat shared the same chatId.
  • threadTimestamp (optional): if part of a thread, the Unix epoch timestamp of the thread’s parent message in numerical format. All messages part of a thread share the same threadTimestamp.
  • timestamp: the Unix epoch timestamp when the message was originally sent in numerical format.
  • messageId: an internal UUIDv4 identifier as a string
  • sender: a “Participant” object that identifiers the message sender
  • contentType: a string that is one of the contentTypes associated with the “MessageContent” object
  • content: a “MessageContent” object that contains the message’s content

Participant

A Participant is a JSON object that contains three common fields: “participantType”, “id”, and “displayName”

  • participantType: one of “email”, “bot”, or “occupant”
  • id: a UUID identifier for the participant
  • displayName: the name associated with the account or an empty string if not provided

Depending on the participant type, the object also contains additional fields:

Email Participant (a human user with a Roam user account)

  • email: the email of the participant

Bot Participant (an automated user maintained by the Roam team or created via the Roam API)

  • roamId: the roam ID associated with the integration
  • integrationId: a unique integration ID name provided by the bot creator
  • botCode: a unique identifier

Message Content

A “MessageContent” object is a JSON object that contains the field “contentType” and, depending on the content type, contains additional fields:

Text Content (contentType = “text”)

  • text: the text in plaintext
  • markdownText: the text in Markdown format
  • attachments: A list of attachment objects

Emoji Content (contentType = “emoji”)

  • text: text representation of the emoji
  • colons: emoji in :emoji: format
  • fileUrl: an optional field containing the URL to a custom emoji image

Item Content (contentType = “item”)

  • itemUrl: the URL where the file can be downloaded from
  • itemType: the type of item (e.g. "photo", "pdf", "blob", "video", "audio", etc.)

Text Snippet Content (contentType = "textSnippet")

  • text: the content of the snippet
  • language: the language of the snippet

Members Changed Content (contentType = “membersChanged”)

  • added: a list of Participant objects corresponding to all participants added in this event
  • removed: a list of Participant objects corresponding to all participants removed in this event

OpenAPI Spec: openapi.json

Request

Responses

Info retrieved successfully