Messages API
The Messages API allows you to send messages via configured messaging channels (Signal, Telegram, Discord, etc.).Send Message
Send a message to a recipient via a messaging channel.Method: send
Request:
string
required
Recipient identifier (phone number, user ID, username, etc.)
string
Text message content (at least one of
message, mediaUrl, or mediaUrls required)string
Channel ID (e.g.,
"signal", "telegram", "discord", "slack")string
required
Unique key to prevent duplicate sends
string
Single media attachment URL
array
Array of media attachment URLs
boolean
default:false
Enable GIF playback (for animated GIFs)
string
Account ID for multi-account channels
string
Thread ID for threaded messages
string
Session key for tracking conversation context
boolean
Whether the message was sent successfully
string
Platform-specific message identifier
boolean
Whether the response was cached (idempotency)
Send Message with Media
Send messages with image, video, or document attachments.Single Media Attachment
Multiple Media Attachments
Media-Only Message
Idempotency
TheidempotencyKey parameter ensures duplicate messages are not sent:
- Same
idempotencyKeywithin a short time window returns cached result - Prevents accidental duplicate sends
- Returns
cached: truein response metadata
Channels
Available channels depend on your configuration:
See Channels for configuration details.
Message Routing
OpenClaw automatically routes messages based on:- Explicit channel - Use
channelparameter - Session key prefix - Extract channel from session key (e.g.,
"signal:+1234567890") - Default channel - Use configured default channel
signal: prefix.
Polls
Send interactive polls via supported channels.Method: poll
string
required
Poll question
array
required
Array of poll options (strings)
string
required
Recipient identifier
string
Channel ID
string
required
Unique key for idempotency
boolean
default:false
Allow multiple selections
boolean
default:false
Hide voter identities
Error Handling
Missing recipient:Example: Send with Media
Example: JavaScript Client
Message Format
Messages support basic formatting depending on the channel: Markdown (Signal, Telegram, Discord, Slack):Best Practices
Always use idempotency keys
Always use idempotency keys
Generate unique keys to prevent duplicate sends:
Validate recipients
Validate recipients
Ensure phone numbers are in E.164 format:
Handle media URLs correctly
Handle media URLs correctly
- Use publicly accessible URLs
- Ensure HTTPS for secure content
- Check file size limits per channel
Check channel status
Check channel status
Verify channel is logged in before sending:
Next Steps
Channels
Configure messaging channels
Sessions
Manage conversation sessions
Agent Protocol
Invoke agents to generate responses

