Cancel the agent candidate plan

Cancel an unconfirmed agent candidate.

HTTP
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agent-builder/candidates/{agent_id}/candidate-versions/{candidate_version}/cancel

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

First generate the agent candidate program or regenerate the agent candidate program] to obtain the candidate version and source_digest.

Set the operation-specific values used in the request:

  • $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

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agent-builder/candidates/$AGENT_ID/candidate-versions/$CANDIDATE_VERSION/cancel" \
  -H "X-API-Key: $CLOUDSIGMA_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.

JSON
{
  "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

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

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

2(INVALID_ARGUMENT)

The request contains unknown fields or source_digest is invalid.

Check the request body.

401

6(UNAUTHENTICATED)

Lack of valid identity credentials.

Check API Key.

403

5(PERMISSION_DENIED)

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

Check workspace and agent authorizations.

404

3(NOT_FOUND)

Release candidate does not exist.

Check for release candidates.

409

4(ALREADY_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

1(INTERNAL)

An internal error occurred while canceling the candidate.

Try again later.

503

15(UNAVAILABLE)

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