POST/api/v4/bulk-posts

Criar uma publicação em massa

Cria uma publicação em redes sociais e a publica em vários locais em uma única requisição.

Requer uma chave de API. Consulte Autenticação para ver o formato do cabeçalho e a rotação de chaves.

Parâmetros

Corpo

Um campo aninhado marcado como obrigatório só se aplica quando você envia o campo pai. Se o campo pai for opcional e você o omitir, os campos filhos obrigatórios não se aplicam.

NomeTipoObrigatórioDescrição
inputobjectobrigatórioWrapper object. Every field below is a property of `input`, the entire body must be nested under it.
input.postNamestringobrigatórioInternal name for the campaign (not shown publicly).
input.locationIdsarray of stringsobrigatórioBase64-encoded location Relay IDs to publish to.
input.postTypestringobrigatórioOne of `EVENT`, `OFFER`, `ANNOUNCEMENT`, `COVID19`, `PRODUCT`.
input.postSitesarray of stringsobrigatórioTarget publishers: `GOOGLE` and/or `FACEBOOK`.
input.postMessagearray of objectsopcionalPer-site post body. Each entry: `site` and `message`.
input.postMessage[].sitestringobrigatórioPublisher for this message: `GOOGLE` or `FACEBOOK`.
input.postMessage[].messagestringobrigatórioPost body text for that site.
input.postMediaUrlarray of objectsopcionalPer-site media. Each entry: `site`, `url`, and `type` (`IMAGE` or `VIDEO`).
input.postMediaUrl[].sitestringobrigatórioPublisher for this media asset.
input.postMediaUrl[].urlstringobrigatórioPublicly accessible media URL.
input.postMediaUrl[].typestringopcional`IMAGE` or `VIDEO`.
input.postCtaarray of objectsopcionalPer-site call-to-action button. Each entry: `site`, `type`, `url`.
input.postScheduledDatesobjectopcionalScheduling window: `startDatetime`, `endDatetime`, and optional `removalSites`. When provided, the post is created with status `SCHEDULED`.
input.postScheduledDates.startDatetimestringobrigatórioISO-8601 datetime the post goes live.
input.postScheduledDates.endDatetimestringobrigatórioISO-8601 datetime the post is removed.
input.postContextInfoobjectopcionalType-specific details (offer coupon/redeem/terms, or event title/times). Required by `OFFER`, `EVENT`, and `PRODUCT` posts.
input.productsarray of objectsopcionalProduct entries for `PRODUCT` posts (name, price, photo, cta).
input.componentIdentifierstringopcionalOptional client component reference for tracking.
input.componentTypestringopcionalOptional client component type for tracking.

Exemplo de requisição

Corpo pronto para colar. Substitua os IDs e valores de exemplo pelos seus.

Request body
{  "input": {    "postName": "July Reopening Announcement",    "locationIds": [      "TG9jYXRpb246MTgwMDI4OQ==",      "TG9jYXRpb246MTgwMDI5MA=="    ],    "postType": "ANNOUNCEMENT",    "postSites": ["GOOGLE", "FACEBOOK"],    "postMessage": [      { "site": "GOOGLE", "message": "We're back! Visit us this week for our summer menu." },      { "site": "FACEBOOK", "message": "We're back! Swing by for the new summer menu." }    ],    "postMediaUrl": [      { "site": "GOOGLE", "url": "https://cdn.example.com/summer.jpg", "type": "IMAGE" }    ],    "postScheduledDates": {      "startDatetime": "2026-07-10T09:00:00Z",      "endDatetime": "2026-07-24T23:59:00Z"    }  }}

Respostas

200Bulk post accepted. `success` is true and the created campaign is returned. Note the response is keyed under `createSocialPost`: the bulk endpoint returns the same response shape as `POST /posts`.
Response
{  "data": {    "createSocialPost": {      "clientMutationId": null,      "success": true,      "errors": null,      "socialPost": {        "id": "U29jaWFsUG9zdDo5OTIwMQ==",        "name": "July Reopening Announcement",        "status": "SCHEDULED",        "type": "ANNOUNCEMENT",        "createdAt": "2026-07-08",        "scheduledStartDate": "2026-07-10",        "scheduledEndDate": "2026-07-24",        "sites": ["GOOGLE", "FACEBOOK"],        "locationIds": [1800289, 1800290]      }    }  }}
400Bad request, the body was not wrapped in `input` (error message: `Variable "$input" of required type ... was not provided`).
401Unauthenticated, missing or invalid API key.

Cria uma campanha com uma única publicação e a distribui para todos os locais em locationIds, publicando em postSites selecionados. Ao contrário da criação por local, uma única chamada abrange todos os seus locais, o que é uma forma eficiente de divulgar um anúncio, uma oferta ou um evento para toda a empresa.

Estrutura da requisição. Todo o corpo deve estar encapsulado em um objeto input; cada campo (postName, locationIds, postType, …) é uma propriedade de input. Um corpo sem esse encapsulamento é rejeitado com HTTP 400 (Variable "$input" of required type ... was not provided). Esse é o mesmo contrato de POST /posts, e uma resposta bem-sucedida usa a chave createSocialPost em vez de uma chave específica para operações em massa.

Caso de uso: anúncio para toda a empresa (mostrado acima). Defina postType: "ANNOUNCEMENT", liste os IDs dos locais e forneça um postMessage por local. Adicione postScheduledDates para veicular a publicação durante um período fixo (nesse caso, a publicação é criada com o status SCHEDULED); omita esse campo para publicar imediatamente.

Caso de uso: uma oferta por tempo limitado em todas as lojas. Altere postType para OFFER e forneça o cupom em postContextInfo (mantendo o encapsulamento em input):

JSON
{  "input": {    "postName": "Summer 20% Off",    "locationIds": ["TG9jYXRpb246MTgwMDI4OQ=="],    "postType": "OFFER",    "postSites": ["GOOGLE"],    "postMessage": [{ "site": "GOOGLE", "message": "20% off through July!" }],    "postContextInfo": {      "title": "Summer Sale",      "couponCode": "SUMMER20",      "redeemUrl": "https://example.com/offer",      "termsConditions": "Valid through July 31",      "startDay": "2026-07-10",      "startTime": "09:00",      "endDay": "2026-07-31",      "endTime": "23:59"    }  }}

Pontos de atenção.

  • O corpo deve estar encapsulado em input; o envio dos campos no nível superior resulta em HTTP 400.
  • postType, postSites, postName e locationIds são obrigatórios; os tipos EVENT, OFFER e PRODUCT também exigem os campos postContextInfo (ou products) correspondentes.
  • postSites aceita apenas GOOGLE e FACEBOOK; os locais de destino devem ter o canal correspondente conectado, caso contrário, o local sem conexão é ignorado.
  • Em caso de falha parcial ou total na validação, a resposta retorna HTTP 200 com success: false e um array errors preenchido; verifique success e, em seguida, acompanhe a entrega em tempo real por local com o endpoint de consulta de publicação em massa.
Request
curl -X POST 'https://listingsapi.com/api/v4/bulk-posts' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "input": {      "postName": "July Reopening Announcement",      "locationIds": [        "TG9jYXRpb246MTgwMDI4OQ==",        "TG9jYXRpb246MTgwMDI5MA=="      ],      "postType": "ANNOUNCEMENT",      "postSites": [        "GOOGLE",        "FACEBOOK"      ],      "postMessage": [        {          "site": "GOOGLE",          "message": "We're back! Visit us this week for our summer menu."        },        {          "site": "FACEBOOK",          "message": "We're back! Swing by for the new summer menu."        }      ],      "postMediaUrl": [        {          "site": "GOOGLE",          "url": "https://cdn.example.com/summer.jpg",          "type": "IMAGE"        }      ],      "postScheduledDates": {        "startDatetime": "2026-07-10T09:00:00Z",        "endDatetime": "2026-07-24T23:59:00Z"      }    }  }'