Get messaging threads

Retrieves inbox threads with search, sorting, pagination and shared filter syntax. Filters include connectedAccountId, emailFolder (in/notIn), lastMessageDirection (inbound/outbound), lastMessageSentAt (last actual message date) and lastMessageAt (activity including drafts). Use caller-scoped filterableFields.options; folder values encode [account UUID, provider folder ID] as a JSON string and groupKey identifies the account heading. Folder membership matches visible placements. Last direction/date exclude drafts, hidden/deleted messages and system events. Filters combine with AND; lastMessageSentAt inLastDays 7 plus notInLastDays 3 finds messages from three to seven days ago, using the standard start-of-day cutoff.

POST
/v1/messaging/threads/search

Authorization

apiKeyAuth
x-api-key<token>

API key authentication. Create an API key in your user profile and include it in the x-api-key header.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://customermates.com/api/v1/messaging/threads/search" \  -H "Content-Type: application/json" \  -d '{}'
{
  "p13nId": "string",
  "items": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "connectedAccountId": "ac03972a-5ca5-43c5-b96f-c519ac843b7a",
      "unipileThreadId": "string",
      "provider": "google",
      "type": "single",
      "name": null,
      "subject": "string",
      "preview": "string",
      "previewKind": "image",
      "lastMessageAt": "string",
      "participants": [
        {
          "attendeeId": "string",
          "displayName": "string",
          "identifier": "string",
          "pictureUrl": "string",
          "profileUrl": "string",
          "headline": "string",
          "occupation": "string",
          "isSelf": true,
          "records": []
        }
      ],
      "state": "unread",
      "sharedToCrm": false,
      "accountShared": false,
      "isOwner": false,
      "lastMessageFromSelf": false,
      "lastSentMessageFromSelf": null,
      "lastMessageSenderName": null,
      "createdAt": "string",
      "updatedAt": "string"
    }
  ],
  "filters": [
    null
  ],
  "searchTerm": "string",
  "sortDescriptor": null,
  "pagination": {
    "page": 0,
    "pageSize": 0,
    "totalPages": 0,
    "total": 0
  },
  "filterableFields": [
    null
  ],
  "columnOrder": [
    "string"
  ],
  "columnWidths": {
    "property1": 0,
    "property2": 0
  },
  "hiddenColumns": [
    "string"
  ],
  "viewMode": "string",
  "groupCounts": {
    "property1": 0,
    "property2": 0
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
{
  "error": {
    "kind": "validation",
    "issues": [
      {
        "code": "string",
        "path": [
          "string"
        ],
        "message": "string",
        "customCode": "recordNotFound",
        "entitlement": "string"
      }
    ],
    "retryable": true
  }
}
Empty