AIP
API 文档
查看 AIP 公开 API 的认证、Agent 对话和业务资源接口。
OpenAPI JSON
AIP Public API 使用工作台中创建的 API 密钥。单 Agent 对话 key 调用 /agent/*,使用已保存的 Agent 配置;Profile API key 按权限访问当前业务身份的资源。开始调用前请阅读 API 入门,会话结果处理见 会话事件与 SSE。
下方接口定义来自 Backplane OpenAPI 快照,按资源分组展示参数、请求体和响应结构。
131 个公开接口。参数、响应和认证定义直接来自 OpenAPI JSON,英文接口说明保留源文档原文。
下载 OpenAPI JSON · 查看上游 OpenAPI JSON
快照日期: 2026-10-16 · 格式: Swagger / OpenAPI 2.0 · 基础地址: https://backend.hast.so/api/public/v1.
下载文件包含 AIP 公开接口及其引用的模型,可导入支持 Swagger 2.0 的 API 工具。上游规范还包含其他服务接口。
认证
使用 AIP 中创建的 API 密钥认证。单 Agent key 调用 /agent/*,Profile key 按资源权限调用其他接口。使用 Authorization: Bearer hast_pk_... ,并在服务端保存密钥。
{
"description": "Personal API key as `Bearer hast_pk_*` for `/api/public/v1`.",
"in": "header",
"name": "Authorization",
"type": "apiKey"
}Agent 对话
POST /api/public/v1/agent/promptsSend a message to the key's bound Agent
Omit session_id to create a conversation; include it to continue. request_id makes retries idempotent. Only the saved Agent configuration is used. A 202 response is accepted, not completed; poll conversation events for the returned request_id.
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Conversation message",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"prompt": {
"maxLength": 65536,
"type": "string"
},
"request_id": {
"maxLength": 128,
"type": "string"
},
"session_id": {
"maxLength": 128,
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
}响应
202 Accepted
{
"properties": {
"after_event_id": {
"type": "integer"
},
"event_url": {
"type": "string"
},
"request_id": {
"type": "string"
},
"run_id": {
"type": "string"
},
"session_id": {
"type": "string"
}
},
"type": "object"
}GET /api/public/v1/agent/sessionsList the bound Agent's conversations
Includes historical conversations belonging to this Agent only. Session IDs can be used with the conversation events tool.
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
limit · query · 可选
{
"description": "Page size (1-100)",
"in": "query",
"name": "limit",
"type": "integer"
}cursor · query · 可选
{
"description": "Next cursor from the previous page",
"in": "query",
"name": "cursor",
"type": "string"
}响应
200 OK
{
"properties": {
"has_more": {
"type": "boolean"
},
"next_cursor": {
"type": "string"
},
"sessions": {
"items": {
"properties": {
"canceled_at": {
"type": "string"
},
"completed_at": {
"type": "string"
},
"created_at": {
"type": "string"
},
"event_cursor": {
"type": "integer"
},
"failed_at": {
"type": "string"
},
"mode": {
"type": "string"
},
"runtime_provider": {
"type": "string"
},
"session_id": {
"type": "string"
},
"status": {
"type": "string"
},
"task_origin": {
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"model": {
"type": "string"
},
"output_tokens": {
"type": "integer"
},
"pricing": {
"properties": {
"cache_read_usd_per_token": {
"type": "string"
},
"cache_write_usd_per_token": {
"type": "string"
},
"input_usd_per_token": {
"type": "string"
},
"output_usd_per_token": {
"type": "string"
}
},
"type": "object"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}GET /api/public/v1/agent/sessions/{session_id}/eventsRead the bound Agent's conversation messages and status
Returns user/assistant messages and run lifecycle events, without configuration or tool traces. Poll using next_after until the matching run_id completes, fails or is interrupted. An empty filtered page may still have has_more=true.
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
session_id · path · 必填
{
"description": "Conversation ID",
"in": "path",
"name": "session_id",
"required": true,
"type": "string"
}after · query · 可选
{
"description": "Last consumed sequence",
"in": "query",
"name": "after",
"type": "integer"
}limit · query · 可选
{
"description": "Page size (1-200)",
"in": "query",
"name": "limit",
"type": "integer"
}响应
200 OK
{
"properties": {
"events": {
"items": {
"discriminator": "type",
"properties": {
"created_at": {
"example": "2026-08-16T12:00:00Z",
"format": "date-time",
"type": "string"
},
"data": {
"allOf": [
{
"properties": {
"attempt": {
"minimum": 1,
"type": "integer"
},
"attempts": {
"minimum": 1,
"type": "integer"
},
"channel": {
"enum": [
"stdout",
"stderr",
"progress"
],
"type": "string"
},
"code": {
"type": "string"
},
"context_window": {
"minimum": 0,
"type": "integer"
},
"cost": {},
"delta": {
"type": "string"
},
"duration_ms": {
"minimum": 0,
"type": "integer"
},
"error": {
"type": "string"
},
"exit_code": {
"type": "integer"
},
"files": {
"items": {
"type": "string"
},
"type": "array"
},
"final_message_id": {
"type": "string"
},
"finish_reason": {
"type": "string"
},
"input": {},
"is_error": {
"type": "boolean"
},
"kind": {
"type": "string"
},
"last": {
"properties": {
"cache_read_tokens": {
"minimum": 0,
"type": "integer"
},
"cache_write_tokens": {
"minimum": 0,
"type": "integer"
},
"input_tokens": {
"minimum": 0,
"type": "integer"
},
"output_tokens": {
"minimum": 0,
"type": "integer"
},
"reasoning_tokens": {
"minimum": 0,
"type": "integer"
},
"total_tokens": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"cache_read_tokens",
"cache_write_tokens",
"input_tokens",
"output_tokens",
"reasoning_tokens",
"total_tokens"
],
"type": "object"
},
"message": {
"type": "string"
},
"message_id": {
"type": "string"
},
"model": {
"type": "string"
},
"model_config": {
"properties": {
"model": {
"type": "string"
},
"model_source": {
"enum": [
"hast",
"codex_account"
],
"type": "string"
},
"reasoning_effort": {
"type": "string"
}
},
"type": "object"
},
"model_source": {
"type": "string"
},
"modified_at": {
"format": "date-time",
"type": "string"
},
"name": {
"type": "string"
},
"operation": {
"enum": [
"update",
"delete"
],
"type": "string"
},
"options": {
"items": {},
"type": "array"
},
"output": {},
"parent_tool_call_id": {
"type": "string"
},
"path": {
"type": "string"
},
"plan_id": {
"type": "string"
},
"prompt": {
"type": "string"
},
"reason": {
"type": "string"
},
"reasoning_id": {
"type": "string"
},
"request_id": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"role": {
"enum": [
"user",
"assistant",
"system"
],
"type": "string"
},
"scope": {
"type": "string"
},
"size_bytes": {
"minimum": 0,
"type": "integer"
},
"status": {
"enum": [
"starting",
"ready",
"failed",
"released",
"succeeded",
"interrupted"
],
"type": "string"
},
"steps": {
"items": {
"properties": {
"status": {
"enum": [
"pending",
"in_progress",
"completed"
],
"example": "in_progress",
"type": "string"
},
"step": {
"type": "string"
}
},
"required": [
"status",
"step"
],
"type": "object"
},
"type": "array"
},
"text": {
"type": "string"
},
"tokens_after": {
"minimum": 0,
"type": "integer"
},
"tokens_before": {
"minimum": 0,
"type": "integer"
},
"tool_call_id": {
"type": "string"
},
"total": {
"properties": {
"cache_read_tokens": {
"minimum": 0,
"type": "integer"
},
"cache_write_tokens": {
"minimum": 0,
"type": "integer"
},
"input_tokens": {
"minimum": 0,
"type": "integer"
},
"output_tokens": {
"minimum": 0,
"type": "integer"
},
"reasoning_tokens": {
"minimum": 0,
"type": "integer"
},
"total_tokens": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"cache_read_tokens",
"cache_write_tokens",
"input_tokens",
"output_tokens",
"reasoning_tokens",
"total_tokens"
],
"type": "object"
},
"turn_type": {
"type": "string"
}
},
"type": "object"
}
],
"description": "Data is the HAST-owned payload union; Type selects its required shape as\ndefined in docs/reference/task-agent-event-v2.md."
},
"engine": {
"enum": [
"codex_cli",
"pi_agent_cli"
],
"example": "codex_cli",
"type": "string"
},
"event_id": {
"example": "evt_123",
"type": "string"
},
"replayable": {
"example": true,
"type": "boolean"
},
"run_id": {
"example": "run_123",
"type": "string"
},
"schema_version": {
"enum": [
2
],
"example": 2,
"type": "integer"
},
"sequence": {
"description": "Sequence is a positive durable order, or null for volatile events.",
"example": 42,
"minimum": 1,
"type": "integer",
"x-nullable": true
},
"session_id": {
"example": "session_123",
"type": "string"
},
"source": {
"enum": [
"runtime",
"backplane",
"workspace"
],
"example": "runtime",
"type": "string"
},
"task_id": {
"example": "task_123",
"type": "string"
},
"type": {
"enum": [
"runtime.status",
"run.queued",
"run.started",
"run.retrying",
"run.completed",
"run.failed",
"run.interrupted",
"message.started",
"message.delta",
"message.completed",
"reasoning.started",
"reasoning.delta",
"reasoning.completed",
"tool.started",
"tool.updated",
"tool.completed",
"plan.updated",
"plan.completed",
"usage.updated",
"file.changed",
"input.requested",
"context.compacted",
"warning",
"error"
],
"example": "message.completed",
"type": "string"
}
},
"required": [
"created_at",
"data",
"engine",
"event_id",
"replayable",
"schema_version",
"sequence",
"source",
"task_id",
"type"
],
"type": "object"
},
"type": "array"
},
"has_more": {
"example": true,
"type": "boolean"
},
"next_after": {
"example": 42,
"format": "int64",
"type": "integer",
"x-nullable": true
}
},
"type": "object"
}接入指南
GET /api/public/v1/guidesDiscover Agent-facing Hast AIP guides
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
200 OK
{
"additionalProperties": true,
"type": "object"
}GET /api/public/v1/guides/{topic}Read a detailed Hast AIP guide for Agents
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
topic · path · 必填
{
"description": "Topic from GET /guides",
"in": "path",
"name": "topic",
"required": true,
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}模型
GET /api/public/v1/modelsList Task Agent Models
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
200 OK
{
"additionalProperties": true,
"type": "object"
}Agent 配置
GET /api/public/v1/webhooksList public Task Agent Webhooks
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
200 OK
{
"properties": {
"hooks": {
"items": {
"properties": {
"communication_knowledge_base_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"created_at": {
"type": "string"
},
"created_by": {
"properties": {
"account_id": {
"type": "string"
},
"api_key_id": {
"type": "string"
},
"api_key_name": {
"type": "string"
},
"email": {
"type": "string"
},
"profile_id": {
"type": "string"
}
},
"type": "object"
},
"crm_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"dynamic_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"hook_id": {
"example": "hook_123",
"type": "string"
},
"knowledge_base_list": {
"items": {
"type": "string"
},
"type": "array"
},
"memory": {
"properties": {
"read_scope": {
"enum": [
"self",
"webhook",
"all"
],
"example": "self",
"type": "string"
},
"write_scope": {
"enum": [
"self",
"shared"
],
"example": "self",
"type": "string"
}
},
"type": "object"
},
"model": {
"type": "string"
},
"model_source": {
"type": "string"
},
"policies": {
"items": {
"type": "string"
},
"type": "array"
},
"reasoning_effort": {
"type": "string"
},
"runtime_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"sandbox_mode": {
"type": "string"
},
"secret_bindings": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"secrets": {
"items": {
"properties": {
"name": {
"example": "CRM_TOKEN",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"selected_skills": {
"items": {
"properties": {
"enabled": {
"type": "boolean"
},
"skill_id": {
"example": "usr_123",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"status": {
"type": "string"
},
"system_prompt": {
"type": "string"
},
"title": {
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"output_tokens": {
"type": "integer"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"updated_at": {
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"pagination": {
"additionalProperties": {},
"type": "object"
},
"policy_options": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}POST /api/public/v1/webhooksCreate a public Task Agent Webhook
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Webhook request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"communication_knowledge_base_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"crm_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"dynamic_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"hook_id": {
"example": "hook_123",
"type": "string"
},
"http_request": {
"additionalProperties": {},
"type": "object"
},
"knowledge_base_list": {
"items": {
"type": "string"
},
"type": "array"
},
"memory": {
"properties": {
"read_scope": {
"enum": [
"self",
"webhook",
"all"
],
"example": "self",
"type": "string"
},
"write_scope": {
"enum": [
"self",
"shared"
],
"example": "self",
"type": "string"
}
},
"type": "object"
},
"model": {
"example": "hast/auto",
"type": "string"
},
"model_source": {
"type": "string"
},
"policies": {
"items": {
"type": "string"
},
"type": "array"
},
"reasoning_effort": {
"example": "medium",
"type": "string"
},
"runtime_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"sandbox_mode": {
"example": "read_only",
"type": "string"
},
"secret_bindings": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"secrets": {
"items": {
"properties": {
"name": {
"example": "CRM_TOKEN",
"type": "string"
},
"value": {
"example": "write-only",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"selected_skills": {
"items": {
"properties": {
"enabled": {
"type": "boolean"
},
"skill_id": {
"example": "usr_123",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"status": {
"example": "active",
"type": "string"
},
"system_prompt": {
"type": "string"
},
"title": {
"example": "Support Agent",
"type": "string"
}
},
"type": "object"
}
}响应
201 Created
{
"properties": {
"hook": {
"properties": {
"communication_knowledge_base_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"created_at": {
"type": "string"
},
"created_by": {
"properties": {
"account_id": {
"type": "string"
},
"api_key_id": {
"type": "string"
},
"api_key_name": {
"type": "string"
},
"email": {
"type": "string"
},
"profile_id": {
"type": "string"
}
},
"type": "object"
},
"crm_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"dynamic_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"hook_id": {
"example": "hook_123",
"type": "string"
},
"knowledge_base_list": {
"items": {
"type": "string"
},
"type": "array"
},
"memory": {
"properties": {
"read_scope": {
"enum": [
"self",
"webhook",
"all"
],
"example": "self",
"type": "string"
},
"write_scope": {
"enum": [
"self",
"shared"
],
"example": "self",
"type": "string"
}
},
"type": "object"
},
"model": {
"type": "string"
},
"model_source": {
"type": "string"
},
"policies": {
"items": {
"type": "string"
},
"type": "array"
},
"reasoning_effort": {
"type": "string"
},
"runtime_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"sandbox_mode": {
"type": "string"
},
"secret_bindings": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"secrets": {
"items": {
"properties": {
"name": {
"example": "CRM_TOKEN",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"selected_skills": {
"items": {
"properties": {
"enabled": {
"type": "boolean"
},
"skill_id": {
"example": "usr_123",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"status": {
"type": "string"
},
"system_prompt": {
"type": "string"
},
"title": {
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"output_tokens": {
"type": "integer"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"updated_at": {
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"policy_options": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}GET /api/public/v1/webhooks/{hook_id}Read a public Task Agent Webhook
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Webhook ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"hook": {
"properties": {
"communication_knowledge_base_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"created_at": {
"type": "string"
},
"created_by": {
"properties": {
"account_id": {
"type": "string"
},
"api_key_id": {
"type": "string"
},
"api_key_name": {
"type": "string"
},
"email": {
"type": "string"
},
"profile_id": {
"type": "string"
}
},
"type": "object"
},
"crm_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"dynamic_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"hook_id": {
"example": "hook_123",
"type": "string"
},
"knowledge_base_list": {
"items": {
"type": "string"
},
"type": "array"
},
"memory": {
"properties": {
"read_scope": {
"enum": [
"self",
"webhook",
"all"
],
"example": "self",
"type": "string"
},
"write_scope": {
"enum": [
"self",
"shared"
],
"example": "self",
"type": "string"
}
},
"type": "object"
},
"model": {
"type": "string"
},
"model_source": {
"type": "string"
},
"policies": {
"items": {
"type": "string"
},
"type": "array"
},
"reasoning_effort": {
"type": "string"
},
"runtime_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"sandbox_mode": {
"type": "string"
},
"secret_bindings": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"secrets": {
"items": {
"properties": {
"name": {
"example": "CRM_TOKEN",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"selected_skills": {
"items": {
"properties": {
"enabled": {
"type": "boolean"
},
"skill_id": {
"example": "usr_123",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"status": {
"type": "string"
},
"system_prompt": {
"type": "string"
},
"title": {
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"output_tokens": {
"type": "integer"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"updated_at": {
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"policy_options": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}PUT /api/public/v1/webhooks/{hook_id}Update a public Task Agent Webhook
请求格式: application/json; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Webhook ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Webhook request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"communication_knowledge_base_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"crm_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"dynamic_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"hook_id": {
"example": "hook_123",
"type": "string"
},
"http_request": {
"additionalProperties": {},
"type": "object"
},
"knowledge_base_list": {
"items": {
"type": "string"
},
"type": "array"
},
"memory": {
"properties": {
"read_scope": {
"enum": [
"self",
"webhook",
"all"
],
"example": "self",
"type": "string"
},
"write_scope": {
"enum": [
"self",
"shared"
],
"example": "self",
"type": "string"
}
},
"type": "object"
},
"model": {
"example": "hast/auto",
"type": "string"
},
"model_source": {
"type": "string"
},
"policies": {
"items": {
"type": "string"
},
"type": "array"
},
"reasoning_effort": {
"example": "medium",
"type": "string"
},
"runtime_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"sandbox_mode": {
"example": "read_only",
"type": "string"
},
"secret_bindings": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"secrets": {
"items": {
"properties": {
"name": {
"example": "CRM_TOKEN",
"type": "string"
},
"value": {
"example": "write-only",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"selected_skills": {
"items": {
"properties": {
"enabled": {
"type": "boolean"
},
"skill_id": {
"example": "usr_123",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"status": {
"example": "active",
"type": "string"
},
"system_prompt": {
"type": "string"
},
"title": {
"example": "Support Agent",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"hook": {
"properties": {
"communication_knowledge_base_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"created_at": {
"type": "string"
},
"created_by": {
"properties": {
"account_id": {
"type": "string"
},
"api_key_id": {
"type": "string"
},
"api_key_name": {
"type": "string"
},
"email": {
"type": "string"
},
"profile_id": {
"type": "string"
}
},
"type": "object"
},
"crm_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"dynamic_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"hook_id": {
"example": "hook_123",
"type": "string"
},
"knowledge_base_list": {
"items": {
"type": "string"
},
"type": "array"
},
"memory": {
"properties": {
"read_scope": {
"enum": [
"self",
"webhook",
"all"
],
"example": "self",
"type": "string"
},
"write_scope": {
"enum": [
"self",
"shared"
],
"example": "self",
"type": "string"
}
},
"type": "object"
},
"model": {
"type": "string"
},
"model_source": {
"type": "string"
},
"policies": {
"items": {
"type": "string"
},
"type": "array"
},
"reasoning_effort": {
"type": "string"
},
"runtime_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"sandbox_mode": {
"type": "string"
},
"secret_bindings": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"secrets": {
"items": {
"properties": {
"name": {
"example": "CRM_TOKEN",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"selected_skills": {
"items": {
"properties": {
"enabled": {
"type": "boolean"
},
"skill_id": {
"example": "usr_123",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"status": {
"type": "string"
},
"system_prompt": {
"type": "string"
},
"title": {
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"output_tokens": {
"type": "integer"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"updated_at": {
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"policy_options": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}PATCH /api/public/v1/webhooks/{hook_id}Update a public Task Agent Webhook
请求格式: application/json; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Webhook ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Webhook request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"communication_knowledge_base_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"crm_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"dynamic_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"hook_id": {
"example": "hook_123",
"type": "string"
},
"http_request": {
"additionalProperties": {},
"type": "object"
},
"knowledge_base_list": {
"items": {
"type": "string"
},
"type": "array"
},
"memory": {
"properties": {
"read_scope": {
"enum": [
"self",
"webhook",
"all"
],
"example": "self",
"type": "string"
},
"write_scope": {
"enum": [
"self",
"shared"
],
"example": "self",
"type": "string"
}
},
"type": "object"
},
"model": {
"example": "hast/auto",
"type": "string"
},
"model_source": {
"type": "string"
},
"policies": {
"items": {
"type": "string"
},
"type": "array"
},
"reasoning_effort": {
"example": "medium",
"type": "string"
},
"runtime_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"sandbox_mode": {
"example": "read_only",
"type": "string"
},
"secret_bindings": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"secrets": {
"items": {
"properties": {
"name": {
"example": "CRM_TOKEN",
"type": "string"
},
"value": {
"example": "write-only",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"selected_skills": {
"items": {
"properties": {
"enabled": {
"type": "boolean"
},
"skill_id": {
"example": "usr_123",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"status": {
"example": "active",
"type": "string"
},
"system_prompt": {
"type": "string"
},
"title": {
"example": "Support Agent",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"hook": {
"properties": {
"communication_knowledge_base_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"created_at": {
"type": "string"
},
"created_by": {
"properties": {
"account_id": {
"type": "string"
},
"api_key_id": {
"type": "string"
},
"api_key_name": {
"type": "string"
},
"email": {
"type": "string"
},
"profile_id": {
"type": "string"
}
},
"type": "object"
},
"crm_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"dynamic_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"hook_id": {
"example": "hook_123",
"type": "string"
},
"knowledge_base_list": {
"items": {
"type": "string"
},
"type": "array"
},
"memory": {
"properties": {
"read_scope": {
"enum": [
"self",
"webhook",
"all"
],
"example": "self",
"type": "string"
},
"write_scope": {
"enum": [
"self",
"shared"
],
"example": "self",
"type": "string"
}
},
"type": "object"
},
"model": {
"type": "string"
},
"model_source": {
"type": "string"
},
"policies": {
"items": {
"type": "string"
},
"type": "array"
},
"reasoning_effort": {
"type": "string"
},
"runtime_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"sandbox_mode": {
"type": "string"
},
"secret_bindings": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"secrets": {
"items": {
"properties": {
"name": {
"example": "CRM_TOKEN",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"selected_skills": {
"items": {
"properties": {
"enabled": {
"type": "boolean"
},
"skill_id": {
"example": "usr_123",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"status": {
"type": "string"
},
"system_prompt": {
"type": "string"
},
"title": {
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"output_tokens": {
"type": "integer"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"updated_at": {
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"policy_options": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}DELETE /api/public/v1/webhooks/{hook_id}Delete a public Task Agent Webhook
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Webhook ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}响应
204 No Content
GET /api/public/v1/webhooks/{hook_id}/channelsRead Webhook channels and final reply configuration
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Webhook ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}响应
PUT /api/public/v1/webhooks/{hook_id}/channelsReplace Webhook channels and final reply configuration
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Webhook ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}body · body · 必填
{
"description": "Bindings and final reply policy",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"connection_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"memory_project_ids": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
}
}响应
GET /api/public/v1/webhooks/{hook_id}/emailRead an Agent email channel
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Agent ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"connection": {
"properties": {
"binding_version": {
"type": "integer"
},
"bound_hook_id": {
"type": "string"
},
"bound_hook_status": {
"type": "string"
},
"bound_hook_title": {
"type": "string"
},
"created_at": {
"type": "string"
},
"email_address": {
"type": "string"
},
"email_hook_id": {
"type": "string"
},
"id": {
"type": "string"
},
"inbox_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"platform": {
"type": "string"
},
"require_admission": {
"type": "boolean"
},
"retain_content": {
"type": "boolean"
},
"setup_required": {
"type": "boolean"
},
"status": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"email": {
"properties": {
"address": {
"type": "string"
},
"connection_id": {
"type": "string"
},
"created_at": {
"type": "string"
},
"hook_id": {
"type": "string"
},
"rules": {
"properties": {
"automatic_reply": {
"type": "boolean"
},
"mode": {
"type": "string"
},
"rules": {
"items": {
"properties": {
"body_keywords": {
"items": {
"type": "string"
},
"type": "array"
},
"domains": {
"items": {
"type": "string"
},
"type": "array"
},
"id": {
"type": "string"
},
"senders": {
"items": {
"type": "string"
},
"type": "array"
},
"subject_keywords": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"rules_version": {
"type": "integer"
},
"source_id": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}POST /api/public/v1/webhooks/{hook_id}/emailPrepare an Agent email channel
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Agent ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"connection": {
"properties": {
"binding_version": {
"type": "integer"
},
"bound_hook_id": {
"type": "string"
},
"bound_hook_status": {
"type": "string"
},
"bound_hook_title": {
"type": "string"
},
"created_at": {
"type": "string"
},
"email_address": {
"type": "string"
},
"email_hook_id": {
"type": "string"
},
"id": {
"type": "string"
},
"inbox_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"platform": {
"type": "string"
},
"require_admission": {
"type": "boolean"
},
"retain_content": {
"type": "boolean"
},
"setup_required": {
"type": "boolean"
},
"status": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"email": {
"properties": {
"address": {
"type": "string"
},
"connection_id": {
"type": "string"
},
"created_at": {
"type": "string"
},
"hook_id": {
"type": "string"
},
"rules": {
"properties": {
"automatic_reply": {
"type": "boolean"
},
"mode": {
"type": "string"
},
"rules": {
"items": {
"properties": {
"body_keywords": {
"items": {
"type": "string"
},
"type": "array"
},
"domains": {
"items": {
"type": "string"
},
"type": "array"
},
"id": {
"type": "string"
},
"senders": {
"items": {
"type": "string"
},
"type": "array"
},
"subject_keywords": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"rules_version": {
"type": "integer"
},
"source_id": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}PATCH /api/public/v1/webhooks/{hook_id}/emailUpdate Agent email triggers
请求格式: application/json; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Agent ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}body · body · 必填
{
"description": "Rules and expected version",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"rules": {
"properties": {
"automatic_reply": {
"type": "boolean"
},
"mode": {
"type": "string"
},
"rules": {
"items": {
"properties": {
"body_keywords": {
"items": {
"type": "string"
},
"type": "array"
},
"domains": {
"items": {
"type": "string"
},
"type": "array"
},
"id": {
"type": "string"
},
"senders": {
"items": {
"type": "string"
},
"type": "array"
},
"subject_keywords": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"rules_version": {
"type": "integer"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"connection": {
"properties": {
"binding_version": {
"type": "integer"
},
"bound_hook_id": {
"type": "string"
},
"bound_hook_status": {
"type": "string"
},
"bound_hook_title": {
"type": "string"
},
"created_at": {
"type": "string"
},
"email_address": {
"type": "string"
},
"email_hook_id": {
"type": "string"
},
"id": {
"type": "string"
},
"inbox_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"platform": {
"type": "string"
},
"require_admission": {
"type": "boolean"
},
"retain_content": {
"type": "boolean"
},
"setup_required": {
"type": "boolean"
},
"status": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"email": {
"properties": {
"address": {
"type": "string"
},
"connection_id": {
"type": "string"
},
"created_at": {
"type": "string"
},
"hook_id": {
"type": "string"
},
"rules": {
"properties": {
"automatic_reply": {
"type": "boolean"
},
"mode": {
"type": "string"
},
"rules": {
"items": {
"properties": {
"body_keywords": {
"items": {
"type": "string"
},
"type": "array"
},
"domains": {
"items": {
"type": "string"
},
"type": "array"
},
"id": {
"type": "string"
},
"senders": {
"items": {
"type": "string"
},
"type": "array"
},
"subject_keywords": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"rules_version": {
"type": "integer"
},
"source_id": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}GET /api/public/v1/webhooks/{hook_id}/email/messagesList Agent email messages
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Agent ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}before · query · 可选
{
"description": "Message cursor",
"in": "query",
"name": "before",
"type": "integer"
}响应
GET /api/public/v1/webhooks/{hook_id}/email/messages/{message_id}Read an Agent email message
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Agent ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}message_id · path · 必填
{
"description": "Retained email ID",
"in": "path",
"name": "message_id",
"required": true,
"type": "integer"
}响应
POST /api/public/v1/webhooks/{hook_id}/email/previewPreview email trigger matching
请求格式: application/json; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Agent ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}body · body · 必填
{
"description": "Retained message and proposed rules",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"message_id": {
"type": "integer"
},
"rules": {
"properties": {
"automatic_reply": {
"type": "boolean"
},
"mode": {
"type": "string"
},
"rules": {
"items": {
"properties": {
"body_keywords": {
"items": {
"type": "string"
},
"type": "array"
},
"domains": {
"items": {
"type": "string"
},
"type": "array"
},
"id": {
"type": "string"
},
"senders": {
"items": {
"type": "string"
},
"type": "array"
},
"subject_keywords": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"reason": {
"type": "string"
},
"rule_id": {
"type": "string"
},
"wake": {
"type": "boolean"
}
},
"type": "object"
}POST /api/public/v1/webhooks/{hook_id}/invokeRun or continue a saved AIP Agent
action=created starts a session; prompted continues or stops it. Poll the session events endpoint for completion. A 202 response means accepted, not completed.
请求格式: application/json; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Owned Agent Hook ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Agent invocation",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"action": {
"enum": [
"created",
"prompted"
],
"type": "string"
},
"payload": {
"properties": {
"after_event_id": {
"type": "integer"
},
"context": {},
"knowledge_base_list": {
"items": {
"type": "string"
},
"type": "array"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"model_config": {
"additionalProperties": {},
"type": "object"
},
"prompt": {
"type": "string"
},
"request_id": {
"type": "string"
},
"session_id": {
"type": "string"
},
"signal": {
"type": "string"
},
"system_prompt": {
"type": "string"
}
},
"type": "object"
}
},
"required": [
"action",
"payload"
],
"type": "object"
}
}响应
202 Accepted
{
"properties": {
"after_event_id": {
"type": "integer"
},
"event_url": {
"type": "string"
},
"request_id": {
"type": "string"
},
"run_id": {
"type": "string"
},
"session_id": {
"type": "string"
}
},
"type": "object"
}PATCH /api/public/v1/webhooks/{hook_id}/memoryUpdate only the owned webhook's Memory settings
请求格式: application/json; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Webhook ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Memory settings; shared writes require webhook or all reads",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"read_scope": {
"enum": [
"self",
"webhook",
"all"
],
"example": "self",
"type": "string"
},
"write_scope": {
"enum": [
"self",
"shared"
],
"example": "self",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"hook": {
"properties": {
"communication_knowledge_base_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"created_at": {
"type": "string"
},
"created_by": {
"properties": {
"account_id": {
"type": "string"
},
"api_key_id": {
"type": "string"
},
"api_key_name": {
"type": "string"
},
"email": {
"type": "string"
},
"profile_id": {
"type": "string"
}
},
"type": "object"
},
"crm_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"dynamic_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"hook_id": {
"example": "hook_123",
"type": "string"
},
"knowledge_base_list": {
"items": {
"type": "string"
},
"type": "array"
},
"memory": {
"properties": {
"read_scope": {
"enum": [
"self",
"webhook",
"all"
],
"example": "self",
"type": "string"
},
"write_scope": {
"enum": [
"self",
"shared"
],
"example": "self",
"type": "string"
}
},
"type": "object"
},
"model": {
"type": "string"
},
"model_source": {
"type": "string"
},
"policies": {
"items": {
"type": "string"
},
"type": "array"
},
"reasoning_effort": {
"type": "string"
},
"runtime_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"sandbox_mode": {
"type": "string"
},
"secret_bindings": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"secrets": {
"items": {
"properties": {
"name": {
"example": "CRM_TOKEN",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"selected_skills": {
"items": {
"properties": {
"enabled": {
"type": "boolean"
},
"skill_id": {
"example": "usr_123",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"status": {
"type": "string"
},
"system_prompt": {
"type": "string"
},
"title": {
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"output_tokens": {
"type": "integer"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"updated_at": {
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"policy_options": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}400 Bad Request
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}404 Not Found
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}GET /api/public/v1/webhooks/{hook_id}/sessions/{session_id}/eventsRead an AIP Agent session's events
Poll with the returned next_after cursor until run.completed, run.failed or run.interrupted. Match the requested request_id. Reads remain scoped to the key's Profile and selected Agent.
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
hook_id · path · 必填
{
"description": "Owned Agent Hook ID",
"in": "path",
"name": "hook_id",
"required": true,
"type": "string"
}session_id · path · 必填
{
"description": "Session ID returned by invoke",
"in": "path",
"name": "session_id",
"required": true,
"type": "string"
}after · query · 可选
{
"description": "Last consumed event sequence",
"in": "query",
"name": "after",
"type": "integer"
}limit · query · 可选
{
"description": "Page size (max 200)",
"in": "query",
"name": "limit",
"type": "integer"
}响应
200 OK
{
"properties": {
"events": {
"items": {
"discriminator": "type",
"properties": {
"created_at": {
"example": "2026-08-16T12:00:00Z",
"format": "date-time",
"type": "string"
},
"data": {
"allOf": [
{
"properties": {
"attempt": {
"minimum": 1,
"type": "integer"
},
"attempts": {
"minimum": 1,
"type": "integer"
},
"channel": {
"enum": [
"stdout",
"stderr",
"progress"
],
"type": "string"
},
"code": {
"type": "string"
},
"context_window": {
"minimum": 0,
"type": "integer"
},
"cost": {},
"delta": {
"type": "string"
},
"duration_ms": {
"minimum": 0,
"type": "integer"
},
"error": {
"type": "string"
},
"exit_code": {
"type": "integer"
},
"files": {
"items": {
"type": "string"
},
"type": "array"
},
"final_message_id": {
"type": "string"
},
"finish_reason": {
"type": "string"
},
"input": {},
"is_error": {
"type": "boolean"
},
"kind": {
"type": "string"
},
"last": {
"properties": {
"cache_read_tokens": {
"minimum": 0,
"type": "integer"
},
"cache_write_tokens": {
"minimum": 0,
"type": "integer"
},
"input_tokens": {
"minimum": 0,
"type": "integer"
},
"output_tokens": {
"minimum": 0,
"type": "integer"
},
"reasoning_tokens": {
"minimum": 0,
"type": "integer"
},
"total_tokens": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"cache_read_tokens",
"cache_write_tokens",
"input_tokens",
"output_tokens",
"reasoning_tokens",
"total_tokens"
],
"type": "object"
},
"message": {
"type": "string"
},
"message_id": {
"type": "string"
},
"model": {
"type": "string"
},
"model_config": {
"properties": {
"model": {
"type": "string"
},
"model_source": {
"enum": [
"hast",
"codex_account"
],
"type": "string"
},
"reasoning_effort": {
"type": "string"
}
},
"type": "object"
},
"model_source": {
"type": "string"
},
"modified_at": {
"format": "date-time",
"type": "string"
},
"name": {
"type": "string"
},
"operation": {
"enum": [
"update",
"delete"
],
"type": "string"
},
"options": {
"items": {},
"type": "array"
},
"output": {},
"parent_tool_call_id": {
"type": "string"
},
"path": {
"type": "string"
},
"plan_id": {
"type": "string"
},
"prompt": {
"type": "string"
},
"reason": {
"type": "string"
},
"reasoning_id": {
"type": "string"
},
"request_id": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"role": {
"enum": [
"user",
"assistant",
"system"
],
"type": "string"
},
"scope": {
"type": "string"
},
"size_bytes": {
"minimum": 0,
"type": "integer"
},
"status": {
"enum": [
"starting",
"ready",
"failed",
"released",
"succeeded",
"interrupted"
],
"type": "string"
},
"steps": {
"items": {
"properties": {
"status": {
"enum": [
"pending",
"in_progress",
"completed"
],
"example": "in_progress",
"type": "string"
},
"step": {
"type": "string"
}
},
"required": [
"status",
"step"
],
"type": "object"
},
"type": "array"
},
"text": {
"type": "string"
},
"tokens_after": {
"minimum": 0,
"type": "integer"
},
"tokens_before": {
"minimum": 0,
"type": "integer"
},
"tool_call_id": {
"type": "string"
},
"total": {
"properties": {
"cache_read_tokens": {
"minimum": 0,
"type": "integer"
},
"cache_write_tokens": {
"minimum": 0,
"type": "integer"
},
"input_tokens": {
"minimum": 0,
"type": "integer"
},
"output_tokens": {
"minimum": 0,
"type": "integer"
},
"reasoning_tokens": {
"minimum": 0,
"type": "integer"
},
"total_tokens": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"cache_read_tokens",
"cache_write_tokens",
"input_tokens",
"output_tokens",
"reasoning_tokens",
"total_tokens"
],
"type": "object"
},
"turn_type": {
"type": "string"
}
},
"type": "object"
}
],
"description": "Data is the HAST-owned payload union; Type selects its required shape as\ndefined in docs/reference/task-agent-event-v2.md."
},
"engine": {
"enum": [
"codex_cli",
"pi_agent_cli"
],
"example": "codex_cli",
"type": "string"
},
"event_id": {
"example": "evt_123",
"type": "string"
},
"replayable": {
"example": true,
"type": "boolean"
},
"run_id": {
"example": "run_123",
"type": "string"
},
"schema_version": {
"enum": [
2
],
"example": 2,
"type": "integer"
},
"sequence": {
"description": "Sequence is a positive durable order, or null for volatile events.",
"example": 42,
"minimum": 1,
"type": "integer",
"x-nullable": true
},
"session_id": {
"example": "session_123",
"type": "string"
},
"source": {
"enum": [
"runtime",
"backplane",
"workspace"
],
"example": "runtime",
"type": "string"
},
"task_id": {
"example": "task_123",
"type": "string"
},
"type": {
"enum": [
"runtime.status",
"run.queued",
"run.started",
"run.retrying",
"run.completed",
"run.failed",
"run.interrupted",
"message.started",
"message.delta",
"message.completed",
"reasoning.started",
"reasoning.delta",
"reasoning.completed",
"tool.started",
"tool.updated",
"tool.completed",
"plan.updated",
"plan.completed",
"usage.updated",
"file.changed",
"input.requested",
"context.compacted",
"warning",
"error"
],
"example": "message.completed",
"type": "string"
}
},
"required": [
"created_at",
"data",
"engine",
"event_id",
"replayable",
"schema_version",
"sequence",
"source",
"task_id",
"type"
],
"type": "object"
},
"type": "array"
},
"has_more": {
"example": true,
"type": "boolean"
},
"next_after": {
"example": 42,
"format": "int64",
"type": "integer",
"x-nullable": true
}
},
"type": "object"
}定时任务
GET /api/public/v1/schedulesList Task Agent schedules
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
limit · query · 可选
{
"description": "Schedule page size",
"in": "query",
"name": "limit",
"type": "integer"
}响应
200 OK
{
"properties": {
"schedules": {
"items": {
"properties": {
"config": {
"additionalProperties": {},
"type": "object"
},
"cron_spec": {
"type": "string"
},
"id": {
"type": "string"
},
"last_run_at": {
"type": "string"
},
"last_task_id": {
"type": "string"
},
"mode": {
"type": "string"
},
"next_run_at": {
"type": "string"
},
"prompt": {
"type": "string"
},
"status": {
"type": "string"
},
"timezone": {
"type": "string"
},
"title": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}POST /api/public/v1/schedulesCreate Task Agent schedule
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Schedule request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"config": {
"additionalProperties": {},
"type": "object"
},
"cron_spec": {
"example": "0 15 * * 1",
"type": "string"
},
"interval_seconds": {
"type": "integer"
},
"mode": {
"example": "direct_execute",
"type": "string"
},
"next_run_at": {
"example": "2026-09-15T01:00:00Z",
"type": "string"
},
"prompt": {
"example": "Summarize the workspace.",
"type": "string"
},
"status": {
"example": "active",
"type": "string"
},
"timezone": {
"example": "Asia/Shanghai",
"type": "string"
},
"title": {
"example": "Weekly workspace report",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"schedule": {
"properties": {
"config": {
"additionalProperties": {},
"type": "object"
},
"cron_spec": {
"type": "string"
},
"id": {
"type": "string"
},
"last_run_at": {
"type": "string"
},
"last_task_id": {
"type": "string"
},
"mode": {
"type": "string"
},
"next_run_at": {
"type": "string"
},
"prompt": {
"type": "string"
},
"status": {
"type": "string"
},
"timezone": {
"type": "string"
},
"title": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}GET /api/public/v1/schedules/{scheduleID}Get Task Agent schedule
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
scheduleID · path · 必填
{
"description": "Schedule ID",
"in": "path",
"name": "scheduleID",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"schedule": {
"properties": {
"config": {
"additionalProperties": {},
"type": "object"
},
"cron_spec": {
"type": "string"
},
"id": {
"type": "string"
},
"last_run_at": {
"type": "string"
},
"last_task_id": {
"type": "string"
},
"mode": {
"type": "string"
},
"next_run_at": {
"type": "string"
},
"prompt": {
"type": "string"
},
"status": {
"type": "string"
},
"timezone": {
"type": "string"
},
"title": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}PUT /api/public/v1/schedules/{scheduleID}Update Task Agent schedule
请求格式: application/json; 响应格式: application/json.
参数
scheduleID · path · 必填
{
"description": "Schedule ID",
"in": "path",
"name": "scheduleID",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Schedule request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"config": {
"additionalProperties": {},
"type": "object"
},
"cron_spec": {
"example": "0 15 * * 1",
"type": "string"
},
"interval_seconds": {
"type": "integer"
},
"mode": {
"example": "direct_execute",
"type": "string"
},
"next_run_at": {
"example": "2026-09-15T01:00:00Z",
"type": "string"
},
"prompt": {
"example": "Summarize the workspace.",
"type": "string"
},
"status": {
"example": "active",
"type": "string"
},
"timezone": {
"example": "Asia/Shanghai",
"type": "string"
},
"title": {
"example": "Weekly workspace report",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"schedule": {
"properties": {
"config": {
"additionalProperties": {},
"type": "object"
},
"cron_spec": {
"type": "string"
},
"id": {
"type": "string"
},
"last_run_at": {
"type": "string"
},
"last_task_id": {
"type": "string"
},
"mode": {
"type": "string"
},
"next_run_at": {
"type": "string"
},
"prompt": {
"type": "string"
},
"status": {
"type": "string"
},
"timezone": {
"type": "string"
},
"title": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}PATCH /api/public/v1/schedules/{scheduleID}Update Task Agent schedule
请求格式: application/json; 响应格式: application/json.
参数
scheduleID · path · 必填
{
"description": "Schedule ID",
"in": "path",
"name": "scheduleID",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Schedule request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"config": {
"additionalProperties": {},
"type": "object"
},
"cron_spec": {
"example": "0 15 * * 1",
"type": "string"
},
"interval_seconds": {
"type": "integer"
},
"mode": {
"example": "direct_execute",
"type": "string"
},
"next_run_at": {
"example": "2026-09-15T01:00:00Z",
"type": "string"
},
"prompt": {
"example": "Summarize the workspace.",
"type": "string"
},
"status": {
"example": "active",
"type": "string"
},
"timezone": {
"example": "Asia/Shanghai",
"type": "string"
},
"title": {
"example": "Weekly workspace report",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"schedule": {
"properties": {
"config": {
"additionalProperties": {},
"type": "object"
},
"cron_spec": {
"type": "string"
},
"id": {
"type": "string"
},
"last_run_at": {
"type": "string"
},
"last_task_id": {
"type": "string"
},
"mode": {
"type": "string"
},
"next_run_at": {
"type": "string"
},
"prompt": {
"type": "string"
},
"status": {
"type": "string"
},
"timezone": {
"type": "string"
},
"title": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}DELETE /api/public/v1/schedules/{scheduleID}Delete Task Agent schedule
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
scheduleID · path · 必填
{
"description": "Schedule ID",
"in": "path",
"name": "scheduleID",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"ok": {
"example": true,
"type": "boolean"
}
},
"type": "object"
}GET /api/public/v1/schedules/{scheduleID}/runsList Task Agent schedule runs
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
scheduleID · path · 必填
{
"description": "Schedule ID",
"in": "path",
"name": "scheduleID",
"required": true,
"type": "string"
}limit · query · 可选
{
"description": "Run page size",
"in": "query",
"name": "limit",
"type": "integer"
}响应
200 OK
{
"properties": {
"runs": {
"items": {
"properties": {
"id": {
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"run_at": {
"type": "string"
},
"schedule_id": {
"type": "string"
},
"status": {
"type": "string"
},
"task_id": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}知识库
GET /api/public/v1/knowledge-basesList public Task Agent Knowledge Bases
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
page · query · 可选
{
"description": "Page number, default 1",
"in": "query",
"name": "page",
"type": "integer"
}page_size · query · 可选
{
"description": "Page size, default 20 and max 100",
"in": "query",
"name": "page_size",
"type": "integer"
}响应
200 OK
{
"properties": {
"knowledge_bases": {
"items": {
"properties": {
"cloudflare_instance_id": {
"example": "hast-kb-product-docs",
"type": "string"
},
"cloudflare_mcp_url": {
"example": "https://hast-kb-product-docs.search.ai.cloudflare.com/mcp",
"type": "string"
},
"cloudflare_public_endpoint_id": {
"example": "hast-kb-product-docs",
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"error_message": {
"type": "string"
},
"id": {
"example": "kb_123",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "Product docs",
"type": "string"
},
"source_content_type": {
"example": "text/markdown",
"type": "string"
},
"source_filename": {
"example": "docs.md",
"type": "string"
},
"source_type": {
"example": "url",
"type": "string"
},
"source_uri": {
"example": "https://example.com/docs.md",
"type": "string"
},
"status": {
"example": "indexed",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"pagination": {
"properties": {
"has_more": {
"example": false,
"type": "boolean"
},
"limit": {
"example": 20,
"type": "integer"
},
"offset": {
"example": 0,
"type": "integer"
},
"page": {
"example": 1,
"type": "integer"
},
"page_size": {
"example": 20,
"type": "integer"
},
"total": {
"example": 1,
"type": "integer"
}
},
"type": "object"
}
},
"type": "object"
}POST /api/public/v1/knowledge-basesCreate a public Task Agent Knowledge Base
Creates a URL Knowledge Base with JSON or a file Knowledge Base with multipart/form-data. Indexing continues asynchronously.
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "URL Knowledge Base request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"description": {
"example": "Public product documentation",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "Product docs",
"type": "string"
},
"source_type": {
"example": "url",
"type": "string"
},
"url": {
"example": "https://example.com/docs.md",
"type": "string"
}
},
"type": "object"
}
}响应
201 Created
{
"properties": {
"knowledge_base": {
"properties": {
"cloudflare_instance_id": {
"example": "hast-kb-product-docs",
"type": "string"
},
"cloudflare_mcp_url": {
"example": "https://hast-kb-product-docs.search.ai.cloudflare.com/mcp",
"type": "string"
},
"cloudflare_public_endpoint_id": {
"example": "hast-kb-product-docs",
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"error_message": {
"type": "string"
},
"id": {
"example": "kb_123",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "Product docs",
"type": "string"
},
"source_content_type": {
"example": "text/markdown",
"type": "string"
},
"source_filename": {
"example": "docs.md",
"type": "string"
},
"source_type": {
"example": "url",
"type": "string"
},
"source_uri": {
"example": "https://example.com/docs.md",
"type": "string"
},
"status": {
"example": "indexed",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}400 Bad Request
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}GET /api/public/v1/knowledge-bases/{id}Read a public Task Agent Knowledge Base
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Knowledge Base ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"knowledge_base": {
"properties": {
"cloudflare_instance_id": {
"example": "hast-kb-product-docs",
"type": "string"
},
"cloudflare_mcp_url": {
"example": "https://hast-kb-product-docs.search.ai.cloudflare.com/mcp",
"type": "string"
},
"cloudflare_public_endpoint_id": {
"example": "hast-kb-product-docs",
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"error_message": {
"type": "string"
},
"id": {
"example": "kb_123",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "Product docs",
"type": "string"
},
"source_content_type": {
"example": "text/markdown",
"type": "string"
},
"source_filename": {
"example": "docs.md",
"type": "string"
},
"source_type": {
"example": "url",
"type": "string"
},
"source_uri": {
"example": "https://example.com/docs.md",
"type": "string"
},
"status": {
"example": "indexed",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}404 Not Found
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}PUT /api/public/v1/knowledge-bases/{id}Update a public Task Agent Knowledge Base
请求格式: application/json; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Knowledge Base ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Knowledge Base update request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"description": {
"example": "Updated description",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "Updated product docs",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"knowledge_base": {
"properties": {
"cloudflare_instance_id": {
"example": "hast-kb-product-docs",
"type": "string"
},
"cloudflare_mcp_url": {
"example": "https://hast-kb-product-docs.search.ai.cloudflare.com/mcp",
"type": "string"
},
"cloudflare_public_endpoint_id": {
"example": "hast-kb-product-docs",
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"error_message": {
"type": "string"
},
"id": {
"example": "kb_123",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "Product docs",
"type": "string"
},
"source_content_type": {
"example": "text/markdown",
"type": "string"
},
"source_filename": {
"example": "docs.md",
"type": "string"
},
"source_type": {
"example": "url",
"type": "string"
},
"source_uri": {
"example": "https://example.com/docs.md",
"type": "string"
},
"status": {
"example": "indexed",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}404 Not Found
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}PATCH /api/public/v1/knowledge-bases/{id}Update a public Task Agent Knowledge Base
请求格式: application/json; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Knowledge Base ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Knowledge Base update request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"description": {
"example": "Updated description",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "Updated product docs",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"knowledge_base": {
"properties": {
"cloudflare_instance_id": {
"example": "hast-kb-product-docs",
"type": "string"
},
"cloudflare_mcp_url": {
"example": "https://hast-kb-product-docs.search.ai.cloudflare.com/mcp",
"type": "string"
},
"cloudflare_public_endpoint_id": {
"example": "hast-kb-product-docs",
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"error_message": {
"type": "string"
},
"id": {
"example": "kb_123",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "Product docs",
"type": "string"
},
"source_content_type": {
"example": "text/markdown",
"type": "string"
},
"source_filename": {
"example": "docs.md",
"type": "string"
},
"source_type": {
"example": "url",
"type": "string"
},
"source_uri": {
"example": "https://example.com/docs.md",
"type": "string"
},
"status": {
"example": "indexed",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}404 Not Found
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}DELETE /api/public/v1/knowledge-bases/{id}Delete a public Task Agent Knowledge Base
Knowledge deletion is disabled to preserve imported originals. This compatibility endpoint returns HTTP 409.
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Knowledge Base ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}响应
409 Conflict
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}CRM
GET /api/public/v1/business-resourcesList CRM and customer communication knowledge bases
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
200 OK
{
"additionalProperties": true,
"type": "object"
}POST /api/public/v1/business-resources/communication-knowledgeCreate a customer communication knowledge base
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Create a customer communication knowledge base request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"name": {
"type": "string"
},
"request_id": {
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}POST /api/public/v1/business-resources/crmCreate an optional Twenty workspace
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Create an optional Twenty workspace request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"name": {
"type": "string"
},
"request_id": {
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}GET /api/public/v1/business-resources/{resource_id}Browse CRM records or communication knowledge source documents
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}object · query · 可选
{
"description": "CRM object (default people); use CRM schema for supported objects",
"in": "query",
"name": "object",
"type": "string"
}cursor · query · 可选
{
"description": "CRM next-page cursor",
"in": "query",
"name": "cursor",
"type": "string"
}query · query · 可选
{
"description": "Communication knowledge search (maximum 2000 bytes); omit to browse sources",
"in": "query",
"name": "query",
"type": "string"
}before · query · 可选
{
"description": "Communication document pagination cursor",
"in": "query",
"name": "before",
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}DELETE /api/public/v1/business-resources/{resource_id}Delete an unused channel resource configuration
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}POST /api/public/v1/business-resources/{resource_id}/crm/attachments/uploadUpload a CRM attachment
请求格式: application/json; 响应格式: application/json.
参数
规范未声明参数。
响应
GET /api/public/v1/business-resources/{resource_id}/crm/schemaRead CRM business objects and field schema
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}GET /api/public/v1/business-resources/{resource_id}/crm/{object}Search CRM records
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}object · path · 必填
{
"description": "object",
"in": "path",
"name": "object",
"required": true,
"type": "string"
}query · query · 可选
{
"description": "Search (maximum 300 bytes, no quotes or line breaks)",
"in": "query",
"name": "query",
"type": "string"
}cursor · query · 可选
{
"description": "Provider cursor returned by the previous page",
"in": "query",
"name": "cursor",
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}POST /api/public/v1/business-resources/{resource_id}/crm/{object}Create a CRM record
Discover objects and writable fields using the CRM schema endpoint before writing. Read back on uncertain errors before retrying.
请求格式: application/json; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}object · path · 必填
{
"description": "object",
"in": "path",
"name": "object",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Create a CRM record request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"request_id": {
"description": "Stable UUID required on create. Reuse it only for the identical create request.",
"type": "string"
},
"updated_at": {
"description": "Required on update; use updatedAt from the last record readback.",
"type": "string"
},
"values": {
"additionalProperties": {},
"description": "Only writable fields from GET /business-resources/{resource_id}/crm/schema.",
"type": "object"
}
},
"required": [
"values"
],
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}GET /api/public/v1/business-resources/{resource_id}/crm/{object}/{record_id}Read CRM record details
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}object · path · 必填
{
"description": "object",
"in": "path",
"name": "object",
"required": true,
"type": "string"
}record_id · path · 必填
{
"description": "record_id",
"in": "path",
"name": "record_id",
"required": true,
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}PATCH /api/public/v1/business-resources/{resource_id}/crm/{object}/{record_id}Update a CRM record
Discover objects and writable fields using the CRM schema endpoint before writing. Read back on uncertain errors before retrying.
请求格式: application/json; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}object · path · 必填
{
"description": "object",
"in": "path",
"name": "object",
"required": true,
"type": "string"
}record_id · path · 必填
{
"description": "record_id",
"in": "path",
"name": "record_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Update a CRM record request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"request_id": {
"description": "Stable UUID required on create. Reuse it only for the identical create request.",
"type": "string"
},
"updated_at": {
"description": "Required on update; use updatedAt from the last record readback.",
"type": "string"
},
"values": {
"additionalProperties": {},
"description": "Only writable fields from GET /business-resources/{resource_id}/crm/schema.",
"type": "object"
}
},
"required": [
"values"
],
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}DELETE /api/public/v1/business-resources/{resource_id}/crm/{object}/{record_id}Delete a CRM record
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}object · path · 必填
{
"description": "object",
"in": "path",
"name": "object",
"required": true,
"type": "string"
}record_id · path · 必填
{
"description": "record_id",
"in": "path",
"name": "record_id",
"required": true,
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}GET /api/public/v1/business-resources/{resource_id}/crm/{object}/{record_id}/files/{field}/{file_id}Download a file attached to a CRM record
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}object · path · 必填
{
"description": "object",
"in": "path",
"name": "object",
"required": true,
"type": "string"
}record_id · path · 必填
{
"description": "record_id",
"in": "path",
"name": "record_id",
"required": true,
"type": "string"
}field · path · 必填
{
"description": "field",
"in": "path",
"name": "field",
"required": true,
"type": "string"
}file_id · path · 必填
{
"description": "file_id",
"in": "path",
"name": "file_id",
"required": true,
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}GET /api/public/v1/business-resources/{resource_id}/crm/{object}/{record_id}/relations/{field}Browse related CRM records
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}object · path · 必填
{
"description": "object",
"in": "path",
"name": "object",
"required": true,
"type": "string"
}record_id · path · 必填
{
"description": "record_id",
"in": "path",
"name": "record_id",
"required": true,
"type": "string"
}field · path · 必填
{
"description": "field",
"in": "path",
"name": "field",
"required": true,
"type": "string"
}cursor · query · 可选
{
"description": "Provider cursor returned by the previous page",
"in": "query",
"name": "cursor",
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}GET /api/public/v1/business-resources/{resource_id}/membersList CRM member identities for owner and assignee fields
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "Owned CRM resource ID",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}cursor · query · 可选
{
"description": "Next cursor from the previous member page",
"in": "query",
"name": "cursor",
"type": "string"
}响应
200 OK
{
"properties": {
"has_more": {
"type": "boolean"
},
"members": {
"items": {
"properties": {
"email": {
"type": "string"
},
"first_name": {
"type": "string"
},
"id": {
"type": "string"
},
"last_name": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"next_cursor": {
"type": "string"
}
},
"type": "object"
}POST /api/public/v1/business-resources/{resource_id}/membersCreate or reuse a CRM member without retaining a password
Uses the selected managed workspace's existing registration flow. No invitation is sent. Generated passwords are discarded. Does not reset accounts outside this CRM; provider email-verification settings still apply.
请求格式: application/json; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "Owned platform-managed CRM resource ID",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Actual email and name; never a password",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"email": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
}
},
"required": [
"email",
"first_name"
],
"type": "object"
}
}响应
200 OK
{
"properties": {
"email": {
"type": "string"
},
"first_name": {
"type": "string"
},
"id": {
"type": "string"
},
"last_name": {
"type": "string"
}
},
"type": "object"
}POST /api/public/v1/business-resources/{resource_id}/provisionRetry an incomplete CRM provisioning operation
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "resource_id",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}记忆项目
GET /api/public/v1/chat_memory_projectsList user chat memory projects
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
POST /api/public/v1/chat_memory_projectsCreate a user chat memory project
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Request body",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"customer_connection_id": {
"type": "string"
},
"customer_id": {
"type": "integer"
},
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
}响应
GET /api/public/v1/chat_memory_projects/writesList user chat memory indexing operations
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
Prompt
POST /api/public/v1/promptsSubmit a public Task Agent prompt
Creates a normal conversational Task Agent session when session_id is omitted, or appends a turn to an existing session. request_id is idempotent.
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Public prompt request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"dynamic_tools": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"files": {
"items": {
"type": "string"
},
"type": "array"
},
"model": {
"example": "hast/auto",
"type": "string"
},
"prompt": {
"example": "Summarize the release notes.",
"type": "string"
},
"reasoning_effort": {
"example": "medium",
"type": "string"
},
"request_id": {
"example": "client-turn-1",
"type": "string"
},
"secret_bindings": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
},
"session_id": {
"example": "sess_abc123",
"type": "string"
},
"skill_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"system_prompt": {
"type": "string"
}
},
"type": "object"
}
}响应
202 Accepted
{
"properties": {
"request_id": {
"example": "client-turn-1",
"type": "string"
},
"session_id": {
"example": "sess_abc123",
"type": "string"
},
"status": {
"example": "dispatch_pending",
"type": "string"
}
},
"type": "object"
}401 Unauthorized
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}409 Conflict
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}413 Request Entity Too Large
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}会话与事件
GET /api/public/v1/sessionsList public Task Agent sessions
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
limit · query · 可选
{
"description": "Page size (1-100, default 50)",
"in": "query",
"name": "limit",
"type": "integer"
}cursor · query · 可选
{
"description": "Opaque cursor returned by the previous page",
"in": "query",
"name": "cursor",
"type": "string"
}响应
200 OK
{
"properties": {
"has_more": {
"type": "boolean"
},
"next_cursor": {
"type": "string"
},
"sessions": {
"items": {
"properties": {
"event_cursor": {
"type": "integer"
},
"mode": {
"type": "string"
},
"runtime_provider": {
"type": "string"
},
"session_id": {
"example": "sess_abc123",
"type": "string"
},
"status": {
"example": "running",
"type": "string"
},
"task_origin": {
"example": "session",
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"model": {
"type": "string"
},
"output_tokens": {
"type": "integer"
},
"pricing": {
"properties": {
"cache_read_usd_per_token": {
"type": "string"
},
"cache_write_usd_per_token": {
"type": "string"
},
"input_usd_per_token": {
"type": "string"
},
"output_usd_per_token": {
"type": "string"
}
},
"type": "object"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}GET /api/public/v1/sessions/{id}Read a public Task Agent session
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Session ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"session": {
"properties": {
"event_cursor": {
"type": "integer"
},
"mode": {
"type": "string"
},
"runtime_provider": {
"type": "string"
},
"session_id": {
"example": "sess_abc123",
"type": "string"
},
"status": {
"example": "running",
"type": "string"
},
"task_origin": {
"example": "session",
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"model": {
"type": "string"
},
"output_tokens": {
"type": "integer"
},
"pricing": {
"properties": {
"cache_read_usd_per_token": {
"type": "string"
},
"cache_write_usd_per_token": {
"type": "string"
},
"input_usd_per_token": {
"type": "string"
},
"output_usd_per_token": {
"type": "string"
}
},
"type": "object"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}DELETE /api/public/v1/sessions/{id}Delete a public Task Agent session
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Session ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"task": {
"properties": {
"client_id": {
"example": "client-main-user-123",
"type": "string"
},
"config": {
"additionalProperties": {},
"type": "object"
},
"created_at": {
"type": "string"
},
"event_cursor": {
"example": 42,
"type": "integer"
},
"id": {
"example": "task-agent-123",
"type": "string"
},
"mode": {
"example": "agent_run",
"type": "string"
},
"profile_id": {
"example": "user_123",
"type": "string"
},
"prompt": {
"type": "string"
},
"runtime_provider": {
"example": "cubesandbox",
"type": "string"
},
"sandbox_id": {
"example": "sandbox-main-user-123",
"type": "string"
},
"sandbox_scope": {
"example": "main",
"type": "string"
},
"status": {
"example": "needs_input",
"type": "string"
},
"task_origin": {
"example": "session",
"type": "string"
},
"title": {
"example": "Release validation",
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"model": {
"type": "string"
},
"output_tokens": {
"type": "integer"
},
"pricing": {
"properties": {
"cache_read_usd_per_token": {
"type": "string"
},
"cache_write_usd_per_token": {
"type": "string"
},
"input_usd_per_token": {
"type": "string"
},
"output_usd_per_token": {
"type": "string"
}
},
"type": "object"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"updated_at": {
"type": "string"
},
"workspace_object_prefix": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}POST /api/public/v1/sessions/{id}/cancelCancel a public Task Agent session
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Session ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"task": {
"properties": {
"client_id": {
"example": "client-main-user-123",
"type": "string"
},
"config": {
"additionalProperties": {},
"type": "object"
},
"created_at": {
"type": "string"
},
"event_cursor": {
"example": 42,
"type": "integer"
},
"id": {
"example": "task-agent-123",
"type": "string"
},
"mode": {
"example": "agent_run",
"type": "string"
},
"profile_id": {
"example": "user_123",
"type": "string"
},
"prompt": {
"type": "string"
},
"runtime_provider": {
"example": "cubesandbox",
"type": "string"
},
"sandbox_id": {
"example": "sandbox-main-user-123",
"type": "string"
},
"sandbox_scope": {
"example": "main",
"type": "string"
},
"status": {
"example": "needs_input",
"type": "string"
},
"task_origin": {
"example": "session",
"type": "string"
},
"title": {
"example": "Release validation",
"type": "string"
},
"token_usage": {
"properties": {
"cache_read_tokens": {
"type": "integer"
},
"cache_write_tokens": {
"type": "integer"
},
"cost_status": {
"type": "string"
},
"estimated_cost_usd": {
"type": "number"
},
"input_tokens": {
"type": "integer"
},
"model": {
"type": "string"
},
"output_tokens": {
"type": "integer"
},
"pricing": {
"properties": {
"cache_read_usd_per_token": {
"type": "string"
},
"cache_write_usd_per_token": {
"type": "string"
},
"input_usd_per_token": {
"type": "string"
},
"output_usd_per_token": {
"type": "string"
}
},
"type": "object"
},
"reasoning_tokens": {
"type": "integer"
},
"reported_sessions": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"unpriced_tokens": {
"type": "integer"
},
"unreported_sessions": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"updated_at": {
"type": "string"
},
"workspace_object_prefix": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}GET /api/public/v1/sessions/{id}/eventsList public Task Agent Event v2 events
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Session ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}after · query · 可选
{
"description": "Return persisted events after this sequence",
"in": "query",
"name": "after",
"type": "integer"
}limit · query · 可选
{
"description": "Event page size, maximum 200",
"in": "query",
"name": "limit",
"type": "integer"
}响应
200 OK
{
"properties": {
"events": {
"items": {
"discriminator": "type",
"properties": {
"created_at": {
"example": "2026-08-16T12:00:00Z",
"format": "date-time",
"type": "string"
},
"data": {
"allOf": [
{
"properties": {
"attempt": {
"minimum": 1,
"type": "integer"
},
"attempts": {
"minimum": 1,
"type": "integer"
},
"channel": {
"enum": [
"stdout",
"stderr",
"progress"
],
"type": "string"
},
"code": {
"type": "string"
},
"context_window": {
"minimum": 0,
"type": "integer"
},
"cost": {},
"delta": {
"type": "string"
},
"duration_ms": {
"minimum": 0,
"type": "integer"
},
"error": {
"type": "string"
},
"exit_code": {
"type": "integer"
},
"files": {
"items": {
"type": "string"
},
"type": "array"
},
"final_message_id": {
"type": "string"
},
"finish_reason": {
"type": "string"
},
"input": {},
"is_error": {
"type": "boolean"
},
"kind": {
"type": "string"
},
"last": {
"properties": {
"cache_read_tokens": {
"minimum": 0,
"type": "integer"
},
"cache_write_tokens": {
"minimum": 0,
"type": "integer"
},
"input_tokens": {
"minimum": 0,
"type": "integer"
},
"output_tokens": {
"minimum": 0,
"type": "integer"
},
"reasoning_tokens": {
"minimum": 0,
"type": "integer"
},
"total_tokens": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"cache_read_tokens",
"cache_write_tokens",
"input_tokens",
"output_tokens",
"reasoning_tokens",
"total_tokens"
],
"type": "object"
},
"message": {
"type": "string"
},
"message_id": {
"type": "string"
},
"model": {
"type": "string"
},
"model_config": {
"properties": {
"model": {
"type": "string"
},
"model_source": {
"enum": [
"hast",
"codex_account"
],
"type": "string"
},
"reasoning_effort": {
"type": "string"
}
},
"type": "object"
},
"model_source": {
"type": "string"
},
"modified_at": {
"format": "date-time",
"type": "string"
},
"name": {
"type": "string"
},
"operation": {
"enum": [
"update",
"delete"
],
"type": "string"
},
"options": {
"items": {},
"type": "array"
},
"output": {},
"parent_tool_call_id": {
"type": "string"
},
"path": {
"type": "string"
},
"plan_id": {
"type": "string"
},
"prompt": {
"type": "string"
},
"reason": {
"type": "string"
},
"reasoning_id": {
"type": "string"
},
"request_id": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"role": {
"enum": [
"user",
"assistant",
"system"
],
"type": "string"
},
"scope": {
"type": "string"
},
"size_bytes": {
"minimum": 0,
"type": "integer"
},
"status": {
"enum": [
"starting",
"ready",
"failed",
"released",
"succeeded",
"interrupted"
],
"type": "string"
},
"steps": {
"items": {
"properties": {
"status": {
"enum": [
"pending",
"in_progress",
"completed"
],
"example": "in_progress",
"type": "string"
},
"step": {
"type": "string"
}
},
"required": [
"status",
"step"
],
"type": "object"
},
"type": "array"
},
"text": {
"type": "string"
},
"tokens_after": {
"minimum": 0,
"type": "integer"
},
"tokens_before": {
"minimum": 0,
"type": "integer"
},
"tool_call_id": {
"type": "string"
},
"total": {
"properties": {
"cache_read_tokens": {
"minimum": 0,
"type": "integer"
},
"cache_write_tokens": {
"minimum": 0,
"type": "integer"
},
"input_tokens": {
"minimum": 0,
"type": "integer"
},
"output_tokens": {
"minimum": 0,
"type": "integer"
},
"reasoning_tokens": {
"minimum": 0,
"type": "integer"
},
"total_tokens": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"cache_read_tokens",
"cache_write_tokens",
"input_tokens",
"output_tokens",
"reasoning_tokens",
"total_tokens"
],
"type": "object"
},
"turn_type": {
"type": "string"
}
},
"type": "object"
}
],
"description": "Data is the HAST-owned payload union; Type selects its required shape as\ndefined in docs/reference/task-agent-event-v2.md."
},
"engine": {
"enum": [
"codex_cli",
"pi_agent_cli"
],
"example": "codex_cli",
"type": "string"
},
"event_id": {
"example": "evt_123",
"type": "string"
},
"replayable": {
"example": true,
"type": "boolean"
},
"run_id": {
"example": "run_123",
"type": "string"
},
"schema_version": {
"enum": [
2
],
"example": 2,
"type": "integer"
},
"sequence": {
"description": "Sequence is a positive durable order, or null for volatile events.",
"example": 42,
"minimum": 1,
"type": "integer",
"x-nullable": true
},
"session_id": {
"example": "session_123",
"type": "string"
},
"source": {
"enum": [
"runtime",
"backplane",
"workspace"
],
"example": "runtime",
"type": "string"
},
"task_id": {
"example": "task_123",
"type": "string"
},
"type": {
"enum": [
"runtime.status",
"run.queued",
"run.started",
"run.retrying",
"run.completed",
"run.failed",
"run.interrupted",
"message.started",
"message.delta",
"message.completed",
"reasoning.started",
"reasoning.delta",
"reasoning.completed",
"tool.started",
"tool.updated",
"tool.completed",
"plan.updated",
"plan.completed",
"usage.updated",
"file.changed",
"input.requested",
"context.compacted",
"warning",
"error"
],
"example": "message.completed",
"type": "string"
}
},
"required": [
"created_at",
"data",
"engine",
"event_id",
"replayable",
"schema_version",
"sequence",
"source",
"task_id",
"type"
],
"type": "object"
},
"type": "array"
},
"has_more": {
"example": true,
"type": "boolean"
},
"next_after": {
"example": 42,
"format": "int64",
"type": "integer",
"x-nullable": true
}
},
"type": "object"
}GET /api/public/v1/sessions/{id}/events/streamStream public Task Agent events
Event v2 SSE supports after and Last-Event-ID replay.
请求格式: 无指定请求正文格式; 响应格式: text/event-stream.
参数
id · path · 必填
{
"description": "Session ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}after · query · 可选
{
"description": "Return persisted events after this sequence",
"in": "query",
"name": "after",
"type": "integer"
}响应
200 SSE stream
{
"type": "string"
}POST /api/public/v1/sessions/{id}/interruptInterrupt a public Task Agent turn
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Session ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"request_id": {
"example": "task-agent-turn-1710000000000000000",
"type": "string"
},
"status": {
"example": "queued",
"type": "string"
}
},
"type": "object"
}202 Accepted
{
"properties": {
"request_id": {
"example": "task-agent-turn-1710000000000000000",
"type": "string"
},
"status": {
"example": "queued",
"type": "string"
}
},
"type": "object"
}技能
GET /api/public/v1/skillsList public Task Agent skills
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
200 OK
{
"properties": {
"skills": {
"items": {
"properties": {
"capability_id": {
"type": "string"
},
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"hash": {
"example": "sha256:abc123",
"type": "string"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
},
"status": {
"example": "active",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}POST /api/public/v1/skillsCreate a public Task Agent skill
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Skill request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"example": "E2E Summary",
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"expected_checksum_sha256": {
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source_type": {
"example": "upload",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"skill": {
"properties": {
"capability_id": {
"type": "string"
},
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"hash": {
"example": "sha256:abc123",
"type": "string"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
},
"status": {
"example": "active",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}GET /api/public/v1/skills/{skillID}Read, update, or delete a public Task Agent skill
请求格式: application/json; 响应格式: application/json.
参数
skillID · path · 必填
{
"description": "Skill ID",
"in": "path",
"name": "skillID",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Skill request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"example": "E2E Summary",
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"expected_checksum_sha256": {
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source_type": {
"example": "upload",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"skill": {
"properties": {
"capability_id": {
"type": "string"
},
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"hash": {
"example": "sha256:abc123",
"type": "string"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
},
"status": {
"example": "active",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}PUT /api/public/v1/skills/{skillID}Read, update, or delete a public Task Agent skill
请求格式: application/json; 响应格式: application/json.
参数
skillID · path · 必填
{
"description": "Skill ID",
"in": "path",
"name": "skillID",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Skill request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"example": "E2E Summary",
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"expected_checksum_sha256": {
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source_type": {
"example": "upload",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"skill": {
"properties": {
"capability_id": {
"type": "string"
},
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"hash": {
"example": "sha256:abc123",
"type": "string"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
},
"status": {
"example": "active",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}PATCH /api/public/v1/skills/{skillID}Read, update, or delete a public Task Agent skill
请求格式: application/json; 响应格式: application/json.
参数
skillID · path · 必填
{
"description": "Skill ID",
"in": "path",
"name": "skillID",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Skill request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"example": "E2E Summary",
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"expected_checksum_sha256": {
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source_type": {
"example": "upload",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"skill": {
"properties": {
"capability_id": {
"type": "string"
},
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"hash": {
"example": "sha256:abc123",
"type": "string"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
},
"status": {
"example": "active",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}DELETE /api/public/v1/skills/{skillID}Read, update, or delete a public Task Agent skill
请求格式: application/json; 响应格式: application/json.
参数
skillID · path · 必填
{
"description": "Skill ID",
"in": "path",
"name": "skillID",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Skill request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"example": "E2E Summary",
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"expected_checksum_sha256": {
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source_type": {
"example": "upload",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"skill": {
"properties": {
"capability_id": {
"type": "string"
},
"description": {
"type": "string"
},
"directory_name": {
"example": "e2e-summary",
"type": "string"
},
"display_name": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"entrypoint_path": {
"example": "SKILL.md",
"type": "string"
},
"files": {
"items": {
"properties": {
"content": {
"type": "string"
},
"path": {
"example": "SKILL.md",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"hash": {
"example": "sha256:abc123",
"type": "string"
},
"skill_id": {
"example": "e2e-summary",
"type": "string"
},
"source": {
"example": "user",
"type": "string"
},
"status": {
"example": "active",
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}渠道
GET /api/public/v1/channelsList user channel connections
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
POST /api/public/v1/channelsConnect a verified existing Chatwoot message inbox
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Request body",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"inbox_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"require_admission": {
"type": "boolean"
}
},
"required": [
"inbox_id",
"name"
],
"type": "object"
}
}响应
POST /api/public/v1/channels/accountInitialize a user channel account
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
GET /api/public/v1/channels/agentsList Agents available for channel assignment
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
page · query · 可选
{
"description": "Page number",
"in": "query",
"name": "page",
"type": "integer"
}page_size · query · 可选
{
"description": "Page size, maximum 100",
"in": "query",
"name": "page_size",
"type": "integer"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}POST /api/public/v1/channels/authorizations/{provider}Begin channel authorization
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
provider · path · 必填
{
"description": "provider",
"in": "path",
"name": "provider",
"required": true,
"type": "string"
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}POST /api/public/v1/channels/authorizations/{provider}/completeComplete channel authorization
请求格式: application/json; 响应格式: application/json.
参数
provider · path · 必填
{
"description": "provider",
"in": "path",
"name": "provider",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Complete channel authorization request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"code": {
"type": "string"
},
"require_admission": {
"type": "boolean"
},
"state": {
"type": "string"
}
},
"required": [
"code",
"state"
],
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}POST /api/public/v1/channels/deletions/{id}/retryRetry channel cleanup
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
202 Accepted
{
"additionalProperties": {
"type": "string"
},
"type": "object"
}POST /api/public/v1/channels/facebookConnect a Facebook page
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Connect a Facebook page request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"page_id": {
"type": "string"
},
"require_admission": {
"type": "boolean"
},
"token": {
"type": "string"
}
},
"required": [
"page_id",
"token"
],
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}POST /api/public/v1/channels/facebook/pagesList authorized Facebook pages
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "List authorized Facebook pages request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"token": {
"type": "string"
}
},
"required": [
"token"
],
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}GET /api/public/v1/channels/inboxesList available Chatwoot message inboxes
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
GET /api/public/v1/channels/resourcesList channel resources and operations
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
POST /api/public/v1/channels/resourcesRegister an independently bindable channel resource
请求格式: application/json; 响应格式: application/json.
参数
body · body · 必填
{
"description": "Resource reference",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"base_url": {
"type": "string"
},
"created_at": {
"type": "string"
},
"credential_expires_at": {
"type": "string"
},
"id": {
"type": "string"
},
"kind": {
"enum": [
"hast_memory",
"cloudflare",
"knowledge_source",
"knowledge_collection",
"hindsight",
"twenty",
"tool",
"schedule"
],
"type": "string",
"x-enum-varnames": [
"ChannelResourceMemory",
"ChannelResourceKnowledge",
"ChannelResourceSource",
"ChannelResourceCollection",
"ChannelResourceFacts",
"ChannelResourceCRM",
"ChannelResourceTool",
"ChannelResourceSchedule"
]
},
"managed": {
"type": "boolean"
},
"name": {
"type": "string"
},
"reference_id": {
"type": "string"
},
"scope_type": {
"type": "string"
},
"secret_id": {
"type": "string"
},
"status": {
"type": "string"
}
},
"type": "object"
}
}响应
POST /api/public/v1/channels/resources/crmCreate an optional Twenty workspace
请求格式: application/json; 响应格式: application/json.
参数
body · body · 必填
{
"description": "CRM name and stable request ID",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"name": {
"type": "string"
},
"request_id": {
"type": "string"
}
},
"type": "object"
}
}响应
DELETE /api/public/v1/channels/resources/{resource_id}Delete an unused channel resource configuration
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "Resource ID",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}响应
POST /api/public/v1/channels/resources/{resource_id}/provisionRetry an incomplete CRM provisioning operation
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "CRM resource ID",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}响应
PUT /api/public/v1/channels/resources/{resource_id}/statusDisable or reverify a CRM resource
请求格式: application/json; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "CRM resource ID",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Request body",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"status": {
"type": "string"
}
},
"required": [
"status"
],
"type": "object"
}
}响应
POST /api/public/v1/channels/resources/{resource_id}/verifyVerify a Twenty resource credential and workspace
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
resource_id · path · 必填
{
"description": "CRM resource ID",
"in": "path",
"name": "resource_id",
"required": true,
"type": "string"
}响应
GET /api/public/v1/channels/schedule_sourcesList verified Webhook Schedule destinations
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
GET /api/public/v1/channels/sendsList user channel sends and provider statuses
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
GET /api/public/v1/channels/setupRead channel setup configuration
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
200 OK
{
"additionalProperties": true,
"type": "object"
}POST /api/public/v1/channels/setupCreate a message channel
Slack accepts optional slack_trigger_rules with require_mention, auto_reply_channel_ids and auto_reply_sender_ids. Omit it for mention-required defaults. Channel and sender exceptions are OR conditions; obtain actual IDs from the authorized Slack workspace.
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Request body",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"account_id": {
"type": "string"
},
"account_sid": {
"type": "string"
},
"api_key": {
"type": "string"
},
"api_secret": {
"type": "string"
},
"application_id": {
"type": "string"
},
"auth_token": {
"type": "string"
},
"bot_token": {
"type": "string"
},
"callback_token": {
"type": "string"
},
"corp_id": {
"type": "string"
},
"corp_secret": {
"type": "string"
},
"email": {
"type": "string"
},
"encoding_aes_key": {
"type": "string"
},
"imap_address": {
"type": "string"
},
"imap_login": {
"type": "string"
},
"imap_password": {
"type": "string"
},
"line_channel_id": {
"type": "string"
},
"line_channel_secret": {
"type": "string"
},
"line_channel_token": {
"type": "string"
},
"medium": {
"type": "string"
},
"name": {
"type": "string"
},
"open_kfid": {
"type": "string"
},
"phone_number": {
"type": "string"
},
"platform": {
"type": "string"
},
"require_admission": {
"type": "boolean"
},
"signing_secret": {
"type": "string"
},
"slack_trigger_rules": {
"properties": {
"auto_reply_channel_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"auto_reply_sender_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"require_mention": {
"type": "boolean"
}
},
"required": [
"require_mention"
],
"type": "object"
},
"smtp_address": {
"type": "string"
},
"smtp_login": {
"type": "string"
},
"smtp_password": {
"type": "string"
},
"telegram_trigger_rules": {
"properties": {
"group_rules": {
"items": {
"properties": {
"chat_id": {
"type": "string"
},
"mode": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"website_url": {
"type": "string"
}
},
"type": "object"
}
}响应
POST /api/public/v1/channels/whatsappCreate an official WhatsApp Cloud connection
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Create an official WhatsApp Cloud connection request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"app_secret_id": {
"type": "string"
},
"app_secret_name": {
"type": "string"
},
"app_secret_value": {
"type": "string"
},
"business_account_id": {
"type": "string"
},
"name": {
"type": "string"
},
"phone_number": {
"type": "string"
},
"phone_number_id": {
"type": "string"
},
"require_admission": {
"type": "boolean"
},
"token_secret_id": {
"type": "string"
},
"token_secret_name": {
"type": "string"
},
"token_secret_value": {
"type": "string"
}
},
"required": [
"business_account_id",
"name",
"phone_number",
"phone_number_id"
],
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}DELETE /api/public/v1/channels/{connection_id}Disconnect a user channel
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
connection_id · path · 必填
{
"description": "Connection ID",
"in": "path",
"name": "connection_id",
"required": true,
"type": "string"
}响应
PUT /api/public/v1/channels/{connection_id}/bindingRelease a legacy channel association
请求格式: application/json; 响应格式: application/json.
参数
connection_id · path · 必填
{
"description": "Channel connection ID",
"in": "path",
"name": "connection_id",
"required": true,
"type": "string"
}body · body · 必填
{
"description": "Expected Webhook ID and binding version; target must be empty to release the association",
"in": "body",
"name": "body",
"required": true,
"schema": {
"properties": {
"expected_binding_version": {
"type": "integer"
},
"expected_hook_id": {
"type": "string"
},
"require_admission": {
"type": "boolean"
},
"target_hook_id": {
"type": "string"
}
},
"type": "object"
}
}响应
GET /api/public/v1/channels/{connection_id}/deletion_previewPreview retained Knowledge affected by channel deletion
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
200 OK
{
"properties": {
"attachment_count": {
"type": "integer"
},
"bases": {
"items": {
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"record_count": {
"type": "integer"
},
"source_count": {
"type": "integer"
}
},
"type": "object"
}GET /api/public/v1/channels/{connection_id}/installationRead channel installation information
WeChat installation includes wechat_trusted_ips, the configured public egress IP list. An empty array means the deployment has not configured it; other platforms omit this field. Slack installation includes slack_trigger_rules and the callback URL. Use the returned rules to preserve existing exceptions when updating a Slack channel.
请求格式: 无指定请求正文格式; 响应格式: 以响应定义为准.
参数
规范未声明参数。
响应
POST /api/public/v1/channels/{connection_id}/reconnectReconnect a disconnected channel
Verify the provider inbox before resuming synchronization. Existing history remains associated with this connection. Automatic replies stay off until an Agent is selected again.
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
connection_id · path · 必填
{
"description": "Connection ID",
"in": "path",
"name": "connection_id",
"required": true,
"type": "string"
}响应
DELETE /api/public/v1/channels/{connection_id}/removeDelete a channel with optional retained Knowledge cleanup
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
connection_id · path · 必填
{
"description": "Connection ID",
"in": "path",
"name": "connection_id",
"required": true,
"type": "string"
}purge_knowledge · query · 可选
{
"description": "Delete retained originals and derived knowledge in all affected bases",
"in": "query",
"name": "purge_knowledge",
"type": "boolean"
}响应
202 Accepted
{
"properties": {
"deletion": {
"properties": {
"affected_base_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"completed": {
"type": "integer"
},
"connection_id": {
"type": "string"
},
"created_at": {
"type": "string"
},
"error": {
"type": "string"
},
"finished_at": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"purge_knowledge": {
"type": "boolean"
},
"stage": {
"type": "string"
},
"state": {
"type": "string"
},
"total": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}PATCH /api/public/v1/channels/{connection_id}/slackSet Slack mention requirements and automatic reply exceptions
Replace the complete Slack trigger rules. Mentions, exempt channel IDs and exempt user or bot IDs independently trigger replies. Both ID arrays support multiple values (up to 100 unique IDs each). Direct messages trigger normally and own-bot echoes are ignored. Requires an owned Slack channel; read /channels/{connection_id}/installation before editing and after saving.
请求格式: application/json; 响应格式: application/json.
参数
connection_id · path · 必填
{
"description": "Channel ID",
"in": "path",
"name": "connection_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Complete Slack trigger rules",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"auto_reply_channel_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"auto_reply_sender_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"require_mention": {
"type": "boolean"
}
},
"required": [
"require_mention"
],
"type": "object"
}
}响应
PATCH /api/public/v1/channels/{connection_id}/telegramSet Telegram group Agent triggers
Replace all group rules. Unlisted groups sync knowledge only. Modes: sync_only, mention (mention or reply to the Bot), all. Private chats trigger normally; Agent configuration and member admission are checked independently.
请求格式: application/json; 响应格式: application/json.
参数
connection_id · path · 必填
{
"description": "Channel ID",
"in": "path",
"name": "connection_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Complete Telegram group rules",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"group_rules": {
"items": {
"properties": {
"chat_id": {
"type": "string"
},
"mode": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
}响应
PATCH /api/public/v1/channels/{connection_id}/wechat-kfComplete WeChat customer service setup
请求格式: application/json; 响应格式: application/json.
参数
connection_id · path · 必填
{
"description": "connection_id",
"in": "path",
"name": "connection_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Complete WeChat customer service setup request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"corp_secret": {
"type": "string"
},
"open_kfid": {
"type": "string"
}
},
"required": [
"corp_secret",
"open_kfid"
],
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}POST /api/public/v1/channels/{connection_id}/wechat-kf/accountsDiscover WeChat customer service accounts without saving credentials
Requires channels:write on a Profile key. Returns account names, IDs and management eligibility for an owned WeChat channel. Does not save the Secret or change bindings. Select an account with manage_privilege=true, then PATCH the WeChat setup with corp_secret and open_kfid.
请求格式: application/json; 响应格式: application/json.
参数
connection_id · path · 必填
{
"description": "Owned WeChat channel connection ID",
"in": "path",
"name": "connection_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Application Secret; never include in prompts or logs",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"corp_secret": {
"maxLength": 4096,
"type": "string"
}
},
"required": [
"corp_secret"
],
"type": "object"
}
}响应
200 OK
{
"properties": {
"accounts": {
"items": {
"properties": {
"manage_privilege": {
"type": "boolean"
},
"name": {
"type": "string"
},
"open_kfid": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}400 wechat_credentials_invalid
{
"properties": {
"code": {
"type": "string"
},
"error": {
"type": "string"
}
},
"type": "object"
}401 Missing or invalid API key
{
"properties": {
"code": {
"type": "string"
},
"error": {
"type": "string"
}
},
"type": "object"
}403 Requires a Profile key with channels:write
{
"properties": {
"code": {
"type": "string"
},
"error": {
"type": "string"
}
},
"type": "object"
}404 WeChat channel not found
{
"properties": {
"code": {
"type": "string"
},
"error": {
"type": "string"
}
},
"type": "object"
}409 Channel account unavailable
{
"properties": {
"code": {
"type": "string"
},
"error": {
"type": "string"
}
},
"type": "object"
}422 wechat_credentials_invalid, wechat_permission_denied, wechat_ip_not_allowed or wechat_accounts_unavailable
{
"properties": {
"code": {
"type": "string"
},
"error": {
"type": "string"
}
},
"type": "object"
}502 wechat_accounts_unavailable
{
"properties": {
"code": {
"type": "string"
},
"error": {
"type": "string"
}
},
"type": "object"
}POST /api/public/v1/channels/{connection_id}/wechat-kf/domain-verificationUpload a WeCom domain verification file
请求格式: application/json; 响应格式: application/json.
参数
connection_id · path · 必填
{
"description": "connection_id",
"in": "path",
"name": "connection_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Upload a WeCom domain verification file request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"content": {
"type": "string"
},
"filename": {
"type": "string"
}
},
"required": [
"content",
"filename"
],
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}PATCH /api/public/v1/channels/{connection_id}/whatsappReauthorize an official WhatsApp Cloud connection
请求格式: application/json; 响应格式: application/json.
参数
connection_id · path · 必填
{
"description": "connection_id",
"in": "path",
"name": "connection_id",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Reauthorize an official WhatsApp Cloud connection request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"app_secret_id": {
"type": "string"
},
"app_secret_name": {
"type": "string"
},
"app_secret_value": {
"type": "string"
},
"business_account_id": {
"type": "string"
},
"phone_number_id": {
"type": "string"
},
"token_secret_id": {
"type": "string"
},
"token_secret_name": {
"type": "string"
},
"token_secret_value": {
"type": "string"
}
},
"required": [
"business_account_id",
"phone_number_id"
],
"type": "object"
}
}响应
200 OK
{
"additionalProperties": true,
"type": "object"
}记忆
GET /api/public/v1/memoriesList public Task Agent memories
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
scope_type · query · 可选
{
"description": "Filter memory category",
"enum": [
"task_agent",
"webhook"
],
"in": "query",
"name": "scope_type",
"type": "string"
}scope_id · query · 可选
{
"description": "Webhook ID; empty selects shared, omitted selects all in the category",
"in": "query",
"name": "scope_id",
"type": "string"
}响应
200 OK
{
"properties": {
"memories": {
"items": {
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}POST /api/public/v1/memoriesCreate a public Task Agent memory
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Memory request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"content": {
"example": "Prefer concise validation notes.",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "project-preferences",
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"memory": {
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}GET /api/public/v1/memories/by-id/{memoryID}Read a memory by ID within the authenticated user
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
memoryID · path · 必填
{
"description": "Memory ID",
"in": "path",
"name": "memoryID",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"memory": {
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}PUT /api/public/v1/memories/by-id/{memoryID}Update a memory by ID, optionally moving its scope
请求格式: application/json; 响应格式: application/json.
参数
memoryID · path · 必填
{
"description": "Memory ID",
"in": "path",
"name": "memoryID",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Memory update",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"content": {
"example": "Prefer concise validation notes.",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "project-preferences",
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"memory": {
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}404 Not Found
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}PATCH /api/public/v1/memories/by-id/{memoryID}Update a memory by ID, optionally moving its scope
请求格式: application/json; 响应格式: application/json.
参数
memoryID · path · 必填
{
"description": "Memory ID",
"in": "path",
"name": "memoryID",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Memory update",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"content": {
"example": "Prefer concise validation notes.",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "project-preferences",
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"memory": {
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}404 Not Found
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}DELETE /api/public/v1/memories/by-id/{memoryID}Delete a memory by ID within the authenticated user
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
memoryID · path · 必填
{
"description": "Memory ID",
"in": "path",
"name": "memoryID",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"ok": {
"example": true,
"type": "boolean"
}
},
"type": "object"
}GET /api/public/v1/memories/{name}Read, update, or delete a public Task Agent memory
请求格式: application/json; 响应格式: application/json.
参数
name · path · 必填
{
"description": "Memory name",
"in": "path",
"name": "name",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Memory request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"content": {
"example": "Prefer concise validation notes.",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "project-preferences",
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"memory": {
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}PUT /api/public/v1/memories/{name}Read, update, or delete a public Task Agent memory
请求格式: application/json; 响应格式: application/json.
参数
name · path · 必填
{
"description": "Memory name",
"in": "path",
"name": "name",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Memory request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"content": {
"example": "Prefer concise validation notes.",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "project-preferences",
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"memory": {
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}PATCH /api/public/v1/memories/{name}Read, update, or delete a public Task Agent memory
请求格式: application/json; 响应格式: application/json.
参数
name · path · 必填
{
"description": "Memory name",
"in": "path",
"name": "name",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Memory request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"content": {
"example": "Prefer concise validation notes.",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "project-preferences",
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"memory": {
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}DELETE /api/public/v1/memories/{name}Read, update, or delete a public Task Agent memory
请求格式: application/json; 响应格式: application/json.
参数
name · path · 必填
{
"description": "Memory name",
"in": "path",
"name": "name",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Memory request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"content": {
"example": "Prefer concise validation notes.",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"example": "project-preferences",
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"memory": {
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"name": {
"type": "string"
},
"scope_id": {
"example": "",
"type": "string"
},
"scope_type": {
"enum": [
"task_agent",
"webhook"
],
"example": "task_agent",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}文件
GET /api/public/v1/filesList, download, or delete public workspace files
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
session_id · query · 可选
{
"description": "Session ID",
"in": "query",
"name": "session_id",
"type": "string"
}path · query · 可选
{
"description": "Workspace directory path",
"in": "query",
"name": "path",
"type": "string"
}scope · query · 可选
{
"description": "Workspace scope",
"in": "query",
"name": "scope",
"type": "string"
}响应
200 OK
{
"properties": {
"has_more": {
"type": "boolean"
},
"items": {
"items": {
"properties": {
"file_id": {
"example": "opaque-file-id",
"type": "string"
},
"id": {
"example": "opaque-file-id",
"type": "string"
},
"name": {
"example": "report.csv",
"type": "string"
},
"path": {
"example": "uploads/upload-id/report.csv",
"type": "string"
},
"relative_path": {
"example": "uploads/upload-id/report.csv",
"type": "string"
},
"session_id": {
"type": "string"
},
"size_bytes": {
"example": 1024,
"type": "integer"
},
"type": {
"example": "file",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"next_cursor": {
"type": "string"
}
},
"type": "object"
}POST /api/public/v1/filesUpload a public Task Agent file
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
file · formData · 必填
{
"description": "File",
"in": "formData",
"name": "file",
"required": true,
"type": "file"
}响应
201 Created
{
"properties": {
"file": {
"properties": {
"file_id": {
"example": "opaque-file-id",
"type": "string"
},
"id": {
"example": "opaque-file-id",
"type": "string"
},
"name": {
"example": "report.csv",
"type": "string"
},
"path": {
"example": "uploads/upload-id/report.csv",
"type": "string"
},
"relative_path": {
"example": "uploads/upload-id/report.csv",
"type": "string"
},
"session_id": {
"type": "string"
},
"size_bytes": {
"example": 1024,
"type": "integer"
},
"type": {
"example": "file",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}GET /api/public/v1/files.zipDownload a public workspace ZIP
请求格式: 无指定请求正文格式; 响应格式: application/zip.
参数
session_id · query · 可选
{
"description": "Session ID",
"in": "query",
"name": "session_id",
"type": "string"
}scope · query · 可选
{
"description": "Workspace scope",
"in": "query",
"name": "scope",
"type": "string"
}响应
200 Workspace ZIP
{
"type": "file"
}GET /api/public/v1/files/{relativePath}Download or delete a public workspace file
请求格式: 无指定请求正文格式; 响应格式: application/octet-stream.
参数
relativePath · path · 必填
{
"description": "Workspace relative path",
"in": "path",
"name": "relativePath",
"required": true,
"type": "string"
}session_id · query · 可选
{
"description": "Session ID",
"in": "query",
"name": "session_id",
"type": "string"
}file_id · query · 必填
{
"description": "Opaque file ID",
"in": "query",
"name": "file_id",
"required": true,
"type": "string"
}scope · query · 可选
{
"description": "Workspace scope",
"in": "query",
"name": "scope",
"type": "string"
}响应
200 Workspace file
{
"type": "file"
}DELETE /api/public/v1/files/{relativePath}Download or delete a public workspace file
请求格式: 无指定请求正文格式; 响应格式: application/octet-stream.
参数
relativePath · path · 必填
{
"description": "Workspace relative path",
"in": "path",
"name": "relativePath",
"required": true,
"type": "string"
}session_id · query · 可选
{
"description": "Session ID",
"in": "query",
"name": "session_id",
"type": "string"
}file_id · query · 必填
{
"description": "Opaque file ID",
"in": "query",
"name": "file_id",
"required": true,
"type": "string"
}scope · query · 可选
{
"description": "Workspace scope",
"in": "query",
"name": "scope",
"type": "string"
}响应
200 Workspace file
{
"type": "file"
}连接器
GET /api/public/v1/connectors/accountsList public connector accounts
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
200 OK
{
"properties": {
"connector_accounts": {
"items": {
"additionalProperties": {},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}GET /api/public/v1/connectors/accounts/{id}Read, update, or delete a public connector account
请求格式: application/json; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Connector account ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Connector account request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"external_account_ref": {
"example": "connected-account-id",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"provider": {
"example": "github",
"type": "string"
},
"status": {
"example": "connected",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"connector_account": {
"additionalProperties": {},
"type": "object"
}
},
"type": "object"
}PUT /api/public/v1/connectors/accounts/{id}Read, update, or delete a public connector account
请求格式: application/json; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Connector account ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Connector account request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"external_account_ref": {
"example": "connected-account-id",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"provider": {
"example": "github",
"type": "string"
},
"status": {
"example": "connected",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"connector_account": {
"additionalProperties": {},
"type": "object"
}
},
"type": "object"
}PATCH /api/public/v1/connectors/accounts/{id}Read, update, or delete a public connector account
请求格式: application/json; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Connector account ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Connector account request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"external_account_ref": {
"example": "connected-account-id",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"provider": {
"example": "github",
"type": "string"
},
"status": {
"example": "connected",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"connector_account": {
"additionalProperties": {},
"type": "object"
}
},
"type": "object"
}DELETE /api/public/v1/connectors/accounts/{id}Read, update, or delete a public connector account
请求格式: application/json; 响应格式: application/json.
参数
id · path · 必填
{
"description": "Connector account ID",
"in": "path",
"name": "id",
"required": true,
"type": "string"
}request · body · 可选
{
"description": "Connector account request",
"in": "body",
"name": "request",
"schema": {
"properties": {
"external_account_ref": {
"example": "connected-account-id",
"type": "string"
},
"metadata": {
"additionalProperties": {},
"type": "object"
},
"provider": {
"example": "github",
"type": "string"
},
"status": {
"example": "connected",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"connector_account": {
"additionalProperties": {},
"type": "object"
}
},
"type": "object"
}GET /api/public/v1/connectors/catalogList public connector catalog
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
search · query · 可选
{
"description": "Search toolkits",
"in": "query",
"name": "search",
"type": "string"
}cursor · query · 可选
{
"description": "Next cursor",
"in": "query",
"name": "cursor",
"type": "string"
}limit · query · 可选
{
"description": "Page size, maximum 100",
"in": "query",
"name": "limit",
"type": "integer"
}响应
200 OK
{
"properties": {
"agent_id": {
"type": "string"
},
"connection_scope": {
"type": "string"
},
"connectors": {
"items": {
"properties": {
"account_label": {
"type": "string"
},
"description": {
"type": "string"
},
"label": {
"example": "GitHub",
"type": "string"
},
"logo": {
"type": "string"
},
"provider": {
"example": "github",
"type": "string"
},
"runtime_provider": {
"example": "composio",
"type": "string"
},
"start_url": {
"type": "string"
},
"status": {
"example": "connected",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"has_more": {
"type": "boolean"
},
"limit": {
"example": 20,
"type": "integer"
},
"next_cursor": {
"type": "string"
},
"profile_id": {
"type": "string"
},
"search": {
"example": "github",
"type": "string"
}
},
"type": "object"
}GET /api/public/v1/connectors/statusList public connector status
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
search · query · 可选
{
"description": "Search connector catalog",
"in": "query",
"name": "search",
"type": "string"
}cursor · query · 可选
{
"description": "Next cursor",
"in": "query",
"name": "cursor",
"type": "string"
}limit · query · 可选
{
"description": "Page size, maximum 100",
"in": "query",
"name": "limit",
"type": "integer"
}响应
200 OK
{
"properties": {
"agent_id": {
"type": "string"
},
"connection_scope": {
"type": "string"
},
"connectors": {
"items": {
"properties": {
"account_label": {
"type": "string"
},
"description": {
"type": "string"
},
"label": {
"example": "GitHub",
"type": "string"
},
"logo": {
"type": "string"
},
"provider": {
"example": "github",
"type": "string"
},
"runtime_provider": {
"example": "composio",
"type": "string"
},
"start_url": {
"type": "string"
},
"status": {
"example": "connected",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"has_more": {
"type": "boolean"
},
"limit": {
"example": 20,
"type": "integer"
},
"next_cursor": {
"type": "string"
},
"profile_id": {
"type": "string"
},
"search": {
"example": "github",
"type": "string"
}
},
"type": "object"
}POST /api/public/v1/connectors/{provider}/oauth/authorizeStart public connector OAuth authorization
请求格式: application/json; 响应格式: application/json.
参数
provider · path · 必填
{
"description": "Connector provider",
"in": "path",
"name": "provider",
"required": true,
"type": "string"
}响应
200 OK
{
"properties": {
"auth_url": {
"type": "string"
},
"connected_account_id": {
"type": "string"
}
},
"type": "object"
}密钥
GET /api/public/v1/secretsList User Secrets
Lists owned User Secret metadata. Secret values are write-only and are never returned.
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
规范未声明参数。
响应
200 OK
{
"properties": {
"secrets": {
"items": {
"properties": {
"created_at": {
"type": "string"
},
"id": {
"example": "sec_123",
"type": "string"
},
"name": {
"example": "kubeconfig",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}POST /api/public/v1/secretsCreate a User Secret
Creates a write-only User Secret. The response returns metadata only.
请求格式: application/json; 响应格式: application/json.
参数
request · body · 必填
{
"description": "Secret request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"name": {
"example": "kubeconfig",
"type": "string"
},
"value": {
"example": "write-only",
"type": "string"
}
},
"type": "object"
}
}响应
201 Created
{
"properties": {
"secret": {
"properties": {
"created_at": {
"type": "string"
},
"id": {
"example": "sec_123",
"type": "string"
},
"name": {
"example": "kubeconfig",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}PATCH /api/public/v1/secrets/{secretID}Update a User Secret value
Replaces the write-only Secret value. The response returns metadata only.
请求格式: application/json; 响应格式: application/json.
参数
secretID · path · 必填
{
"description": "Secret ID",
"in": "path",
"name": "secretID",
"required": true,
"type": "string"
}request · body · 必填
{
"description": "Secret request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"properties": {
"value": {
"example": "write-only",
"type": "string"
}
},
"type": "object"
}
}响应
200 OK
{
"properties": {
"secret": {
"properties": {
"created_at": {
"type": "string"
},
"id": {
"example": "sec_123",
"type": "string"
},
"name": {
"example": "kubeconfig",
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}404 Not Found
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}DELETE /api/public/v1/secrets/{secretID}Delete a User Secret
请求格式: 无指定请求正文格式; 响应格式: application/json.
参数
secretID · path · 必填
{
"description": "Secret ID",
"in": "path",
"name": "secretID",
"required": true,
"type": "string"
}响应
204 No Content
404 Not Found
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}409 Conflict
{
"properties": {
"code": {
"description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
"example": 0,
"type": "integer"
},
"message": {
"description": "Message is a human-readable status or error description.",
"example": "ok",
"type": "string"
}
},
"type": "object"
}获取微信客服账号
创建微信客服渠道草稿并完成企业微信授权后,使用带 channels:write 的 Profile API key 调用 POST /api/public/v1/channels/{connection_id}/wechat-kf/accounts。写入权限包含读取;单 Agent 对话 key 无法使用此接口。
请求体(Secret 占位符只通过客户端安全参数替换,不要写入提示词或日志):
{"corp_secret":"<APPLICATION_SECRET>"}成功返回 200:
{"accounts":[{"open_kfid":"wk-example","name":"Customer support","manage_privilege":true}]}按名称选择 manage_privilege: true 的账号。只有一个可管理账号时可以预选,多个时由用户选择;空列表也是有效结果。获取列表不会保存 Secret 或修改绑定。确认后向 PATCH /api/public/v1/channels/{connection_id}/wechat-kf 提交同一个 corp_secret 和选中的 open_kfid,后端会再次校验管理权限。
400/422 wechat_credentials_invalid:检查应用 Secret 和企业 ID;422 wechat_permission_denied:授权应用调用客服 API;422 wechat_ip_not_allowed:配置可信出口 IP;422/502 wechat_accounts_unavailable:稍后重试。401/403 检查 API key 和权限,404 检查渠道归属,409 检查渠道账号初始化。