{"openapi":"3.1.0","info":{"title":"Seller Auto Reply Listings API","version":"1.0.0","summary":"Manage the Facebook Marketplace listing context that drives automatic replies.","description":"The Listings API manages the listing context Seller Auto Reply uses when it writes an automatic reply — name, description, price, and per-listing instructions. It is the programmatic equivalent of the listing importer in the dashboard. Human-readable reference: https://www.fbautoreplyai.com/docs/api","contact":{"name":"Seller Auto Reply support","email":"support@fbautoreplyai.com","url":"https://www.fbautoreplyai.com/contact"},"termsOfService":"https://www.fbautoreplyai.com/terms"},"servers":[{"url":"https://www.fbautoreplyai.com","description":"Production"}],"externalDocs":{"description":"Seller Auto Reply developer documentation","url":"https://www.fbautoreplyai.com/docs/api"},"security":[{"uniqueKey":[]}],"tags":[{"name":"Listings","description":"Read and write the seller's Marketplace listing context."}],"paths":{"/api/listings":{"get":{"tags":["Listings"],"operationId":"getListings","summary":"List the authenticated account's listings","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"minimum":1},"description":"Page size."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"minimum":0},"description":"Rows to skip."}],"responses":{"200":{"description":"Listings retrieved","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SuccessResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"listings":{"type":"array","items":{"$ref":"#/components/schemas/Listing"}},"limit":{"type":"integer"},"offset":{"type":"integer"},"count":{"type":"integer"}}}}}]}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Listings"],"operationId":"updateListing","summary":"Update one listing","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["listingId","updates"],"properties":{"listingId":{"type":"string","description":"The listing's `_id`."},"updates":{"type":"object","description":"Omitted fields are left unchanged.","properties":{"name":{"type":"string"},"description":{"type":"string"},"instructions":{"type":"string"},"price":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Listing updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListingIdResponse"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Listings"],"operationId":"deleteListing","summary":"Delete one listing","parameters":[{"name":"listingId","in":"query","required":true,"schema":{"type":"string","minLength":1},"description":"The listing's `_id`."}],"responses":{"200":{"description":"Listing deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListingIdResponse"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/listings/batch":{"post":{"tags":["Listings"],"operationId":"batchImportListings","summary":"Import or update many listings","description":"Schedules an asynchronous import. A 200 means the work was scheduled, not that every row has landed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["listings"],"properties":{"listings":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ListingInput"},"description":"Listings to import or update, matched on listingUrl."}}}}}},"responses":{"200":{"description":"Import scheduled","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SuccessResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"importedCount":{"type":"integer"},"importId":{"type":"string"}}}}}]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/listings/csv":{"post":{"tags":["Listings"],"operationId":"csvImportListings","summary":"Replay a spreadsheet export, field for field","description":"Same body as /api/listings/batch, with one difference: the string \"__NULL__\" clears a field, while an omitted field is left unchanged.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["listings"],"properties":{"listings":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ListingInput"},"description":"Listings to import. The string \"__NULL__\" clears a field; an omitted field is left unchanged."}}}}}},"responses":{"200":{"description":"Import scheduled","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SuccessResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"processedCount":{"type":"integer"},"importId":{"type":"string"}}}}}]}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"uniqueKey":{"type":"apiKey","in":"header","name":"X-Unique-Key","description":"The account's Unique Key, shown in the dashboard under “Your Unique Key”. Treat it like a password."}},"schemas":{"ListingInput":{"type":"object","required":["listingUrl"],"properties":{"listingUrl":{"type":"string","format":"uri","description":"Facebook Marketplace item URL. Must contain /marketplace/item/ and point at facebook.com. This is the listing's identity: re-sending the same URL updates the existing listing.","examples":["https://www.facebook.com/marketplace/item/123456789/"]},"name":{"type":"string","description":"Listing title. Defaults to `Listing <id>` when omitted."},"description":{"type":"string","description":"Listing description."},"instructions":{"type":"string","description":"Per-listing guidance for the automatic replies."},"price":{"type":"string","description":"Free-form price, for example `$150`."}}},"Listing":{"type":"object","properties":{"_id":{"type":"string"},"userId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"instructions":{"type":"string"},"price":{"type":"string"},"facebookListingId":{"type":"string"},"listingUrl":{"type":"string","format":"uri"},"_creationTime":{"type":"number","description":"Unix epoch milliseconds."}}},"SuccessResponse":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","const":true},"message":{"type":"string"}}},"ListingIdResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"listingId":{"type":"string"}}},"message":{"type":"string"}}},"ErrorResponse":{"type":"object","required":["success","message"],"properties":{"success":{"type":"boolean","const":false},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"string"},"description":"Validation messages, when the body failed schema validation."}}}}}}