curl --request POST \
--url https://api.notifique.dev/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Black Friday SMS+WA",
"templateId": "tpl_abc123",
"channels": [
"whatsapp",
"sms"
],
"segmentId": "seg_xyz",
"instanceId": "wa_inst_1",
"variables": {
"discount": "10",
"campaign_name": "bf_2026"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Black Friday SMS+WA',
templateId: 'tpl_abc123',
channels: ['whatsapp', 'sms'],
segmentId: 'seg_xyz',
instanceId: 'wa_inst_1',
variables: {discount: '10', campaign_name: 'bf_2026'}
})
};
fetch('https://api.notifique.dev/v1/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/campaigns"
payload = {
"name": "Black Friday SMS+WA",
"templateId": "tpl_abc123",
"channels": ["whatsapp", "sms"],
"segmentId": "seg_xyz",
"instanceId": "wa_inst_1",
"variables": {
"discount": "10",
"campaign_name": "bf_2026"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notifique.dev/v1/campaigns"
payload := strings.NewReader("{\n \"name\": \"Black Friday SMS+WA\",\n \"templateId\": \"tpl_abc123\",\n \"channels\": [\n \"whatsapp\",\n \"sms\"\n ],\n \"segmentId\": \"seg_xyz\",\n \"instanceId\": \"wa_inst_1\",\n \"variables\": {\n \"discount\": \"10\",\n \"campaign_name\": \"bf_2026\"\n }\n}")
req, _ := http.NewRequest("POST", 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))
}{
"success": true,
"data": {
"id": "clxx...",
"name": "Exemplo",
"status": "DRAFT",
"templateId": "clxx...",
"channels": [
"whatsapp"
],
"segmentId": "clxx...",
"audienceContactIds": [
"clxx..."
],
"scheduledFor": "2025-02-10T14:00:00.000Z",
"instanceId": "clxx...",
"telegramInstanceId": "clxx...",
"fromEmail": "string",
"channelFailureMode": "STRICT",
"variables": {},
"startedAt": "2025-02-10T14:00:00.000Z",
"completedAt": "2025-02-10T14:00:00.000Z",
"errorMessage": "string",
"createdAt": "2025-02-10T14:00:00.000Z",
"updatedAt": "2025-02-10T14:00:00.000Z",
"audienceCount": 1,
"lastRunAt": "2025-02-10T14:00:00.000Z",
"sendingPoolId": "clxx..."
}
}{
"success": false,
"error": "Bad Request",
"code": "VALIDATION_ERROR",
"message": "Campo inválido ou ausente."
}{
"success": false,
"error": "Bad Request",
"code": "VALIDATION_ERROR",
"message": "Campo inválido ou ausente."
}{
"success": false,
"error": "Bad Request",
"code": "VALIDATION_ERROR",
"message": "Campo inválido ou ausente."
}{
"success": false,
"error": "Bad Request",
"code": "VALIDATION_ERROR",
"message": "Campo inválido ou ausente."
}{
"success": false,
"error": "string",
"message": "string",
"code": "string"
}Criar campanha
Cadastra um novo campanha.
curl --request POST \
--url https://api.notifique.dev/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Black Friday SMS+WA",
"templateId": "tpl_abc123",
"channels": [
"whatsapp",
"sms"
],
"segmentId": "seg_xyz",
"instanceId": "wa_inst_1",
"variables": {
"discount": "10",
"campaign_name": "bf_2026"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Black Friday SMS+WA',
templateId: 'tpl_abc123',
channels: ['whatsapp', 'sms'],
segmentId: 'seg_xyz',
instanceId: 'wa_inst_1',
variables: {discount: '10', campaign_name: 'bf_2026'}
})
};
fetch('https://api.notifique.dev/v1/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/campaigns"
payload = {
"name": "Black Friday SMS+WA",
"templateId": "tpl_abc123",
"channels": ["whatsapp", "sms"],
"segmentId": "seg_xyz",
"instanceId": "wa_inst_1",
"variables": {
"discount": "10",
"campaign_name": "bf_2026"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notifique.dev/v1/campaigns"
payload := strings.NewReader("{\n \"name\": \"Black Friday SMS+WA\",\n \"templateId\": \"tpl_abc123\",\n \"channels\": [\n \"whatsapp\",\n \"sms\"\n ],\n \"segmentId\": \"seg_xyz\",\n \"instanceId\": \"wa_inst_1\",\n \"variables\": {\n \"discount\": \"10\",\n \"campaign_name\": \"bf_2026\"\n }\n}")
req, _ := http.NewRequest("POST", 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))
}{
"success": true,
"data": {
"id": "clxx...",
"name": "Exemplo",
"status": "DRAFT",
"templateId": "clxx...",
"channels": [
"whatsapp"
],
"segmentId": "clxx...",
"audienceContactIds": [
"clxx..."
],
"scheduledFor": "2025-02-10T14:00:00.000Z",
"instanceId": "clxx...",
"telegramInstanceId": "clxx...",
"fromEmail": "string",
"channelFailureMode": "STRICT",
"variables": {},
"startedAt": "2025-02-10T14:00:00.000Z",
"completedAt": "2025-02-10T14:00:00.000Z",
"errorMessage": "string",
"createdAt": "2025-02-10T14:00:00.000Z",
"updatedAt": "2025-02-10T14:00:00.000Z",
"audienceCount": 1,
"lastRunAt": "2025-02-10T14:00:00.000Z",
"sendingPoolId": "clxx..."
}
}{
"success": false,
"error": "Bad Request",
"code": "VALIDATION_ERROR",
"message": "Campo inválido ou ausente."
}{
"success": false,
"error": "Bad Request",
"code": "VALIDATION_ERROR",
"message": "Campo inválido ou ausente."
}{
"success": false,
"error": "Bad Request",
"code": "VALIDATION_ERROR",
"message": "Campo inválido ou ausente."
}{
"success": false,
"error": "Bad Request",
"code": "VALIDATION_ERROR",
"message": "Campo inválido ou ausente."
}{
"success": false,
"error": "string",
"message": "string",
"code": "string"
}Autorizações
Authorization: Bearer sk_live_xxxxx
Corpo
templateId obrigatório. channels ⊆ enabledChannels do template (whatsapp, sms, email, telegram). Com scheduledFor (≥ ~2 min), status inicial SCHEDULED. Sending Pool WhatsApp: configure no painel (a API v1 de create ainda não envia sendingPoolId).
128Template cujo conjunto de canais habilitados restringe channels.
11Canal na campanha (create/update): whatsapp, sms, email, telegram, push, rcs, instagram. Deve ser subconjunto dos canais habilitados no template.
whatsapp, sms, email, telegram, push, rcs, instagram Lista fixa de contatos (máx. 10.000). Mutuamente exclusivo com segmentId.
10000ISO-8601. Mínimo ~2 minutos no futuro → status SCHEDULED.
Instância WhatsApp (obrigatória na prática se incluir whatsapp e não houver padrão no workspace).
Instância Telegram (obrigatória na prática se incluir telegram e não houver padrão no workspace).
Modo de falha por canal. Padrão STRICT.
STRICT, PARTIAL, strict, partial, pessimistic, optimistic, best_effort Mesclado por cima das propriedades do contato no render do template.
Show child attributes
Show child attributes
Sending Pool WhatsApp (alternativa a instanceId quando whatsapp ∈ channels).
Resposta
Criada.
Campanha multicanal. channels ⊆ canais habilitados do template (whatsapp|sms|email|telegram). Status: DRAFT, SCHEDULED, RUNNING, COMPLETED, FAILED, CANCELLED.
Show child attributes
Show child attributes
{
"id": "clxx...",
"name": "Exemplo",
"status": "DRAFT",
"templateId": "clxx...",
"channels": ["whatsapp"],
"segmentId": "clxx...",
"audienceContactIds": ["clxx..."],
"scheduledFor": "2025-02-10T14:00:00.000Z",
"instanceId": "clxx...",
"telegramInstanceId": "clxx...",
"fromEmail": "string",
"channelFailureMode": "STRICT",
"variables": {},
"startedAt": "2025-02-10T14:00:00.000Z",
"completedAt": "2025-02-10T14:00:00.000Z",
"errorMessage": "string",
"createdAt": "2025-02-10T14:00:00.000Z",
"updatedAt": "2025-02-10T14:00:00.000Z",
"audienceCount": 1,
"lastRunAt": "2025-02-10T14:00:00.000Z",
"sendingPoolId": "clxx..."
}
Esta página foi útil?

