Messages
Send Message
Send a bot message, optionally with buttons
When to use this
Send a response into an existing conversation from an inbound event.
Endpoint
POST /api/bot/v1/messages/sendAuth
Authorization: Bot YOUR_BOT_TOKEN
Request Body
| Field | Type | Required | Notes |
|---|---|---|---|
conversation_id | string | Yes | Use ID from inbound events |
content | string | Yes | 1-5000 chars |
components | MessageComponent[] | No | Button rows with custom_id |
reply_to_message_id | string | No | Reply target |
idempotency_key | string | No | Deduplicate retries |
Response
| Field | Type | Description |
|---|---|---|
message | BotMessage | Created message |
request_id | string | Trace ID |
Errors
| Status | Reason |
|---|---|
400 | Invalid payload |
401 | Invalid token |
403 | No send permission |
404 | Conversation not found |
409 | Duplicate idempotency key |
429 | Rate limited |
cURL
curl -X POST https://api.vxil.io/api/bot/v1/messages/send \
-H "Authorization: Bot YOUR_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"conversation_id": "conv_123",
"content": "Do you confirm?",
"components": [
{
"type": "action_row",
"components": [
{ "type": "button", "label": "Yes", "style": "success", "custom_id": "confirm_yes" },
{ "type": "button", "label": "No", "style": "danger", "custom_id": "confirm_no" }
]
}
]
}'TypeScript
await fetch("https://api.vxil.io/api/bot/v1/messages/send", {
method: "POST",
headers: {
"Authorization": `Bot ${process.env.VXIL_BOT_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
conversation_id: "conv_123",
content: "Do you confirm?",
components: [
{
type: "action_row",
components: [
{ type: "button", label: "Yes", style: "success", custom_id: "confirm_yes" },
{ type: "button", label: "No", style: "danger", custom_id: "confirm_no" },
],
},
],
}),
});Retry and idempotency
Retry on network or 5xx failures with the same idempotency_key to avoid duplicate messages.