v1

latestOpenAPI 3.1.1Proprietary2026-07-2687313591.4 KB
Emails

Get metadata on all Emails

Paginate through all emails in Affinity. Returns basic information about the email interaction and its participants. Will only return emails or subject lines that the current authenticated user has permission to see.

Email bodies (the message content) are not available through the API. Only metadata such as the subject, participants, and timestamps is returned.

If the authenticated user does not have permission to see an email's subject, the subject field is obfuscated and returned as ******** rather than the actual subject line.

You can filter emails using the filter query parameter. The filter parameter is a string that you can specify conditions based on the following properties.

Property NameTypeAllowed OperatorsExamples
idint64=id=1|id=2|id=3
sentAtdatetime>, <, >=, <=sentAt>2025-01-01T01:00:00Z
createdAtdatetime>, <, >=, <=createdAt<2025-01-01T01:00:00Z
updatedAtdatetime>, <, >=, <=updatedAt>=2025-01-01T01:00:00Z
get/v2/emails

Query parameters

cursorstring
Example:ICAgICAgYmVmb3JlOjo6Nw

Cursor for the next or previous page

limitinteger
Example:100

Number of items to include in the page

filterstring

Filter options

Response

OK

Example response

{
  "data": [
    {
      "id": 1,
      "sentAt": "2023-01-01T00:00:00Z",
      "loggingType": "automated",
      "direction": "received",
      "subject": "Example subject",
      "createdAt": "2023-01-01T00:00:00Z",
      "updatedAt": "2023-01-01T00:00:00Z",
      "from": {
        "emailAddress": "john.smith@contoso.com",
        "person": {
          "id": 1,
          "firstName": "Jane",
          "lastName": "Doe",
          "primaryEmailAddress": "jane.smith@northpointvc.com",
          "type": "internal"
        }
      },
      "toParticipantsPreview": {
        "data": [
          {
            "emailAddress": "john.smith@contoso.com",
            "person": {
              "id": 1,
              "firstName": "Jane",
              "lastName": "Doe",
              "primaryEmailAddress": "jane.smith@northpointvc.com",
              "type": "internal"
            }
          }
        ],
        "totalCount": 200
      },
      "ccParticipantsPreview": {
        "data": [
          {
            "emailAddress": "john.smith@contoso.com",
            "person": {
              "id": 1,
              "firstName": "Jane",
              "lastName": "Doe",
              "primaryEmailAddress": "jane.smith@northpointvc.com",
              "type": "internal"
            }
          }
        ],
        "totalCount": 200
      }
    }
  ],
  "pagination": {
    "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw",
    "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA"
  }
}