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

# Get Upload URL

> Get a pre-signed URL to upload your Docker build context

## Uploading Your Context

After receiving the upload URL and fields, upload your context archive using a multipart form POST request:

```bash theme={null}
# Get the upload URL
RESPONSE=$(curl -s -X POST "https://api.pipecat.daily.co/v1/builds/upload-url" \
  -H "Authorization: Bearer $PIPECAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"region": "us-west"}')

# Extract fields from response
UPLOAD_URL=$(echo $RESPONSE | jq -r '.uploadUrl')
UPLOAD_ID=$(echo $RESPONSE | jq -r '.uploadId')

# Upload the context archive (must be gzipped tar)
# Note: Field names are case-sensitive (X-Amz-*, not x-amz-*)
curl -X POST "$UPLOAD_URL" \
  -F "key=$(echo $RESPONSE | jq -r '.uploadFields.key')" \
  -F "bucket=$(echo $RESPONSE | jq -r '.uploadFields.bucket')" \
  -F "Content-Type=application/gzip" \
  -F "Policy=$(echo $RESPONSE | jq -r '.uploadFields.Policy')" \
  -F "X-Amz-Algorithm=$(echo $RESPONSE | jq -r '.uploadFields[\"X-Amz-Algorithm\"]')" \
  -F "X-Amz-Credential=$(echo $RESPONSE | jq -r '.uploadFields[\"X-Amz-Credential\"]')" \
  -F "X-Amz-Date=$(echo $RESPONSE | jq -r '.uploadFields[\"X-Amz-Date\"]')" \
  -F "X-Amz-Security-Token=$(echo $RESPONSE | jq -r '.uploadFields[\"X-Amz-Security-Token\"]')" \
  -F "X-Amz-Signature=$(echo $RESPONSE | jq -r '.uploadFields[\"X-Amz-Signature\"]')" \
  -F "file=@context.tar.gz"

echo "Upload ID: $UPLOAD_ID"
```

<Note>
  The context archive must be a gzipped tar file (`.tar.gz`). The upload URL validates both the content type and file size.
</Note>

<Warning>
  **Field names are case-sensitive.** When uploading to S3, you must use the exact field names returned in `uploadFields` (e.g., `X-Amz-Algorithm`, not `x-amz-algorithm`). Using incorrect casing will result in authentication errors.
</Warning>

## Creating the Context Archive

Your context archive should contain your Dockerfile and all files needed for the build:

```bash theme={null}
# Create a tar.gz of your project
tar -czvf context.tar.gz \
  --exclude='.git' \
  --exclude='node_modules' \
  --exclude='__pycache__' \
  --exclude='.venv' \
  .
```

<Warning>
  The maximum context size is **500MB**. Use a `.dockerignore` file to exclude unnecessary files and keep your context small for faster uploads and builds.
</Warning>


## OpenAPI

````yaml POST /builds/upload-url
openapi: 3.0.0
info:
  title: Pipecat Cloud
  version: 1.0.0
  description: Public API for Pipecat Cloud services
servers:
  - url: https://api.pipecat.daily.co/v1
    description: API server
security:
  - BearerAuth: []
paths:
  /builds/upload-url:
    post:
      summary: Get upload URL for build context
      description: >-
        Generate a pre-signed URL for uploading your Docker build context
        (tar.gz archive) to Pipecat Cloud storage. The returned URL expires
        after 15 minutes.
      operationId: getBuildUploadUrl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadUrlRequest'
      responses:
        '200':
          description: Upload URL generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadUrlResponse'
        '400':
          description: Invalid request (e.g., cloud build not enabled for region)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    UploadUrlRequest:
      type: object
      required:
        - region
      properties:
        region:
          type: string
          description: >-
            Target region for the build. Must be a region where cloud builds are
            enabled.
          example: us-west
    UploadUrlResponse:
      type: object
      properties:
        uploadId:
          type: string
          format: uuid
          description: Unique identifier for this upload. Use this when creating the build.
          example: 550e8400-e29b-41d4-a716-446655440000
        uploadUrl:
          type: string
          format: uri
          description: >-
            Pre-signed URL to upload your context archive. Use HTTP POST with
            form-data.
          example: https://daily-co-pcc-build-context.s3.amazonaws.com
        uploadFields:
          type: object
          description: >-
            Form fields that must be included when uploading to the pre-signed
            URL.
          additionalProperties:
            type: string
          example:
            key: org-123/550e8400-e29b-41d4-a716-446655440000.tar.gz
            bucket: daily-co-pcc-build-context-qa-us-west-2
            Content-Type: application/gzip
            Policy: eyJleHBpcmF0aW9uIjoi...
            X-Amz-Algorithm: AWS4-HMAC-SHA256
            X-Amz-Credential: ASIA.../us-west-2/s3/aws4_request
            X-Amz-Date: 20260220T120000Z
            X-Amz-Security-Token: FwoGZXIvYXdzE...
            X-Amz-Signature: abc123...
        expiresAt:
          type: string
          format: date-time
          description: When the upload URL expires. Upload must complete before this time.
          example: '2026-02-20T12:15:00.000Z'
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          description: Error code
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authentication using a Pipecat Cloud API token.

````