Madmail

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

CampoTipoObrigatórioDescrição
namestringSim
fromstringSim
subjectstringSim
previewTextstringNão
contactBookIdstringSim
contentstringNão
htmlstringNão
replyTostring | array<string>Não
ccstring | array<string>Não
bccstring | array<string>Não
sendNowbooleanNão
scheduledAtstringNãoData e hora no formato ISO 8601 ou em linguagem natural em inglês (ex.: 'tomorrow 9am', 'next monday 10:30')
batchSizeintegerNão

Exemplo

{
  "name": "Exemplo",
  "from": "cliente@exemplo.com",
  "subject": "Assunto do e-mail",
  "contactBookId": "abc123"
}

Respostas

200 — Cria uma campanha

CampoTipoDescrição
idstring
namestring
fromstring
subjectstring
previewTextstring | null
contactBookIdstring | null
htmlstring | null
contentstring | null
statusstring
scheduledAtstring | null
batchSizeinteger
batchWindowMinutesinteger
totalinteger
sentinteger
deliveredinteger
openedinteger
clickedinteger
unsubscribedinteger
bouncedinteger
hardBouncedinteger
complainedinteger
replyToarray<string>
ccarray<string>
bccarray<string>
createdAtstring
updatedAtstring
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"
}