Criar campanha
POST /v1/campaigns
Exemplo de requisição
curl -X POST "https://app.madmail.com.br/api/v1/campaigns" \
-H "Authorization: Bearer us_SUA_CHAVE" \
-H "Content-Type: application/json" \
-d '{
"name": "Exemplo",
"from": "cliente@exemplo.com",
"subject": "Assunto do e-mail",
"contactBookId": "abc123"
}'Corpo da requisição
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string | Sim | |
from | string | Sim | |
subject | string | Sim | |
previewText | string | Não | |
contactBookId | string | Sim | |
content | string | Não | |
html | string | Não | |
replyTo | string | array<string> | Não | |
cc | string | array<string> | Não | |
bcc | string | array<string> | Não | |
sendNow | boolean | Não | |
scheduledAt | string | Não | Data e hora no formato ISO 8601 ou em linguagem natural em inglês (ex.: 'tomorrow 9am', 'next monday 10:30') |
batchSize | integer | Não |
Exemplo
{
"name": "Exemplo",
"from": "cliente@exemplo.com",
"subject": "Assunto do e-mail",
"contactBookId": "abc123"
}Respostas
200 — Cria uma campanha
| Campo | Tipo | Descrição |
|---|---|---|
id | string | |
name | string | |
from | string | |
subject | string | |
previewText | string | null | |
contactBookId | string | null | |
html | string | null | |
content | string | null | |
status | string | |
scheduledAt | string | null | |
batchSize | integer | |
batchWindowMinutes | integer | |
total | integer | |
sent | integer | |
delivered | integer | |
opened | integer | |
clicked | integer | |
unsubscribed | integer | |
bounced | integer | |
hardBounced | integer | |
complained | integer | |
replyTo | array<string> | |
cc | array<string> | |
bcc | array<string> | |
createdAt | string | |
updatedAt | string |
Exemplo de resposta
{
"id": "abc123",
"name": "Exemplo",
"from": "cliente@exemplo.com",
"subject": "Assunto do e-mail",
"previewText": "string",
"contactBookId": "abc123",
"html": "<p>Olá!</p>",
"content": "string",
"status": "string",
"scheduledAt": "2024-01-01T00:00:00Z",
"batchSize": 1,
"batchWindowMinutes": 1,
"total": 1,
"sent": 1,
"delivered": 1,
"opened": 1,
"clicked": 1,
"unsubscribed": 1,
"bounced": 1,
"hardBounced": 1,
"complained": 1,
"replyTo": [
"string"
],
"cc": [
"string"
],
"bcc": [
"string"
],
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}