REST API

Stitch 工作区操作的 REST API 端点参考。

v2alpha REST API 支撑 Stitch 的工作区管理、代码库优先级、洞察与解决方案。

通过 stitch api <path> 调用端点前,需要先用 stitch enable loop 启用一次工作区功能。

从 CLI 调用 API

stitch api workspaces
stitch api workspaces/<workspace-id>/goals
stitch api -X POST workspaces/<workspace-id>/insights:generate --json '{}'

端点

方法端点
POSTclientNotices:fetch
POSTcontexts:parseMcpJson
POSTfeedback:submit
POSTworkspaces/{workspace}/files
GETorganizations/{organization}
GETorganizations
POSTtos:accept
GETtos:check
GETusers/{user}/preferences
PATCHusers/{user}/preferences
POSTusers/{user}/tos:accept
GETusers/{user}/tos:check
POSTv2alpha:completeOAuth
POSTworkspaces/{workspace}:addRepository
POSTworkspaces/{workspace}:addUser
POSTworkspaces
POSTworkspaces/{workspace}:createToolkitConnectLink
DELETEworkspaces/{workspace}
GETworkspaces/{workspace}
GETworkspaces/{workspace}/marketRadarCheckpoint
GETworkspaces/{workspace}/userNotificationSettings
GETworkspaces/{workspace}/workspaceNotificationSettings
GETworkspaces
PATCHworkspaces/{workspace}
POSTworkspaces/{workspace}:removeRepository
POSTworkspaces/{workspace}:removeUser
PATCHworkspaces/{workspace}/userNotificationSettings
PATCHworkspaces/{workspace}/workspaceNotificationSettings
DELETEworkspaces/{workspace}/assessments/{assessment}
POSTworkspaces/{workspace}/assessments:generate
GETworkspaces/{workspace}/assessments/{assessment}
GETworkspaces/{workspace}/assessments
PATCHworkspaces/{workspace}/assessments/{assessment}
POSTworkspaces/{workspace}/contexts
DELETEworkspaces/{workspace}/contexts/{context}
GETworkspaces/{workspace}/contexts/{context}
POSTworkspaces/{workspace}/contexts:initiateOAuth
GETworkspaces/{workspace}/contexts
PATCHworkspaces/{workspace}/contexts/{context}
GETworkspaces/{workspace}/contexts:search
GETworkspaces/{workspace}/eventDeliveries/{eventDeliverie}
GETworkspaces/{workspace}/eventDeliveries
GETworkspaces/{workspace}/events
POSTworkspaces/{workspace}/events/{event}:replay
GETworkspaces/{workspace}/feedback:batchGet
POSTworkspaces/{workspace}/fileSystemEntries
DELETEworkspaces/{workspace}/fileSystemEntries/{fileSystemEntrie}
GETworkspaces/{workspace}/fileSystemEntries/{fileSystemEntrie}
GETworkspaces/{workspace}/fileSystemEntries
PATCHworkspaces/{workspace}/fileSystemEntries/{fileSystemEntrie}
DELETEworkspaces/{workspace}/files/{file}
GETworkspaces/{workspace}/files/{file}
GETworkspaces/{workspace}/files
GETworkspaces/{workspace}/goalTemplates
POSTworkspaces/{workspace}/goals
DELETEworkspaces/{workspace}/goals/{goal}
GETworkspaces/{workspace}/goals/{goal}
GETworkspaces/{workspace}/goals/{goal}/insightGeneration
GETworkspaces/{workspace}/goals
PATCHworkspaces/{workspace}/goals/{goal}
POSTworkspaces/{workspace}/goals/suggest
GETworkspaces/{workspace}/goals/{goal}/insightGeneration:queryStatusUpdates
GETworkspaces/{workspace}/insights:batchGet
POSTworkspaces/{workspace}/insights/{insight}:dismiss
POSTworkspaces/{workspace}/insights/generate
GETworkspaces/{workspace}/insights/{insight}
GETworkspaces/{workspace}/insights/{insight}/investigationReport
GETworkspaces/{workspace}/insights/summary
GETworkspaces/{workspace}/insights
POSTworkspaces/{workspace}/insights/{insight}/setReadStatus
POSTworkspaces/{workspace}/insights/{insight}:undismiss
POSTworkspaces/{workspace}/insights/{insight}/feedback
DELETEworkspaces/{workspace}/insights/{insight}/feedback/{feedback}
GETworkspaces/{workspace}/insights/{insight}/feedback/{feedback}
GETworkspaces/{workspace}/insights/{insight}/feedback
PATCHworkspaces/{workspace}/insights/{insight}/feedback/{feedback}
GETworkspaces/{workspace}/insights/{insight}/insightUpdates/{insightUpdate}/investigationReport
GETworkspaces/{workspace}/insights/{insight}/insightUpdates
POSTworkspaces/{workspace}/marketRadarCheckpoint/generate
POSTworkspaces/{workspace}/productMd:generate
GETworkspaces/{workspace}/productMd:getStatus
POSTworkspaces/{workspace}/skills
DELETEworkspaces/{workspace}/skills/{skill}
GETworkspaces/{workspace}/skills
PATCHworkspaces/{workspace}/skills/{skill}
DELETEworkspaces/{workspace}/toolProviders/{toolProvider}
DELETEworkspaces/{workspace}/toolProviders/{toolProvider}:deleteAuth
GETworkspaces/{workspace}/toolProviders
POSTworkspaces/{workspace}/toolProviders:upsert
POSTworkspaces/{workspace}/toolProviders/{toolProvider}:upsertAuth
GETworkspaces/{workspace}/users
POSTworkspaces/{workspace}/webhookConfigs
DELETEworkspaces/{workspace}/webhookConfigs/{webhookConfig}
GETworkspaces/{workspace}/webhookConfigs/{webhookConfig}
GETworkspaces/{workspace}/webhookConfigs
PATCHworkspaces/{workspace}/webhookConfigs/{webhookConfig}
PATCHworkspaces/{workspace}/webhookConfigs/{webhookConfig}/verify
GETworkspaces/{workspace}/webhookEvents/{webhookEvent}
GETworkspaces/{workspace}/webhookEvents
POSTworkspaces/{workspace}/webhookEvents/{webhookEvent}:send

clientNotices.fetch

为客户端获取动态公告、警告横幅、服务中断通知和免责声明。

stitch api -X POST clientNotices:fetch

contexts.parseMcpJson

将 MCP JSON 配置解析为规范化的工具提供方配置。

stitch api -X POST contexts:parseMcpJson

feedback.submit

提交产品反馈(例如来自 Stitch CLI 的反馈)。

stitch api -X POST feedback:submit

media.upload

创建文件。

stitch api -X POST workspaces/{workspace}/files

参数

名称位置类型描述
parent (required)pathstring必需。用于创建文件元数据的父工作区。格式:workspaces/{workspace}。

organizations.get

按资源名称获取单个组织。

stitch api organizations/{organization}

参数

名称位置类型描述
name (required)pathstring必需。要获取的组织资源名称。格式:organizations/{organization}

organizations.list

列出组织。

stitch api organizations

参数

名称位置类型描述
filterquerystring可选。用于筛选组织的 CEL 过滤表达式。
pageSizequeryinteger可选。返回组织的最大数量。
pageTokenquerystring可选。从之前的 ListOrganizations 调用收到的页面令牌。

tos.accept

记录已认证用户已接受指定的 ToS 版本。

stitch api -X POST tos:accept

tos.check

检查已认证用户是否已接受指定的 ToS 版本。

stitch api tos:check

参数

名称位置类型描述
userquerystring可选。用户的资源名称(可选)。默认为已认证用户(“users/me”)。
versionquerystring可选。要检查的 ToS 版本(可选)(例如 "2026-03-18")。如果省略,服务器将根据后端配置的当前有效 ToS 版本进行检查。

users.getPreferences

获取用户偏好设置。

stitch api users/{user}/preferences

参数

名称位置类型描述
name (required)pathstring必需。要获取的用户偏好设置资源名称。格式:users/{user}/preferences 或 users/me/preferences

users.updatePreferences

更新用户偏好设置。

stitch api -X PATCH users/{user}/preferences

参数

名称位置类型描述
name (required)pathstring标识符。用户偏好设置的资源名称。格式:users/{user}/preferences 或 users/me/preferences
updateMaskquerystring可选。要更新的字段列表。如果为空或包含“*”,则更新所有可变字段。

users.tos.accept

记录已认证用户已接受指定的 ToS 版本。

stitch api -X POST users/{user}/tos:accept

参数

名称位置类型描述
user (required)pathstring可选。用户的资源名称(可选)。默认为已认证用户(“users/me”)。

users.tos.check

检查已认证用户是否已接受指定的 ToS 版本。

stitch api users/{user}/tos:check

参数

名称位置类型描述
user (required)pathstring可选。用户的资源名称(可选)。默认为已认证用户(“users/me”)。
versionquerystring可选。要检查的 ToS 版本(可选)(例如 "2026-03-18")。如果省略,服务器将根据后端配置的当前有效 ToS 版本进行检查。

completeOAuth

通过将授权码兑换为令牌并安全存储,完成 OAuth 2.0 流程。这是一个无状态的自定义方法(AIP-136),因为工作区和提供方的身份被安全封装在 state_token 中并从中解析,而不是通过资源路径或父级集合来指定。

stitch api -X POST v2alpha:completeOAuth

workspaces.addRepository

向工作区添加仓库。

stitch api -X POST workspaces/{workspace}:addRepository

参数

名称位置类型描述
name (required)pathstring必需。要添加仓库的目标工作区资源名称。格式:workspaces/{workspace}

workspaces.addUser

向工作区添加用户。

stitch api -X POST workspaces/{workspace}:addUser

参数

名称位置类型描述
name (required)pathstring必需。要添加用户的目标工作区资源名称。格式:workspaces/{workspace}

workspaces.create

创建新工作区。

stitch api -X POST workspaces

创建用于在工作区中对工具包进行认证的连接链接。

stitch api -X POST workspaces/{workspace}:createToolkitConnectLink

参数

名称位置类型描述
parent (required)pathstring必需。要为其创建工具包连接链接的父工作区。格式:workspaces/{workspace}。

workspaces.delete

按资源名称删除工作区。

stitch api -X DELETE workspaces/{workspace}

参数

名称位置类型描述
name (required)pathstring必需。要删除的工作区资源名称。格式:workspaces/{workspace}

workspaces.get

按资源名称获取单个工作区。

stitch api workspaces/{workspace}

参数

名称位置类型描述
name (required)pathstring必需。要获取的工作区资源名称。格式:workspaces/{workspace}

workspaces.getMarketRadarCheckpoint

获取竞争性市场分析详情检查点。

stitch api workspaces/{workspace}/marketRadarCheckpoint

参数

名称位置类型描述
name (required)pathstring必需。市场雷达检查点的资源名称。格式:workspaces/{workspace}/marketRadarCheckpoint

workspaces.getUserNotificationSettings

获取调用方用户针对工作区的通知设置。

stitch api workspaces/{workspace}/userNotificationSettings

参数

名称位置类型描述
name (required)pathstring必需。用户通知设置的资源名称。格式:workspaces/{workspace}/userNotificationSettings

workspaces.getWorkspaceNotificationSettings

获取工作区级通知设置。

stitch api workspaces/{workspace}/workspaceNotificationSettings

参数

名称位置类型描述
name (required)pathstring必需。工作区通知设置的资源名称。格式:workspaces/{workspace}/workspaceNotificationSettings

workspaces.list

列出工作区。

stitch api workspaces

参数

名称位置类型描述
filterquerystring可选。用于筛选工作区的 CEL 过滤表达式。
pageSizequeryinteger可选。返回工作区的最大数量。
pageTokenquerystring可选。从之前的 ListWorkspaces 调用收到的页面令牌。

workspaces.patch

更新现有工作区。

stitch api -X PATCH workspaces/{workspace}

参数

名称位置类型描述
name (required)pathstring标识符。资源名称。格式:workspaces/{workspace}
updateMaskquerystring可选。要更新的字段列表。

workspaces.removeRepository

从工作区移除仓库。

stitch api -X POST workspaces/{workspace}:removeRepository

参数

名称位置类型描述
name (required)pathstring必需。要移除仓库的来源工作区资源名称。格式:workspaces/{workspace}

workspaces.removeUser

从工作区移除用户。

stitch api -X POST workspaces/{workspace}:removeUser

参数

名称位置类型描述
name (required)pathstring必需。要移除用户的来源工作区资源名称。格式:workspaces/{workspace}

workspaces.updateUserNotificationSettings

更新调用方用户针对工作区的通知设置。

stitch api -X PATCH workspaces/{workspace}/userNotificationSettings

参数

名称位置类型描述
name (required)pathstring标识符。资源名称。格式:workspaces/{workspace}/userNotificationSettings
updateMaskquerystring可选。要更新的字段列表。

workspaces.updateWorkspaceNotificationSettings

更新工作区级通知设置。

stitch api -X PATCH workspaces/{workspace}/workspaceNotificationSettings

参数

名称位置类型描述
name (required)pathstring标识符。资源名称。格式:workspaces/{workspace}/workspaceNotificationSettings
updateMaskquerystring可选。要更新的字段列表。

workspaces.assessments.delete

按名称删除评估。

stitch api -X DELETE workspaces/{workspace}/assessments/{assessment}

参数

名称位置类型描述
name (required)pathstring必需。要删除的评估资源名称。格式:workspaces/{workspace}/assessments/{assessment}

workspaces.assessments.generate

为一组洞察生成评估。

stitch api -X POST workspaces/{workspace}/assessments:generate

参数

名称位置类型描述
parent (required)pathstring必需。父工作区。格式:workspaces/{workspace}

workspaces.assessments.get

按名称获取单个评估。

stitch api workspaces/{workspace}/assessments/{assessment}

参数

名称位置类型描述
name (required)pathstring必需。要获取的评估资源名称。格式:workspaces/{workspace}/assessments/{assessment}

workspaces.assessments.list

列出工作区中的评估。

stitch api workspaces/{workspace}/assessments

参数

名称位置类型描述
filterquerystring可选。用于筛选评估的 AIP-160 过滤表达式。支持的字段:insights。例如 insights:"workspaces/123/insights/456"
pageSizequeryinteger可选。返回评估的最大数量。服务可能返回少于此值的结果。如果未指定,最多返回 20 个评估。最大值为 100;超过 100 的值将被强制限制为 100。
pageTokenquerystring可选。从之前的 ListAssessments 调用收到的页面令牌。提供此令牌可获取后续页面。
parent (required)pathstring必需。要列出评估的父工作区。格式:workspaces/{workspace}

workspaces.assessments.patch

更新评估。

stitch api -X PATCH workspaces/{workspace}/assessments/{assessment}

参数

名称位置类型描述
name (required)pathstring标识符。评估的完整资源名称。格式:workspaces/{workspace}/assessments/{assessment}
updateMaskquerystring可选。指定要更新哪些字段的掩码。

workspaces.contexts.create

将新的上下文摄取到工作区中。

stitch api -X POST workspaces/{workspace}/contexts

参数

名称位置类型描述
parent (required)pathstring必需。要在其中创建上下文的父工作区。格式:workspaces/{workspace}。

workspaces.contexts.delete

删除工作区中的上下文。

stitch api -X DELETE workspaces/{workspace}/contexts/{context}

参数

名称位置类型描述
name (required)pathstring必需。要删除的上下文资源名称。格式:workspaces/{workspace}/contexts/{context}。

workspaces.contexts.get

按 id 获取上下文。

stitch api workspaces/{workspace}/contexts/{context}

参数

名称位置类型描述
name (required)pathstring必需。要获取的上下文资源名称。格式:workspaces/{workspace}/contexts/{context}。

workspaces.contexts.initiateOAuth

为工具提供方发起 OAuth 2.0 流程。返回调用方应将用户重定向到的授权 URL。

stitch api -X POST workspaces/{workspace}/contexts:initiateOAuth

参数

名称位置类型描述
parent (required)pathstring必需。要为其发起 OAuth 的父工作区。格式:workspaces/{workspace}。

workspaces.contexts.list

列出工作区中的上下文。

stitch api workspaces/{workspace}/contexts

参数

名称位置类型描述
filterquerystring可选。用于缩小返回上下文范围的 AIP-160 过滤表达式。支持的过滤字段:- data_source:对上下文的数据源进行等值匹配。示例:data_source = "user_feedback" - annotations.:对注解值进行等值匹配。示例:annotations.env = "prod" - description:使用 HAS (:) 运算符进行子串匹配。示例:description : "error" - data:使用 HAS (:) 运算符进行子串匹配。示例:data : "exception" - create_time:使用 RFC 3339 时间戳进行不等值匹配(<=、<、>=、>)。示例:create_time >= "2024-01-01T00:00:00Z" 仅支持使用 AND 的复合表达式:data_source = "notes" AND description : "bug" 对于格式错误或不支持的过滤条件,返回 INVALID_ARGUMENT。
orderByquerystring可选。返回上下文的排序顺序。
pageSizequeryinteger可选。返回上下文的最大数量。服务可能返回少于此值的结果。如果未指定,最多返回 50 个上下文。最大值为 1000;超过 1000 的值将被强制限制为 1000。
pageTokenquerystring可选。从之前的 ListContexts 调用收到的页面令牌。提供此令牌可获取后续页面。
parent (required)pathstring必需。要列出上下文的工作区。格式:workspaces/{workspace}。

workspaces.contexts.patch

更新工作区中的现有上下文。

stitch api -X PATCH workspaces/{workspace}/contexts/{context}

参数

名称位置类型描述
name (required)pathstring仅输出。标识符。上下文的完整资源名称。格式:workspaces/{workspace}/contexts/{context}
updateMaskquerystring可选。要更新的字段列表。

使用向量嵌入按语义相似度搜索上下文。

stitch api workspaces/{workspace}/contexts:search

参数

名称位置类型描述
filterquerystring可选。用于缩小返回上下文范围的 AIP-160 过滤表达式。遵循 https://google.aip.dev/160 支持的过滤字段:- data_source:对上下文的数据源进行等值匹配。示例:data_source = "user_feedback" - annotations.:对注解值进行等值匹配。示例:annotations.env = "prod" - description:使用 HAS (:) 运算符进行子串匹配。示例:description : "error" - data:使用 HAS (:) 运算符进行子串匹配。示例:data : "exception" - create_time:使用 RFC 3339 时间戳进行不等值匹配(<=、<、>=、>)。示例:create_time >= "2024-01-01T00:00:00Z"
maxResultsqueryinteger可选。已废弃:请改用 page_size。
pageSizequeryinteger可选。返回搜索结果的最大数量。如果未指定,最多返回 10 条结果。最大值为 100;超过 100 的值将被强制限制为 100。
pageTokenquerystring可选。从之前的 SearchContexts 调用收到的页面令牌。提供此令牌可获取后续页面。
parent (required)pathstring必需。要在其中搜索上下文的父工作区。格式:workspaces/{workspace}。
queryquerystring必需。自然语言搜索查询。
readMaskquerystring可选。指定要返回 Context 的哪些字段的掩码(可选)。

workspaces.eventDeliveries.get

按资源名称获取单次事件投递。

stitch api workspaces/{workspace}/eventDeliveries/{eventDeliverie}

参数

名称位置类型描述
name (required)pathstring必需。事件投递的资源名称。格式:workspaces/{workspace}/eventDeliveries/{event_delivery}

workspaces.eventDeliveries.list

列出工作区的事件投递。

stitch api workspaces/{workspace}/eventDeliveries

参数

名称位置类型描述
filterquerystring可选。针对 status 和/或 event_type 的 AIP-160 过滤表达式。
pageSizequeryinteger可选。返回投递事件的最大数量。
pageTokenquerystring可选。用于分页的令牌(可选)。
parent (required)pathstring必需。要列出事件投递的工作区。格式:workspaces/{workspace}

workspaces.events.list

列出工作区的通知事件。

stitch api workspaces/{workspace}/events

参数

名称位置类型描述
pageSizequeryinteger可选。返回事件的最大数量。
pageTokenquerystring可选。用于分页的令牌。
parent (required)pathstring必需。要列出事件的工作区。格式:workspaces/{workspace}

workspaces.events.replay

将通知事件重放给一个或多个订阅方。

stitch api -X POST workspaces/{workspace}/events/{event}:replay

参数

名称位置类型描述
name (required)pathstring必需。要重放的事件资源名称。格式:workspaces/{workspace}/events/{event}

workspaces.feedback.batchGet

批量获取多个洞察的反馈条目。

stitch api workspaces/{workspace}/feedback:batchGet

参数

名称位置类型描述
namesquerystring必需。要获取反馈的洞察资源名称。格式:workspaces/{workspace}/insights/{insight}
parent (required)pathstring必需。包含这些洞察的父工作区。格式:workspaces/{workspace}

workspaces.fileSystemEntries.create

在给定路径创建文件系统条目。

stitch api -X POST workspaces/{workspace}/fileSystemEntries

参数

名称位置类型描述
fileSystemEntryIdquerystring可选。用于文件系统条目的 ID,它将成为该文件系统条目资源名称的最后一段。
parent (required)pathstring必需。要在其中创建条目的父工作区。格式:workspaces/{workspace}。

workspaces.fileSystemEntries.delete

删除给定路径的文件系统条目。

stitch api -X DELETE workspaces/{workspace}/fileSystemEntries/{fileSystemEntrie}

参数

名称位置类型描述
name (required)pathstring必需。要删除的文件系统条目名称。格式:workspaces/{workspace}/fileSystemEntries/{file_system_entry}

workspaces.fileSystemEntries.get

按路径获取文件系统条目。

stitch api workspaces/{workspace}/fileSystemEntries/{fileSystemEntrie}

参数

名称位置类型描述
name (required)pathstring必需。要获取的文件系统条目名称。格式:workspaces/{workspace}/fileSystemEntries/{file_system_entry}

workspaces.fileSystemEntries.list

列出工作区中的文件系统条目。

stitch api workspaces/{workspace}/fileSystemEntries

参数

名称位置类型描述
filterquerystring可选。标准过滤字符串。
pageSizequeryinteger可选。返回条目的最大数量。
pageTokenquerystring可选。用于分页的页面令牌。
parent (required)pathstring必需。要列出条目的父工作区。格式:workspaces/{workspace}。

workspaces.fileSystemEntries.patch

更新给定路径的文件系统条目。

stitch api -X PATCH workspaces/{workspace}/fileSystemEntries/{fileSystemEntrie}

参数

名称位置类型描述
name (required)pathstring标识符。文件系统条目的资源名称。格式:workspaces/{workspace}/fileSystemEntries/{file_system_entry} {file_system_entry} 片段是用户指定的相对 path。
updateMaskquerystring可选。要更新的字段列表。

workspaces.files.delete

从工作区中删除文件。

stitch api -X DELETE workspaces/{workspace}/files/{file}

参数

名称位置类型描述
name (required)pathstring必需。要删除的文件资源名称。格式:workspaces/{workspace}/files/{file}。

workspaces.files.get

按 id 获取文件。

stitch api workspaces/{workspace}/files/{file}

参数

名称位置类型描述
name (required)pathstring必需。要获取的文件资源名称。格式:workspaces/{workspace}/files/{file}。

workspaces.files.list

列出工作区中的文件。

stitch api workspaces/{workspace}/files

参数

名称位置类型描述
filterquerystring可选。用于缩小返回文件范围的 AIP-160 过滤表达式。遵循 https://google.aip.dev/160 支持的过滤字段:- annotations.:对存储在 FileAnnotations 表中的注解值进行等值匹配。仅支持 =(EQUALS)比较器。示例:annotations.env = "prod" 仅支持使用 AND 的复合表达式:annotations.env = "prod" AND annotations.team = "ai" 不支持对其他字段(例如 display_name)进行过滤,这类过滤会返回 INVALID_ARGUMENT。对于格式错误或不支持的过滤条件,返回 INVALID_ARGUMENT。
orderByquerystring可选。返回文件的排序顺序。
pageSizequeryinteger可选。返回文件的最大数量。
pageTokenquerystring可选。从之前的 ListFiles 调用收到的页面令牌。
parent (required)pathstring必需。要列出文件的工作区。格式:workspaces/{workspace}。

workspaces.goalTemplates.list

列出工作区可用的入门目标模板。

stitch api workspaces/{workspace}/goalTemplates

参数

名称位置类型描述
filterquerystring可选。用于筛选目标模板的 AIP-160 过滤表达式。遵循 https://google.aip.dev/160
pageSizequeryinteger可选。返回目标模板的最大数量。服务可能返回少于此值的结果。如果未指定,最多返回 20 个模板。最大值为 100;超过 100 的值将被强制限制为 100。
pageTokenquerystring可选。从之前的 ListGoalTemplates 调用收到的页面令牌。提供此令牌可获取后续页面。
parent (required)pathstring必需。将在其中创建目标的父工作区。格式:workspaces/{workspace}
readMaskquerystring可选。指定要读取哪些字段的掩码(可选)。

workspaces.goals.create

在指定工作区中创建新目标。

stitch api -X POST workspaces/{workspace}/goals

参数

名称位置类型描述
parent (required)pathstring必需。要在其中创建目标的父工作区。格式:workspaces/{workspace}

workspaces.goals.delete

删除目标。

stitch api -X DELETE workspaces/{workspace}/goals/{goal}

参数

名称位置类型描述
name (required)pathstring必需。要删除的目标资源名称。格式:workspaces/{workspace}/goals/{goal}

workspaces.goals.get

按资源名称获取单个目标。

stitch api workspaces/{workspace}/goals/{goal}

参数

名称位置类型描述
name (required)pathstring必需。要获取的目标资源名称。格式:workspaces/{workspace}/goals/{goal}
readMaskquerystring可选。指定要读取哪些字段的掩码(可选)。

workspaces.goals.getInsightGeneration

获取最近一次洞察生成运行的状态和状态信息。

stitch api workspaces/{workspace}/goals/{goal}/insightGeneration

参数

名称位置类型描述
name (required)pathstring必需。洞察生成状态的资源名称。格式:workspaces/{workspace}/goals/{goal}/insightGeneration。

workspaces.goals.list

列出工作区中的目标。

stitch api workspaces/{workspace}/goals

参数

名称位置类型描述
filterquerystring可选。用于筛选目标的 AIP-160 过滤表达式。
pageSizequeryinteger可选。返回目标的最大数量。服务可能返回少于此值的结果。如果未指定,最多返回 20 个目标。最大值为 100;超过 100 的值将被强制限制为 100。
pageTokenquerystring可选。从之前的 ListGoals 调用收到的页面令牌。提供此令牌可获取后续页面。
parent (required)pathstring必需。要列出目标的父工作区。格式:workspaces/{workspace}
readMaskquerystring可选。指定要读取哪些字段的掩码(可选)。

workspaces.goals.patch

更新现有目标。

stitch api -X PATCH workspaces/{workspace}/goals/{goal}

参数

名称位置类型描述
name (required)pathstring标识符。目标的完整资源名称。格式:workspaces/{workspace}/goals/{goal}
updateMaskquerystring可选。要更新的字段列表。

workspaces.goals.suggest

为工作区推荐目标。

stitch api -X POST workspaces/{workspace}/goals/suggest

参数

名称位置类型描述
parent (required)pathstring必需。将在其中推荐目标的父工作区。格式:workspaces/{workspace}

workspaces.goals.insightGeneration.queryStatusUpdates

查询洞察生成运行期间发出的中间状态更新。

stitch api workspaces/{workspace}/goals/{goal}/insightGeneration:queryStatusUpdates

参数

名称位置类型描述
name (required)pathstring必需。洞察生成状态的资源名称。格式:workspaces/{workspace}/goals/{goal}/insightGeneration。
pageSizequeryinteger可选。返回状态更新的最大数量。
pageTokenquerystring可选。从之前的调用收到的页面令牌,用于仅获取新发出的更新。

workspaces.insights.batchGet

按名称获取多个洞察。

stitch api workspaces/{workspace}/insights:batchGet

参数

名称位置类型描述
namesquerystring必需。要获取的洞察名称。单次批量最多可获取 100 个洞察。格式:workspaces/{workspace}/insights/{insight}
parent (required)pathstring必需。包含这些洞察的父工作区。格式:workspaces/{workspace}

workspaces.insights.dismiss

忽略某个洞察。

stitch api -X POST workspaces/{workspace}/insights/{insight}:dismiss

参数

名称位置类型描述
name (required)pathstring必需。要忽略的洞察资源名称。格式:workspaces/{workspace}/insights/{insight}。

workspaces.insights.generate

为工作区中的一组目标生成洞察。

stitch api -X POST workspaces/{workspace}/insights/generate

参数

名称位置类型描述
parent (required)pathstring必需。触发洞察生成的父工作区。格式:workspaces/{workspace}

workspaces.insights.get

按名称获取单个洞察。

stitch api workspaces/{workspace}/insights/{insight}

参数

名称位置类型描述
name (required)pathstring必需。要获取的洞察资源名称。格式:workspaces/{workspace}/insights/{insight}。

workspaces.insights.getInvestigationReport

获取某个洞察或某次特定洞察更新的调查报告。如果请求针对某个洞察(workspaces/{workspace}/insights/{insight}/investigationReport),将返回最新的调查报告(对应最近一次洞察更新)。如果请求针对某次特定洞察更新(workspaces/{workspace}/insights/{insight}/insightUpdates/{insight_update}/investigationReport),则返回该次更新时的调查报告。

stitch api workspaces/{workspace}/insights/{insight}/investigationReport

参数

名称位置类型描述
name (required)pathstring必需。调查报告的资源名称。格式:- workspaces/{workspace}/insights/{insight}/investigationReport,用于获取该洞察的最新调查报告(对应 ## 最近一次洞察更新)。workspaces/{workspace}/insights/{insight}/insightUpdates/{insight_update}/investigationReport,用于获取某次特定洞察更新的调查报告。

workspaces.insights.getSummary

按状态获取工作区洞察数量的摘要。

stitch api workspaces/{workspace}/insights/summary

参数

名称位置类型描述
filterquerystring可选。用于筛选洞察摘要的 AIP-160 过滤表达式。
name (required)pathstring必需。要查询洞察摘要的父工作区。格式:workspaces/{workspace}。

workspaces.insights.list

列出工作区中的洞察。

stitch api workspaces/{workspace}/insights

参数

名称位置类型描述
filterquerystring可选。用于筛选洞察的 AIP-160 过滤表达式。支持的字段:“state”、“goal_ids”。
pageSizequeryinteger可选。返回洞察的最大数量。服务可能返回少于此值的结果。如果未指定,最多返回 20 个洞察。最大值为 100;超过 100 的值将被强制限制为 100。
pageTokenquerystring可选。从之前的 ListInsights 调用收到的页面令牌。提供此令牌可获取后续页面。
parent (required)pathstring必需。要列出洞察的父工作区。格式:workspaces/{workspace}。
readMaskquerystring可选。指定要读取哪些字段的掩码(可选)。不支持通配符 *。

workspaces.insights.setReadStatus

设置某个洞察针对用户的已读/未读状态。

stitch api -X POST workspaces/{workspace}/insights/{insight}/setReadStatus

参数

名称位置类型描述
name (required)pathstring必需。洞察的资源名称。格式:workspaces/{workspace}/insights/{insight}

workspaces.insights.undismiss

取消忽略某个洞察。

stitch api -X POST workspaces/{workspace}/insights/{insight}:undismiss

参数

名称位置类型描述
name (required)pathstring必需。要取消忽略的洞察资源名称。格式:workspaces/{workspace}/insights/{insight}。

workspaces.insights.feedback.create

提交对某个洞察的反馈。

stitch api -X POST workspaces/{workspace}/insights/{insight}/feedback

参数

名称位置类型描述
insightFeedbackIdquerystring可选。用于反馈的 ID,它将成为该反馈资源名称的最后一段。不支持客户端指定的 ID。此字段必须为空。
parent (required)pathstring必需。父级洞察资源名称。格式:workspaces/{workspace}/insights/{insight}

workspaces.insights.feedback.delete

删除洞察反馈条目。

stitch api -X DELETE workspaces/{workspace}/insights/{insight}/feedback/{feedback}

参数

名称位置类型描述
name (required)pathstring必需。要删除的反馈条目资源名称。格式:workspaces/{workspace}/insights/{insight}/feedback/{feedback} 支持虚拟资源别名 like(依据 AIP-122),可直接作用于已认证调用方的点赞记录,而无需预先获取其 ID。

workspaces.insights.feedback.get

获取洞察的特定反馈条目。

stitch api workspaces/{workspace}/insights/{insight}/feedback/{feedback}

参数

名称位置类型描述
name (required)pathstring必需。反馈条目的资源名称。格式:workspaces/{workspace}/insights/{insight}/feedback/{feedback} 支持虚拟资源别名 like(依据 AIP-122),可直接作用于已认证调用方的点赞记录,而无需预先获取其 ID。

workspaces.insights.feedback.list

列出洞察上的反馈条目。

stitch api workspaces/{workspace}/insights/{insight}/feedback

参数

名称位置类型描述
pageSizequeryinteger可选。返回反馈条目的最大数量。
pageTokenquerystring可选。从之前的 ListInsightFeedbacks 调用收到的页面令牌。
parent (required)pathstring必需。要列出反馈的父级洞察。格式:workspaces/{workspace}/insights/{insight}

workspaces.insights.feedback.patch

更新现有洞察反馈提交。

stitch api -X PATCH workspaces/{workspace}/insights/{insight}/feedback/{feedback}

参数

名称位置类型描述
name (required)pathstring标识符。反馈条目的完整资源名称。格式:workspaces/{workspace}/insights/{insight}/feedback/{feedback}
updateMaskquerystring可选。要更新的字段列表。

workspaces.insights.insightUpdates.getInvestigationReport

获取某个洞察或某次特定洞察更新的调查报告。如果请求针对某个洞察(workspaces/{workspace}/insights/{insight}/investigationReport),将返回最新的调查报告(对应最近一次洞察更新)。如果请求针对某次特定洞察更新(workspaces/{workspace}/insights/{insight}/insightUpdates/{insight_update}/investigationReport),则返回该次更新时的调查报告。

stitch api workspaces/{workspace}/insights/{insight}/insightUpdates/{insightUpdate}/investigationReport

参数

名称位置类型描述
name (required)pathstring必需。调查报告的资源名称。格式:- workspaces/{workspace}/insights/{insight}/investigationReport,用于获取该洞察的最新调查报告(对应 ## 最近一次洞察更新)。workspaces/{workspace}/insights/{insight}/insightUpdates/{insight_update}/investigationReport,用于获取某次特定洞察更新的调查报告。

workspaces.insights.insightUpdates.list

列出某个洞察的更新。

stitch api workspaces/{workspace}/insights/{insight}/insightUpdates

参数

名称位置类型描述
filterquerystring可选。用于筛选洞察更新的 AIP-160 过滤表达式。支持的字段:substantive、source、create_time、description。
orderByquerystring可选。用于对洞察更新排序的字段。支持的语法遵循 AIP-132(例如 create_time、create_time desc)。支持的字段:create_time。如果为空,默认为 create_time desc。
pageSizequeryinteger可选。返回洞察更新的最大数量。服务可能返回少于此值的结果。如果未指定,最多返回 20 条洞察更新。最大值为 100;超过 100 的值将被强制限制为 100。
pageTokenquerystring可选。从之前的 ListInsightUpdates 调用收到的页面令牌。提供此令牌可获取后续页面。
parent (required)pathstring必需。要列出更新的父级洞察。格式:workspaces/{workspace}/insights/{insight}。
readMaskquerystring可选。指定要读取哪些字段的掩码(可选)。不支持通配符 *。

workspaces.marketRadarCheckpoint.generate

触发市场雷达检查点的后台生成。

stitch api -X POST workspaces/{workspace}/marketRadarCheckpoint/generate

参数

名称位置类型描述
parent (required)pathstring必需。要触发市场雷达生成的父工作区。格式:workspaces/{workspace}

workspaces.productMd.generate

为工作区启动 ProductMd 智能体。

stitch api -X POST workspaces/{workspace}/productMd:generate

参数

名称位置类型描述
parent (required)pathstring必需。要为其生成 ProductMd 的工作区资源名称。格式:workspaces/{workspace}

workspaces.productMd.getStatus

轮询正在运行的 ProductMd 智能体发出的中间状态更新。

stitch api workspaces/{workspace}/productMd:getStatus

参数

名称位置类型描述
agencySessionIdquerystring可选。已废弃:请改用 execution_id。GenerateProductMd 返回的 agency 会话 ID。
continuationTokenquerystring可选。来自之前 GetProductMdStatus 响应的续传令牌。
executionIdquerystring可选。GenerateProductMd 返回的执行 ID。
parent (required)pathstring必需。工作区的资源名称。格式:workspaces/{workspace}

workspaces.skills.create

在工作区中创建技能。

stitch api -X POST workspaces/{workspace}/skills

参数

名称位置类型描述
parent (required)pathstring必需。要在其中创建技能的父工作区。格式:workspaces/{workspace}。
skillIdquerystring可选。用于技能的 ID,它将成为该技能资源名称的最后一段(workspaces/{workspace}/skills/{skill_id})。服务器不会生成 ID,因此必须在此处或通过 skill.name 提供该 ID。如果两者都设置了,它们必须一致,否则返回 INVALID_ARGUMENT。

workspaces.skills.delete

删除工作区中的技能。

stitch api -X DELETE workspaces/{workspace}/skills/{skill}

参数

名称位置类型描述
name (required)pathstring必需。要删除的技能名称。格式:workspaces/{workspace}/skills/{skill}

workspaces.skills.list

列出工作区中的技能。

stitch api workspaces/{workspace}/skills

参数

名称位置类型描述
filterquerystring可选。标准过滤字符串。
pageSizequeryinteger可选。返回技能的最大数量。
pageTokenquerystring可选。用于分页的页面令牌。
parent (required)pathstring必需。要列出技能的父工作区。格式:workspaces/{workspace}。

workspaces.skills.patch

更新工作区中的技能。

stitch api -X PATCH workspaces/{workspace}/skills/{skill}

参数

名称位置类型描述
allowMissingqueryboolean可选。如果设为 true,并且未找到该技能,将创建一个新技能。
name (required)pathstring标识符。技能的资源名称。格式:workspaces/{workspace}/skills/{skill}
updateMaskquerystring可选。要更新的字段列表。

workspaces.toolProviders.delete

删除用户的工具提供方配置。

stitch api -X DELETE workspaces/{workspace}/toolProviders/{toolProvider}

参数

名称位置类型描述
name (required)pathstring必需。要删除的工具提供方资源名称。格式:workspaces/{workspace}/toolProviders/{tool_provider}

workspaces.toolProviders.deleteAuth

删除工具提供方的所有认证凭据。

stitch api -X DELETE workspaces/{workspace}/toolProviders/{toolProvider}:deleteAuth

参数

名称位置类型描述
name (required)pathstring必需。要删除其认证凭据的工具提供方资源名称。格式:workspaces/{workspace}/toolProviders/{tool_provider}

workspaces.toolProviders.list

列出工作区可用的工具提供方。

stitch api workspaces/{workspace}/toolProviders

参数

名称位置类型描述
filterquerystring可选。AIP-160 过滤表达式。
orderByquerystring可选。工具提供方的排序顺序。
pageSizequeryinteger可选。返回工具提供方的最大数量。
pageTokenquerystring可选。用于分页的页面令牌。
parent (required)pathstring必需。要列出工具提供方的工作区。格式:workspaces/{workspace}。

workspaces.toolProviders.upsert

插入或更新用户的工具提供方配置。

stitch api -X POST workspaces/{workspace}/toolProviders:upsert

参数

名称位置类型描述
parent (required)pathstring必需。要在其中插入或更新工具提供方的父工作区。格式:workspaces/{workspace}。

workspaces.toolProviders.upsertAuth

替换工具提供方的完整认证标头集合。

stitch api -X POST workspaces/{workspace}/toolProviders/{toolProvider}:upsertAuth

参数

名称位置类型描述
name (required)pathstring必需。要更新其认证信息的工具提供方资源名称。格式:workspaces/{workspace}/toolProviders/{tool_provider}

workspaces.users.list

列出工作区中的用户。

stitch api workspaces/{workspace}/users

参数

名称位置类型描述
filterquerystring可选。用于筛选用户的 CEL 过滤表达式。
pageSizequeryinteger可选。返回用户的最大数量。
pageTokenquerystring可选。从之前的 ListUsers 调用收到的页面令牌。
parent (required)pathstring必需。要列出用户的工作区资源名称。格式:workspaces/{workspace}

workspaces.webhookConfigs.create

在指定工作区中创建新的 webhook 配置。

stitch api -X POST workspaces/{workspace}/webhookConfigs

参数

名称位置类型描述
parent (required)pathstring必需。要在其中创建 webhook 配置的父工作区。格式:workspaces/{workspace}

workspaces.webhookConfigs.delete

按其资源名称删除 webhook 配置。

stitch api -X DELETE workspaces/{workspace}/webhookConfigs/{webhookConfig}

参数

名称位置类型描述
name (required)pathstring必需。要删除的 webhook 配置资源名称。格式:workspaces/{workspace}/webhookConfigs/{webhook_config}

workspaces.webhookConfigs.get

按其资源名称获取单个 webhook 配置。

stitch api workspaces/{workspace}/webhookConfigs/{webhookConfig}

参数

名称位置类型描述
name (required)pathstring必需。要获取的 webhook 配置资源名称。格式:workspaces/{workspace}/webhookConfigs/{webhook_config}

workspaces.webhookConfigs.list

列出工作区的所有 webhook 配置。

stitch api workspaces/{workspace}/webhookConfigs

参数

名称位置类型描述
pageSizequeryinteger可选。每页返回 webhook 配置的最大数量。允许的最大值为 100。
pageTokenquerystring可选。从之前的 ListWebhookConfigs 调用收到的页面令牌。提供此令牌可获取后续页面。
parent (required)pathstring必需。要列出 webhook 配置的父工作区。格式:workspaces/{workspace}

workspaces.webhookConfigs.patch

更新现有 webhook 配置。仅修改更新掩码中指定的字段。

stitch api -X PATCH workspaces/{workspace}/webhookConfigs/{webhookConfig}

参数

名称位置类型描述
name (required)pathstring标识符。webhook 配置的资源名称。格式:workspaces/{workspace}/webhookConfigs/{webhook_config}
updateMaskquerystring可选。要更新的字段列表。如果未设置,则更新所有可变字段。

workspaces.webhookConfigs.verify

通过发送质询请求并确认端点正确回显来验证 webhook 端点。

stitch api -X PATCH workspaces/{workspace}/webhookConfigs/{webhookConfig}/verify

参数

名称位置类型描述
name (required)pathstring必需。要验证的 webhook 配置资源名称。格式:workspaces/{workspace}/webhookConfigs/{webhook_config}

workspaces.webhookEvents.get

按其资源名称获取单个 webhook 事件。

stitch api workspaces/{workspace}/webhookEvents/{webhookEvent}

参数

名称位置类型描述
name (required)pathstring必需。要获取的 webhook 事件资源名称。格式:workspaces/{workspace}/webhookEvents/{webhook_event}

workspaces.webhookEvents.list

列出工作区的所有 webhook 事件。

stitch api workspaces/{workspace}/webhookEvents

参数

名称位置类型描述
filterquerystring可选。用于筛选响应中所返回 webhook 事件的过滤表达式。支持对 ‘delivery_state’ 和 ‘event_type’ 进行过滤。
pageSizequeryinteger可选。每页返回 webhook 事件的最大数量。允许的最大值为 100。
pageTokenquerystring可选。从之前的 ListWebhookEvents 调用收到的页面令牌。提供此令牌可获取后续页面。
parent (required)pathstring必需。要列出 webhook 事件的父工作区。格式:workspaces/{workspace}

workspaces.webhookEvents.send

将 webhook 事件负载投递到其配置的端点。可用于手动重新投递事件。

stitch api -X POST workspaces/{workspace}/webhookEvents/{webhookEvent}:send

参数

名称位置类型描述
name (required)pathstring必需。要发送的 webhook 事件资源名称。格式:workspaces/{workspace}/webhookEvents/{webhook_event}

原文: https://stitch.withgoogle.com/docs/cli/reference/rest-api/

本页翻译自 Google Stitch 官方文档,原文版权归 Google LLC 所有。本站为独立第三方翻译,与 Google 无关联。