面向开发者和 AI

从一个请求开始。

面向 WhatsApp、Telegram 和 MAX 普通账号的统一 HTTP API。公开文档说明 API 约定;只有使用您自己的密钥才能获取您的账号列表。

1. 创建账号和连接

使用邮箱注册,通过邮件验证地址,然后登录 控制台。选择即时通讯平台,并使用该平台支持的二维码或手机号方式登录。Telegram 需要您自己的 application API credentials。其他可能需要的登录步骤会在控制台中显示。

2. 创建 API 密钥

在“个人资料 → API 密钥”中为项目创建独立密钥。默认允许读取;发送消息及其他修改操作需要 write 权限。密钥值仅显示一次。请将其保存在后端机密配置中,不要放在浏览器、Git 或 AI 提示词中。

3. 获取连接和完整命令目录

curl 'https://api-senden.ru/api/v1/integrations/manifest' \
  --header 'Authorization: Bearer YOUR_API_KEY'

响应包含 instances, connectedMessengers, commands 和 permissions. Подключения относятся только к вашему пространству, архивные исключены явно. Для отправки выберите аккаунт со state: connected.

4. 选择聊天、发送并检查结果

通过以下接口获取真实聊天 ID: GET /api/v1/instances/{id}/chats。发送文字和文件使用 POST /api/v1/instances/{id}/messages 并使用一个固定的 Idempotency-Key。202 响应表示进入队列,不代表送达。可通过历史、SSE、webhook 和通知队列获取状态及入站消息。具体传输功能见下文。

对于 MAX,contacts.lookup 当前返回的是用户 ID,不能自动将其视为私聊 ID。请使用聊天列表中的 ID 作为目标。如果首次发送的结果尚不明确,不要换用新密钥再次发送。

事件与 webhook 安全

使用 webhook 时,请验证 HMAC 签名,并以幂等方式处理事件。端点必须是公开的 HTTPS 地址;本地和私有网络会被阻止。SSE 用于提供事件流;从队列获取通知会创建 lease,并且需要 write 权限,之后还须通过 ack 确认。完整参数和请求格式见 OpenAPI。

可直接使用的资料

不含密钥、二维码、会话或用户数据。运行客户端时只执行 discovery 请求。

完整目录:70 个 HTTP 命令

这是统一的 API 命令目录;各原生命令的支持情况以及是否需要活动连接会单独注明。/methods 目录仅包含原生命令子集。

Senden 公开 API 和 Bearer API 命令
方法与路径用途支持情况权限
GET/api/v1/health进程健康检查whatsapp, telegram, maxread
GET/api/v1/status连接与状态whatsapp, telegram, maxread
POST/api/v1/instances创建连接whatsapp, telegram, maxwrite
GET/api/v1/instances获取活动或已归档的连接whatsapp, telegram, maxread
DELETE/api/v1/instances/{id}停止并归档连接,同时保留历史记录和会话whatsapp, telegram, maxwrite
PATCH/api/v1/instances/{id}重命名连接whatsapp, telegram, maxwrite
GET/api/v1/instances/{id}连接状态whatsapp, telegram, maxread
POST/api/v1/instances/{id}/restore在限制范围内从归档恢复,不自动建立连接whatsapp, telegram, maxwrite
POST/api/v1/instances/{id}/connect开始登录whatsapp, telegram, maxwrite
POST/api/v1/instances/{id}/auth继续当前登录步骤whatsapp, telegram, maxwrite
POST/api/v1/instances/{id}/stop停止并保留会话whatsapp, telegram, maxwrite
POST/api/v1/instances/{id}/logout请求退出登录whatsapp, telegram, maxwrite
GET/api/v1/instances/{id}/chats获取聊天列表whatsapp, telegram, max需要连接read
GET/api/v1/instances/{id}/messages已保存的消息历史whatsapp, telegram, maxread
POST/api/v1/instances/{id}/messages将文本或文件加入队列whatsapp, telegram, maxwriteIdempotency-Key
POST/api/v1/instances/{id}/messages/from-url安全下载 HTTPS 文件并将文档加入队列whatsapp, telegram, maxwriteIdempotency-Key
GET/api/v1/instances/{id}/settings连接与事件设置whatsapp, telegram, maxread
PUT/api/v1/instances/{id}/settings修改设置whatsapp, telegram, maxwrite
GET/api/v1/instances/{id}/queue持久化消息队列whatsapp, telegram, maxread
POST/api/v1/instances/{id}/queue/clear取消所有 queued 消息whatsapp, telegram, maxwrite
POST/api/v1/instances/{id}/queue/{messageId}/cancel取消一条 queued 消息whatsapp, telegram, maxwrite
POST/api/v1/instances/{id}/queue/{messageId}/retry仅重试已确认的 failed 错误操作whatsapp, telegram, maxwrite
GET/api/v1/instances/{id}/notifications/stats待处理和已处理的通知数量whatsapp, telegram, maxread
POST/api/v1/instances/{id}/notifications/receive通过 lease 和等待获取通知whatsapp, telegram, maxwrite
DELETE/api/v1/instances/{id}/notifications/{receiptId}确认当前回执已处理whatsapp, telegram, maxwrite
GET/api/v1/instances/{id}/deliverieswebhook 投递结果whatsapp, telegram, maxread
GET/api/v1/instances/{id}/deliveries/statswebhook 任务计数whatsapp, telegram, maxread
POST/api/v1/instances/{id}/deliveries/clear取消待处理、重试中和 dead-letter webhookwhatsapp, telegram, maxwrite
GET/api/v1/instances/{id}/deliveries/{jobId}/attemptswebhook 尝试日志whatsapp, telegram, maxread
POST/api/v1/instances/{id}/deliveries/{jobId}/retry重试 dead-letter 中的 webhookwhatsapp, telegram, maxwrite
GET/api/v1/events带游标的事件whatsapp, telegram, maxread
GET/api/v1/streamSSE 事件流whatsapp, telegram, maxread
POST/api/v1/files上传不超过 20 MB 的文件whatsapp, telegram, maxwrite
GET/api/v1/files/{fileId}下载之前上传的本地文件whatsapp, telegram, maxread
PUT/api/v1/config应用及网络连接设置whatsapp, telegram, maxwrite
GET/api/v1/methods可用操作目录whatsapp, telegram, maxread
GET/api/v1/integrations/manifest当前工作空间的连接、命令和可直接使用的集成文件,不含密钥或认证数据whatsapp, telegram, maxread
GET/api/v1/integrations/files/{name}下载不含个人数据的集成模板或完整 ZIP 包whatsapp, telegram, maxread
POST/api/v1/instances/{id}/operations/account.settings.get已连接账号的资料whatsapp, telegram, max需要连接read
POST/api/v1/instances/{id}/operations/contacts.list联系人列表whatsapp, telegram, max需要连接read
POST/api/v1/instances/{id}/operations/contacts.get联系人信息whatsapp, telegram, max需要连接read
POST/api/v1/instances/{id}/operations/contacts.lookup通过手机号或 ID 检查账号是否存在whatsapp, telegram, max需要连接read
POST/api/v1/instances/{id}/operations/contacts.create添加联系人telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/contacts.update编辑联系人telegram需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/contacts.delete删除联系人telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/profile.avatar.get获取头像whatsapp需要连接read
POST/api/v1/instances/{id}/operations/messages.history从即时通讯平台加载历史记录telegram, max需要连接read
POST/api/v1/instances/{id}/operations/messages.get从即时通讯平台获取消息telegram, max需要连接read
POST/api/v1/instances/{id}/operations/messages.read将消息标记为已读whatsapp, telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/messages.delete删除消息whatsapp, telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/messages.edit编辑消息文本whatsapp, telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/messages.forward转发选中的消息whatsapp, telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/messages.react修改消息回应whatsapp, telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/messages.contact发送联系人名片whatsapp, telegram需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/messages.location发送位置whatsapp, telegram需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/messages.poll发送投票whatsapp, telegram需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/chats.typing显示正在输入指示whatsapp, telegram需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/chats.archive归档聊天whatsapp, telegram需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/chats.unarchive取消聊天归档whatsapp, telegram需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/chats.expiration配置阅后即焚消息whatsapp, telegram需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/chats.reactions获取可用的消息回应telegram需要连接read
POST/api/v1/instances/{id}/operations/groups.get群组信息whatsapp, telegram, max需要连接read
POST/api/v1/instances/{id}/operations/groups.create创建群组whatsapp, telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/groups.rename重命名群组whatsapp, telegram需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/groups.members.add添加成员whatsapp, telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/groups.members.remove移除成员whatsapp, telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/groups.admins.add指定群组管理员whatsapp需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/groups.admins.remove撤销群组管理员权限whatsapp需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/groups.leave退出群组whatsapp, telegram, max需要连接writeIdempotency-Key
POST/api/v1/instances/{id}/operations/groups.settings修改一项群组权限whatsapp需要连接writeIdempotency-Key

从构想到集成

连接您的第一个账号

创建账号、验证邮箱,然后从请求连接列表开始。