Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

Report a build

POST/v1/buildsReport a build

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

Records a build any deploy tool is running — a CI workflow, a deploy script, or Composer from a laptop. The workspace comes from the token, never from the body, which is what lets a build be reported before the project it will create exists. Supplying runIdentity makes the call idempotent: a repeat for the same run returns the build already recorded rather than a second one. The response is the same either way; a caller cannot tell whether it created the build or joined one.

A build reported with no runIdentity has no dedup key, so a client that retries a lost response creates a second build. Supply a runIdentity whenever the run has one.

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.

maxLength 200 · minLength 1

branchIdstring

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

branchNamestringrequired

Git branch name.

maxLength 500 · minLength 1

commitShastringrequired

Commit the build ran on.

maxLength 200 · minLength 1

externalLogUrlstring · uri

Link to the run's logs in the reporter's own system.

maxLength 2000

projectIdstring

Project the build targets, when it exists. A build may be reported before its project does.

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

runIdentityobject

Identifies the CI run. Supplying it makes creation idempotent — a repeat call for the same run returns the build that already exists. Omit it for builds with no run to name, such as a deploy from a laptop, where every call creates a new build.

Show child attributes
providerstringrequired

CI provider the run identity belongs to.

const "github"

repositoryIdstringrequired

Provider's repository id (for GitHub, the numeric repo id).

maxLength 20 · pattern ^[0-9]+$

runAttemptintegerrequired

Attempt number of the run; a re-run is a separate build.

exclusiveMinimum 0

runIdstringrequired

Provider's workflow-run id.

maxLength 20 · pattern ^[0-9]+$

sourcestringrequired

`ci` for a build reported from a CI run, `cli` for a deploy run directly by a human or agent.

one of "ci", "cli"

Example request
{
  "applicationTopologyContentHash": "string",
  "branchId": "string",
  "branchName": "string",
  "commitSha": "string",
  "externalLogUrl": "https://example.com",
  "projectId": "string",
  "runIdentity": {
    "provider": "github",
    "repositoryId": "string",
    "runAttempt": 0,
    "runId": "string"
  },
  "source": "ci"
}

Responses

201The build. Returned whether this call created it or an earlier report of the same run did.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"
  }
}
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