Skip to main content
POST
Rebuild Image from Current Source
There is no request body. The source depends on the image: an image linked to GitHub is built from the current tip of its linked branch; any other image is built from the build context of its latest build, including a build that failed. Use it to retry a failed build without sending the files again. The rebuild keeps the same image ID and, when it succeeds, adds a new version. It counts toward the hourly deploy limit like any other build, and a failed rebuild keeps the current version. Applications are only restarted if the image has auto_update_apps turned on; otherwise each app moves to the new version on the next restart or deploy you ask for. To build from different files, use Rebuild Image. Needs the images:write scope when called with an API key.
string
required
The image ID.
string
If the image belongs to a workspace, the workspace’s ID. Required for workspace members acting on an image they don’t own.

Response

object
The image. The response is 202 Accepted with status: "building".

Error Responses

string
The error code indicating the reason for the failure. Possible values:
  • API_KEY_SCOPE_DENIED: The API key does not have the required scope (403).
  • IMAGE_NOT_FOUND: The image does not exist (404).
  • ACCESS_DENIED: The image belongs to another account or is provided by the platform, or you are a workspace member without the right to rebuild it (403).
  • IMAGE_TEMPLATE_ONLY: The image came from a template and cannot be rebuilt (409).
  • PLAN_REQUIRED: The image owner has no active plan (403).
  • PLAN_DOES_NOT_SUPPORT_CUSTOM_IMAGES: The plan does not include custom Docker images (403).
  • IMAGE_BUILD_IN_PROGRESS: The image already has a build running (409).
  • OPERATION_IN_PROGRESS: The image is being deleted (409).
  • IMAGE_NOT_READY: The image has no stored build context to build from (409).
  • DEPLOY_RATE_LIMITED: The hourly deploy limit of the image owner was reached; details has limit, window_seconds and retry_after (429).
  • INSTALLATION_NOT_FOUND: The linked repository is no longer in a GitHub App installation of the image owner (404).
  • FETCH_ZIP_ERROR: GitHub did not return the repository archive, for example because the linked branch no longer exists (404), or GitHub is unavailable (502).
  • DOCKERFILE_NOT_FOUND: There is no file named exactly Dockerfile at the root of the context (400).
  • DOCKERFILE_REFUSED: The Dockerfile has a refused instruction; details lists the findings (400).
  • INVALID_ZIP: The stored build context or the repository archive is not a readable ZIP file (400).
  • IMAGE_CONTEXT_TOO_LARGE: The build context is over a limit: more than 100 MB compressed, more than 512 MB uncompressed, more than 50,000 entries, or a Dockerfile larger than 1 MB (413).
  • IMAGE_BUILDER_UNAVAILABLE: No host can build images right now; try again later (503). Also returned when the build could not be started (409).
  • INTERNAL_SERVER_ERROR: Unexpected failure (500).
Last modified on November 11, 2026