面向开发者和 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 作为目标。如果首次发送的结果尚不明确,不要换用新密钥再次发送。

Группы и переписка

Список /chats содержит доступные аккаунту чаты, а groups.get — информацию выбранной группы. Полнота снимка участников не гарантируется. groups.invite.preview 检查支持的社区地址,但不加入; groups.join требует write и один стабильный Idempotency-Key. Результат joined подтверждает членство, pending — запрос одобрения, unknown требует проверки без автоматического повтора. Ссылку приглашения храните как секрет; права и ограничения мессенджера сохраняются.

公开的 Telegram 频道或群组无需邀请:将 target 设为 @username 或 https://t.me/username。私人邀请仍使用 inviteLink。请仅提供一个字段。

Необязательный senderId в сообщении обозначает наблюдавшегося автора, храните его строкой. Поиск /messages?chatId=…&search=… 针对本地历史记录,而不是所有公开群组。收到的附件通过 attachments/prepare/content 操作下载,并检查来源账号及权限。旧的、已删除或受保护的附件可能不可用。

通过 API 和控制台传输文件

可靠文件上传:POST /uploads、PUT 完整字节,并在响应丢失后 GET 同一回执。发送 fileId 是独立命令,使用单独的 Idempotency-Key。上传不会发送消息;202 不表示已送达。完整指南:file-transfer.txt。

事件与 webhook 安全

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

送达、已读与状态订阅

请保存发送响应中的本地 message.id。message.state 表示服务内的处理状态,message.delivery 表示已观察到的回执。HTTP 202、queued、submitted 和 observed 不代表送达或已读;unknown 表示尚未收到确认。

在 status 事件中,用 data.messageId 关联本地 UUID,并将 data.providerId 另存为字符串。旧字段 data.id 可能是平台 ID。可通过 GET /api/v1/instances/{id}/messages/{messageId} 核对单条消息。scope=participant 和 participants 仅表示个别成员,不代表整个群组;participantsComplete=false。即使 participants 中有 read,总体 delivery.status 仍可能为 unknown。

MAX read 表示某个成员的阅读位置已越过该消息,不代表其听过语音。readAt 是 read-through watermark 时间,不是打开消息或播放录音的准确时刻。暂不支持 MAX 原生 played。设备的 played ACK 是客户端自行报告的本地播放结果,不是平台 read/played 回执,也不能证明有人听到了声音。

Telegram:sent/read 来自原生出站阅读位置;不提供独立 delivered、读者名单/数量或全员已读证明。出站语音的 played 与 source=telegram_voice_listened 表示至少一位接收者的 is_listened=true,不包含其身份或准确播放时间。WhatsApp:read 不等于 played,私聊 played 必须有原生证据。固定版本的群回调只报告成员 delivered/read,不能单独区分 group played。隐私或回执缺失可能使结果保持 unknown。出站 /voice 支持三个平台;入站音频和设备 API 仍仅支持 MAX。

未收到状态时,请核对自己的 instanceId、本地 message.id、status 过滤器和 webhook/pull 路由;用已保存游标恢复 /events/SSE 并核对 GET message。Telegram 可将临时 providerId 替换为最终 ID,messageId 保持不变。使用服务端返回的 chatId/providerId,不要自行构造 WA PN/LID 别名。readAt/playedAt 缺失是合法的,包括 Telegram played;结果未知不能作为重新发送的依据。

在 notificationFilters 中加入 status 和 chat_read,并保留其他所需类型。webhookEnabled=true 时,新匹配事件进入 webhook;false 时进入 pull。这是二选一的分发模式。/events?after=… 与 SSE 可独立读取。用 after 或 Last-Event-ID 恢复 SSE,处理 id/data,处理成功后保存游标,并按 event.id 去重。积压批次满时,流以 retry:1000 结束,请从最后一个 ID 继续。

校验 webhook 原始字节的 HMAC SHA-256,并在持久处理后返回 2xx。pull 回执应在处理成功后、leaseExpiresAt 前确认。webhook 任务的 delivered 仅表示 HTTP 已交给您的处理器,不代表消息送达平台收件人。不要为获取状态而重复发送。密钥只保存在服务端,不放入 URL。

完整状态示例与排查(TXT,俄语) ↓

可直接使用的资料

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

Полный каталог: 85 HTTP-команд

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

Senden 公开 API 和 Bearer API 命令
方法与路径用途支持情况权限
GET/api/v1/health进程健康检查whatsapp, telegram, maxread
GET/api/v1/statusПодключения, состояния и usage: тариф, сроки, счётчики и maxFileByteswhatsapp, 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
GET/api/v1/instances/{id}/messages/{messageId}Получить сообщение по локальному UUID и сохранённые подтвержденияwhatsapp, telegram, maxread
POST/api/v1/instances/{id}/voiceПоставить нативное голосовое сообщение в очередьwhatsapp, telegram, maxwriteIdempotency-Key
POST/api/v1/instances/{id}/messages/{messageId}/voiceЗагрузить голосовое MAX по UUID сообщения своего пространстваmax需要连接write
GET/api/v1/instances/{id}/messages/{messageId}/voice/contentВоспроизвести ранее загруженное голосовое MAXmaxread
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/streamПоток событий SSE с возобновлениемwhatsapp, telegram, maxread
POST/api/v1/filesЗагрузить файл: до 20 МБ на пробном тарифе, до 200 МБ на Prowhatsapp, 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.invite.previewПроверить приглашение в группу без вступленияwhatsapp, telegram, max需要连接read
POST/api/v1/instances/{id}/operations/groups.join加入社区:公开 Telegram 或邀请whatsapp, telegram, max需要连接writeIdempotency-Key
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
GET/api/v1/instances/{id}/messages/{messageId}/attachmentsList safe observed attachment metadata; no remote download.whatsapp, telegram, maxread
GET/api/v1/instances/{id}/messages/{messageId}/attachments/{attachmentId}Read metadata and preparation state; suitable for polling.whatsapp, telegram, maxread
POST/api/v1/instances/{id}/messages/{messageId}/attachments/{attachmentId}/preparePrepare a private cached copy of an observed attachment.whatsapp, telegram, maxread
GET/api/v1/instances/{id}/messages/{messageId}/attachments/{attachmentId}/contentStream only a ready local attachment as a download.whatsapp, telegram, maxread
HEAD/api/v1/instances/{id}/messages/{messageId}/attachments/{attachmentId}/contentHeaders of a ready copy without a body or remote download.whatsapp, telegram, maxread
POST/api/v1/uploadsReserve a durable upload intent; no messenger send.whatsapp, telegram, maxwriteIdempotency-Key
GET/api/v1/uploads/{uploadId}Recover own upload receipt and fileId after a lost response.whatsapp, telegram, maxwrite
PUT/api/v1/uploads/{uploadId}/contentVerify a full raw stream into one immutable fileId.whatsapp, telegram, maxwrite
GET/api/v1/files/{fileId}/metadataRead own safe file metadata/tombstone, not a filesystem path.whatsapp, telegram, maxread

从构想到集成

连接您的第一个账号

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