---
title: "Prepare Remote Build Upload"
method: POST
path: "/builds/prepare"
tags: ["Builds"]
---

# Prepare Remote Build Upload

`POST /builds/prepare`

Return a presigned URL for uploading a build context archive to GCS.

## Request body

- BuildPrepareRequest — Prepare a remote build by issuing a presigned upload URL for build context.
  - `agent_name` string, required — Agent short name (without namespace prefix)
  - `namespace` string, required — Target namespace slug for the build
  - `tag` string, required — Image tag to build/push (typically git hash)

## Response `200`

Successful Response

- BuildPrepareResponse — Response containing a presigned URL for uploading build context.
  - `bucket` string, required — GCS bucket where the context will be stored.
  - `content_type` string, required — Content-Type header that must be used for the upload.
  - `expires_at` string, date-time, required — When the presigned URL expires.
  - `image_url` string, required — Full Artifact Registry image URL that the build will push.
  - `instructions` string, required — Human instructions for how to upload the context archive.
  - `method` string — HTTP method to use for the upload.
  - `object_key` string, required — GCS object key where the context will be stored.
  - `upload_url` string, required — Presigned PUT URL for uploading the build context archive.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/terminaluse/apis/sb0-api.md) · [All operations](https://skmtc.net/terminaluse/apis/sb0-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/terminaluse/sb0-api/revisions/f24a474dc415/schema)
