Cancel the agent candidate plan

Cancel an unconfirmed agent candidate.

POST https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-builder/candidates/{agent_id}/candidate-versions/{candidate_version}/cancel

Preparation before calling

First generate the agent candidate program or regenerate the agent candidate program] to obtain the candidate version and source_digest. Prepare a personal access token with access to the target workspace, target workspace ID, agent ID, and release candidate.

The example below uses:

  • $AI_STUDIO_API_KEY: The actual personal access token, passed through the X-API-Key Header.

  • $WORKSPACE_ID: Target workspace ID, passed through the X-Workspace-ID Header and also as workspace_id in the path.

  • $AGENT_ID: Agent ID, as agent_id in the path.

  • $CANDIDATE_VERSION: Candidate version to cancel, as candidate_version in the path.

  • $SOURCE_DIGEST: Digest from the current candidate response for source_digest in the request body.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-builder/candidates/$AGENT_ID/candidate-versions/$CANDIDATE_VERSION/cancel" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "source_digest": "'"$SOURCE_DIGEST"'"
  }'

Path parameters

Parameters

Type

Is it required

Description

workspace_id

string

Yes

Workspace ID.

agent_id

string

Yes

Agent ID.

candidate_version

string

Yes

Candidate version to cancel.

Request body

Parameters

Type

Is it required

Description

source_digest

string

Yes

The digest in the current candidate response.

Successful response

Returns 200 on success. data returns the candidate after cancellation; status is superseded.

{
  "code": 0,
  "data": {
    "workspace_id": "ws_01",
    "agent_id": "agent_01",
    "candidate_version": "cand_01",
    "source_digest": "sha256:<HEX_DIGEST>",
    "status": "superseded",
    "display": {
      "agent_name": "产品助手"
    },
    "diagnostics": []
  }
}

The response fields are as follows.

Field

Type

Description

code

integer

0 on success.

data.workspace_id

string

The workspace, agent and version candidate to which the candidate belongs.

data.agent_id

string

The workspace, agent and version candidate to which the candidate belongs.

data.candidate_version

string

The workspace, agent and version candidate to which the candidate belongs.

data.source_digest

string

Content summary of canceled candidates.

data.status

string

superseded on success.

data.display

object

Display candidate content, diagnostics, and resolved resource references.

data.diagnostics

array

Candidate display content, diagnostics, and resolved resource references.

data.resolved_refs

object

Display candidate content, diagnostics, and resolved resource references.

Error response

{
  "code": 4,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

2INVALID_ARGUMENT

The request contains unknown fields or source_digest is invalid.

Check the request body.

401

6UNAUTHENTICATED

Lack of valid identity credentials.

Check API Key.

403

5PERMISSION_DENIED

The current identity does not have the authority to cancel candidacy.

Check workspace and agent authorizations.

404

3NOT_FOUND

Release candidate does not exist.

Check for release candidates.

409

4ALREADY_EXISTS

The digest does not match, the candidate has been replaced, or the current status does not allow cancellation.

Try again after getting the latest candidate.

500

1INTERNAL

An internal error occurred while canceling the candidate.

Try again later.

503

15UNAVAILABLE

Agent construction or authorization services are temporarily unavailable.

Try again later.

Follow-up operations

When you need to continue building, Generate agent candidate solutions.

Last updated on