---
title: "Update a suggestion"
method: PATCH
path: "/action_item/{actionItemId}/suggestions/{id}"
tags: ["Suggestion"]
---

# Update a suggestion

`PATCH /action_item/{actionItemId}/suggestions/{id}`

Update a suggestion. The `user_metadata` field is only editable when the suggestion is in `pending` or `failed` status.

To retry a failed suggestion, set `status` to `approved`.

## Path parameters

- `actionItemId` string, required
- `id` string, required

## Request body

- object
  - `status` 'approved' — Set to `approved` to retry a failed suggestion.
  - `user_metadata` object — Updated human-editable parameters.

## Response `200`

The updated suggestion.

- Suggestion
  - `id` string — The unique suggestion ID.
  - `slug` string — Auto-generated URL-friendly slug.
  - `action_item_id` string — The parent action item ID.
  - `status` 'pending' | 'approved' | 'applied' | 'failed' | 'rejected' | 'expired' — The current status.
  - `created_by` string — The agent that created the suggestion.
  - `owner` string — The agent or system that will execute the fix.
  - `confidence` number — Confidence score between 0 and 1.
  - `description` string — A description of the proposed fix. Supports Markdown.
  - `metadata` object — Machine-to-machine metadata for the executor.
  - `user_metadata` object — Human-editable parameters.
  - `user_metadata_config` object — JSON Schema for rendering `user_metadata` in the UI.
  - `execution_result` ExecutionResult — Result of a suggestion execution.
    - `success` boolean — Whether the execution succeeded.
    - `message` string — A summary message.
    - `details` object — Additional details, such as a link to the resulting PR.
  - `executed_at` string, date — Date when the suggestion was executed.
  - `expires_at` string, date — Expiration date.
  - `created_at` string, date-time — Creation timestamp.
  - `updated_at` string, date-time — Last update timestamp.

## Other responses

- `4XX` — Client error responses due to invalid input, missing parameters, or unauthorized access. Request validation errors use a different shape: ```json { "type": "ValidationError", "errors": [{ "message": "body must have required property 'defer_until'" }] } ```
- `5XX` — Server error responses indicating an issue on the API side.

---

[API](https://skmtc.dev/nullplatform/apis/nullplatform-api.md) · [All operations](https://skmtc.dev/nullplatform/apis/nullplatform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nullplatform/nullplatform-api/revisions/1c4ea154b159/schema)
