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

# Update Build

> Update an existing website with new content or configuration

## Overview

The Update Build API allows you to modify an existing website. It reuses the same hosting infrastructure, providing faster deployments and discounted pricing while maintaining your existing URL and SEO.

## Authentication

Requires x402 payment. First call returns a quote (402), second call with payment executes.

## Request Body

<ParamField body="build_id" type="string" required>
  The `request_id` from the original build's completed result. This identifies which website to update.
</ParamField>

<ParamField body="product" type="object" required>
  Updated product information.

  <Expandable title="product properties">
    <ParamField body="product.name" type="string" required>
      Product or business name
    </ParamField>

    <ParamField body="product.description" type="string" required>
      Updated description (minimum 10 characters)
    </ParamField>

    <ParamField body="product.industry" type="string">
      Industry category
    </ParamField>

    <ParamField body="product.pricing" type="string">
      Updated pricing information
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="type" type="string">
  Website type (optional, keeps existing if not specified)
</ParamField>

<ParamField body="sections" type="string[]">
  Updated sections to include
</ParamField>

<ParamField body="lead_capture" type="object">
  Lead capture configuration
</ParamField>

<ParamField body="brand" type="object">
  Updated brand settings
</ParamField>

<ParamField body="images" type="object">
  Updated image URLs
</ParamField>

<ParamField body="domain" type="string">
  Custom domain
</ParamField>

<Snippet file="audit-context-params.mdx" />

## Quote Response (402)

Returns pricing with update discount applied:

<ResponseField name="context.is_update" type="boolean">
  `true` for update requests
</ResponseField>

<ResponseField name="context.pricing.update_discount" type="string">
  Discount amount applied
</ResponseField>

## Execution Response (202)

Same as create, but updates existing deployment.

<RequestExample>
  ```bash cURL (Get Quote) theme={null}
  curl -X POST https://win.oneshotagent.com/v1/tools/build \
    -H "Content-Type: application/json" \
    -H "X-Agent-ID: 0xYourWalletAddress" \
    -d '{
      "build_id": "550e8400-e29b-41d4-a716-446655440000",
      "product": {
        "name": "TaskFlow 2.0",
        "description": "Now with AI automation! AI-powered task management for remote teams.",
        "pricing": "Free tier, Pro $15/mo, Team $35/mo"
      }
    }'
  ```

  ```typescript SDK theme={null}
  import { OneShot } from "@oneshot-agent/sdk";

  const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });

  // Using the dedicated updateBuild method
  const result = await agent.updateBuild({
    build_id: "550e8400-e29b-41d4-a716-446655440000",
    product: {
      name: "TaskFlow 2.0",
      description: "Now with AI automation! AI-powered task management for remote teams.",
      pricing: "Free tier, Pro $15/mo, Team $35/mo"
    }
  });

  console.log("Updated URL:", result.url);
  ```
</RequestExample>

<ResponseExample>
  ```json Quote Response (402) theme={null}
  {
    "error": "payment_required",
    "payment_request": {
      "chain_id": 8453,
      "token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "5.00",
      "recipient": "0x..."
    },
    "context": {
      "tool": "build",
      "quote_id": "quote_xyz789",
      "is_update": true,
      "type": "saas",
      "product_name": "TaskFlow 2.0",
      "pricing": {
        "base_price": "10.00",
        "update_discount": "-5.00",
        "total": "5.00"
      },
      "expires_at": "2024-01-15T12:00:00Z"
    }
  }
  ```

  ```json Completed Result theme={null}
  {
    "request_id": "660e8400-e29b-41d4-a716-446655440001",
    "status": "completed",
    "result": {
      "status": "deployed",
      "url": "https://taskflow.oneshotagent.com",
      "design_score": 8.7
    }
  }
  ```
</ResponseExample>

## Benefits of Updates

* **Faster deployments**: Reuses existing infrastructure
* **Discounted pricing**: Significant savings vs new builds
* **Same URL**: Maintains existing domain and SEO
* **Version history**: Previous versions accessible in GitHub

<Tip>Store the `request_id` from your initial build to use for future updates.</Tip>
