Messages
Send messages to users and receive their replies
/api/agent/eventsSend a chat message from your agent. The message appears instantly in the user's Nod app.
typerequiredtextimage_base64conversation_idPOST /api/agent/events
X-Nod-Agent-Id: agt_abc123
X-Nod-Secret: nod_abc123...
{
"type": "message",
"text": "Deployment complete. All checks passed."
}{
"type": "message",
"text": "Here's the build output:",
"image_base64": "data:image/png;base64,iVBORw0KGgo..."
}{
"status": "ok",
"message_id": "msg_xyz789"
}WebSocket frameAgents with a persistent WebSocket send messages as JSON frames.
typerequiredtextconversation_idimage_base64report_titlereport_descriptiontask_run_id{
"type": "message",
"text": "Build succeeded. Deploying now...",
"conversation_id": "conv_abc123"
}{
"type": "message",
"text": "# Daily Summary\n\n- Deploys: 3\n- Errors: 0",
"report_title": "Daily Summary",
"report_description": "Deploys and errors for today",
"conversation_id": "conv_abc123"
}{
"type": "message",
"text": "Backup completed. 2.4 GB total.",
"task_run_id": "run_abc123"
}{
"type": "message",
"text": "Screenshot of the error:",
"image_base64": "data:image/png;base64,iVBORw0KGgo..."
}Receiving messages
When a user sends a message from the Nod app, your agent receives a user_message event via WebSocket or webhook. Users can send text, images, multiple images, and voice messages — all delivered in the same event format.
user_message eventDelivered via WebSocket if online, otherwise POSTed to your webhook_url.
textsender_nameconversation_idmessage_idimage_urlimage_urlsaudio_url{
"type": "user_message",
"text": "Deploy the latest build to staging.",
"sender_name": "Alice",
"conversation_id": "conv_abc123",
"message_id": "msg_001"
}{
"type": "user_message",
"text": "What's wrong with this error?",
"sender_name": "Alice",
"conversation_id": "conv_abc123",
"message_id": "msg_002",
"image_url": "https://storage.asknod.ai/media/1720000000.png"
}{
"type": "user_message",
"text": "Compare these designs",
"sender_name": "Alice",
"conversation_id": "conv_abc123",
"message_id": "msg_003",
"image_urls": [
"https://storage.asknod.ai/media/design-a.png",
"https://storage.asknod.ai/media/design-b.png"
]
}{
"type": "user_message",
"text": "Deploy the latest build to staging",
"sender_name": "Alice",
"conversation_id": "conv_abc123",
"message_id": "msg_004",
"audio_url": "https://storage.asknod.ai/media/1720000001.m4a"
}/api/agent/conversations/{conversation_id}/messagesFetch message history for a conversation. Returns messages in reverse chronological order (newest first). Use this to build context for your agent so it can reference prior messages.
conversation_idrequiredlimitcursorGET /api/agent/conversations/conv_abc123/messages?limit=20 X-Nod-Agent-Id: agt_abc123 X-Nod-Secret: nod_abc123...
[
{
"id": "msg_002",
"conversation_id": "conv_abc123",
"sender": "agent",
"sender_name": "My Agent",
"text": "Here are the latest results...",
"created_at": "2025-03-25T12:01:00Z"
},
{
"id": "msg_001",
"conversation_id": "conv_abc123",
"sender": "human",
"sender_name": "Alice",
"text": "Look up the latest news",
"created_at": "2025-03-25T12:00:00Z"
}
]Media URLs
Image and audio URLs are publicly accessible — no authentication needed to download them. Your agent can fetch them directly with a simple HTTP GET.
Voice messages are pre-transcribed
text field contains the transcription, and audio_url contains the original recording. Your agent just reads text — no speech-to-text integration needed.Users configure their transcription provider (OpenAI Whisper or Deepgram) and API key in the Nod app settings. Keys are stored securely on the device using the OS keychain and are never sent to Nod servers.
How to handle media
- Images — download and pass to a vision model, save locally, or ignore
- Voice messages — just read the
textfield (already transcribed). Theaudio_urlis available if you need the original recording. - Text only — just read the
textfield and skip media fields