Overview
The Shinzo agent messaging system lets you send messages to agents and retrieve conversation history. Agents support communication through the API, Discord, Slack, and Telegram channels. Messages are automatically routed back through the channel they originated from.Supported channels: Discord, Slack, and Telegram are fully supported. WhatsApp support is coming soon.
Sending Messages
Send a message to an agent withPOST /v1/agent/:id/messages:
Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
content | string | ✅ | — | The message text to send to the agent |
metadata | object | ❌ | — | Arbitrary key-value metadata to attach to the message |
channel | enum | ❌ | "api" | Channel to send through: api, discord, or slack |
queue_mode | enum | ❌ | "collect" | How to handle messages when the agent is busy: collect or interrupt |
Response Format
A successful request returns the created message object:Listing Messages
Retrieve conversation history withGET /v1/agent/:id/messages:
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 50 | Number of messages to return (1-100) |
before | string | — | Return messages before this message UUID (cursor) |
after | string | — | Return messages after this message UUID (cursor) |
status | enum | — | Filter by status: pending, delivered, or read |
channel | enum | — | Filter by channel: api, discord, or slack |
Response Format
Cursor-Based Pagination
Use thebefore and after parameters with message UUIDs to paginate through results. To fetch the next page, pass the last message’s id as the after parameter:
has_more is false.
Message States
Messages transition through three states:| State | Description |
|---|---|
pending | Message has been received and is queued for processing |
delivered | Message has been delivered to the agent or sent back to the user |
read | Message has been read/acknowledged |
Queue Modes
Queue modes control how the agent handles incoming messages when it is already processing a task.Collect Mode
Interrupt Mode
Channel Routing
When a message arrives through a specific channel (for example, Discord), the agent’s response is automatically routed back through that same channel. You do not need to specify the return channel — the platform handles this for you. This means:- A message sent via the API receives its response via the API
- A message sent via Discord receives its response as a Discord message
- A message sent via Slack receives its response as a Slack message
- A message sent via Telegram receives its response as a Telegram message
- The same agent can handle conversations across multiple channels simultaneously
An agent can maintain active conversations across multiple channels simultaneously. Each channel operates independently with its own message history.
Discord Integration
Discord is a fully supported external channel. Linking your agent to Discord allows users to interact with it directly through Discord direct messages via the Shinzo bot. Use cases:- Personal assistant. Link your agent to Discord and interact with it throughout the day without leaving your chat client.
- Team collaboration. Team members can each link to the same agent for shared access to tools and knowledge.
- Notification delivery. Configure webhooks to trigger agent messages that are delivered directly to your Discord DMs.
- Rapid prototyping. Test agent behavior interactively through Discord during development without building a custom frontend.
Setting Up the Shinzo Bot
Before linking, you must create a Discord bot application and configure it in Shinzo: Step 1: Create a Discord application- Visit discord.com/developers/applications and click “New Application”
- Give your application a name and click Create
- Navigate to the Bot section in the left sidebar
- Click “Add Bot” and confirm
- Under the Bot section, click “Reset Token” to generate a new bot token
- Copy the token immediately — it won’t be shown again
- Enable the following Privileged Gateway Intents:
- Message Content Intent
- Server Members Intent
- Presence Intent
discord_bot_token field in the POST /v1/agent request.
Need help? See Discord’s official documentation on Creating a Bot and Bot Tokens for detailed instructions.
Linking Your Discord Account
After configuring your bot token, you can link your Discord user account to your agent: Step 1: Generate a link code Request a 6-character link code from the API withPOST /v1/agent/:id/discord/link:
What are link codes for? Link codes pair your Discord user identity with your Shinzo account so messages from you are properly attributed. The bot token setup and link code flow are two separate steps — the token activates the bot, and the link code associates your user account with it.
Check Link Status
Verify whether a Discord account is linked to your agent withGET /v1/agent/:id/discord/status:
Unlink Discord
Disconnect a Discord account from your agent withDELETE /v1/agent/:id/discord/unlink:
Slack Integration
Slack is a fully supported external channel. You can connect your Shinzo agent to Slack by creating your own Slack app and providing the required credentials to Shinzo. Use cases:- Workspace assistant. Link your agent to Slack and interact with it throughout your workday without leaving your communication tool.
- Team productivity. Access agent capabilities directly from your team’s Slack workspace.
- Notification delivery. Configure webhooks to trigger agent messages that are delivered directly to your Slack DMs.
- Rapid prototyping. Test agent behavior interactively through Slack during development without building a custom interface.
- Cross-platform access. Use the same agent through both Discord and Slack depending on your context.
Creating Your Slack App
Before linking, you must create a Slack app and configure it in Shinzo. Slack requires three credentials for bot operation: Step 1: Create a Slack app- Visit api.slack.com/apps and click “Create New App”
- Choose “From scratch” and give your app a name
- Select the Slack workspace where you want to install the app
- In your app settings, navigate to OAuth & Permissions
- Under Bot Token Scopes, add the following scopes:
chat:write- Send messages as the botim:write- Send direct messagesim:history- Read direct message historyusers:read- Access user profile information
- Click “Install to Workspace” and authorize the app
- Copy the Bot User OAuth Token (starts with
xoxb-)
- Navigate to Socket Mode in the left sidebar and toggle it on
- When prompted, generate an app-level token with the
connections:writescope - Copy the App-Level Token (starts with
xapp-) - Navigate to Basic Information and copy your Signing Secret
- Navigate to App Home in the left sidebar
- Scroll down to the Show Tabs section
- Enable “Allow users to send Slash commands and messages from the messages tab”
- Navigate to Event Subscriptions in the left sidebar and toggle it on
- Under Subscribe to bot events, add the following events:
app_mention- To receive messages when your bot is @mentionedmessage.im- To receive direct messages sent to your bot
- Click Save Changes
slack_bot_token field in the POST /v1/agent request.
Need help? See Slack’s official documentation on Creating Apps, Bot Tokens, and Socket Mode.
Linking Your Slack Account
After configuring your bot credentials, you can link your Slack user account to your agent: Step 1: Generate a link code Request a 6-character link code from the API withPOST /v1/agent/:id/slack/link:
What are link codes for? Link codes pair your Slack user identity with your Shinzo account so messages from you are properly attributed. The bot credentials setup and link code flow are two separate steps — the credentials activate the bot, and the link code associates your user account with it.
Check Link Status
Verify whether a Slack account is linked to your agent withGET /v1/agent/:id/slack/status:
Unlink Slack
Disconnect a Slack account from your agent withDELETE /v1/agent/:id/slack/unlink:
Telegram Integration
Telegram is a fully supported external channel. Linking your agent to Telegram allows users to interact with it directly through Telegram direct messages via your agent’s Telegram bot. Use cases:- Mobile-first access. Link your agent to Telegram and interact with it on-the-go from your mobile device.
- Privacy-focused communication. Use Telegram’s encrypted messaging for secure agent interactions.
- Global accessibility. Telegram works well even in regions with limited connectivity or restrictions on other platforms.
- Bot-native workflows. Leverage Telegram’s bot ecosystem for rich integrations and inline interactions.
- Multi-platform flexibility. Use the same agent through Discord, Slack, and Telegram depending on your preference.
Setting Up Your Agent’s Telegram Bot
Before linking, you must create a dedicated Telegram bot for your agent and configure it in Shinzo: Step 1: Create a Telegram bot via BotFather- Open Telegram and search for @BotFather (the official bot creation tool)
- Send the command
/newbotto BotFather - Follow the prompts to choose a name and username for your bot
- BotFather will provide you with a bot token (e.g.,
110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw)
telegram_bot_token field in the POST /v1/agent request.
Step 3: Start a conversation with your bot
- Search for your bot in Telegram using the username you created (e.g.,
@YourAgentBot) - Click Start or send any message to open the conversation
- Your bot is now ready to be linked to your Telegram account
Need help? See Telegram’s official Bot API Documentation and BotFather Guide for detailed instructions on bot creation and management.
Link Code Workflow
Connecting an agent to Telegram follows the same simple three-step process as Discord and Slack: Step 1: Generate a link code Request a 6-character link code from the API withPOST /v1/agent/:id/telegram/link:
Check Link Status
Verify whether a Telegram account is linked to your agent withGET /v1/agent/:id/telegram/status:
Unlink Telegram
Disconnect a Telegram account from your agent withDELETE /v1/agent/:id/telegram/unlink:
Best Practices
- Use
collectmode by default. Reserveinterruptfor genuinely urgent messages that cannot wait for the current task to finish. - Attach metadata for traceability. Include request IDs, user identifiers, or other context in the
metadatafield to correlate messages with your application logic. - Paginate large histories. Use cursor-based pagination instead of fetching all messages at once to keep response times low.
- Filter by channel when needed. If your agent handles messages from multiple channels, use the
channelfilter to retrieve conversations for a specific integration. - Monitor message status. Track
pendingmessages to detect processing delays and ensure your agent is keeping up with demand. - Generate link codes close to when they will be used. Codes expire after 10 minutes, so avoid generating them far in advance.
- Check link status before generating new codes. If an account is already linked, you do not need a new code.
- Unlink before re-linking. If you need to change the linked account, unlink the current one first.
Next Steps
Agent Configuration
Configure agent behavior, memory, and runtime settings.
Filesystem Management
Manage files in agent workspaces programmatically.

