Atualizar agendamento
Só é possível editar agendamentos que ainda não foram enviados:
| Estado | Editável | Resposta |
|---|---|---|
PENDENTE | sim | Aguardando o horário. |
ERRO | sim | O envio falhou. Editar reprograma o envio. |
AGENDADA | não | 409 ERR_API_SCHEDULE_NOT_EDITABLE. O envio já está na fila. |
ENVIADA | não | 409 ERR_API_SCHEDULE_ALREADY_SENT |
CANCELADA | não | 409 ERR_API_SCHEDULE_CANCELED. Crie um novo agendamento. |
Se você trocar o canal de um agendamento com template, envie o template de novo. Um template
aprovado no canal antigo pode não existir no novo.
Mídia: em canais de WhatsApp não oficial (web_whatsapp, web_whatsapp_premium), o
arquivo pode ser enviado junto, como multipart/form-data no campo file. Nesses canais o
arquivo é a própria mensagem e o body vira a legenda. Com anexo, o texto deixa de ser obrigatório.
Em canal oficial, o anexo só é aceito quando o template tem cabeçalho de mídia. Caso
contrário, a resposta é 400 ERR_API_TEMPLATE_MEDIA_NOT_ALLOWED, porque a Meta não aceita
anexo avulso.
curl --request PUT \
--url https://api.connectadesk.com/api/v1/schedules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sendAt": "2026-09-15T09:00:00-03:00",
"contactId": 1042,
"channelId": 4,
"body": "Lembrete: sua consulta é amanhã às 14h.",
"template": {
"name": "confirmacao_pedido",
"parameters": {
"body": [
"Maria",
"12345"
]
}
},
"userId": 3,
"queueId": 7
}
'import requests
url = "https://api.connectadesk.com/api/v1/schedules/{id}"
payload = {
"sendAt": "2026-09-15T09:00:00-03:00",
"contactId": 1042,
"channelId": 4,
"body": "Lembrete: sua consulta é amanhã às 14h.",
"template": {
"name": "confirmacao_pedido",
"parameters": { "body": ["Maria", "12345"] }
},
"userId": 3,
"queueId": 7
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sendAt: '2026-09-15T09:00:00-03:00',
contactId: 1042,
channelId: 4,
body: JSON.stringify('Lembrete: sua consulta é amanhã às 14h.'),
template: {
name: 'confirmacao_pedido',
parameters: {body: JSON.stringify(['Maria', '12345'])}
},
userId: 3,
queueId: 7
})
};
fetch('https://api.connectadesk.com/api/v1/schedules/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sendAt' => '2026-09-15T09:00:00-03:00',
'contactId' => 1042,
'channelId' => 4,
'body' => 'Lembrete: sua consulta é amanhã às 14h.',
'template' => [
'name' => 'confirmacao_pedido',
'parameters' => [
'body' => [
'Maria',
'12345'
]
]
],
'userId' => 3,
'queueId' => 7
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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}"
payload := strings.NewReader("{\n \"sendAt\": \"2026-09-15T09:00:00-03:00\",\n \"contactId\": 1042,\n \"channelId\": 4,\n \"body\": \"Lembrete: sua consulta é amanhã às 14h.\",\n \"template\": {\n \"name\": \"confirmacao_pedido\",\n \"parameters\": {\n \"body\": [\n \"Maria\",\n \"12345\"\n ]\n }\n },\n \"userId\": 3,\n \"queueId\": 7\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.connectadesk.com/api/v1/schedules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sendAt\": \"2026-09-15T09:00:00-03:00\",\n \"contactId\": 1042,\n \"channelId\": 4,\n \"body\": \"Lembrete: sua consulta é amanhã às 14h.\",\n \"template\": {\n \"name\": \"confirmacao_pedido\",\n \"parameters\": {\n \"body\": [\n \"Maria\",\n \"12345\"\n ]\n }\n },\n \"userId\": 3,\n \"queueId\": 7\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.connectadesk.com/api/v1/schedules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sendAt\": \"2026-09-15T09:00:00-03:00\",\n \"contactId\": 1042,\n \"channelId\": 4,\n \"body\": \"Lembrete: sua consulta é amanhã às 14h.\",\n \"template\": {\n \"name\": \"confirmacao_pedido\",\n \"parameters\": {\n \"body\": [\n \"Maria\",\n \"12345\"\n ]\n }\n },\n \"userId\": 3,\n \"queueId\": 7\n}"
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_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\"."
}
}Autorizações
Token da API no formato sk_live_….
Parâmetros de caminho
Corpo
Data e hora do envio, no formato ISO 8601. Precisa ser uma data futura.
Sem fuso, vale o fuso da sua empresa. 2026-09-15T09:00:00 envia às
nove da manhã no fuso configurado na empresa. Com fuso explícito
(2026-09-15T09:00:00-03:00) ou em UTC (Z), o valor é respeitado como
está.
"2026-09-15T09:00:00-03:00"
Contato ao qual este registro pertence.
1042
Canal por onde a conversa acontece. Veja os canais disponíveis em GET /channels.
4
Texto da mensagem, em canais de texto livre.
"Lembrete: sua consulta é amanhã às 14h."
Template da mensagem, em canais de WhatsApp oficial. É validado de novo a cada atualização.
Show child attributes
Show child attributes
{ "name": "confirmacao_pedido", "parameters": { "body": ["Maria", "12345"] } }
Id do usuário nesta empresa, o mesmo que GET /users devolve. A mesma pessoa tem um id diferente em cada empresa em que trabalha.
3
Fila de atendimento.
7
Resposta
OK
Show child attributes
Show child attributes
{ "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" }
curl --request PUT \
--url https://api.connectadesk.com/api/v1/schedules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sendAt": "2026-09-15T09:00:00-03:00",
"contactId": 1042,
"channelId": 4,
"body": "Lembrete: sua consulta é amanhã às 14h.",
"template": {
"name": "confirmacao_pedido",
"parameters": {
"body": [
"Maria",
"12345"
]
}
},
"userId": 3,
"queueId": 7
}
'import requests
url = "https://api.connectadesk.com/api/v1/schedules/{id}"
payload = {
"sendAt": "2026-09-15T09:00:00-03:00",
"contactId": 1042,
"channelId": 4,
"body": "Lembrete: sua consulta é amanhã às 14h.",
"template": {
"name": "confirmacao_pedido",
"parameters": { "body": ["Maria", "12345"] }
},
"userId": 3,
"queueId": 7
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sendAt: '2026-09-15T09:00:00-03:00',
contactId: 1042,
channelId: 4,
body: JSON.stringify('Lembrete: sua consulta é amanhã às 14h.'),
template: {
name: 'confirmacao_pedido',
parameters: {body: JSON.stringify(['Maria', '12345'])}
},
userId: 3,
queueId: 7
})
};
fetch('https://api.connectadesk.com/api/v1/schedules/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sendAt' => '2026-09-15T09:00:00-03:00',
'contactId' => 1042,
'channelId' => 4,
'body' => 'Lembrete: sua consulta é amanhã às 14h.',
'template' => [
'name' => 'confirmacao_pedido',
'parameters' => [
'body' => [
'Maria',
'12345'
]
]
],
'userId' => 3,
'queueId' => 7
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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}"
payload := strings.NewReader("{\n \"sendAt\": \"2026-09-15T09:00:00-03:00\",\n \"contactId\": 1042,\n \"channelId\": 4,\n \"body\": \"Lembrete: sua consulta é amanhã às 14h.\",\n \"template\": {\n \"name\": \"confirmacao_pedido\",\n \"parameters\": {\n \"body\": [\n \"Maria\",\n \"12345\"\n ]\n }\n },\n \"userId\": 3,\n \"queueId\": 7\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.connectadesk.com/api/v1/schedules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sendAt\": \"2026-09-15T09:00:00-03:00\",\n \"contactId\": 1042,\n \"channelId\": 4,\n \"body\": \"Lembrete: sua consulta é amanhã às 14h.\",\n \"template\": {\n \"name\": \"confirmacao_pedido\",\n \"parameters\": {\n \"body\": [\n \"Maria\",\n \"12345\"\n ]\n }\n },\n \"userId\": 3,\n \"queueId\": 7\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.connectadesk.com/api/v1/schedules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sendAt\": \"2026-09-15T09:00:00-03:00\",\n \"contactId\": 1042,\n \"channelId\": 4,\n \"body\": \"Lembrete: sua consulta é amanhã às 14h.\",\n \"template\": {\n \"name\": \"confirmacao_pedido\",\n \"parameters\": {\n \"body\": [\n \"Maria\",\n \"12345\"\n ]\n }\n },\n \"userId\": 3,\n \"queueId\": 7\n}"
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_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\"."
}
}
