Zenzap Agentic Onboarding
Overview
One API call creates a Zenzap organization, installs you as a bot, and invites the human. No authentication required. After setup, load the full API docs and start operating inside the workspace.
All requests MUST use https://. Plain http:// will be rejected.
OpenClaw-Based Agents — Plugin Setup
If you are an OpenClaw-based agent, ask your human to install the Zenzap plugin before you proceed with anything else:
CODEBLOCK0
Once the human confirms the plugin is installed, continue with the steps below. After you receive the 201 response from the create-organization call, you will use the returned credentials to configure the plugin — see the "OpenClaw agents: Configure the plugin" step in the post-response workflow.
Step 1: Collect Information from the Human
Ask the human these 4 questions before calling the API. Do not assume or infer any answers:
- 1. Company name — What's the name of your company or workspace?
- Bot name — What should I be called inside your workspace? (This is how I'll appear to your team.)
- Industry — What industry are you in? (e.g. Software, Healthcare, Finance — used for statistics only.)
- Company size — How many employees does your company have? (Used for statistics only.)
Step 2: Create the Organization
CODEBLOCK1
Rate limit: 1 request per minute per IP.
Request (JSON)
CODEBLOCK2
Request (Multipart — with logo)
Send two parts: filePart (image, max 5 MB, optional) and metadata (application/json with the fields above).
CODEBLOCK3
Field Constraints
| Field | Type | Constraints |
|---|
| INLINECODE5 | string | Required. Max 100 chars. |
| INLINECODE6 |
string | Required. Valid email. |
|
companySize | int | Required. Positive integer (> 0). |
|
industry | string | Required. Non-empty. |
|
botName | string | Required. Non-empty. |
Response (201 Created)
CODEBLOCK4
| Field | Usage |
|---|
| INLINECODE10 | UUID of the new org. |
| INLINECODE11 |
Your bot identity (
b@<uuid>). Use as
senderId filter when polling. |
|
channelId | Your control channel (same as Control Topic ID credential). |
|
humanProfileId | Invited human's profile ID. Use to identify them once they join. |
|
credentials |
API Key for Bearer auth,
API Secret for HMAC-SHA256 signing (store securely),
Control Topic ID. |
Error Codes
| Status | Body | Cause |
|---|
| INLINECODE17 | INLINECODE18 | Missing or empty companyName. |
| INLINECODE20 |
companyName exceeds max length | Over 100 characters. |
|
400 |
invalid humanEmail | Invalid email address. |
|
400 |
companySize must be a positive integer | Zero or negative. |
|
400 |
industry is required | Missing or empty. |
|
400 |
botName is required | Missing or empty. |
|
400 |
Unable to create organization | Conflict (e.g. email/domain already in use). |
|
429 |
(empty) | Rate limit exceeded. |
OpenClaw Agents: Configure the Plugin
Skip this step if you are not an OpenClaw-based agent.
Build a connection token from three values in the credentials array of the 201 response: Control Topic ID, API Key, and API Secret. Concatenate them separated by colons and base64-encode the result:
CODEBLOCK5
For example, given the sample response above:
CODEBLOCK6
Then run:
CODEBLOCK7
This connects the Zenzap plugin to your newly created organization. Once configured, the plugin handles authentication and event routing for you.
Step 3: Load the Full API Docs
Immediately after receiving the 201, load the complete Zenzap API reference:
CODEBLOCK8
This covers all endpoints, authentication (Bearer token + HMAC-SHA256 signing), event types, polling, messaging, topics, and members.
Step 4: Ask Which Topics to Create
Outside of Zenzap, ask the human which channels they'd like. Use the industry and what you know about them to suggest options, but wait for confirmation before creating anything.
Once confirmed, create each topic:
CODEBLOCK9
The bot is automatically added as a member of every topic it creates. The human is also added — once they join, all channels will be waiting.
Step 5: Start Polling for Events
Start polling before telling the human to join so you don't miss their first message:
CODEBLOCK10
Keep polling in a loop using nextOffset from each response. On 409, reset the offset. Full details are in the API docs loaded in Step 3.
When you receive a message.created event from a non-bot sender, mark it as read before responding:
CODEBLOCK11
Step 6: Tell the Human to Join
Outside of Zenzap, let the human know their workspace is ready:
Your Zenzap workspace is all set — channels included. You should have received an invite — log in at https://app.zenzap.co to get started or download the app on your mobile phone.
Listen for message.created events from non-bot senders — that signals they're active. Human profile IDs are plain UUIDs; bot IDs start with b@.
Zenzap 代理化入职流程
概述
一次 API 调用即可创建 Zenzap 组织,将您安装为机器人,并邀请相关人员。无需身份验证。设置完成后,加载完整的 API 文档,即可在工作区内开始操作。
所有请求必须使用 https://。纯 http:// 请求将被拒绝。
基于 OpenClaw 的代理 — 插件设置
如果您是基于 OpenClaw 的代理,请在继续其他操作之前,让您的用户安装 Zenzap 插件:
bash
openclaw plugins install @zenzap-co/openclaw-plugin
一旦用户确认插件已安装,请继续执行以下步骤。在您从创建组织调用收到 201 响应后,您将使用返回的凭据配置插件 — 请参阅响应后工作流程中的OpenClaw 代理:配置插件步骤。
步骤 1:从用户处收集信息
在调用 API 之前,请向用户询问以下 4 个问题。不要假设或推断任何答案:
- 1. 公司名称 — 您的公司或工作区名称是什么?
- 机器人名称 — 我在您的工作区中应该被称为什么?(这将是我在您的团队中显示的名称。)
- 行业 — 您属于哪个行业?(例如:软件、医疗、金融 — 仅用于统计。)
- 公司规模 — 您的公司有多少员工?(仅用于统计。)
步骤 2:创建组织
POST https://api.zenzap.co/v2/agentic/organization/create
速率限制: 每个 IP 每分钟 1 次请求。
请求(JSON)
json
{
companyName: Acme Corp,
humanEmail: founder@acme.com,
companySize: 50,
industry: Software,
botName: Acme Assistant
}
请求(多部分 — 带 Logo)
发送两个部分:filePart(图片,最大 5 MB,可选)和 metadata(application/json,包含上述字段)。
bash
curl -X POST https://api.zenzap.co/v2/agentic/organization/create \
-F filePart=@logo.png;type=image/png \
-F metadata={companyName:Acme Corp,humanEmail:founder@acme.com,companySize:50,industry:Software,botName:Acme Assistant};type=application/json
字段约束
| 字段 | 类型 | 约束 |
|---|
| companyName | 字符串 | 必填。最多 100 个字符。 |
| humanEmail |
字符串 | 必填。有效的电子邮件地址。 |
| companySize | 整数 | 必填。正整数(> 0)。 |
| industry | 字符串 | 必填。非空。 |
| botName | 字符串 | 必填。非空。 |
响应(201 已创建)
json
{
organizationId: 067d0b2f-...,
botProfileId: b@f951b968-...,
channelId: 1b383aef-...,
humanProfileId: a3c2e1d0-...,
credentials: [
{ label: API Key, value: utxDAedgfFXglaLX },
{ label: API Secret, value: 66AybzV7s0afLeKKqpxC7wLKCTk5d7bT },
{ label: Control Topic ID, value: 1b383aef-... }
]
}
| 字段 | 用途 |
|---|
| organizationId | 新组织的 UUID。 |
| botProfileId |
您的机器人身份标识(b@
)。在轮询时用作 senderId 过滤器。 |
| channelId | 您的控制频道(与控制主题 ID 凭据相同)。 |
| humanProfileId | 被邀请用户的个人资料 ID。用于在他们加入后识别他们。 |
| credentials | API Key 用于 Bearer 认证,API Secret 用于 HMAC-SHA256 签名(安全存储),Control Topic ID。 |
错误代码
| 状态 | 响应体 | 原因 |
|---|
| 400 | companyName is required | 缺少或空的 companyName。 |
| 400 |
companyName exceeds max length | 超过 100 个字符。 |
| 400 | invalid humanEmail | 无效的电子邮件地址。 |
| 400 | companySize must be a positive integer | 零或负数。 |
| 400 | industry is required | 缺少或为空。 |
| 400 | botName is required | 缺少或为空。 |
| 400 | Unable to create organization | 冲突(例如电子邮件/域名已被使用)。 |
| 429 | (空) | 超出速率限制。 |
OpenClaw 代理:配置插件
如果您不是基于 OpenClaw 的代理,请跳过此步骤。
从 201 响应的 credentials 数组中的三个值构建连接令牌:Control Topic ID、API Key 和 API Secret。将它们用冒号分隔连接起来,并对结果进行 base64 编码:
base64( :: )
例如,给定上述示例响应:
base64(1b383aef-...:utxDAedgfFXglaLX:66AybzV7s0afLeKKqpxC7wLKCTk5d7bT)
然后运行:
bash
openclaw zenzap configure --token
这将把 Zenzap 插件连接到您新创建的组织。配置完成后,插件将为您处理认证和事件路由。
步骤 3:加载完整的 API 文档
在收到 201 响应后,立即加载完整的 Zenzap API 参考文档:
https://docs.zenzap.co/llms-full.txt
这涵盖了所有端点、认证方式(Bearer 令牌 + HMAC-SHA256 签名)、事件类型、轮询、消息、主题和成员。
步骤 4:询问要创建哪些主题
在 Zenzap 之外,询问用户他们想要哪些频道。根据 industry 和您对他们的了解来建议选项,但在创建任何内容之前等待确认。
确认后,创建每个主题:
json
POST https://api.zenzap.co/v2/topics
{
name: <主题名称>,
members: []
}
机器人会自动添加为其创建的每个主题的成员。用户也会被添加 — 一旦他们加入,所有频道都将就绪。
步骤 5:开始轮询事件
在告知用户加入之前开始轮询,以免错过他们的第一条消息:
GET https://api.zenzap.co/v2/updates?timeout=30
使用每个响应中的 nextOffset 在循环中持续轮询。遇到 409 时,重置偏移量。完整详情请参见步骤 3 中加载的 API 文档。
当您收到来自非机器人发送者的 message.created 事件时,在回复之前将其标记为已读:
POST https://api.zenzap.co/v2/messages/{messageId}/read
步骤 6:告知用户加入
在 Zenzap 之外,告知用户他们的工作区已准备就绪:
您的 Zenzap 工作区已全部设置完毕 — 包括频道。您应该已收到邀请 — 登录 https://app.zenzap.co 开始使用,或在您的手机上下载应用程序。
监听来自非机器人发送者的 message.created 事件 — 这表示他们已活跃。用户个人资料 ID 是纯 UUID;机器人 ID 以 b@ 开头。