WebsitePublisher.ai
Build and publish real websites through conversation. You describe it — the AI builds and deploys it.
The user's credentials are set as environment variables:
- -
WEBSITEPUBLISHER_TOKEN — API token (starts with wpa_) - INLINECODE2 — Project ID (numeric, e.g.
12345)
If either variable is missing, stop and instruct the user:
- 1. Sign up at https://www.websitepublisher.ai/dashboard
- Copy their API token and Project ID from the dashboard
- Add to their OpenClaw config:
{
"env": {
"WEBSITEPUBLISHER_TOKEN": "wpa_xxxx...",
"WEBSITEPUBLISHER_PROJECT": "12345"
}
}
Authentication
Every API call requires these headers:
CODEBLOCK1
Base URL: https://api.websitepublisher.ai
Workflow — Build a Complete Website
When asked to build a website, follow this exact sequence:
Step 1 — Check existing content
CODEBLOCK2
This returns the project URL, existing pages, and current status. Always do this first.
Step 2 — Create pages (use bulk for multiple pages)
Single page:
CODEBLOCK3
Multiple pages at once (preferred — saves API calls):
CODEBLOCK4
Step 3 — Upload assets (images, CSS, JS)
CODEBLOCK5
Asset URL pattern: https://cdn.websitepublisher.ai/[path]/[slug]
Reference assets in HTML using this CDN URL.
Step 4 — Confirm live URL
The project URL is returned by the status endpoint. Share it with the user.
PAPI — Pages & Assets (Full Reference)
Pages
| Action | Method | Endpoint |
|---|
| List pages | GET | INLINECODE6 |
| Get page |
GET |
/papi/project/{id}/pages/{slug} |
| Create page | POST |
/papi/project/{id}/pages |
| Bulk create | POST |
/papi/project/{id}/pages/bulk |
| Update page | PUT |
/papi/project/{id}/pages/{slug} |
| Patch page | PATCH |
/papi/project/{id}/pages/{slug} |
| Delete page | DELETE |
/papi/project/{id}/pages/{slug} |
| List versions | GET |
/papi/project/{id}/pages/{slug}/versions |
| Rollback | POST |
/papi/project/{id}/pages/{slug}/rollback |
Page fields:
CODEBLOCK6
Patch a page (partial update — send only changed HTML fragment):
CODEBLOCK7
Assets
| Action | Method | Endpoint |
|---|
| List assets | GET | INLINECODE15 |
| Get asset |
GET |
/papi/project/{id}/assets/{slug} |
| Upload asset | POST |
/papi/project/{id}/assets |
| Bulk upload | POST |
/papi/project/{id}/assets/bulk |
| Delete asset | DELETE |
/papi/project/{id}/assets/{slug} |
Asset fields:
CODEBLOCK8
Tip: You can pass a public image URL as content — the platform fetches and stores it automatically.
MAPI — Dynamic Data (Products, Blog, Team, etc.)
Use MAPI when the website needs structured, repeatable data — product listings, blog posts, team members, portfolio items, etc.
Create an entity (data model)
CODEBLOCK9
Create records
CODEBLOCK10
Note: MAPI endpoint uses the plural entity name — e.g. /products not /product.
MAPI Reference
| Action | Method | Endpoint |
|---|
| List entities | GET | INLINECODE23 |
| Create entity |
POST |
/mapi/project/{id}/entities |
| Get entity schema | GET |
/mapi/project/{id}/entities/{name}/properties |
| List records | GET |
/mapi/project/{id}/{entity} |
| Get record | GET |
/mapi/project/{id}/{entity}/{recordId} |
| Create record | POST |
/mapi/project/{id}/{entity} |
| Update record | PUT |
/mapi/project/{id}/{entity}/{recordId} |
| Delete record | DELETE |
/mapi/project/{id}/{entity}/{recordId} |
Public read: MAPI records are publicly readable at the same endpoint without a token — useful for frontend JavaScript fetching live data.
SAPI — Contact Forms
Add a working contact form to any page in two steps.
Step 1 — Configure the form
CODEBLOCK11
Important: Always send ALL fields on every configure_form call — no partial updates.
Step 2 — Add the form HTML to the page
The API returns a form_id. Use this snippet in the page HTML:
CODEBLOCK12
SAPI Reference
| Action | Method | Endpoint |
|---|
| Configure form | POST | INLINECODE32 |
| List forms |
GET |
/sapi/project/{id}/forms |
| Remove form | DELETE |
/sapi/project/{id}/forms/{form_id} |
Rate Limits
| Plan | Limit |
|---|
| Free | 30 requests/min |
| Starter |
60 requests/min |
| Pro+ | 150-300 requests/min |
Always prefer bulk endpoints (/pages/bulk, /assets/bulk) over individual calls to stay within rate limits. A bulk call counts as one request regardless of how many items it creates.
Common Patterns
Landing page (one page)
- 1.
GET /status — check project - INLINECODE38 — create
index.html with full content - INLINECODE40 — configure contact form if needed
- Share project URL
Multi-page website
- 1.
GET /status — check project - INLINECODE42 — create all pages in one call
- INLINECODE43 — upload all images in one call
- INLINECODE44 — configure contact form on contact page
- Share project URL
Website with dynamic data (e.g. product catalogue)
- 1.
GET /status — check project - INLINECODE46 — create data model (e.g. "products")
- INLINECODE47 — create records (one per product)
- INLINECODE48 — create pages with JS that fetches MAPI data
- Share project URL
Error Handling
All endpoints return standard HTTP status codes:
| Code | Meaning |
|---|
| 200/201 | Success |
| 400 |
Invalid request — check your JSON fields |
| 401 | Invalid or missing token |
| 404 | Page/asset/entity not found |
| 422 | Validation error — response body contains field errors |
| 429 | Rate limit exceeded — use bulk endpoints or wait |
| 500 | Server error — try again |
On error, the response body always contains a message field with a description.
Support & Docs
- - Dashboard: https://www.websitepublisher.ai/dashboard
- Full API docs: https://www.websitepublisher.ai/docs
- PAPI docs: https://www.websitepublisher.ai/docs/papi
- MAPI docs: https://www.websitepublisher.ai/docs/mapi
- SAPI docs: https://www.websitepublisher.ai/docs/sapi
WebsitePublisher.ai
通过对话构建并发布真实网站。您描述需求——AI 构建并部署网站。
用户的凭据已设置为环境变量:
- - WEBSITEPUBLISHERTOKEN — API 令牌(以 wpa 开头)
- WEBSITEPUBLISHER_PROJECT — 项目 ID(数字,例如 12345)
如果缺少任一变量,请停止并指导用户:
- 1. 在 https://www.websitepublisher.ai/dashboard 注册
- 从仪表盘复制 API 令牌和项目 ID
- 添加到 OpenClaw 配置中:
json
{
env: {
WEBSITEPUBLISHER
TOKEN: wpaxxxx...,
WEBSITEPUBLISHER_PROJECT: 12345
}
}
身份验证
每次 API 调用都需要以下请求头:
Authorization: Bearer $WEBSITEPUBLISHER_TOKEN
Content-Type: application/json
Accept: application/json
基础 URL: https://api.websitepublisher.ai
工作流程 — 构建完整网站
当被要求构建网站时,请按以下确切顺序执行:
步骤 1 — 检查现有内容
bash
curl -s \
-H Authorization: Bearer $WEBSITEPUBLISHER_TOKEN \
-H Accept: application/json \
https://api.websitepublisher.ai/papi/project/$WEBSITEPUBLISHER_PROJECT/status
这将返回项目 URL、现有页面和当前状态。务必先执行此步骤。
步骤 2 — 创建页面(多个页面使用批量创建)
单个页面:
bash
curl -s -X POST \
-H Authorization: Bearer $WEBSITEPUBLISHER_TOKEN \
-H Content-Type: application/json \
-H Accept: application/json \
-d {
slug: index.html,
content: ...,
title: 首页,
seotitle: 公司名称 — 标语,
seodescription: 用一句话描述页面内容,供搜索引擎使用。
} \
https://api.websitepublisher.ai/papi/project/$WEBSITEPUBLISHER_PROJECT/pages
同时创建多个页面(推荐 — 节省 API 调用次数):
bash
curl -s -X POST \
-H Authorization: Bearer $WEBSITEPUBLISHER_TOKEN \
-H Content-Type: application/json \
-H Accept: application/json \
-d {
pages: [
{slug: index.html, content: ..., title: 首页},
{slug: about.html, content: ..., title: 关于我们},
{slug: contact.html, content: ..., title: 联系我们}
]
} \
https://api.websitepublisher.ai/papi/project/$WEBSITEPUBLISHER_PROJECT/pages/bulk
步骤 3 — 上传资源(图片、CSS、JS)
bash
curl -s -X POST \
-H Authorization: Bearer $WEBSITEPUBLISHER_TOKEN \
-H Content-Type: application/json \
-H Accept: application/json \
-d {
slug: images/logo.png,
content: BASE64
ENCODEDDATA,
alt: 公司 Logo
} \
https://api.websitepublisher.ai/papi/project/$WEBSITEPUBLISHER_PROJECT/assets
资源 URL 模式: https://cdn.websitepublisher.ai/[路径]/[slug]
在 HTML 中使用此 CDN URL 引用资源。
步骤 4 — 确认在线 URL
项目 URL 由状态端点返回。与用户分享。
PAPI — 页面与资源(完整参考)
页面
| 操作 | 方法 | 端点 |
|---|
| 列出页面 | GET | /papi/project/{id}/pages |
| 获取页面 |
GET | /papi/project/{id}/pages/{slug} |
| 创建页面 | POST | /papi/project/{id}/pages |
| 批量创建 | POST | /papi/project/{id}/pages/bulk |
| 更新页面 | PUT | /papi/project/{id}/pages/{slug} |
| 部分更新页面 | PATCH | /papi/project/{id}/pages/{slug} |
| 删除页面 | DELETE | /papi/project/{id}/pages/{slug} |
| 列出版本 | GET | /papi/project/{id}/pages/{slug}/versions |
| 回滚 | POST | /papi/project/{id}/pages/{slug}/rollback |
页面字段:
json
{
slug: about.html,
content: 完整 HTML 字符串,
title: 仪表盘中显示的标签,
seotitle: 浏览器标签页 + 搜索标题,
seodescription: 用于搜索的元描述,
seokeywords: 逗号,分隔,关键词,
canonical: https://example.com/about
}
部分更新页面(仅发送更改的 HTML 片段):
bash
curl -s -X PATCH \
-H Authorization: Bearer $WEBSITEPUBLISHER_TOKEN \
-H Content-Type: application/json \
-H Accept: application/json \
-d {
patches: [
{
search:
旧标题
,
replace:
新标题
}
]
} \
https://api.websitepublisher.ai/papi/project/$WEBSITEPUBLISHER_PROJECT/pages/index.html
资源
| 操作 | 方法 | 端点 |
|---|
| 列出资源 | GET | /papi/project/{id}/assets |
| 获取资源 |
GET | /papi/project/{id}/assets/{slug} |
| 上传资源 | POST | /papi/project/{id}/assets |
| 批量上传 | POST | /papi/project/{id}/assets/bulk |
| 删除资源 | DELETE | /papi/project/{id}/assets/{slug} |
资源字段:
json
{
slug: images/hero.jpg,
content: BASE64_STRING 或 https://example.com/image.jpg,
alt: 无障碍描述,
type: image
}
提示: 您可以将公开图片 URL 作为 content 传递——平台会自动获取并存储。
MAPI — 动态数据(产品、博客、团队等)
当网站需要结构化、可重复的数据时使用 MAPI——产品列表、博客文章、团队成员、作品集项目等。
创建实体(数据模型)
bash
curl -s -X POST \
-H Authorization: Bearer $WEBSITEPUBLISHER_TOKEN \
-H Content-Type: application/json \
-H Accept: application/json \
-d {
name: products,
properties: [
{name: name, type: string, required: true},
{name: price, type: number},
{name: description, type: text},
{name: image, type: image}
]
} \
https://api.websitepublisher.ai/mapi/project/$WEBSITEPUBLISHER_PROJECT/entities
创建记录
bash
curl -s -X POST \
-H Authorization: Bearer $WEBSITEPUBLISHER_TOKEN \
-H Content-Type: application/json \
-H Accept: application/json \
-d {
name: 无线耳机,
price: 89.99,
description: 高级降噪耳机,
image: https://example.com/headphones.jpg
} \
https://api.websitepublisher.ai/mapi/project/$WEBSITEPUBLISHER_PROJECT/products
注意: MAPI 端点使用实体名称的复数形式——例如 /products 而不是 /product。
MAPI 参考
| 操作 | 方法 | 端点 |
|---|
| 列出实体 | GET | /mapi/project/{id}/entities |
| 创建实体 |
POST | /mapi/project/{id}/entities |
| 获取实体架构 | GET | /m