POST/api/v4/bulk-posts

Crear una publicación masiva

Crea una publicación en redes sociales y la publica en muchas ubicaciones con una sola solicitud.

Requiere una clave de API. Consulta Autenticación para conocer el formato del encabezado y la rotación de claves.

Parámetros

Cuerpo

Un campo anidado marcado como obligatorio solo se aplica cuando envías su campo principal. Si el campo principal es opcional y lo omites, sus campos hijos obligatorios no se aplican.

NombreTipoObligatorioDescripción
inputobjectobligatorioWrapper object. Every field below is a property of `input`, the entire body must be nested under it.
input.postNamestringobligatorioInternal name for the campaign (not shown publicly).
input.locationIdsarray of stringsobligatorioBase64-encoded location Relay IDs to publish to.
input.postTypestringobligatorioOne of `EVENT`, `OFFER`, `ANNOUNCEMENT`, `COVID19`, `PRODUCT`.
input.postSitesarray of stringsobligatorioTarget publishers: `GOOGLE` and/or `FACEBOOK`.
input.postMessagearray of objectsopcionalPer-site post body. Each entry: `site` and `message`.
input.postMessage[].sitestringobligatorioPublisher for this message: `GOOGLE` or `FACEBOOK`.
input.postMessage[].messagestringobligatorioPost body text for that site.
input.postMediaUrlarray of objectsopcionalPer-site media. Each entry: `site`, `url`, and `type` (`IMAGE` or `VIDEO`).
input.postMediaUrl[].sitestringobligatorioPublisher for this media asset.
input.postMediaUrl[].urlstringobligatorioPublicly 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.startDatetimestringobligatorioISO-8601 datetime the post goes live.
input.postScheduledDates.endDatetimestringobligatorioISO-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.

Solicitud de ejemplo

Cuerpo listo para pegar. Sustituye los ID y valores de ejemplo por los tuyos.

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"    }  }}

Respuestas

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.

Crea una única campaña de publicación y la distribuye a todas las ubicaciones de locationIds, publicándola en los postSites seleccionados. A diferencia de la creación por ubicación, una sola llamada abarca todas tus ubicaciones, lo que permite difundir de forma eficiente un anuncio, una oferta o un evento para toda la empresa.

Estructura de la solicitud. Todo el cuerpo debe estar envuelto en un objeto input; cada campo (postName, locationIds, postType, …) es una propiedad de input. Un cuerpo plano, sin envolver, se rechaza con un HTTP 400 (Variable "$input" of required type ... was not provided). Este es el mismo contrato que el de POST /posts, y una respuesta correcta utiliza la clave createSocialPost en lugar de una clave específica para publicaciones masivas.

Caso de uso: anuncio para toda la empresa (mostrado arriba). Configura postType: "ANNOUNCEMENT", enumera los ID de las ubicaciones y proporciona un postMessage por ubicación. Añade postScheduledDates para que la publicación esté activa durante un período fijo (la publicación se crea entonces con el estado SCHEDULED); omítelo para publicar de inmediato.

Caso de uso: una oferta por tiempo limitado en todas las tiendas. Cambia postType a OFFER e incluye el cupón en postContextInfo (manteniendo el cuerpo envuelto en 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"    }  }}

Aspectos que debes tener en cuenta.

  • El cuerpo debe estar envuelto en input; si envías los campos en el nivel superior, se devuelve un HTTP 400.
  • postType, postSites, postName y locationIds son obligatorios; los tipos EVENT, OFFER y PRODUCT requieren además los campos postContextInfo (o products) correspondientes.
  • postSites solo acepta GOOGLE y FACEBOOK; las ubicaciones de destino deben tener conectado el canal correspondiente o se omitirá la ubicación.
  • La respuesta devuelve HTTP 200 con success: false y un array errors con elementos si la validación falla de forma parcial o total; comprueba success y, a continuación, supervisa la entrega en tiempo real por ubicación mediante el endpoint de consulta de publicaciones masivas.
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"      }    }  }'