Documentation menu

Update service source

PATCHhttps://api.instacloud.com/projects/{projectId}/services/{serviceId}/source

Token scope: account · org · project — read-only tokens refused (not a GET).

Change how a connected service builds (admin+): the tracked branch, root directory, auto-deploy, build/start commands. A branch, root-directory or command change deploys the new configuration now (even at the same commit).

Parameters

NameInTypeRequiredDescription
projectIdpathstringyes
serviceIdpathstringyes

Request body

application/json

FieldTypeRequiredDescription
branchstringno
rootDirstring | nullno
autoDeploybooleanno
buildCommandstring | nullno
startCommandstring | nullno
watchPathsstring[] | nullno

Responses

200

Default Response

FieldTypeRequiredDescription
sourceobjectyesWhere a compute service’s running image comes from: an image somebody deployed (type=image, the absence of a connected source) or a connected repository (type=github).
source.type"image" | "github"yes
source.imagestring | nullnotype=image — the image the service runs; null when nothing has been deployed yet
source.idstringno
source.ownerstringno
source.repostringno
source.branchstringnothe repo branch this service tracks; defaults to the repo’s default branch
source.root_dirstring | nullnosubdirectory to build from (monorepo); null = repo root. Also decides which pushes deploy this service: the build context is this directory, so a push that changed nothing under it is skipped
source.watch_pathsstring[] | nullnoinclude list of gitignore patterns, matched against paths relative to the repository root (not to root_dir); a push deploys this service only when it changed a matching path. null/absent falls back to the root-directory rule: a service with root_dir deploys when a push changed something under it, one building from the repo root deploys on every push
source.auto_deploybooleannoa push to `branch` rebuilds and redeploys; always false for a public repo (no App, no webhooks)
source.publicbooleannoconnected as a public repo, without a GitHub App installation
source.installation_idstring | nullno
source.repo_idstring | nullnoGitHub repository id (bigint as string)
source.build_commandstring | nullnocustom build command for source builds without a Dockerfile; null uses automatic detection
source.start_commandstring | nullno
source.created_atstringno
source.updated_atstringno
source.last_buildobject | nullnothe newest build of this service (null before the first)
source.last_build.idstringno
source.last_build.source_idstring | nullnothe service source that queued it; null once that source was disconnected
source.last_build.project_idstringno
source.last_build.service_idstring | nullno
source.last_build.branch_idstring | nullno
source.last_build.commit_shastringno
source.last_build.status"queued" | "fetching" | "building" | "deploying" | "live" | "failed"no
source.last_build.image_refstring | nullno
source.last_build.errorstring | nullno
source.last_build.created_atstringno
source.last_build.updated_atstringno
buildobjectno
build.buildIdstringyes
build.queuedbooleanyesfalse when this commit already has a build (dedup)
build.serviceIdstringyes

202

Default Response

FieldTypeRequiredDescription
statusstringyes
approvalIdstringyes
actionstringyes
actionsstring[]yes
messagestringyes
urlstringyes

400

Default Response

FieldTypeRequiredDescription
errorstringyes

403

Default Response

FieldTypeRequiredDescription
errorstringyes

404

Default Response

FieldTypeRequiredDescription
errorstringyes

View as Markdown