You’re viewing the V1 docs. V2 is now recommended — read the V2 docs.
Watt Data

generate_url_for_upload

Description: Generates a presigned S3 URL for uploading customer CSV data. Returns a csv_key for subsequent analyze_customers calls.

Tool Identifier: generate_url_for_upload

Input Parameters

ParameterTypeRequiredDefaultConstraintsDescription
market_contextstringYes-Min length: 1Business context for cluster interpretation and ICP synthesis
filenamestringNo"customer-data.csv"-Original filename for metadata
workflow_idstringNo-Valid UUIDWorkflow session identifier for correlation

Request Schema:

interface GenerateUrlForUploadParams {
  market_context: string;
  filename?: string;
  workflow_id?: string;
}

Output Format

Success Response:

{
  csv_key: string;           // S3 key for referencing the uploaded CSV
  upload_url: string;        // Presigned S3 PUT URL (expires in 1 hour)
  upload_expires_at: string; // ISO timestamp when URL expires
  instructions: string;      // Next step instructions
  tool_trace_id: string;
  workflow_id: string;
}

Example Response:

{
  "csv_key": "uploads/abc123-def456/customer-data.csv",
  "upload_url": "https://watt-agentic-uploads.s3.amazonaws.com/uploads/abc123...",
  "upload_expires_at": "2025-01-16T15:30:00Z",
  "instructions": "Upload your CSV file using this command:\n\ncurl -X PUT -H \"Content-Type: text/csv\" -T \"<your-file.csv>\" \"<upload_url>\"\n\nAfter uploading, call analyze_customers with csv_key.",
  "tool_trace_id": "a1b2c3d4e5f6",
  "workflow_id": "550e8400-e29b-41d4-a716-446655440000"
}

Error Handling

Common Errors:

  • Empty market_context: "market_context is required"

Usage Examples

Example 1: Basic upload URL generation

{
  "market_context": "B2B SaaS platform for marketing automation targeting mid-market companies"
}

Example 2: With custom filename

{
  "market_context": "E-commerce retailer selling outdoor gear",
  "filename": "q4-customers.csv"
}

Next Steps

After receiving the upload URL:

  1. Upload your CSV file using the provided curl command
  2. Call analyze_customers with the csv_key

On this page