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.
# Step 1: Get upload URLcurl -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 CSVcurl -X PUT "https://presigned-url..." \ -H "Content-Type: text/csv" \ --data-binary @contacts.csvUse 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,basicReference
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
| Argument | In | Type | Required | Description |
|---|---|---|---|---|
file_name | body | string | required | CSV filename |
file_size | body | integer | required | File size in bytes (max 10MB) |
content_type | body | string | default "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
| Status | When |
|---|---|
404 | Not found |
422 | Validation Error |