<span id="拒绝待确认工作流提案"></span>

# Reject a pending workflow proposal

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Reject a pending proposal while retaining accepted and saved plans. See [Common information](objects.md) for objects, variables, and environment boundaries.

```text
POST https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-candidates/reject-proposal
```

<span id="调用前准备"></span>

## Before you call this API

Prepare a personal access token with workflow operation privileges for the target workspace. Use conversations, tasks, and artifacts from the same environment. Install jq and set example variables.

<span id="请求体"></span>

## Request body

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl -X POST "https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-candidates/reject-proposal" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  --data-binary "$(jq -n --arg v0 "$PROPOSAL_ID" '{"proposal_id":$v0}')"
```

:::::
:::::{tab-item} Parameters

Reject only pending proposals, changing status to rejected. This neither revokes accepted records nor deletes or rolls back published workflows. Repeated rejection is not successful replay. Read history when the result is unknown rather than treating rejection as an idempotent write.

| Fields | Type | Required | Description |
| --- | --- | --- | --- |
| `proposal_id` | string | Yes | Pending proposal ID in the current workspace. |

:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "proposal_id": "proposal-1",
    "status": "rejected"
  }
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on success. |
| `msg` | string | Response information. |
| `data` | object | Result of this operation. |
| `data.proposal_id` | string | Rejected proposal. |
| `data.status` | string | rejected after success. |

:::::
::::::
:::::::

<span id="错误响应"></span>

## Error response

Handle HTTP status and business fields. History and recovery have dedicated errors; see [Errors and environments](objects.md#错误与环境). Retain identity, source references, and operation identifiers, then check state before proceeding. Do not automatically switch workspace, candidate, or confirmation key.
