Get Contact Messages

Retrieve a contact's conversation history with pagination.

GET

Get Contact Messages

Returns all messages for a contact ordered newest-first. Supports pagination via limit and offset query parameters.

Endpoint

GET https://crmwebhook.com/functions/v1/crm-api/get-contact-messages/{contact_id}

Path Parameters

ParameterTypeRequiredDescription
contact_idstring (UUID)YesThe contact whose messages to retrieve

Query Parameters

ParameterTypeRequiredDescription
limitnumberOptionalMax messages to return. Default 50, max 200
offsetnumberOptionalNumber of messages to skip. Default 0

Headers

HeaderValueRequired
x-api-keycfy_your_api_keyYes

Example Request

curl "https://crmwebhook.com/functions/v1/crm-api/get-contact-messages/c1a2b3d4-...?limit=20&offset=0" \
  -H "x-api-key: cfy_your_api_key"

Response Shape

{
  "contact_id": "c1a2b3d4-e5f6-7890-abcd-ef1234567890",
  "contact": {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "phone": "+15551234567"
  },
  "conversation_id": "conv_abc123",
  "messages": [
    {
      "id": "msg_001",
      "content": "Thanks, I'll get back to you soon.",
      "sender_type": "agent",
      "message_type": "sms",
      "timestamp": "2026-04-18T14:22:11.000Z"
    }
  ],
  "total": 24,
  "limit": 20,
  "offset": 0
}

Response Fields

FieldTypeDescription
contact_idstringContact UUID
contactobjectContact details: name, email, phone
conversation_idstringConversation UUID
messagesarrayArray of message objects
messages[].idstringMessage ID
messages[].contentstringMessage text
messages[].sender_typestringWho sent it (e.g., “agent”, “contact”)
messages[].message_typestringChannel type (e.g., “sms”, “email”)
messages[].timestampstringISO 8601 timestamp
totalnumberTotal messages in conversation
limitnumberLimit used for this request
offsetnumberOffset used for this request

Response Codes

StatusMeaning
200Paginated message list returned
401Invalid API key
404Contact not found or no conversation exists
500Internal error
© 2026 Centerfy AI. All rights reserved.