LemuAI

Upload Contacts CSV

Get a presigned S3 URL to upload a contacts CSV for a campaign

Uploading contacts is a two-step process. First call this endpoint to get a presigned upload URL, then PUT your CSV directly to that URL.

# Step 1: Get upload URL
curl -X POST https://your-lemu-instance/api/v1/s3/presigned-upload-url \
  -H "X-API-Key: lemu_your_api_key"
 
# Response:
# { "upload_url": "https://...", "file_key": "campaigns/...", "expires_in": 3600 }
 
# Step 2: Upload the CSV
curl -X PUT "https://presigned-url..." \
  -H "Content-Type: text/csv" \
  --data-binary @contacts.csv

Use the file_key from the response as the source_url when creating a campaign.

CSV format#

The CSV must include a phone_number column. Any additional columns are passed as initial_context to each call, making them available as template variables in the workflow.

phone_number,customer_name,plan
+14155550100,Jane Smith,premium
+14155550101,Bob Jones,basic
POST/api/v1/s3/presigned-upload-url

Request body#

FieldTypeRequiredDescription
file_namestringYesCSV filename
file_sizeintegerYesFile size in bytes (max 10MB)
content_typestringNoFile content type

Example request body:

{
  "file_name": "Example Name",
  "file_size": 0,
  "content_type": "text/csv"
}

Responses#

200 — Successful Response

{
  "upload_url": "https://example.com/webhook",
  "file_key": "string",
  "expires_in": 0
}

404 — Not found

422 — Validation Error

{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

© 2026 LemuAI. Built with our own docs platform.