POST /v1/campaigns
const url = 'https://seu-endereco-da-api/v1/campaigns';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","channelId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","kind":"template","templateId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","templateVariables":[{}],"headerMediaKey":"example","headerMediaMime":"example","cardMedia":[{}],"audienceFilter":{},"segmentId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","gatewaySteps":[{"id":"example","kind":"text","text":"example","mediaKey":"example","mediaMime":"example","fileName":"example","delaySec":1}],"gatewayConfig":{"gapMin":1,"gapMax":1,"dailyLimit":1,"businessHours":true,"businessHoursConfigId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"},"rotationChannelIds":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"rotationMode":"roundrobin","rotationSwitchEvery":1,"emailTemplateId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","subject":"example","smsBody":"example","scheduledAt":"example","stopOnReply":true,"optimizedMarketing":true,"handoffFlowId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","optOutKeywords":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://seu-endereco-da-api/v1/campaigns \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "channelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "kind": "template", "templateId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "templateVariables": [ {} ], "headerMediaKey": "example", "headerMediaMime": "example", "cardMedia": [ {} ], "audienceFilter": {}, "segmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "gatewaySteps": [ { "id": "example", "kind": "text", "text": "example", "mediaKey": "example", "mediaMime": "example", "fileName": "example", "delaySec": 1 } ], "gatewayConfig": { "gapMin": 1, "gapMax": 1, "dailyLimit": 1, "businessHours": true, "businessHoursConfigId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "rotationChannelIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "rotationMode": "roundrobin", "rotationSwitchEvery": 1, "emailTemplateId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "subject": "example", "smsBody": "example", "scheduledAt": "example", "stopOnReply": true, "optimizedMarketing": true, "handoffFlowId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "optOutKeywords": [ "example" ] }'Permissão que a Chave de acesso precisa: Criar e disparar campanhas (campaigns:manage).
Authorizations
Seção intitulada “Authorizations”Request Bodyrequired
Seção intitulada “Request Bodyrequired”object
object
object
object
object
object
Responses
Seção intitulada “Responses”object
object
O nome que o cliente deu ao canal na plataforma
O numero ou @ da conta no provedor
O nome da conta no provedor: o verificado da Meta, ou o do aparelho no canal lite
O canal foi apagado; a conversa continua descrevendo por onde ela aconteceu
Each item is a fixed text or { field, fallback } bound to a contact field
object
Temporary link to the header media; only on the single-campaign read
object
object
Subject typed for the campaign; empty means the template subject
Segmento salvo de que este publico veio; a campanha guarda a propria copia da regra
A regra de publico guardada na campanha; nula quando vai para a base inteira
object
Status para mostrar: a campanha concluida em que todo envio falhou vira failed, e a que teve parte das falhas vira completed_with_failures
Entregues / (entregues + falhas), de 0 a 1; nula sem nenhum envio concluido
Quem respondeu depois de receber / entregues, de 0 a 1; nula sem entregues
Recipients left out when the audience was materialized: no address, suppressed, blocked or duplicated
Why a broadcast campaign paused itself: insufficient_funds, bounce_rate, spam_rate or provider_auth
object
Mensagem presa: o numero esta desconectado ou ainda nao enviou
Quem recebeu: entregue, lida, parou por ter respondido ou respondeu
Quem nao recebeu: falhou sem nunca ter respondido
Custo em centavos, pela mesma conta do relatorio de campanhas
Present on the detail: what the AI did to create this campaign, if it did.
object
Present on the detail: whether any message of this campaign really went through the Meta marketing API.
Example
{ "kind": "template", "gatewaySteps": [ { "kind": "text" } ], "displayStatus": "draft"}