Crescendo Lab 文档
简体中文
注册开始用

Deployments API 参考

Platform API v1 的 Deployments:每个操作的路径、参数、请求与回应字段、scope、幂等与错误,直接取自 API 合约。

最后更新

由 API 合约(Agent Lab Platform API 1.0.0-alpha.1)产生。说明文本是合约的英文原文。

What answers each channel entry point. An application deploys itself as an entry's responder, optionally with a deployed configuration: an agent configuration it publishes for the entry, which the platform runs on every event of the entry. Without one, the entry's events are delivered to the application (sdk-event/v1).

The workspace's channel deployments#

GET /v1/workspaces/{workspaceId}/deployments

Every channel entry point of the workspace and what answers it, active and disabled: an application (responder: "application"), or an assistant the console deployed (responder: "agent"). Of a deployed configuration only its agentRef, revision and time are answered. Any member may read it.

Scope身分验证方式Idempotency-Key
channels:readmemberinstallationToken—

参数

名称位置类型必填说明
workspaceIdpathstring是The workspace, by id. It must be the installation's.
Agentlab-On-Behalf-Ofheaderstring是The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again.
cursorquerystring否The nextCursor of the previous page. Opaque.
limitqueryinteger否Items per page. 默认值: 50.

回应

状态码内容说明
200application/json: DeploymentPageA page of deployments.
400application/json: ErrorThe request itself is wrong, such as a cursor this list did not answer (recovery: none).
401application/json: ErrorNo token, or a token the platform does not honor.
403application/json: ErrorRefused: SCOPE_NOT_GRANTED (configure); WORKSPACE_NOT_INSTALLED, the path names a workspace other than the installation's (configure); MEMBER_REQUIRED, no single Agentlab-On-Behalf-Of (none); MEMBER_NOT_AUTHORIZED, the named account is not a current member who signed in to the application here, or the member may not read or do this (authorize); SERVER_TO_SERVER_ONLY, sent from a browser (none); PRODUCT_ACCESS_DENIED, the workspace's plan does not include it (configure).
404application/json: ErrorNo such operation or resource.
429application/json: ErrorRate limited (recovery: retry).
503application/json: ErrorTry again later (recovery: retry).

Answer a channel entry point with this application#

POST /v1/workspaces/{workspaceId}/deployments

Makes the calling installation's application the responder of one entry point: a Slack workspace (entryKind: "slack", entryRef its team id), one Slack channel ("slack_channel", entryRef teamId/channelId) or a LINE official account ("line", entryRef its destination id), held by a channel connection of this workspace. The acting member must be one who may manage the workspace (MEMBER_NOT_AUTHORIZED). An entry point something already answers is ENTRY_ALREADY_DEPLOYED; one the workspace does not hold is not found.

With agent, the entry gets a deployed configuration as its revision 1: the platform runs every event of the entry with it, for the acting member, and the application's server need not be up. It is checked as POST …/runs checks a run's configuration, for the acting member, and every problem is answered at once (RUN_CONFIGURATION_INVALID); its MCP connections must be organization-shared ones, because its answers reach everyone in the channel. Without agent, the entry's events are delivered to the application as sdk-event/v1 (which needs channels:respond), and it answers them itself or with a run's replyTo.

Send Idempotency-Key: without one, a retried request may answer ENTRY_ALREADY_DEPLOYED.

Scope身分验证方式Idempotency-Key
deployments:writememberinstallationToken支持

参数

名称位置类型必填说明
workspaceIdpathstring是The workspace, by id. It must be the installation's.
Agentlab-On-Behalf-Ofheaderstring是The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again.
Idempotency-Keyheaderstring否Makes a creating call safe to retry. The same key and body within 24 hours answer the first answer again; the same key with a different body is 409.

请求内容

application/json: DeploymentCreate

字段类型必填说明
entryKindstring是slack, slack_channel or line; values may be added later.
entryRefstring是The entry point in the channel's own terms, as createDeployment describes.
agentAgentConfig否—

回应

状态码内容说明
201application/json: DeploymentThe deployment.
400application/json: ErrorThe request itself is wrong, such as a cursor this list did not answer (recovery: none).
401application/json: ErrorNo token, or a token the platform does not honor.
403application/json: ErrorRefused: SCOPE_NOT_GRANTED (configure); WORKSPACE_NOT_INSTALLED, the path names a workspace other than the installation's (configure); MEMBER_REQUIRED, no single Agentlab-On-Behalf-Of (none); MEMBER_NOT_AUTHORIZED, the named account is not a current member who signed in to the application here, or the member may not read or do this (authorize); SERVER_TO_SERVER_ONLY, sent from a browser (none); PRODUCT_ACCESS_DENIED, the workspace's plan does not include it (configure).
404application/json: ErrorNo such operation or resource.
409application/json: ErrorNothing changed: REVISION_CONFLICT, the entry's deployed configuration is no longer the revision named, read the deployment again (none); ENTRY_ALREADY_DEPLOYED, something already answers the entry point (none); or the Idempotency-Key conflict IdempotencyConflict describes.
413application/json: ErrorThe body is larger than the operation accepts (PAYLOAD_TOO_LARGE, recovery: none).
422application/json: ErrorRUN_CONFIGURATION_INVALID: the body or its configuration has problems, each in problems with its field (none); nothing was stored.
429application/json: ErrorRate limited (recovery: retry).
503application/json: ErrorTry again later (recovery: retry).

Publish a deployed configuration for an entry point#

PUT /v1/workspaces/{workspaceId}/deployments/{deploymentId}/agent

Replaces the deployed configuration of an active entry point this application answers with agent, as its next revision, when the entry still holds expectedRevision (0 for an entry with none yet); otherwise REVISION_CONFLICT and nothing changes. The replacement is atomic: an event is answered by the configuration deployed when it arrived, never by a mix, and a run already started keeps the configuration it started with. The configuration is immutable once deployed; publishing again is another revision. It is checked as createDeployment checks one, for the acting member, who must be one who may manage the workspace; its runs then act for that member. An entry of another application, a disabled one or another workspace's is not found.

Scope身分验证方式Idempotency-Key
deployments:writememberinstallationToken—

参数

名称位置类型必填说明
workspaceIdpathstring是The workspace, by id. It must be the installation's.
Agentlab-On-Behalf-Ofheaderstring是The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again.
deploymentIdpathstring是The deployment, by id.

请求内容

application/json: DeployedAgentReplace

字段类型必填说明
agentAgentConfig是—
expectedRevisioninteger是The revision this replaces, as the deployment answered it; 0 for the first.

回应

状态码内容说明
200application/json: DeploymentThe deployment with its new revision.
400application/json: ErrorThe request itself is wrong, such as a cursor this list did not answer (recovery: none).
401application/json: ErrorNo token, or a token the platform does not honor.
403application/json: ErrorRefused: SCOPE_NOT_GRANTED (configure); WORKSPACE_NOT_INSTALLED, the path names a workspace other than the installation's (configure); MEMBER_REQUIRED, no single Agentlab-On-Behalf-Of (none); MEMBER_NOT_AUTHORIZED, the named account is not a current member who signed in to the application here, or the member may not read or do this (authorize); SERVER_TO_SERVER_ONLY, sent from a browser (none); PRODUCT_ACCESS_DENIED, the workspace's plan does not include it (configure).
404application/json: ErrorNo such operation or resource.
409application/json: ErrorNothing changed: REVISION_CONFLICT, the entry's deployed configuration is no longer the revision named, read the deployment again (none); ENTRY_ALREADY_DEPLOYED, something already answers the entry point (none); or the Idempotency-Key conflict IdempotencyConflict describes.
413application/json: ErrorThe body is larger than the operation accepts (PAYLOAD_TOO_LARGE, recovery: none).
422application/json: ErrorRUN_CONFIGURATION_INVALID: the body or its configuration has problems, each in problems with its field (none); nothing was stored.
429application/json: ErrorRate limited (recovery: retry).
503application/json: ErrorTry again later (recovery: retry).