Skip to main content
Attachments represent the files included in an incoming or outgoing email. They can be documents, images, spreadsheets, or any other file type sent via email. An Attachment is associated with a specific Activity within a Thread. Every Attachment goes through a “stringification” process, where its content is converted into a text format that can be processed by the Agent. This allows the Agent to read and extract relevant information from the attachment.

Key Capabilities

  • Store and manage files associated with emails in a Thread.
  • Stringify content from various file types, enabling Agents to understand and extract data from attachment content.
  • Provide an interface for accessing attachment content and metadata via Monsteria API.
Attachments can be accessed and downloaded via the Monsteria API. Use GET /v0/attachments/{attachmentId}/download-url to retrieve a secure URL for downloading the attachment file.

Attributes

Each Attachment has the following attributes:
  • id: string
  • activityId: string - The Activity associated with the Attachment
  • threadId: string - The Thread associated with the Attachment
  • fileName: string - The name of the file
  • contentType: string - The MIME type of the attachment (e.g., application/pdf, image/png)
  • stringifiedContent: string - The text representation of the attachment content after stringification
  • externalReferenceId: string - The external system’s identifier for the Attachment (e.g., Gmail attachment ID)
  • createdAt: Date - Timestamp when the Attachment was created
  • updatedAt: Date - Timestamp when the Attachment was last updated

Example

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "activityId": "cdc9c789-f489-44f8-94dc-4c6b246a6b40",
  "threadId": "2786a46d-1971-401b-a4d5-7f037d970a02",
  "fileName": "dental-insurance-card.pdf",
  "contentType": "application/pdf",
  "stringifiedContent": "Lorem ipsum dolor sit amet",
  "externalReferenceId": "gmail-attachment-id",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}