Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

Update a build

PATCH/v1/builds/{buildId}Update a build

⚠️ Experimental endpoint: this API is in active development and may change at any time without notice. ⚠️

Records progress on a build. Any holder of the workspace token may patch any field — the webhook, the CI run and Composer each report the part of a deploy they can see, and the token is the boundary. Reaching running stamps startedAt and reaching a terminal state stamps finishedAt, both only if unset, so re-reporting the same state does not move the clock. Once a build has finished, its state no longer changes: a later report updates the other fields and leaves the state as the finishing report set it.

projectId, branchId, deployedUrl and applicationTopologyContentHash can each be set once and never changed: a reporter that resolves them partway through a deploy sets them here, but a value already recorded cannot be changed and the attempt is a conflict. Sending the value already recorded is accepted and changes nothing. projectId and branchId must belong to the caller's workspace, and a branch must belong to the build's project, so a branch from another project is refused.

Parameters

buildIdstringpathrequired

pattern ^(bld_)?([cC][^\s-]{8,}|[a-z0-9]+)$

Request body

application/json
object
applicationTopologyContentHashstring

Content hash of the application topology this run deploys, as submitted to the application-topology endpoint. A value match, never a reference: equal hashes identify the same graph. Can be set once and never changed, like `projectId`.

maxLength 200 · minLength 1

branchIdstring

Branch the build targets. Can be set once and never changed, like `projectId`.

pattern ^(br_)?([cC][^\s-]{8,}|[a-z0-9]+)$

deployedUrlstring · uri

Where the deployed app can be reached. Can be set once and never changed, like `projectId`.

maxLength 2000

errorMessagestring

maxLength 5000 · minLength 1

externalLogUrlstring · uri

maxLength 2000

failingStepstring

Name of the step that failed, free text — step names come from build tooling the platform cannot validate.

maxLength 500 · minLength 1

phasestring

How far the run has got.

one of "queued", "build", "deploy"

projectIdstring

Project the build targets. Can be set once and never changed: a reporter that learns the project partway through a deploy may set it, but a value already recorded cannot be changed.

pattern ^(proj_)?([cC][^\s-]{8,}|[a-z0-9]+)$

statestring

one of "pending", "running", "succeeded", "failed", "cancelled"

Example request
{
  "applicationTopologyContentHash": "string",
  "branchId": "string",
  "deployedUrl": "https://example.com",
  "errorMessage": "string",
  "externalLogUrl": "https://example.com",
  "failingStep": "string",
  "phase": "build",
  "projectId": "string",
  "state": "cancelled"
}

Responses

200The updated build.application/json
object
dataobjectrequired
Show child attributes
applicationTopologyContentHashnull | stringrequired
branchIdnull | stringrequired

pattern ^(br_)([cC][^\s-]{8,}|[a-z0-9]+)$

branchNamestringrequired
commitShastringrequired
createdAtstringrequired
deployedUrlnull | stringrequired
errorMessagenull | stringrequired
externalLogUrlnull | stringrequired
failingStepnull | stringrequired
finishedAtnull | stringrequired
gitRepoIdnull | stringrequired

Repository the build ran against. Set only when the workspace has a live link to it; a reported repository the platform does not know stays null.

idstringrequired

pattern ^(bld_)([cC][^\s-]{8,}|[a-z0-9]+)$

phasenull | stringrequired

Null when nothing reported a phase; the platform never invents an observation it did not receive.

one of "queued", "build", "deploy", null

projectIdnull | stringrequired

pattern ^(proj_)([cC][^\s-]{8,}|[a-z0-9]+)$

sourcestringrequired

one of "webhook", "setup", "manual", "ci", "cli"

startedAtnull | stringrequired
statestringrequired

one of "pending", "running", "succeeded", "failed", "cancelled"

Example response
{
  "data": {
    "applicationTopologyContentHash": "string",
    "branchId": "string",
    "branchName": "string",
    "commitSha": "string",
    "createdAt": "string",
    "deployedUrl": "string",
    "errorMessage": "string",
    "externalLogUrl": "string",
    "failingStep": "string",
    "finishedAt": "string",
    "gitRepoId": "string",
    "id": "string",
    "phase": "build",
    "projectId": "string",
    "source": "ci",
    "startedAt": "string",
    "state": "cancelled"
  }
}
401Missing or invalid authorization token.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
404Build not found, or the caller's workspace does not own it (indistinguishable).application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
409A field that can only be set once already holds a different value.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
413Request body exceeds this endpoint's size cap.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
429Rate limit exceeded.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
Documentation menu