---
title: "Fetch email records by ID"
method: POST
path: "/appmail/fetch"
tags: ["App Mail Records"]
---

# Fetch email records by ID

`POST /appmail/fetch`

## Request

- Base URL: `https://api.surense.com/api/v1`
- URL: `https://api.surense.com/api/v1/appmail/fetch`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://api.surense.com/oauth/token`

Returns the search view of the given email records that belong to the given parent entity, after checking the caller can access that entity. Used by the activity journal.

## Request body

- GetAppMailsByIdsRequest
  - `employerId` string, uuid: Parent employer ID. Cannot be combined with customerId, leadId or workflowId.
  - `customerId` string, uuid: Parent customer ID. Cannot be combined with leadId or workflowId.
  - `leadId` string, uuid: Parent lead ID. Cannot be combined with workflowId.
  - `workflowId` string, uuid: Parent workflow ID.
  - `meetingId` string, uuid: Parent meeting ID; used only when no other parent ID is given.
  - `ids` string[]: Email record IDs to fetch; must not be empty.

## Response `200`

OK

- AppMailRecordSearchView[]
  - `id` string, uuid
  - `provider` string
  - `version` integer
  - `subject` string
  - `plainContent` string
  - `tenantId` string, uuid
  - `leadId` string, uuid
  - `customerId` string, uuid
  - `employerId` string, uuid
  - `workflowId` string, uuid
  - `meetingId` string, uuid
  - `fromAddress` string
  - `to` InternetAddress[]
    - `personal` string
    - `address` string
    - `fullAddress` string
  - `reactions` AppMailReaction[]
    - `id` string, uuid
    - `userId` string, uuid
    - `userName` string
    - `reaction` string
    - `reactedAt` string, date-time
  - `replies` AppMailReply[]
    - `id` string, uuid
    - `userId` string, uuid
    - `userName` string
    - `jsonContent` JsonNode: Reply JSON content
      - `empty` boolean
      - `array` boolean
      - `null` boolean
      - `object` boolean
      - `float` boolean
      - `container` boolean
      - `string` boolean
      - `pojo` boolean
      - `floatingPointNumber` boolean
      - `short` boolean
      - `int` boolean
      - `long` boolean
      - `valueNode` boolean
      - `missingNode` boolean
      - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
      - `integralNumber` boolean
      - `double` boolean
      - `bigDecimal` boolean
      - `bigInteger` boolean
      - `textual` boolean
      - `boolean` boolean
      - `binary` boolean
      - `number` boolean
      - `embeddedValue` boolean
    - `htmlContent` string
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `mentions` AppMailMention[]
      - `type` string
      - `entityId` string, uuid
      - `label` string
      - `order` integer
    - `reactions` AppMailReaction[]
      - `id` string, uuid
      - `userId` string, uuid
      - `userName` string
      - `reaction` string
      - `reactedAt` string, date-time
  - `createdBy` string, uuid
  - `fromPersonal` string
  - `cc` InternetAddress[]
    - `personal` string
    - `address` string
    - `fullAddress` string
  - `bcc` InternetAddress[]
    - `personal` string
    - `address` string
    - `fullAddress` string
  - `attachments` AppMailAttachment[]
    - `documentId` string, uuid
    - `documentName` string
  - `emlSize` integer
  - `htmlSize` integer
  - `providerMessageId` string
  - `providerWebLink` string
  - `createdDate` string, date-time
  - `creatorName` string
  - `lastModifiedDate` string, date-time
  - `lastModifiedBy` string, uuid

---

[API](https://skmtc.dev/surense/apis/appmail-api.md) - [All operations](https://skmtc.dev/surense/apis/appmail-api/llms.txt) - [OpenAPI document](https://skmtc.dev/surense/apis/appmail-api/revisions/dd959778fa2e?raw)
