Skip to main content
POST
/
messages
/
search
cURL
curl --request POST \
  --url https://api.useanima.sh/v1/messages/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "filters": {},
  "pagination": {
    "limit": 20
  }
}
'
{
  "items": [
    {
      "id": "<string>",
      "agentId": "<string>",
      "fromAddress": "<string>",
      "toAddress": "<string>",
      "subject": "<string>",
      "body": "<string>",
      "bodyHtml": "<string>",
      "headers": {},
      "metadata": {},
      "threadId": "<string>",
      "inReplyTo": "<string>",
      "externalId": "<string>",
      "sentAt": "2023-11-07T05:31:56Z",
      "receivedAt": "2023-11-07T05:31:56Z",
      "attachments": [
        {
          "id": "<string>",
          "filename": "<string>",
          "mimeType": "<string>",
          "sizeBytes": 1,
          "storageKey": "<string>",
          "url": "<string>",
          "createdAt": "2023-11-07T05:31:56Z",
          "detectedMimeType": "<string>"
        }
      ],
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "pagination": {
    "nextCursor": "<string>",
    "hasMore": true
  }
}

Authorizations

Authorization
string
header
required

JWT Bearer token obtained from authentication. Pass as: Authorization: Bearer

Body

application/json

Request body for searching messages with full-text query and optional filters

query
string
required

Full-text search query to match against message content

Minimum string length: 1
filters
object

Optional filters to narrow search results

pagination
object

Pagination parameters for the search results

Response

200 - application/json

OK

Paginated list of messages

items
object[]
required

Array of message resources matching the query

pagination
object
required

Pagination metadata for retrieving additional pages