/api/v4/postsCreate an offer post
Creates an OFFER social post with a coupon, discount, and terms, published to the chosen sites for one or more locations.
Parameters
Body
| Name | Type | Required | Description |
|---|---|---|---|
| input | object | required | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.postName | string | required | Internal name for the campaign (not shown to customers). |
| input.locationIds | array of strings | required | Base64-encoded location IDs to publish to (e.g. `TG9jYXRpb246MTgwMDI4OQ==`). |
| input.postType | string | required | Must be `OFFER`. One of EVENT, OFFER, ANNOUNCEMENT, COVID19, PRODUCT. |
| input.postSites | array of strings | required | Sites to publish to: `GOOGLE`, `FACEBOOK`. |
| input.postContextInfo | object | optional | Offer details: `{ title, couponCode, discount, redeemUrl, termsConditions, startDay, endDay }`. `title` labels the offer; `startDay`/`endDay` bound its validity. |
| input.postMessage | array of objects | optional | Per-site body text: `{ site, message }`. One entry per site in `postSites`. |
| input.postScheduledDates | object | optional | When to publish/expire the post itself: `{ startDatetime, endDatetime, removalSites }`. Distinct from the offer validity in `postContextInfo`. |
| input.postCta | array of objects | optional | Optional call-to-action per site: `{ site, type, url }`. Offers typically use `GET_OFFER` or `REDEEM`; allowed types: BOOK, ORDER, SHOP, LEARN_MORE, SIGN_UP, GET_OFFER. |
| input.postMediaUrl | array of objects | optional | Optional media per site: `{ site, url, type }` where `type` is IMAGE or VIDEO. |
| input.clientMutationId | string | optional | Optional client token echoed back in the response for correlation. |
Sample request
Ready-to-paste body. Replace placeholder IDs and values with yours.
{ "input": { "postName": "Diwali 25% Off", "locationIds": ["TG9jYXRpb246MTgwMDI4OQ=="], "postType": "OFFER", "postSites": ["GOOGLE"], "postContextInfo": { "title": "25% off storewide", "couponCode": "DIWALI25", "discount": "25%", "redeemUrl": "https://jennyhome.example/diwali", "termsConditions": "Valid in-store only through July 6. Cannot be combined with other offers.", "startDay": "2026-06-22", "endDay": "2026-07-06" }, "postMessage": [ { "site": "GOOGLE", "message": "Celebrate with us: 25% off everything in store this festive week." } ], "postCta": [ { "site": "GOOGLE", "type": "GET_OFFER", "url": "https://jennyhome.example/diwali" } ], "postMediaUrl": [ { "site": "GOOGLE", "url": "https://cdn.example.com/diwali.jpg", "type": "IMAGE" } ] }}Responses
200Post accepted. Publishing runs asynchronously, the returned post starts as INPROGRESS.
{ "data": { "createSocialPost": { "clientMutationId": null, "success": true, "errors": [], "socialPost": { "id": "U29jaWFsUG9zdDo0NDEyNA==", "name": "Diwali 25% Off", "status": "INPROGRESS", "type": "OFFER", "createdAt": "2026-06-20", "scheduledStartDate": "2026-06-22", "scheduledEndDate": "2026-07-06", "sites": ["GOOGLE"], "message": [ { "site": "GOOGLE", "message": "Celebrate with us: 25% off everything in store this festive week." } ], "cta": [ { "type": { "value": "GET_OFFER", "label": "Get offer" }, "url": "https://jennyhome.example/diwali", "site": "GOOGLE", "tinyUrl": null } ], "contextInfo": { "title": "25% off storewide", "couponCode": "DIWALI25", "discount": "25%", "redeemUrl": "https://jennyhome.example/diwali", "termsConditions": "Valid in-store only through July 6. Cannot be combined with other offers.", "startDay": "2026-06-22", "endDay": "2026-07-06", "startTime": null, "endTime": null, "locationType": null }, "mediaUrl": [ { "url": "https://cdn.example.com/diwali.jpg", "site": "GOOGLE", "type": "IMAGE" } ], "publishDetails": [ { "site": "GOOGLE", "status": "PUBLISHING", "createdDate": "2026-06-20", "submissionError": null } ], "postLinks": [], "locationIds": [1800289] } } }}400Bad request, the body was not wrapped in `input` (GraphQL: `Variable "$input" of required type "CreateSocialPostMutationInput!" was not provided`).
401Unauthenticated, missing or invalid API key.
Creates an offer post: a promotion card with a coupon code, discount, redeem link, and terms. The offer specifics live in postContextInfo (title, couponCode, discount, redeemUrl, termsConditions, startDay, endDay). Offers pair naturally with a GET_OFFER CTA.
Use case: run a time-boxed promotion. Launch a "Diwali 25% Off" offer for Jenny Home valid June 22–July 6, with coupon DIWALI25 and a redeem URL. Set postType: "OFFER", fill postContextInfo, and add a GET_OFFER CTA. The call returns status: INPROGRESS; verify it lands on each site with GET /posts/{postId}, and delete it early with DELETE /posts/{postId} if the promotion ends.
Notes.
- The request body must be wrapped in an
inputobject: every field is a property ofinput. A flat, unwrapped body is rejected with an HTTP 400 (Variable "$input" of required type "CreateSocialPostMutationInput!" was not provided). postContextInfo.startDay/endDaybound the offer's validity; usepostScheduledDatesif you also want to schedule when the post publishes/expires independently.- Provide a
postMessageentry for each site inpostSites. - For plain updates use announcements; for dated happenings use events.
Write operation: not executed against the live account. The request and response shown are built from the API schema; this posts to real Google/Facebook profiles when run.
curl -X POST 'https://listingsapi.com/api/v4/posts' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "postName": "Diwali 25% Off", "locationIds": [ "TG9jYXRpb246MTgwMDI4OQ==" ], "postType": "OFFER", "postSites": [ "GOOGLE" ], "postContextInfo": { "title": "25% off storewide", "couponCode": "DIWALI25", "discount": "25%", "redeemUrl": "https://jennyhome.example/diwali", "termsConditions": "Valid in-store only through July 6. Cannot be combined with other offers.", "startDay": "2026-06-22", "endDay": "2026-07-06" }, "postMessage": [ { "site": "GOOGLE", "message": "Celebrate with us: 25% off everything in store this festive week." } ], "postCta": [ { "site": "GOOGLE", "type": "GET_OFFER", "url": "https://jennyhome.example/diwali" } ], "postMediaUrl": [ { "site": "GOOGLE", "url": "https://cdn.example.com/diwali.jpg", "type": "IMAGE" } ] } }'