This method creates a new build using the original build request, which may or may not result in an identical build.
For triggered builds:
Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision.
For non-triggered builds that specify RepoSource:
If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build.
If the original build specified a commit sha or revision ID, the retried build will use the identical source.
For builds that specify StorageSource:
If the original build pulled source from Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source.
If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings.
HTTP request
POST https://cloudbuild.googleapis.com/v1/{name=projects/*/locations/*/builds/*}:retry
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-17 UTC."],[[["\u003cp\u003eThis endpoint retries a specified build, potentially resulting in a new build that may or may not be identical to the original.\u003c/p\u003e\n"],["\u003cp\u003eThe behavior of retrying a build depends on whether it was triggered, used a \u003ccode\u003eRepoSource\u003c/code\u003e, or a \u003ccode\u003eStorageSource\u003c/code\u003e, and how the source was defined.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request to retry a build is a \u003ccode\u003ePOST\u003c/code\u003e method to the provided URL, and requires a \u003ccode\u003ename\u003c/code\u003e path parameter in the format of \u003ccode\u003eprojects/*/locations/*/builds/*\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain the \u003ccode\u003eprojectId\u003c/code\u003e and \u003ccode\u003eid\u003c/code\u003e of the original build in the correct JSON format, and requires specific IAM permissions.\u003c/p\u003e\n"],["\u003cp\u003eThe endpoint response provides an \u003ccode\u003eOperation\u003c/code\u003e object and the authorization requires the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e scope.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.builds.retry\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a new build based on the specified build.\n\nThis method creates a new build using the original build request, which may or may not result in an identical build.\n\nFor triggered builds:\n\n- Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision.\n\nFor non-triggered builds that specify `RepoSource`:\n\n- If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build.\n- If the original build specified a commit sha or revision ID, the retried build will use the identical source.\n\nFor builds that specify `StorageSource`:\n\n- If the original build pulled source from Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source.\n- If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings.\n\n### HTTP request\n\n`POST https://cloudbuild.googleapis.com/v1/{name=projects/*/locations/*/builds/*}:retry`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/build/docs/api/reference/rest/Shared.Types/Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/)."]]