Skip to content

contacts.uploadUrl

A signed URL to upload a contacts file to, before importing it.

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.

Terminal window
# Step 1: Get upload URL
curl -X POST https://api.decibyl.ai/api/v1/s3/presigned-upload-url \
-H "X-API-Key: dcb_your_api_key"
# Response:
# { "upload_url": "https://...", "s3_key": "campaigns/..." }
# Step 2: Upload the CSV
curl -X PUT "https://presigned-url..." \
-H "Content-Type: text/csv" \
--data-binary @contacts.csv

Use the s3_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

Reference

POST/api/v1/s3/presigned-upload-url

Auth
API key in X-API-Key
Content
application/json
Returns
200 · PresignedUploadUrlResponse

Generate a presigned PUT URL for direct CSV file upload to S3/MinIO. This endpoint enables browser-to-storage uploads without passing through the backend Access Control: * All authenticated users can upload CSV files scoped to their organization. * Files are stored with organization-scoped keys for multi-tenancy. Returns: * upload_url: Presigned URL (valid for 15 minutes) for PUT request * file_key: Unique storage key to use as source_id in campaign creation * expires_in: URL expiration time in seconds

Arguments

ArgumentInTypeRequiredDescription
file_namebodystringrequiredCSV filename
file_sizebodyintegerrequiredFile size in bytes (max 10MB)
content_typebodystringdefault "text/csv"File content type

Example request

curl -X POST "https://api.decibyl.ai/api/v1/s3/presigned-upload-url" \
  -H "X-API-Key: dcb_your_key" \
  -H "Content-Type: application/json" \
  -d '{"file_name":"string","file_size":1,"content_type":"text/csv"}'

Response

{
  "upload_url": "string",
  "file_key": "string",
  "expires_in": 1
}

Errors

StatusWhen
404Not found
422Validation Error