跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.topify.ai/llms.txt

Use this file to discover all available pages before exploring further.

操作是 AI 生成的建议,用于提升您的品牌在 AI 搜索结果中的可见度。共有四种操作类别:on_page_seo(建议性 SEO 修改)、new_content(带完整撰写流程的新文章)、content_update(页面编辑建议)和 forum_engagement(Reddit 回复草稿)。

列出操作

GET /projects/{project_id}/actions
返回项目的所有操作,可选按状态或分组筛选。

路径参数

参数类型描述
project_idstring (UUID)项目 ID

查询参数

参数类型默认值描述
statusstring按状态筛选(suggestedacceptedin_progresscompletedignored
groupstring按分组名称筛选
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions?status=suggested" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": [
    {
      "id": "a1b2c3d4-...",
      "priority": "high",
      "title": "Add structured data to pricing page",
      "description": "Adding FAQ schema markup to your pricing page will help AI models extract and cite your pricing details.",
      "category": "on_page_seo",
      "effort": "quick-win",
      "expected_impact_min": 5,
      "expected_impact_max": 15,
      "status": "suggested",
      "targets": [
        { "type": "url", "value": "https://example.com/pricing" }
      ],
      "execution": {
        "type": "manual",
        "prompt": null,
        "skill": null,
        "params": null
      },
      "group": "Technical SEO",
      "depends_on": [],
      "created_at": "2026-04-01T12:00:00Z",
      "updated_at": "2026-04-01T12:00:00Z"
    }
  ]
}

ActionItem 字段

字段类型可空描述
idstring (UUID)No操作 ID
prioritystringNocriticalhighmediumlow
titlestringNo操作的简短标题
descriptionstringNo建议的详细说明
categorystringNoon_page_seonew_contentcontent_updateforum_engagement
effortstringYesquick-winmoderatemajor
expected_impact_minnumberYes预估的最低可见度影响(百分点)
expected_impact_maxnumberYes预估的最高可见度影响(百分点)
statusstringNosuggestedacceptedin_progresscompletedignored
targetsobject[]No目标数组(见下文)
executionobjectNo执行配置(见下文)
groupstringYes逻辑分组名称
depends_onstring[]No此操作所依赖的操作 ID
created_atstringNoISO 8601 创建时间
updated_atstringNoISO 8601 更新时间

Target 对象

字段类型描述
typestringurlkeywordpage_typedomain
valuestring目标值

Execution 对象

字段类型可空描述
typestringNopromptpublishable_contentforum_replymanual
promptstringYes用于执行的 LLM 提示
skillstringYes智能体技能标识
paramsobjectYes额外的执行参数

获取单个操作

GET /projects/{project_id}/actions/{action_id}
按 ID 返回单个操作。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
action_idstring (UUID)操作 ID
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions/{action_id}" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": {
    "id": "a1b2c3d4-...",
    "priority": "high",
    "title": "Add structured data to pricing page",
    "description": "Adding FAQ schema markup to your pricing page will help AI models extract and cite your pricing details.",
    "category": "on_page_seo",
    "effort": "quick-win",
    "expected_impact_min": 5,
    "expected_impact_max": 15,
    "status": "suggested",
    "targets": [
      { "type": "url", "value": "https://example.com/pricing" }
    ],
    "execution": {
      "type": "manual",
      "prompt": null,
      "skill": null,
      "params": null
    },
    "group": "Technical SEO",
    "depends_on": [],
    "created_at": "2026-04-01T12:00:00Z",
    "updated_at": "2026-04-01T12:00:00Z"
  }
}

错误响应

状态原因
404在此项目中未找到操作

创建操作

POST /projects/{project_id}/actions
手动创建一个新操作。

路径参数

参数类型描述
project_idstring (UUID)项目 ID

请求体

字段类型必填描述
titlestringYes操作的简短标题
descriptionstringYes详细说明
categorystringYeson_page_seonew_contentcontent_updateforum_engagement
prioritystringYescriticalhighmediumlow
executionobjectYes{type, prompt?, skill?}
targetsobject[]No{type, value} 目标数组
effortstringNoquick-winmoderatemajor
expected_impact_minnumberNo预估的最低影响
expected_impact_maxnumberNo预估的最高影响
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions" \
  -H "X-API-Key: tk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Write a comparison article",
    "description": "Create an article comparing your product with top competitors for the keyword \"best project management tools\".",
    "category": "new_content",
    "priority": "high",
    "execution": {"type": "publishable_content", "skill": "write_article"},
    "targets": [{"type": "keyword", "value": "best project management tools"}],
    "effort": "major",
    "expected_impact_min": 10,
    "expected_impact_max": 25
  }'

响应

返回创建的操作(与 获取单个操作 形状相同),状态为 suggested

错误响应

状态原因
400缺少必填字段,或 category/priority/execution 类型无效
403API 密钥具有只读权限

增强操作

POST /projects/{project_id}/actions/enrich
将不完整的操作数据发送给 LLM 并返回增强后的字段(改进的标题、描述、目标、执行配置)。

路径参数

参数类型描述
project_idstring (UUID)项目 ID

请求体

字段类型必填描述
action_typestringYeson_page_seonew_contentcontent_updateforum_engagement
titlestringNo草稿标题
descriptionstringNo草稿描述
target_urlstringNo此操作的目标 URL
keywordsstring[]No相关关键词
instructionsstringNo给 LLM 的自由格式指令
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions/enrich" \
  -H "X-API-Key: tk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "action_type": "new_content",
    "title": "Comparison article",
    "keywords": ["best project management tools"]
  }'

响应

返回经 LLM 增强后的操作字段(标题、描述、目标、执行配置、工作量、预估影响)。

错误响应

状态原因
400缺少 action_type 或值无效

状态切换

PATCH /projects/{project_id}/actions/{action_id}/{action}
将操作切换到新状态。action 路径参数决定切换方式。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
action_idstring (UUID)操作 ID
actionstring取值之一:acceptstartcompleteignorereopen

请求体(仅 ignore)

字段类型必填描述
reasonstringNo忽略的原因
feedbackstringNo额外的反馈

状态机

suggested --> accepted --> in_progress --> completed
    |                                        ^
    +--> ignored ---(reopen)---> accepted ---+
curl -X PATCH "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions/{action_id}/accept" \
  -H "X-API-Key: tk_live_..."

响应

返回切换至新状态后的操作。

错误响应

状态原因
400无效的状态切换(例如完成 suggested 状态的操作)
403API 密钥具有只读权限
404未找到操作

批量切换状态

POST /projects/{project_id}/actions/batch-transition
一次切换多个操作的状态。

路径参数

参数类型描述
project_idstring (UUID)项目 ID

请求体

字段类型必填描述
idsstring[]Yes操作 ID 数组
actionstringYesacceptstartcompleteignorereopen
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions/batch-transition" \
  -H "X-API-Key: tk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "ids": ["a1b2c3d4-...", "e5f6g7h8-..."],
    "action": "accept"
  }'

响应

{
  "success": true,
  "data": {
    "succeeded": 2,
    "failed": 0,
    "total": 2
  }
}

错误响应

状态原因
400ids 数组为空或 action 无效
403API 密钥具有只读权限

推荐操作

POST /projects/{project_id}/actions/recommend
将基于 AI 的操作推荐生成作为后台任务触发。AI 会分析您的项目数据并生成一组推荐操作。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions/recommend" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": {
    "task_id": "f1e2d3c4-..."
  }
}
使用 查询推荐任务状态 端点轮询完成情况。

查询推荐任务状态

GET /projects/{project_id}/actions/tasks/{task_id}
查询后台推荐任务的状态。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
task_idstring (UUID)推荐端点返回的任务 ID
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions/tasks/{task_id}" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": {
    "status": "completed",
    "item_count": 12,
    "error": null
  }
}

任务状态值

状态描述
running任务仍在进行中
completed推荐生成成功
failed任务遇到错误(请查看 error 字段)

增强内容

POST /projects/{project_id}/actions/{action_id}/enrich-content
适用于 content_update 操作。通过 Firecrawl 抓取目标页面,然后通过 LLM 生成 SEO 编辑建议。返回一组用于提升 AI 可见度的具体编辑。
此端点可能需要 10—20 秒才能响应,因为它需要抓取并分析目标页面。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
action_idstring (UUID)操作 ID(必须是 content_update 操作)
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions/{action_id}/enrich-content" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": [
    {
      "section": "Introduction paragraph",
      "type": "replace",
      "before": "We offer project management software.",
      "after": "We offer AI-powered project management software trusted by 10,000+ teams worldwide.",
      "signal": "authority",
      "reason": "Adding specificity and social proof helps AI models identify your brand as a credible source."
    },
    {
      "section": "FAQ section",
      "type": "insert",
      "before": null,
      "after": "<h2>Frequently Asked Questions</h2>...",
      "signal": "structured_data",
      "reason": "FAQ sections are heavily cited by AI models when answering user questions."
    }
  ]
}

Edit 对象字段

字段类型可空描述
sectionstringNo被编辑的页面区域
typestringNoreplaceinsertdelete
beforestringYes原始文本(insert 时为 null)
afterstringYes替换文本(delete 时为 null)
signalstringNo针对的 SEO/GEO 信号
reasonstringNo此编辑为何能提升可见度的说明

错误响应

状态原因
400操作不是 content_update 类型,或没有目标 URL
404未找到操作

增强论坛

POST /projects/{project_id}/actions/{action_id}/enrich-forum
适用于 forum_engagement 操作。重新生成针对目标主题帖量身定制的 Reddit 评论草稿。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
action_idstring (UUID)操作 ID(必须是 forum_engagement 操作)
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions/{action_id}/enrich-forum" \
  -H "X-API-Key: tk_live_..."

响应

{
  "success": true,
  "data": {
    "comment": "I've been using Acme for about six months now and it's been solid for our team...",
    "comment_word_count": 87,
    "thread_title": "What project management tool do you use?",
    "thread_url": "https://www.reddit.com/r/productivity/comments/..."
  }
}

错误响应

状态原因
400操作不是 forum_engagement 类型
404未找到操作

执行操作

POST /projects/{project_id}/actions/{action_id}/execute
execution.typepublishable_contentnew_content 操作启动执行工作流。这会触发文章生成,并带有人工审核检查点(大纲、草稿、终稿)。进度通过 Webhook 推送。
仅适用于 execution.type: "publishable_content" 的操作。您必须为 action.checkpoint 事件注册 webhook 才能接收审核提示。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
action_idstring (UUID)操作 ID
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions/{action_id}/execute" \
  -H "X-API-Key: tk_live_..."

响应(202 Accepted)

{
  "success": true,
  "data": {
    "workflow_id": "w1x2y3z4-...",
    "status": "started"
  }
}

错误响应

状态原因
400操作不是 publishable_content 类型,或不处于 accepted/in_progress 状态
404未找到操作

响应检查点

POST /projects/{project_id}/actions/{action_id}/execute/respond
响应一个进行中的执行工作流中的审核检查点。在收到 action.checkpoint Webhook 事件后调用。

路径参数

参数类型描述
project_idstring (UUID)项目 ID
action_idstring (UUID)操作 ID

请求体

字段类型必填描述
workflow_idstring (UUID)Yes检查点事件中的工作流 ID
decisionstringYesapproveeditregeneratereject
edited_contentstringNo修改后的内容(当 decisionedit 时必填)
feedbackstringNo用于重新生成的指令(当 decisionregenerate 时使用)
curl -X POST "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/actions/{action_id}/execute/respond" \
  -H "X-API-Key: tk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_id": "w1x2y3z4-...",
    "decision": "approve"
  }'

响应

{
  "success": true,
  "data": {
    "status": "continuing"
  }
}

错误响应

状态原因
400决策无效、缺少 workflow_id,或需要但未提供 edited_content
404未找到操作或工作流
409工作流当前未在检查点等待