/api/v4/social/bulk-postsCrea post in blocco
Convalida e accoda fino a 500 post social in una richiesta e restituisce un job da interrogare periodicamente per i risultati di ogni riga.
Parametri
Corpo
Un campo annidato contrassegnato come obbligatorio si applica solo quando invii il campo padre. Se il padre è facoltativo e lo ometti, i suoi campi figli obbligatori non si applicano.
| Nome | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
| input | object | obbligatorio | Wrapper object. The entire request body must be nested under `input`. |
| input.posts | array of objects | obbligatorio | The rows to create, 1 to 500 of them. Each row is the same object POST /social/posts takes as its `input`; the per-row fields are listed below. |
| input.name | string | facoltativo | Optional label for the job itself, to identify it in your own logs. Not shown to any audience. |
| input.posts[].socialProfileId | string | obbligatorio | UUID of the brand publishing this row. Rows may target different brands in one request. |
| input.posts[].name | string | obbligatorio | Internal name for the post. |
| input.posts[].platforms | array of strings | obbligatorio | Platforms for this row: `FACEBOOK`, `INSTAGRAM`, `TWITTER` (X), `LINKEDIN`, `PINTEREST`. Each must already have a connection on that row's brand. |
| input.posts[].content | string | obbligatorio | The post body. |
| input.posts[].action | string | obbligatorio | `DRAFT`, `SCHEDULE` (requires a schedule) or `PUBLISH`. |
| input.posts[].mediaUrls | array of strings | facoltativo | Public https image URLs. Required when the row targets Instagram or Pinterest. |
| input.posts[].videoUrls | array of strings | facoltativo | Public https video URLs. |
| input.posts[].link | string | facoltativo | Link to attach where the platform supports one. |
| input.posts[].scheduledAt | string | facoltativo | ISO-8601 publish instant with an offset. Alternative to `scheduleDate` + `scheduleTime`, never both. |
| input.posts[].scheduleDate | string | facoltativo | `YYYY-MM-DD`, interpreted in that row's brand timezone. Send with `scheduleTime`. |
| input.posts[].scheduleTime | string | facoltativo | `HH:MM`, interpreted in that row's brand timezone. Send with `scheduleDate`. |
| input.posts[].connectedChannelIds | array of strings | facoltativo | Restrict this row to specific connections by ID. |
| input.posts[].clientReference | string | facoltativo | Your own identifier for this row, echoed back on the matching job result. The most reliable way to reconcile a batch against your own records. |
Richiesta di esempio
Corpo pronto da incollare. Sostituisci gli ID e i valori segnaposto con i tuoi.
{ "input": { "name": "Autumn campaign load", "posts": [ { "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "name": "Autumn week 1", "platforms": ["INSTAGRAM", "FACEBOOK"], "content": "Week one of the autumn collection: the Fairfield oak sideboard, finished by hand in the workshop.", "mediaUrls": ["https://cdn.example.com/social/autumn-w1.jpg"], "action": "SCHEDULE", "scheduleDate": "2026-10-02", "scheduleTime": "09:30", "clientReference": "campaign-4471-slot-01" }, { "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "name": "Autumn week 2", "platforms": ["INSTAGRAM", "FACEBOOK", "LINKEDIN"], "content": "Week two: the Halcyon armchair. Sixty hours of work, one chair.", "mediaUrls": ["https://cdn.example.com/social/autumn-w2.jpg"], "action": "SCHEDULE", "scheduleDate": "2026-10-09", "scheduleTime": "09:30", "clientReference": "campaign-4471-slot-02" }, { "socialProfileId": "a90f7c22-5db1-4e83-9f40-2b7c6a1e5d33", "name": "Eastside autumn teaser", "platforms": ["INSTAGRAM"], "content": "Something solid is arriving next week. Stay tuned.", "mediaUrls": ["https://cdn.example.com/social/eastside-teaser.jpg"], "action": "SCHEDULE", "scheduledAt": "2026-10-01T08:00:00-04:00", "clientReference": "campaign-4471-slot-03" } ] }}Risposte
200The whole batch validated. A job was queued, poll GET /social/bulk-posts/{bulkJobId} for per-row results.
{ "data": { "createBulkSocialMediaPosts": { "success": true, "error": [], "job": { "id": "9b3f18d0-7a26-4c51-8e94-1f0d5c6b7a82", "status": "QUEUED", "totalCount": 3, "processedCount": 0, "successCount": 0, "failureCount": 0, "createdAt": "2026-09-28T14:04:52Z", "updatedAt": "2026-09-28T14:04:52Z", "results": [] } } }}200At least one row failed validation, so **nothing was created**. `success` is `false`, no job is returned, and each rejected row is reported with its 0-based `index`.
{ "data": { "createBulkSocialMediaPosts": { "success": false, "error": [ { "message": "SY95050: Bulk validation failed, no posts were created", "code": "SY95050", "contextInfo": null } ], "job": { "id": null, "status": "FAILED", "totalCount": 3, "processedCount": 0, "successCount": 0, "failureCount": 2, "createdAt": "2026-09-28T14:04:52Z", "updatedAt": "2026-09-28T14:04:52Z", "results": [ { "index": 1, "clientReference": "campaign-4471-slot-02", "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "platforms": ["INSTAGRAM", "FACEBOOK", "LINKEDIN"], "status": "INVALID", "socialPostId": null, "postStatus": null, "errors": [ { "message": "SY95045: No connected channel for LINKEDIN on this brand", "code": "SY95045", "contextInfo": [{ "key": "platform", "value": "LINKEDIN" }] } ] }, { "index": 2, "clientReference": "campaign-4471-slot-03", "socialProfileId": "a90f7c22-5db1-4e83-9f40-2b7c6a1e5d33", "platforms": ["INSTAGRAM"], "status": "INVALID", "socialPostId": null, "postStatus": null, "errors": [ { "message": "SY95046: scheduledAt must carry a UTC offset", "code": "SY95046", "contextInfo": null } ] } ] } } }}401Unauthenticated, missing or invalid API key.
Crea molti post social in un'unica richiesta. Le righe vengono trasmesse nel payload della richiesta — non vengono caricati file e non viene usato alcun CSV, ma solo un array degli stessi oggetti che POST /social/posts accetta uno alla volta. Fino a 500 righe per richiesta.
Caso d'uso: caricare un trimestre di contenuti in un'unica chiamata. Il tuo strumento di pianificazione contiene l'intero calendario dei contenuti del cliente. Crea una riga per ogni slot, contrassegna ciascuna con un tuo clientReference e inviale insieme. Il batch riesce nel suo insieme oppure ti indica esattamente quali righe correggere. Memorizza il valore job.id restituito e interroga periodicamente GET /social/bulk-posts/{bulkJobId} finché status non raggiunge uno stato terminale, quindi riconcilia ogni risultato tramite il relativo clientReference.
L'intero batch viene convalidato prima di procedere
La convalida viene eseguita su ogni riga prima che venga creato qualsiasi elemento, e in questa fase il batch è atomico:
- Se anche una sola riga non è valida, non viene creato nulla.
successèfalse,SY95050viene restituito inerrore ogni riga non valida compare injob.results[]con il relativoindexcon indicizzazione a partire da 0, il relativoclientReferencee il motivo inerrors[]. Correggi quelle righe e invia nuovamente l'intero batch. - Se ogni riga è valida, viene messo in coda un job,
successètruee ricevi unjob.id. Le singole righe possono comunque fallire in seguito, quando la piattaforma le rifiuta al momento della pubblicazione; questo viene riportato nel job, non qui.
Riconcilia tramite clientReference quando possibile e tramite index negli altri casi — le righe stesse non vengono restituite, quindi questi due campi sono l'unico collegamento ai tuoi dati.
Note.
- Il corpo della richiesta deve essere racchiuso in un oggetto
input, con le righe ininput.posts. - Controlla
success, non lo stato HTTP. Un rifiuto dell'intero batch viene restituito comeHTTP 200consuccess: falseeSY95050inerror. - Massimo 500 righe per richiesta. Un array più grande viene rifiutato immediatamente con
SY95048e non viene creato nulla; suddividilo e invia più batch. - Il brand di ogni riga è
socialProfileId.brandIdè sempre e soltanto un token del percorso URL, e questa rotta non contiene alcun token di percorso. - Le righe possono essere destinate a brand diversi. I valori di
platformsdi ogni riga vengono verificati rispetto al brand della riga stessa, quindi una piattaforma collegata a un brand ma non a un altro fa fallire solo le righe che la richiedono. - Ogni riga segue le stesse regole di pianificazione di un singolo post:
scheduledAtoppurescheduleDate+scheduleTime, mai entrambi, escheduleDate/scheduleTimevengono interpretati nel fuso orario del brand di quella riga. È consentito usare entrambe le forme su righe diverse dello stesso batch. - I limiti di frequenza si applicano alla richiesta, non alle righe: un batch di 500 righe consuma una sola richiesta della tua quota. Consulta Limiti di frequenza.
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/bulk-posts' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "name": "Autumn campaign load", "posts": [ { "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "name": "Autumn week 1", "platforms": [ "INSTAGRAM", "FACEBOOK" ], "content": "Week one of the autumn collection: the Fairfield oak sideboard, finished by hand in the workshop.", "mediaUrls": [ "https://cdn.example.com/social/autumn-w1.jpg" ], "action": "SCHEDULE", "scheduleDate": "2026-10-02", "scheduleTime": "09:30", "clientReference": "campaign-4471-slot-01" }, { "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "name": "Autumn week 2", "platforms": [ "INSTAGRAM", "FACEBOOK", "LINKEDIN" ], "content": "Week two: the Halcyon armchair. Sixty hours of work, one chair.", "mediaUrls": [ "https://cdn.example.com/social/autumn-w2.jpg" ], "action": "SCHEDULE", "scheduleDate": "2026-10-09", "scheduleTime": "09:30", "clientReference": "campaign-4471-slot-02" }, { "socialProfileId": "a90f7c22-5db1-4e83-9f40-2b7c6a1e5d33", "name": "Eastside autumn teaser", "platforms": [ "INSTAGRAM" ], "content": "Something solid is arriving next week. Stay tuned.", "mediaUrls": [ "https://cdn.example.com/social/eastside-teaser.jpg" ], "action": "SCHEDULE", "scheduledAt": "2026-10-01T08:00:00-04:00", "clientReference": "campaign-4471-slot-03" } ] } }'