---
title: "Update a build source"
method: PATCH
path: "/build-sources/{buildSourceId}"
tags: ["Build Sources"]
---

# Update a build source

`PATCH /build-sources/{buildSourceId}`

## Request

- Base URL: `https://api.render.com/v1`
- URL: `https://api.render.com/v1/build-sources/{buildSourceId}`
- Auth: HTTP bearer

Update a shared build source. Each top-level field is a true patch,
unset fields are left unchanged.

Supplying `git` or `image` can change the build source's
underlying identity:
- `image` on a git-backed build source switches it to image-backed
- `git` on an image-backed build source switches it to git-backed
- `git` on a build source that's already git-backed is a pure
  patch onto the existing config

## Request body

- object
  - `name` string
  - `git` object
    - `branch` string
    - `buildCommand` string
    - `buildFilter` object: Glob patterns matched against files changed by a commit. When set, a commit only triggers a build when at least one changed file matches `paths` and none match `ignoredPaths`. Useful for monorepos where a single repo backs many services.
      - `paths` string[], required
      - `ignoredPaths` string[], required
    - `dockerContext` string: Directory passed to `docker build` as the build context, relative to the repository root. Only valid for the `docker` runtime.
    - `dockerfilePath` string
    - `runtime` 'docker' | 'elixir' | 'go' | 'node' | 'python' | 'ruby' | 'rust': Build runtime for the build source. Static sites are not supported for build sources.
    - `registryCredentialId` string: Optional reference to the registry credential for this build. Omit the field to leave the stored credential unchanged; send an empty string to clear it.
    - `region` 'frankfurt' | 'oregon' | 'ohio' | 'singapore' | 'virginia': Region for the build. Honored only when this PATCH performs an image→build transition; rejected on a pure build patch (the cluster is pinned for an existing build), and must match the prior build region when switching back to build after time as an external image. Defaults to "oregon" for first-time builds.
    - `repoUrl` string
    - `rootDir` string
  - `image` object: Patch shape for a build source's image identity. Unset fields are left unchanged on the underlying image reference. ownerId is intentionally omitted — a build source's owner is fixed at creation, and changing the image's owner would amount to a different identity.
    - `imageUrl` string
    - `registryCredentialId` string: Optional reference to the registry credential passed to the image repository to retrieve this image. Omit the field to leave the stored credential unchanged; send an empty string to clear it.

## Response `200`

Success

- Schema (unresolved $ref)

## Other responses

- `400`: The request could not be understood by the server.
- `401`: Authorization information is missing or invalid.
- `403`: You do not have permissions for the requested resource. If a scoped API token does not satisfy the endpoint's minimum scope requirements, the response has code insufficient_token_scope and its message lists all minimum required scopes. Broader scopes that include their permissions also satisfy the requirements. Passing this check does not guarantee access to the requested resource or to conditional operations.
- `404`: Unable to find the requested resource.
- `429`: Rate limit has been surpassed. Rate-limited endpoints also return `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` on successful responses so clients can track their remaining quota.
- `500`: An unexpected server error has occurred.

## Changes

- **2026-11-03** `6ac5d3d47362`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/render/apis/render-public-api/changes/build-sources/:buildSourceId/patch.md)

---

[API](https://skmtc.dev/render/apis/render-public-api.md) - [All operations](https://skmtc.dev/render/apis/render-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/render/apis/render-public-api/revisions/6ac5d3d47362?raw)
