> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clickproof.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload a build

> POST /api/v1/projects/{projectId}/build

<div className="text-sm font-mono">POST /api/v1/projects/{`{projectId}`}/build</div>

Upload the app build for a project. Send the **raw file bytes** as the request
body (not multipart form data). The upload replaces the project's current build.

## Request

<ParamField path="projectId" type="string" required>
  The project id, in the URL path.
</ParamField>

<ParamField header="Authorization" type="string" required>
  `Bearer <your API key>`.
</ParamField>

<ParamField header="Content-Type" type="string">
  `application/octet-stream`.
</ParamField>

<ParamField body="body" type="binary" required>
  The raw build bytes. The platform is inferred from the file extension, not the project's
  platform. Max **600 MB**.
</ParamField>

## Response

<ResponseField name="ok" type="boolean">
  `true` on success.
</ResponseField>

<ResponseField name="projectId" type="string">
  The project the build was attached to.
</ResponseField>

<ResponseField name="buildId" type="string">
  Id of the stored build asset.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST \
    -H "Authorization: Bearer $CLICKPROOF_API_KEY" \
    -H "Content-Type: application/octet-stream" \
    --data-binary @app.apk \
    https://clickproof.app/api/v1/projects/YOUR_PROJECT_ID/build
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "ok": true,
    "projectId": "7f3a9c21-4e8b-45d2-9a1c-2b6e0f8d1a44",
    "buildId": "asset_9c1d4e5f6a7b"
  }
  ```
</ResponseExample>

## Errors

| Status | Body                            | When                                 |
| ------ | ------------------------------- | ------------------------------------ |
| `400`  | `empty build body`              | The request body had no bytes.       |
| `413`  | `build exceeds the 600MB limit` | Build too large.                     |
| `404`  | `project not found`             | No such project for your team.       |
| `502`  | upstream message                | The build store rejected the upload. |
