{"operation":"messages/send","version":"1.0.0","status":"pilot","title":"Send a Marketplace message","summary":"Sends a message with a connected Facebook account: the first one to a Marketplace listing's seller, or a reply in one of the account's Marketplace conversations. Answers the message as Facebook keeps it.","use_when":"You buy or sell on Facebook Marketplace with a connected account and want to write to someone: give `listing` (a listing's id or link, as facebook_marketplace/listings/search and listings/get return them) to send its seller a first message, or `conversation` (as facebook_marketplace/conversations/list returns it) to reply in a conversation the account already has, never both. The answer is the message as messages/list reads it, with the conversation's id to reply in later. Each message is sent once and never retried by lobstr.io: a call that fails sent nothing, except `send_unconfirmed`, after which you check the conversation with facebook_marketplace/messages/list before sending again. An account sends at most 5 messages a day here, 20 to 40 seconds apart.","categories":["E-commerce","Lead generation"],"icon":"send","source":"facebook_marketplace","input":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":2000,"description":"The message, as the person reading it will see it: plain text, line breaks kept, 2,000 characters at most.","examples":["Hi! Is this still available? I can pick it up this week."]},"listing":{"type":"string","maxLength":2000,"description":"For a first message to its seller: the listing's id, or the link of its page (facebook.com/marketplace/item/<id>), as facebook_marketplace/listings/search and listings/get give them. Give it or `conversation`, never both.","examples":["1438514411597979","https://www.facebook.com/marketplace/item/1438514411597979/"]},"conversation":{"type":"string","maxLength":2000,"description":"For a reply: the conversation's id, or its link in Messenger (facebook.com/messages/t/<id>), as facebook_marketplace/conversations/list gives them, or as a first message's answer says it (`conversation_id`). Give it or `listing`, never both.","examples":["1674007894521163","https://www.facebook.com/messages/t/1674007894521163/"]},"account":{"type":"string","description":"The connected Facebook account that writes (GET /v2/accounts). Left out, the platform takes the first of your Facebook accounts with a message left today and a free slot.","examples":["acc_7Hq2Kd9mX4pL"]}}},"requires":{"account":"facebook"},"limits":{"own":true,"per_account":{"calls":1,"per_s":20,"jitter_s":[0,20]},"daily_per_account":5,"when_busy":{"error":"account_rate_limited","retry_after":true}},"pagination":{"style":"none","page_size":1},"record":{"type":"object","additionalProperties":false,"required":["object","id","position","conversation_id","text","sent_at","sender","is_admin_message","attachments","sticker_id","reactions","reply_to","mentions","read_by_other","is_forwarded","is_unsent","unsent_at","edit_count","url","source_url","observed_at"],"properties":{"object":{"const":"message"},"id":{"type":["string","null"],"description":"The message's id on Facebook (mid.$...), as messages/list gives it; null when Facebook confirmed the message but its conversation did not show it yet."},"position":{"type":"integer","minimum":1,"description":"Its rank from the latest: 1, the message just sent."},"conversation_id":{"type":"string","description":"The conversation's id, as conversations/list's `id`."},"text":{"type":["string","null"],"description":"As written; Facebook's own line for an event (Daniel sold 1 Bed 1 Bath Apartment/condo.) when `is_admin_message`; null for a message of photos or a sticker only."},"sent_at":{"type":["string","null"],"format":"date-time"},"sender":{"type":"object","properties":{"id":{"type":["string","null"],"description":"Their Facebook id: facebook_marketplace/sellers/get reads a seller by it."},"name":{"type":["string","null"]},"photo_url":{"type":["string","null"]},"is_account":{"type":["boolean","null"],"description":"Whether the connected account wrote it."}}},"is_admin_message":{"type":"boolean","description":"Facebook's own line (a listing sold, a name changed), not a person's."},"attachments":{"type":"array","description":"Its photos, videos, voice messages and files (`kind: file`), and shared cards (`kind: card`), in order.","items":{"type":"object","additionalProperties":false,"required":["kind","id","index","type","filename","size","url","mime_type","preview_url","width","height","duration_ms","title","subtitle","description","action_url"],"properties":{"kind":{"enum":["file","card"]},"id":{"type":["string","null"]},"index":{"type":["integer","null"]},"type":{"type":["integer","null"],"description":"Messenger's code for it (2: a photo, 7: a card...)."},"filename":{"type":["string","null"]},"size":{"type":["integer","null"],"description":"In bytes."},"url":{"type":["string","null"],"description":"The file itself; Facebook signs the link for a few days."},"mime_type":{"type":["string","null"]},"preview_url":{"type":["string","null"]},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"duration_ms":{"type":["integer","null"],"description":"A video or a voice message."},"title":{"type":["string","null"],"description":"A card's title (Facebook's own line when it is gone)."},"subtitle":{"type":["string","null"]},"description":{"type":["string","null"]},"action_url":{"type":["string","null"],"description":"Where a card leads."}}}},"sticker_id":{"type":["string","null"]},"reactions":{"type":"array","items":{"type":"object","properties":{"reaction":{"type":["string","null"],"description":"The emoji."},"by_id":{"type":["string","null"]},"at":{"type":["string","null"],"format":"date-time"}}}},"reply_to":{"type":["object","null"],"description":"The message it answers, when it is a reply.","properties":{"message_id":{"type":["string","null"]},"text":{"type":["string","null"]},"sender_id":{"type":["string","null"]},"media_url":{"type":["string","null"]},"sent_at":{"type":["string","null"],"format":"date-time"}}},"mentions":{"type":"array","items":{"type":"object","properties":{"offset":{"type":["integer","null"]},"length":{"type":["integer","null"]},"id":{"type":["string","null"]},"type":{"type":["string","null"]}}}},"read_by_other":{"type":["boolean","null"],"description":"For the account's own messages: whether the person on the other side has read it (how far they read, as Messenger says). Null for their messages, or when Facebook does not say."},"is_forwarded":{"type":"boolean"},"is_unsent":{"type":"boolean","description":"Taken back by its sender: its text is gone."},"unsent_at":{"type":["string","null"],"format":"date-time"},"edit_count":{"type":"integer","minimum":0},"url":{"type":"string","format":"uri","description":"The conversation in Messenger."},"source_url":{"type":"string","format":"uri"},"observed_at":{"type":"string","format":"date-time"}}},"price":{"credits_per_call":3,"description":"3 credits a message sent. A message Facebook refuses, a call your account's pace or daily count holds back, and a failed call are free.","free":["failed","account_rate_limited","account_quota_exceeded"]},"deadline":{"default_s":60,"max_s":120},"errors":[{"code":"invalid_options","status":422,"detail":true,"message":"`text` is the message, and `listing` (a listing's id or link) or `conversation` (a conversation's id or link) says where it goes: one of the two, never both."},{"code":"not_found","status":404,"message":"Facebook shows no such listing (sold and removed, deleted, or never listed), or the account has no Marketplace conversation with this id (facebook_marketplace/conversations/list gives its conversations). Nothing was sent."},{"code":"cannot_message","status":409,"message":"Facebook does not let this account write to this listing's seller (the account's own listing, or one whose seller takes no messages). Nothing was sent."},{"code":"conversation_exists","status":409,"detail":true,"message":"The account already has a conversation with this seller about this listing: reply in it with `conversation` (facebook_marketplace/conversations/list gives it). Nothing was sent."},{"code":"message_refused","status":422,"detail":true,"counts":true,"message":"Facebook refused to send this message, in its own words below. It counts in the account's day, and the account sends nothing more here for 24 hours (`retry_after`), so that Facebook does not restrict it further."},{"code":"send_unconfirmed","status":502,"counts":true,"message":"The message left, but Facebook's confirmation did not come back. It may have been sent: check the conversation with facebook_marketplace/messages/list before sending it again. Not charged."},{"code":"account_required","status":422,"message":"You have no connected Facebook account. Connect one with POST /v2/accounts {\"site\": \"facebook\", \"cookies\": ...}: the cookies of a browser where you are logged in to facebook.com (https://docs.lobstr.io/accounts)."},{"code":"account_rate_limited","status":429,"retryable":true,"detail":true,"message":"This Facebook account cannot send right now: it waits 20 to 40 seconds between two messages, and Facebook can slow it down. `retry_after` says when it can again, in seconds. Retrying before then gets this same answer: nothing is queued, and nothing was sent."},{"code":"account_quota_exceeded","status":429,"retryable":true,"message":"Your Facebook accounts sent their 5 messages for today; `retry_after` says when the day starts over (midnight UTC). Nothing was sent."},{"code":"account_unusable","status":409,"message":"Facebook logged this account out or asks it a security check. Open facebook.com in the browser the account comes from, then connect it again with POST /v2/accounts and fresh cookies (the same account keeps its id). Nothing was sent."},{"code":"site_unavailable","status":503,"retryable":true,"message":"Facebook did not answer properly before the message left; nothing was sent, retry later (not charged)."},{"code":"unexpected_answer","status":424,"retryable":false,"message":"Facebook answered in a shape we do not read yet, before the message left: nothing was sent; we are told and fix it (not charged)."}],"examples":[{"request":{"listing":"1438514411597979","text":"Hi! Is this still available? I can pick it up this week."},"records":[{"object":"message","id":"mid.$gAAXygFXndUuoYs0jrGiMYfZuPX9V","position":1,"conversation_id":"1674007894521163","text":"Hi! Is this still available? I can pick it up this week.","sent_at":"2026-12-01T12:14:59Z","sender":{"id":"1095825462","name":"Alex Morgan","photo_url":"https://scontent.xx.fbcdn.net/v/t1.30497-1/84628273_176159830277856_972693363922829312_n.jpg","is_account":true},"is_admin_message":false,"attachments":[],"sticker_id":null,"reactions":[],"reply_to":null,"mentions":[],"read_by_other":false,"is_forwarded":false,"is_unsent":false,"unsent_at":null,"edit_count":0,"url":"https://www.facebook.com/messages/t/1674007894521163/","source_url":"https://www.facebook.com/marketplace/item/1438514411597979/","observed_at":"2026-12-01T12:15:00Z"}]}],"changelog":[{"version":"1.0.0","date":"2026-12-01","notes":"First version: a first message to a Marketplace listing's seller, or a reply in one of the account's conversations, sent once as Facebook's own page sends it and answered as the message Facebook keeps. 5 messages a day an account, 20 to 40 seconds apart."}],"object":"operation","id":"facebook_marketplace/messages/send","site":{"title":"Facebook Marketplace","domain":"facebook.com/marketplace","color":"#6C8CFF"}}