---
id: suggestion-update
title: "Update a suggestion"
description: "Update a suggestion. The `user_metadata` field is only editable when the suggestion is in `pending` or `failed` status."
sidebar_label: "Update a suggestion"
hide_title: true
hide_table_of_contents: true
api: eJzVWFtz4jgW/isqvcxMlQHn0rPbvDHpbHWm5tKVkLlsoEBYx1jTtuTWhYSh/N+njmSwDXSHZGdra/NADJbO9TvXDeVgEi1KK5SkQ3pfcmaBMGLccgkGf+2TcQZk7gzoWQGWcWbZnKQCck6EIUrmawJcWLbIgTxmIInNoHUfDwlJ5iVILuRyTpQm85SJHPicGMusM/2JnMixIhqsXhNGwtsWjYgYsGQeTs+JVWTOylKrFfB5fyJpRFUJmuHRG06HtLk5dF4jGlHLloYOH+jd7h2dRtRA4rSwazp82NAFMA165GxGhw/TahrRkmlWgAVt/AGBNiqZzWhEJSuADilLPFcLxQ2nETVJBgWjww216xLfG6uFXNIqoho+OaGB06HVDqI9y6ORAy0iLBTk5l2fRhSeWFHmSOfp9z//8c+3o8UVv05pFR2VRfzHErTcti+AuV+enV9sBZgGamDsd4qvkds+8URJC9LiK1aWuUi8ewZ/GGS2ORRTLf6AxNKIlhqdaQUYf877/FCdiIJ0BTp0iwR0Z1ejO7BdrOC3z4Ksq+6OahXRDvaPiXwsiDjJXMFkbxcbDZY6nDbUMr0EO1uBNoHAedxjeSkkXPTPY1qFPzS4KZU0wS7ncYz/Dl3oau5dxf4mbwh+zBNHhJDik3sBnCJqcrd8nvbIWdVbgsRgB07ub3/opVqA5PmaIIUuj2CKHlfJR9CpyKG3YAZ6omBLQJ4h3mYYb7NTNSuZBmlfEqonQLjOjTRqYBcFP/mnAFWKCECv+Ed4Kn20HYAehUyc9lLW6bUj3ZZXFdFEA5pxtlifpjtbIlGbMUvqq3u5fs/FdW7tmYRJCbrn7yNj9ShBv4Sn0sSsDRrbc38UeU7gCRJnwYuQiqcub+/jXgBAi3GiZCo4yARa3KUrFqAPuF/tzhKTKA1kAfYRQJKYMMnJWYdh3H97Xu1ReBbMpPWdqNR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9gvFbuHg2bkPE1kPqNKS3N8fS2x3oFeiD9CYk99Esl4Thrsg4ICqUs9GHG2JEgOqr59f/VTRrKDUYkF4zX5xLSEQqEmJahujA9s0LIntEis/Hdj2iMQtLXwpMECDwxWHS6b3ARLW0ZPksHJpBB2WniLPQAtKo3nnsZHpBbripRSA1UHZA/69liZEkTsJT6UfqWi6V+NmZbzEY7NFvljAF2EzxsHpLcPfmV3BDOmgtEwab9lawGjR9mRlsBK9wS+fphq2i03mrq2Sl6GOTVubMYtLC/tLv27bjtJ8tAkTbC8uddZDQdg/oY9gfwkHLP/xr2/d8/+vYdykYQ7fNLu+66Xu3i4v2VuJwHHtuexVRIVOFR5szZ/24H9OmQxqFdcqNT11VREtlbMF8aNe7zSOb6X0AbJos8f+7yK6daOHJDsqcCek7WUTIpobaQ3tvRSM63F9BN2jDt8LviDKFo8sD3WxwO3Cv86rCnz85wMH8YRrRFdMCVfeQ5MLgM6fDlOVmf1XcNvTXt3WC/YYcX2EfVWhbsiQWrBXLHX6jEf0I6/2dOpbjV4tzsIB8hTSC02paRTQDxnFr9bCpX1wFrr1xqO7biwf1CTUIN0ZJAqX94tlpK8V8GI2v3mPg1iv2wpcGqtkjFjb2GKRUZfA1Llvwtw3NmVw6nzJpIIpByLpZYi8rtFvmrh02m3BirD6CrKqdWSx+p77k/wWmfB+c
sidebar_class_name: "patch api-method"
info_path: docs/api/action-items
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Update a suggestion"}
>
</Heading>

<MethodEndpoint
  method={"patch"}
  path={"/action_item/{actionItemId}/suggestions/{id}"}
  context={"endpoint"}
>
  
</MethodEndpoint>



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`.


<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"in":"path","name":"actionItemId","schema":{"type":"string"},"required":true,"description":"The action item ID.","example":"xYz789AbCdEf"},{"in":"path","name":"id","schema":{"type":"string"},"required":true,"description":"The suggestion ID.","example":"sUg123AbCdEf"}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["approved"],"description":"Set to `approved` to retry a failed suggestion.","example":"approved"},"user_metadata":{"type":"object","description":"Updated human-editable parameters.","example":{"target_version":"20-alpine3.20"}}}}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"The updated suggestion.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The unique suggestion ID.","example":"sUg123AbCdEf"},"slug":{"type":"string","description":"Auto-generated URL-friendly slug.","example":"update-dockerfile-base-image"},"action_item_id":{"type":"string","description":"The parent action item ID.","example":"xYz789AbCdEf"},"status":{"type":"string","enum":["pending","approved","applied","failed","rejected","expired"],"description":"The current status.","example":"pending"},"created_by":{"type":"string","description":"The agent that created the suggestion.","example":"security-scanner-agent"},"owner":{"type":"string","description":"The agent or system that will execute the fix.","example":"image-updater-agent"},"confidence":{"type":"number","description":"Confidence score between 0 and 1.","example":0.92},"description":{"type":"string","description":"A description of the proposed fix. Supports Markdown.","example":"Update the Dockerfile base image to resolve CVE-2026-1234."},"metadata":{"type":"object","description":"Machine-to-machine metadata for the executor.","example":{"repository":"org/my-api-service","branch":"fix/cve-2026-1234"}},"user_metadata":{"type":"object","description":"Human-editable parameters.","example":{"target_version":"20-alpine3.19"}},"user_metadata_config":{"type":"object","description":"JSON Schema for rendering `user_metadata` in the UI."},"execution_result":{"type":"object","description":"Result of a suggestion execution.","properties":{"success":{"type":"boolean","description":"Whether the execution succeeded.","example":true},"message":{"type":"string","description":"A summary message.","example":"Base image updated successfully."},"details":{"type":"object","description":"Additional details, such as a link to the resulting PR.","example":{"pull_request":"https://github.com/org/my-api-service/pull/42"}}},"title":"ExecutionResult"},"executed_at":{"type":"string","format":"date","description":"Date when the suggestion was executed.","example":null},"expires_at":{"type":"string","format":"date","description":"Expiration date.","example":"2026-05-15"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp.","example":"2026-04-06T12:30:00.000Z"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp.","example":"2026-04-06T12:30:00.000Z"}},"title":"Suggestion"}}}},"4XX":{"description":"Client error responses due to invalid input, missing parameters, or unauthorized access.\n\nRequest validation errors use a different shape:\n```json\n{\n  \"type\": \"ValidationError\",\n  \"errors\": [{ \"message\": \"body must have required property 'defer_until'\" }]\n}\n```\n","content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"Standard error response.","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code (e.g., 400, 401, 403, 404).","example":400},"code":{"type":"string","description":"Machine-readable error code.","example":"bad_request"},"error":{"type":"string","description":"Short description of the error type.","example":"Bad Request"},"message":{"type":"string","description":"Additional details about the error.","example":"The request was malformed or contained invalid parameters."}}},{"type":"object","description":"Request validation error response.","required":["type","errors"],"properties":{"type":{"type":"string","example":"ValidationError"},"errors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","example":"body must have required property 'until'"}}}}}}]}}}},"5XX":{"description":"Server error responses indicating an issue on the API side.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific server error.","example":500},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"internal_server_error"},"error":{"type":"string","description":"A brief, human-readable description of the error type.","example":"Internal Server Error"},"message":{"type":"string","description":"Additional details about the error.","example":"An unexpected error occurred on the server."}}}}}}}}
>
  
</StatusCodes>


      