Messages API
Send and retrieve messages within conversations.
List Messages
GET /v1/conversations/:id/messages
curl -X GET "https://api.chatmefy.com/v1/conversations/conv_abc/messages" \
-H "Authorization: Bearer YOUR_API_KEY"
# Response
{
"data": [
{
"id": "msg_001",
"role": "bot",
"content": "Hello! How can I help you today?",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "msg_002",
"role": "user",
"content": "What are your pricing options?",
"created_at": "2024-01-15T10:30:15Z"
},
{
"id": "msg_003",
"role": "bot",
"content": "We offer three plans: Free, Pro, and Business...",
"created_at": "2024-01-15T10:30:18Z"
}
]
}Send Message (Agent)
Send a message as a human agent in a conversation:
POST /v1/conversations/:id/messages
curl -X POST "https://api.chatmefy.com/v1/conversations/conv_abc/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Hi! I am taking over this conversation.",
"role": "agent"
}'
# Response
{
"data": {
"id": "msg_004",
"role": "agent",
"content": "Hi! I am taking over this conversation.",
"created_at": "2024-01-15T10:35:00Z"
}
}Request Body
content string Message content (max 4000 chars)
role string agent or system (default: agent)
Message Object
| Field | Type | Description |
|---|