POST/api/v4/social/posts

Crea un post sui social

Crea un post in bozza, programmato o pubblicato immediatamente sugli account Facebook, Instagram, X, LinkedIn e Pinterest collegati a un brand.

Richiede una chiave API. Consulta Autenticazione per il formato dell’header e la rotazione delle chiavi.

Parametri

Corpo

NomeTipoObbligatorioDescrizione
inputobjectobbligatorioWrapper object. Every field below is a property of `input`, the entire body must be nested under it.
input.socialProfileIdstringobbligatorioUUID of the brand publishing the post, the same value used as the `brandId` path token elsewhere. Every platform in `platforms` must already have a connection on this brand.
input.namestringobbligatorioInternal name for the post (not shown to the audience). Used to find it again in lists.
input.platformsarray of stringsobbligatorioPlatforms to publish to: `FACEBOOK`, `INSTAGRAM`, `TWITTER` (X), `LINKEDIN`, `PINTEREST`.
input.contentstringobbligatorioThe post body, published to every platform in `platforms`.
input.actionstringobbligatorio`DRAFT` to save without publishing, `SCHEDULE` to publish at a future time (requires a schedule), or `PUBLISH` to publish now.
input.mediaUrlsarray of stringsfacoltativoPublic https image URLs to attach. Instagram and Pinterest require at least one.
input.videoUrlsarray of stringsfacoltativoPublic https video URLs to attach.
input.linkstringfacoltativoLink to attach to the post where the platform supports one.
input.scheduledAtstringfacoltativoPublish time as an ISO-8601 timestamp with an offset, e.g. `2026-10-02T09:30:00-04:00`. Required when `action` is `SCHEDULE` unless you send `scheduleDate` + `scheduleTime`. Never send both forms.
input.scheduleDatestringfacoltativoPublish date as `YYYY-MM-DD`, interpreted in the **brand's** timezone. Must be sent together with `scheduleTime`.
input.scheduleTimestringfacoltativoPublish time as `HH:MM` (24-hour), interpreted in the **brand's** timezone. Must be sent together with `scheduleDate`.
input.connectedChannelIdsarray of stringsfacoltativoRestrict publishing to specific connections by their `id` from the connections list. Defaults to the brand's active connection for each platform in `platforms`.
input.clientReferencestringfacoltativoYour own identifier for this post, stored and echoed back. Use it to reconcile the post against your own records without holding onto the returned UUID.

Richiesta di esempio

Corpo pronto da incollare. Sostituisci gli ID e i valori segnaposto con i tuoi.

Request body
{  "input": {    "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902",    "name": "Autumn collection launch",    "platforms": ["INSTAGRAM", "FACEBOOK", "LINKEDIN"],    "content": "Our autumn collection lands today. Solid oak, hand-finished, made two blocks from the shop. Come see it in person this weekend.",    "mediaUrls": ["https://cdn.example.com/social/autumn-collection.jpg"],    "link": "https://jennyhome.example/autumn",    "action": "SCHEDULE",    "scheduleDate": "2026-10-02",    "scheduleTime": "09:30",    "clientReference": "campaign-4471-slot-01"  }}

Risposte

200Post accepted. Publishing runs asynchronously, poll GET /social/posts/{postId} for per-channel status.
Response
{  "data": {    "createSimpleSocialMediaPost": {      "success": true,      "error": [],      "socialPostId": "c47a1e58-2b93-4f10-a6d7-58e0c9b12345",      "status": "SCHEDULED"    }  }}
200Validation failed. Nothing was created. The status is still 200: read `success` and the `error` array.
Response
{  "data": {    "createSimpleSocialMediaPost": {      "success": false,      "error": [        {          "message": "SY95045: No connected channel for PINTEREST on this brand",          "code": "SY95045",          "contextInfo": [{ "key": "platform", "value": "PINTEREST" }]        },        {          "message": "SY95046: scheduleTime must be HH:MM in the brand's timezone",          "code": "SY95046",          "contextInfo": null        }      ],      "socialPostId": null,      "status": null    }  }}
401Unauthenticated, missing or invalid API key.
404No brand with that ID on this account (`SY95043`).

Crea un post per un brand su uno o più dei suoi account social collegati. La stessa chiamata copre tutti e tre i cicli di vita: salvare un DRAFT, mettere in coda un SCHEDULE o PUBLISH immediatamente.

Caso d'uso: programmare una campagna dal tuo calendario. La tua app sa già cosa vuole comunicare un cliente e quando. Per ogni fascia oraria, chiama questo endpoint con action: "SCHEDULE" e con scheduledAt oppure scheduleDate + scheduleTime, e passa il tuo identificatore della fascia oraria come clientReference, così puoi effettuare la riconciliazione senza memorizzare l'UUID restituito. Mostra la voce come in attesa finché GET /social/posts/{postId} non segnala che il post è pubblicato su ogni canale e offri un pulsante di annullamento collegato a POST /social/posts/cancel.

La pubblicazione è asincrona

action: "PUBLISH" non pubblica prima di rispondere. La chiamata accetta il post, restituisce un socialPostId e lo passa alla pipeline di pubblicazione. Per sapere cosa è effettivamente successo, interroga periodicamente GET /social/posts/{postId} e leggi l'array channels[] con i risultati per canale: il valore status di ogni voce è l'esito per quella singola piattaforma. Nella stessa richiesta, un post può essere pubblicato correttamente su Instagram e non essere pubblicato su LinkedIn, quindi channels[] è la fonte attendibile e status a livello di post è un riepilogo.

Scegliere una programmazione

action: "SCHEDULE" richiede esattamente una delle due forme, mai entrambe:

FormaCampiInterpretata in base a
Istante assolutoscheduledAt, ISO-8601 con un offset (2026-10-02T09:30:00-04:00)L'offset che hai inviato
Ora localescheduleDate (YYYY-MM-DD) e scheduleTime (HH:MM)Il fuso orario del brand

L'invio di entrambe le forme, di scheduleDate senza scheduleTime o di un scheduledAt senza offset viene rifiutato con SY95046. DRAFT e PUBLISH non devono includere alcuna programmazione.

Note.

  • Il corpo della richiesta deve essere racchiuso in un oggetto input.
  • Controlla success, non lo stato HTTP. Gli errori di validazione vengono restituiti come HTTP 200 con success: false e una voce nell'array error per ogni problema. Non viene creato nulla quando success è false.
  • Il brand è identificato nel corpo come socialProfileId. brandId è sempre e solo un token nel percorso dell'URL, mai un campo del corpo.
  • Ogni piattaforma in platforms deve già avere una connessione sul brand. Per una piattaforma senza un canale attivo, l'operazione fallisce con SY95045; leggi prima le connessioni del brand e indirizza l'utente a un link di connessione per ogni connessione mancante.
  • I valori delle piattaforme sono i nomi dell'enum in maiuscolo FACEBOOK, INSTAGRAM, TWITTER, LINKEDIN, PINTEREST. TWITTER corrisponde a X; il valore ha mantenuto il vecchio nome e un valore in minuscolo viene rifiutato.
  • Instagram e Pinterest non accettano post di solo testo: fornisci almeno una voce mediaUrls quando una delle due piattaforme è presente in platforms.
  • Gli ID dei post sono semplici UUID, non gli ID relay in Base64 usati dai post delle sedi.
  • Per inviare più di qualche post in una sola volta, usa POST /social/bulk-posts, che accetta la stessa struttura delle righe e convalida l'intero lotto prima di elaborarlo.

Operazione di scrittura: non eseguita sull'account reale. La richiesta e la risposta mostrate sono costruite a partire dallo schema dell'API; quando viene eseguita, questa operazione pubblica su account social reali.

Request
curl -X POST 'https://listingsapi.com/api/v4/social/posts' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "input": {      "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902",      "name": "Autumn collection launch",      "platforms": [        "INSTAGRAM",        "FACEBOOK",        "LINKEDIN"      ],      "content": "Our autumn collection lands today. Solid oak, hand-finished, made two blocks from the shop. Come see it in person this weekend.",      "mediaUrls": [        "https://cdn.example.com/social/autumn-collection.jpg"      ],      "link": "https://jennyhome.example/autumn",      "action": "SCHEDULE",      "scheduleDate": "2026-10-02",      "scheduleTime": "09:30",      "clientReference": "campaign-4471-slot-01"    }  }'