Skip to main content
POST
/
leads
/
audio
Upload Audio for Voice Message Step
curl --request POST \
  --url https://api.lemlist.com/api/leads/audio \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file'
import requests

url = "https://api.lemlist.com/api/leads/audio"

files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Basic <encoded-value>"}

response = requests.post(url, files=files, headers=headers)

print(response.text)
const form = new FormData();
form.append('file', '<string>');

const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};

options.body = form;

fetch('https://api.lemlist.com/api/leads/audio', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
require 'uri'
require 'net/http'

url = URI("https://api.lemlist.com/api/leads/audio")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"

response = http.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.lemlist.com/api/leads/audio",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
  CURLOPT_HTTPHEADER => [
    "Authorization: Basic <encoded-value>",
    "Content-Type: multipart/form-data"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
{
  "ok": true,
  "status": {
    "url": "https://example.com/files/fil_CD7M60ym74aR0e57f.m4a",
    "teamId": "tea_Sh11ph1qHfjSpLKGT",
    "campaignId": "cam_R9mwDo0iZRwNEHUcW",
    "leadId": "lea_jZKIJ1Jn1SaMsP83s",
    "fileName": "file2"
  }
}
"Bad team"

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Query Parameters

leadId
string
required

The unique identifier of the lead

stepId
string
required

The unique identifier of the voice message step

Body

multipart/form-data
file
file

Audio file to upload

Response

Success

ok
boolean
status
object