channel=website.
Authentication
| Method | Headers |
|---|---|
| API key (recommended) | X-API-Key: psk_live_YOUR_KEY |
| JWT session | Authorization: Bearer YOUR_JWT + X-Workspace-Id: YOUR_WORKSPACE_UUID |
workspace_id in the request body must match the authenticated workspace.
Agent turns consume AI credits (
agent_turn = 2 credits, plus per-tool costs). Requires a plan with agent access (Pro for WhatsApp; website chat follows workspace AI composer limits).Send a message
POST /workspace-agent/website/chat
Run one agent turn. Provide at least one of: text, image_url, video_url, image_media_id, video_media_id.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | No* | User message |
image_url | string | No* | Public HTTPS image URL |
video_url | string | No* | Public HTTPS video URL |
image_media_id | UUID | No* | Postsiva unified media ID (image from media library) |
video_media_id | UUID | No* | Postsiva unified media ID (video) |
workspace_id | UUID | No | Must match authenticated workspace if sent |
Convenience parse of
agent_response_json. Primary field is response (markdown-friendly text). Optional: tables_markdown, charts_markdown, mermaid_diagrams, image_urls, video_urls, append_footer.Agent tools
The agent has access to the same tool layer as MCP (minusweb_search_duckduckgo on some channels):
| Tool | Capability |
|---|---|
get_accounts | List connected platforms or load one profile |
get_queued_posts | Scheduled posts and drafts |
get_user_posts | Recent posts per platform |
get_unified_analytics | Cross-platform analytics |
get_comments | Comments on recent posts |
reply_to_comment | Reply to a comment thread |
manage_platform_connection | OAuth connect/disconnect |
idea_to_content | Idea → post copy |
content_to_image | Copy → images |
media_to_content | Image/video URL → captions |
analyze_media | Describe image/video URL |
publish | Publish, draft, or schedule |
clear_workspace_chat_history | Clear agent memory (WhatsApp/website; not on MCP) |
List chat history
GET /user-agent-chats
Returns archived user/assistant turns stored in user_agent_chats. Newest first.
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
channel | string | — | Filter by surface: whatsapp, instagram_dm, facebook_messenger, website, mobile |
since | ISO 8601 | — | Include turns with created_at >= since |
until | ISO 8601 | — | Include turns with created_at <= until |
limit | integer | 20 | Page size (1–100) |
offset | integer | 0 | Pagination offset |
Count of rows matching filters (ignores
limit/offset).Clear chat history
DELETE /user-agent-chats
Deletes all archived turns for the workspace (every channel) and clears LangGraph thread memory. Equivalent to asking the agent to run clear_workspace_chat_history.
Voice transcription (optional)
POST /workspace-agent/website/transcribe
Upload audio (e.g. audio/webm) to get a text transcript. Send the transcript as text in /chat. Requires server-side Pollinations configuration.
Errors
| Status | Meaning |
|---|---|
401 | Invalid or revoked API key / JWT |
403 | workspace_id body mismatch |
422 | No text or media fields in body |
500 | Agent invocation failed |
502 | Agent returned empty response |
REST vs MCP vs agent chat
| Agent chat | MCP | REST | |
|---|---|---|---|
| Caller | Your app with natural language | External AI agent | Your code |
| Tool selection | Agent decides | Client agent decides | You call endpoints |
| Memory | Per-workspace thread | Stateless | Stateless |
| Best for | Embedded chat UI, copilots | Cursor, n8n AI Agent | Deterministic pipelines |
Next
MCP overview
Connect Cursor or n8n
AI content APIs
Direct generate endpoints
GPT Actions
ChatGPT Custom GPT setup