/api/v4/social/postsCrea 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.
Parametri
Corpo
| Nome | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
| input | object | obbligatorio | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.socialProfileId | string | obbligatorio | UUID 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.name | string | obbligatorio | Internal name for the post (not shown to the audience). Used to find it again in lists. |
| input.platforms | array of strings | obbligatorio | Platforms to publish to: `FACEBOOK`, `INSTAGRAM`, `TWITTER` (X), `LINKEDIN`, `PINTEREST`. |
| input.content | string | obbligatorio | The post body, published to every platform in `platforms`. |
| input.action | string | obbligatorio | `DRAFT` to save without publishing, `SCHEDULE` to publish at a future time (requires a schedule), or `PUBLISH` to publish now. |
| input.mediaUrls | array of strings | facoltativo | Public https image URLs to attach. Instagram and Pinterest require at least one. |
| input.videoUrls | array of strings | facoltativo | Public https video URLs to attach. |
| input.link | string | facoltativo | Link to attach to the post where the platform supports one. |
| input.scheduledAt | string | facoltativo | Publish 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.scheduleDate | string | facoltativo | Publish date as `YYYY-MM-DD`, interpreted in the **brand's** timezone. Must be sent together with `scheduleTime`. |
| input.scheduleTime | string | facoltativo | Publish time as `HH:MM` (24-hour), interpreted in the **brand's** timezone. Must be sent together with `scheduleDate`. |
| input.connectedChannelIds | array of strings | facoltativo | Restrict publishing to specific connections by their `id` from the connections list. Defaults to the brand's active connection for each platform in `platforms`. |
| input.clientReference | string | facoltativo | Your 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.
{ "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.
{ "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.
{ "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:
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 comeHTTP 200consuccess: falsee una voce nell'arrayerrorper ogni problema. Non viene creato nulla quandosuccessè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
platformsdeve già avere una connessione sul brand. Per una piattaforma senza un canale attivo, l'operazione fallisce conSY95045; 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.TWITTERcorrisponde 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
mediaUrlsquando una delle due piattaforme è presente inplatforms. - 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.
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" } }'