Get Contact Messages
Retrieve a contact's conversation history with pagination.
GET
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
| Parameter | Type | Required | Description |
|---|
contact_id | string (UUID) | Yes | The contact whose messages to retrieve |
Query Parameters
| Parameter | Type | Required | Description |
|---|
limit | number | Optional | Max messages to return. Default 50, max 200 |
offset | number | Optional | Number of messages to skip. Default 0 |
| Header | Value | Required |
|---|
x-api-key | cfy_your_api_key | Yes |
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
| Field | Type | Description |
|---|
contact_id | string | Contact UUID |
contact | object | Contact details: name, email, phone |
conversation_id | string | Conversation UUID |
messages | array | Array of message objects |
messages[].id | string | Message ID |
messages[].content | string | Message text |
messages[].sender_type | string | Who sent it (e.g., “agent”, “contact”) |
messages[].message_type | string | Channel type (e.g., “sms”, “email”) |
messages[].timestamp | string | ISO 8601 timestamp |
total | number | Total messages in conversation |
limit | number | Limit used for this request |
offset | number | Offset used for this request |
Response Codes
| Status | Meaning |
|---|
200 | Paginated message list returned |
401 | Invalid API key |
404 | Contact not found or no conversation exists |
500 | Internal error |