# Report a build

**POST** `/v1/builds`

⚠️ 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.

Base URL: `https://api.prisma.io`

Tags: `[Experimental]`

## Authorization

Any ONE of the following options authorizes this operation; every scheme listed within an option is required together.

| Option | Scheme | Type | Sent as | Scopes |
| --- | --- | --- | --- | --- |
| Option 1 | `OAuth2` | `oauth2` | `Authorization: Bearer <access token>` | `offline_access`, `workspace:admin` |
| Option 2 | `Bearer` | `http` | `Authorization: Bearer <token>` (JWT) | — |

### OAuth 2.0 flows

- **OAuth2 · authorizationCode**
  - Authorization URL: `https://auth.prisma.io/authorize`
  - Token URL: `https://auth.prisma.io/token`
  - Refresh URL: `https://auth.prisma.io/token`
  - Scope `offline_access` — Offline access
  - Scope `workspace:admin` — Full access to workspace resources

## Request body

Optional. Media type: `application/json`

### Example request body

```json
{
  "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

| Status | Description | Media type |
| --- | --- | --- |
| `201` | The build. Returned whether this call created it or an earlier report of the same run did. | `application/json` |
| `401` | Missing or invalid authorization token. | `application/json` |
| `404` | Build not found, or the caller's workspace does not own it (indistinguishable). | `application/json` |
| `413` | Request body exceeds this endpoint's size cap. | `application/json` |
| `429` | Rate limit exceeded. | `application/json` |

### Example response: 201 — The build. Returned whether this call created it or an earlier report of the same run did.

```json
{
  "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"
  }
}
```

### Example response: 401 — Missing or invalid authorization token.

```json
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
```

### Example response: 404 — Build not found, or the caller's workspace does not own it (indistinguishable).

```json
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
```

### Example response: 413 — Request body exceeds this endpoint's size cap.

```json
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
```

### Example response: 429 — Rate limit exceeded.

```json
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
```

## Related pages

- [[Experimental]](./tags/experimental.md)
- [Acquire Alchemy deploy lease](./postv1projectsbyprojectidbranchesbybranchidalchemy-statelease.md)
- [Agents](./tags/agents.md)
- [Alchemy state store version](./getv1projectsbyprojectidbranchesbybranchidalchemy-stateversion.md)
- [Buckets](./tags/buckets.md)
- [Connections](./tags/connections.md)
- [Create a branch](./postv1projectsbyprojectidbranches.md)
- [Create a custom domain](./postv1appsbyappiddomains.md)
- [Create a custom domain](./postv1servicesbyserviceiddomains.md)
- [Create a workspace](./postv1workspaces.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
