Scheduled messages
Attach file to the scheduled message
Attaches an image, video, document or audio file to the schedule. Use it when you want to replace
only the file. The attachment can also be sent along with the schedule’s POST and PUT.
Audio is converted to OGG/Opus, the format WhatsApp accepts as a voice message. A new attachment replaces the previous one, and the old file’s space goes back to your storage quota.
The same editing rule applies: only schedules in PENDENTE or ERRO accept attachments.
POST
/
schedules
/
{id}
/
media
Attach file to the scheduled message
curl --request POST \
--url https://api.connectadesk.com/api/v1/schedules/{id}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.connectadesk.com/api/v1/schedules/{id}/media"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
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: 'Bearer <token>'}};
options.body = form;
fetch('https://api.connectadesk.com/api/v1/schedules/{id}/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.connectadesk.com/api/v1/schedules/{id}/media",
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: Bearer <token>",
"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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.connectadesk.com/api/v1/schedules/{id}/media"
payload := strings.NewReader("-----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--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.connectadesk.com/api/v1/schedules/{id}/media")
.header("Authorization", "Bearer <token>")
.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--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.connectadesk.com/api/v1/schedules/{id}/media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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{
"data": {
"id": 318,
"body": "Oi {{name}}, sua reserva vence amanhã!",
"sendAt": "2026-08-20T13:00:00.000Z",
"sentAt": null,
"status": "pending",
"contact": {
"id": 842,
"name": "Maria Silva",
"number": "5511987654321",
"numberCountry": "BR",
"email": "maria.silva@exemplo.com.br",
"code": "CLI-00842",
"cpfCnpj": "12345678909",
"origin": "site",
"profilePicUrl": "https://cdn.exemplo.com/avatars/842.jpg",
"isGroup": false,
"instagramUsername": "maria.silva",
"lid": null,
"sourceUrl": "https://loja.exemplo.com.br/promo",
"sourceId": "23851234567890123",
"headline": "Coleção de inverno",
"mediaType": "image",
"mediaUrl": "https://cdn.exemplo.com/anuncios/inverno.jpg",
"utmSource": "instagram",
"utmMedium": "cpc",
"utmCampaign": "inverno-2026",
"utmId": "6543210987",
"fbclid": "IwAR0xYzAbC123",
"gclid": null,
"ctwaClid": null,
"tags": [
{
"id": 3,
"name": "Cliente VIP",
"color": "#6941C6"
}
],
"customFields": [
{
"key": "plano",
"value": "Ouro",
"customFieldId": 91,
"name": "Plano",
"type": "select"
}
],
"lastChannel": {
"id": 11,
"name": "Instagram Loja",
"type": "instagram"
},
"createdAt": "2026-07-14T13:22:05.412Z",
"updatedAt": "2026-08-18T09:41:17.883Z"
},
"user": {
"id": 3,
"name": "Gabriel Goulart"
},
"channelId": 11,
"mediaPath": null,
"mediaName": null,
"createdAt": "2026-08-18T15:10:00.000Z",
"updatedAt": "2026-08-18T15:10:00.000Z"
}
}{
"error": {
"code": "ERR_API_VALIDATION",
"message": "O campo `number` é obrigatório."
}
}{
"error": {
"code": "ERR_API_NOT_FOUND",
"message": "Registro não encontrado."
}
}{
"error": {
"code": "ERR_API_FORBIDDEN_SCOPE",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "ERR_API_VALIDATION",
"message": "O parâmetro `application` é obrigatório e aceita \"contact\" ou \"card\"."
}
}Authorizations
API token in the sk_live_… format.
Path Parameters
Body
multipart/form-data
Response
OK
Show child attributes
Show child attributes
Example:
{
"id": 318,
"body": "Oi {{name}}, sua reserva vence amanhã!",
"sendAt": "2026-08-20T13:00:00.000Z",
"sentAt": null,
"status": "pending",
"contact": {
"id": 842,
"name": "Maria Silva",
"number": "5511987654321",
"numberCountry": "BR",
"email": "maria.silva@exemplo.com.br",
"code": "CLI-00842",
"cpfCnpj": "12345678909",
"origin": "site",
"profilePicUrl": "https://cdn.exemplo.com/avatars/842.jpg",
"isGroup": false,
"instagramUsername": "maria.silva",
"lid": null,
"sourceUrl": "https://loja.exemplo.com.br/promo",
"sourceId": "23851234567890123",
"headline": "Coleção de inverno",
"mediaType": "image",
"mediaUrl": "https://cdn.exemplo.com/anuncios/inverno.jpg",
"utmSource": "instagram",
"utmMedium": "cpc",
"utmCampaign": "inverno-2026",
"utmId": "6543210987",
"fbclid": "IwAR0xYzAbC123",
"gclid": null,
"ctwaClid": null,
"tags": [
{
"id": 3,
"name": "Cliente VIP",
"color": "#6941C6"
}
],
"customFields": [
{
"key": "plano",
"value": "Ouro",
"customFieldId": 91,
"name": "Plano",
"type": "select"
}
],
"lastChannel": {
"id": 11,
"name": "Instagram Loja",
"type": "instagram"
},
"createdAt": "2026-07-14T13:22:05.412Z",
"updatedAt": "2026-08-18T09:41:17.883Z"
},
"user": { "id": 3, "name": "Gabriel Goulart" },
"channelId": 11,
"mediaPath": null,
"mediaName": null,
"createdAt": "2026-08-18T15:10:00.000Z",
"updatedAt": "2026-08-18T15:10:00.000Z"
}
⌘I
Attach file to the scheduled message
curl --request POST \
--url https://api.connectadesk.com/api/v1/schedules/{id}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.connectadesk.com/api/v1/schedules/{id}/media"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
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: 'Bearer <token>'}};
options.body = form;
fetch('https://api.connectadesk.com/api/v1/schedules/{id}/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.connectadesk.com/api/v1/schedules/{id}/media",
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: Bearer <token>",
"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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.connectadesk.com/api/v1/schedules/{id}/media"
payload := strings.NewReader("-----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--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.connectadesk.com/api/v1/schedules/{id}/media")
.header("Authorization", "Bearer <token>")
.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--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.connectadesk.com/api/v1/schedules/{id}/media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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{
"data": {
"id": 318,
"body": "Oi {{name}}, sua reserva vence amanhã!",
"sendAt": "2026-08-20T13:00:00.000Z",
"sentAt": null,
"status": "pending",
"contact": {
"id": 842,
"name": "Maria Silva",
"number": "5511987654321",
"numberCountry": "BR",
"email": "maria.silva@exemplo.com.br",
"code": "CLI-00842",
"cpfCnpj": "12345678909",
"origin": "site",
"profilePicUrl": "https://cdn.exemplo.com/avatars/842.jpg",
"isGroup": false,
"instagramUsername": "maria.silva",
"lid": null,
"sourceUrl": "https://loja.exemplo.com.br/promo",
"sourceId": "23851234567890123",
"headline": "Coleção de inverno",
"mediaType": "image",
"mediaUrl": "https://cdn.exemplo.com/anuncios/inverno.jpg",
"utmSource": "instagram",
"utmMedium": "cpc",
"utmCampaign": "inverno-2026",
"utmId": "6543210987",
"fbclid": "IwAR0xYzAbC123",
"gclid": null,
"ctwaClid": null,
"tags": [
{
"id": 3,
"name": "Cliente VIP",
"color": "#6941C6"
}
],
"customFields": [
{
"key": "plano",
"value": "Ouro",
"customFieldId": 91,
"name": "Plano",
"type": "select"
}
],
"lastChannel": {
"id": 11,
"name": "Instagram Loja",
"type": "instagram"
},
"createdAt": "2026-07-14T13:22:05.412Z",
"updatedAt": "2026-08-18T09:41:17.883Z"
},
"user": {
"id": 3,
"name": "Gabriel Goulart"
},
"channelId": 11,
"mediaPath": null,
"mediaName": null,
"createdAt": "2026-08-18T15:10:00.000Z",
"updatedAt": "2026-08-18T15:10:00.000Z"
}
}{
"error": {
"code": "ERR_API_VALIDATION",
"message": "O campo `number` é obrigatório."
}
}{
"error": {
"code": "ERR_API_NOT_FOUND",
"message": "Registro não encontrado."
}
}{
"error": {
"code": "ERR_API_FORBIDDEN_SCOPE",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "ERR_API_VALIDATION",
"message": "O parâmetro `application` é obrigatório e aceita \"contact\" ou \"card\"."
}
}
