Skip to content

[Feature New API]: Messages search API #110

Description

@igatanasov

🌟 Describe the Feature

As an Integration Developer, I would like to be able to fetch all messages. I would like access to the https://services.leadconnectorhq.com/messages/search API so I can fetch messages per location.

I would like the API to support the following parameters:

  • locationId – required
  • limit – optional, defaults to 100, maximum of 1000
  • type – required; values: TYPE_CALL, TYPE_SMS
  • startAfterDate - start after message update date
  • endDate - end message update date
  • all messages should include an attached userId. Some TYPE_CALL messages currently lack a userId.
    Example:
{
        "direction": "inbound",
        "status": "completed",
        "type": 1,
        "dateAdded": "2025-08-03T20:04:24.736Z",
        "meta": {
          "call": {
            "duration": 3309,
            "status": "completed"
          }
        },
        "messageType": "TYPE_CALL"
}
  • An optional parameter to include contact data, similar to the Conversations API:
{
      "contactId": "ABCHkzuJQ8ZMd4Te84GK",
        "fullName": "John Doe",
        "contactName": "John Doe",
        "companyName": null,
        "email": "test@example.com",
        "phone": "+111 123 456 7890"
}

🚀 Justification

This would improve the speed of retrieving this data by:

  • Skipping the retrieval of all conversations
  • Traversing only relevant messages per conversation
  • Avoiding the fetching of contact metadata for every message

📝 Suggestions

POST https://services.leadconnectorhq.com/messages/search?locationId=14561324&limit=1000,type=TYPE_CALL&startAfterDate=1741131116976&endDate=1741132116976

{
  "messages": {
    "lastMessageId": "NEW_LAST_MESSAGE_ID",
    "nextPage": false,
    "messages": [
      {
        "id": "NEW_MESSAGE_ID",
        "direction": "inbound",
        "status": "completed",
        "type": 1,
        "locationId": "NEW_LOCATION_ID",
        "contactId": "NEW_CONTACT_ID",
        "fullName": "John Doe",
        "contactName": "John Doe",
        "companyName": null,
        "email": "test@example.com",
        "phone": "+111 123 456 7890",
        "conversationId": "NEW_CONVERSATION_ID",
        "dateAdded": "2025-08-03T21:09:40.141Z",
        "meta": {
          "call": {
            "duration": 53,
            "status": "completed"
          }
        },
        "altId": "NEW_ALT_ID",
        "messageType": "TYPE_CALL"
      }
    ]
  },
  "traceId": "NEW_TRACE_ID"
}

Product Area

conversations

🧠 Additional Context

Summary: Purpose and Benefits

This API request will help Integration Developers efficiently retrieve messaging data across locations. By enhancing the /messages/search endpoint with filtering and data enrichment options, it enables:

  • Centralized access to all messages (calls or SMS) per location
  • Improved data control through parameters like message type, limit, and location ID
  • User tracking and accountability by ensuring all messages include a userId
  • Richer message context by optionally attaching contact data (e.g., full name, company)
  • Better support for analytics, audits, and integrations with third-party systems

Overall, it enhances the flexibility and completeness of message data retrieval, streamlining development and automation workflows.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions