Send a message
Send text to a person, group, or channel.
2 min read
Send text
POST /v1/messages/send
Authorization: Bearer knk_live_...
Content-Type: application/json
Idempotency-Key: optional-unique-key Requires API key scope messages:send.
export BASE=https://api.example.com
export KEY=knk_live_...
curl -sS -X POST "$BASE/v1/messages/send"
-H "Authorization: Bearer $KEY"
-H "Idempotency-Key: order-2048-confirm"
-H "Content-Type: application/json"
-d '{"to": "peer_username", "message": "Hello"}' type is optional for text — when message is present, the server sets type: text.
Destination (to)
| To | to value |
|---|---|
| Personal | Kenalko username (lowercase) |
| Group or channel | Room ULID (26 chars) |
Never send both to and group_id. Legacy group_id-only sends still work — prefer to.
Unknown username → 404. Not connected / not a member / channel send restricted → 403.
201 response
| Field | Meaning |
|---|---|
message_id | Server ULID |
type | personal or group (groups and channels) |
to | Peer username or room ULID |
message_type | text, button, attachment, … |
status | Always sent on HTTP — delivery/read via webhooks |
expires_at | Interactive button/list card expiry only, when set |
Check your key
curl -sS "$BASE/v1/me" -H "Authorization: Bearer $KEY"
# { "username": "your_account" } Not billable; messages:send scope not required.
What you can send
| Kind | Doc |
|---|---|
| Text | This page |
| File from URL | Attachments |
| Buttons | Buttons |
| List | Lists |
Form (form_id) | Forms |
Do not combine url with button/list/form. Forbidden body fields: id, sender_id, send_source.
@ai (text)
Requires @ai in message and context.mentions with { "type": "ai" }. Insufficient token budget → 402.