# Facebook Marketplace: Send a Marketplace message

`facebook_marketplace/messages/send` · version 1.0.0 · pilot · 3 credits a call

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.

Categories: E-commerce, Lead generation

## When to use

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.

## Call

```bash
curl https://api.lobstr.io/v2/run \
  -H "Authorization: Bearer $LOBSTR_API_KEY" \
  -H "content-type: application/json" \
  -d '{"source": "facebook_marketplace", "operation": "messages/send", "options": {"listing": "1438514411597979", "text": "Hi! Is this still available? I can pick it up this week."}}'
```

It answers:

```json
{"object": "run", "status": "succeeded", "count": 1, "has_more": false, "next": null,
 "cost": {"credits": 3}, "balance": {"credits": 9990}, "results": [...]}
```

`cost` and `balance` are objects: a call's credits are `cost.credits`. `results` holds the records (below).

Beside `options`, the call takes:

| Parameter | Type | Description |
|---|---|---|
| `fields` | array of string | The record fields to keep, by path (`title`, `address.city`); `object`, `id` and `position` always come. Left out: every field. |

## Options

| Option | Type | Required | Default | Description |
|---|---|---|---|---|
| `text` | string | yes |  | The message, as the person reading it will see it: plain text, line breaks kept, 2,000 characters at most. |
| `listing` | string |  |  | 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. |
| `conversation` | string |  |  | 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. |
| `account` | string |  |  | 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. |

## Record

Each item of `results`. Every field is always present, `null` when the site gives nothing.

| Field | Type | Description |
|---|---|---|
| `object` | `"message"` |  |
| `id` | string | null | 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` | integer | Its rank from the latest: 1, the message just sent. |
| `conversation_id` | string | The conversation's id, as conversations/list's `id`. |
| `text` | string | null | 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` | string | null (date-time) |  |
| `sender` | object |  |
| `sender.id` | string | null | Their Facebook id: facebook_marketplace/sellers/get reads a seller by it. |
| `sender.name` | string | null |  |
| `sender.photo_url` | string | null |  |
| `sender.is_account` | boolean | null | Whether the connected account wrote it. |
| `is_admin_message` | boolean | Facebook's own line (a listing sold, a name changed), not a person's. |
| `attachments` | array | Its photos, videos, voice messages and files (`kind: file`), and shared cards (`kind: card`), in order. |
| `attachments[].kind` | `file`, `card` |  |
| `attachments[].id` | string | null |  |
| `attachments[].index` | integer | null |  |
| `attachments[].type` | integer | null | Messenger's code for it (2: a photo, 7: a card...). |
| `attachments[].filename` | string | null |  |
| `attachments[].size` | integer | null | In bytes. |
| `attachments[].url` | string | null | The file itself; Facebook signs the link for a few days. |
| `attachments[].mime_type` | string | null |  |
| `attachments[].preview_url` | string | null |  |
| `attachments[].width` | integer | null |  |
| `attachments[].height` | integer | null |  |
| `attachments[].duration_ms` | integer | null | A video or a voice message. |
| `attachments[].title` | string | null | A card's title (Facebook's own line when it is gone). |
| `attachments[].subtitle` | string | null |  |
| `attachments[].description` | string | null |  |
| `attachments[].action_url` | string | null | Where a card leads. |
| `sticker_id` | string | null |  |
| `reactions` | array |  |
| `reactions[].reaction` | string | null | The emoji. |
| `reactions[].by_id` | string | null |  |
| `reactions[].at` | string | null (date-time) |  |
| `reply_to` | object | null | The message it answers, when it is a reply. |
| `reply_to.message_id` | string | null |  |
| `reply_to.text` | string | null |  |
| `reply_to.sender_id` | string | null |  |
| `reply_to.media_url` | string | null |  |
| `reply_to.sent_at` | string | null (date-time) |  |
| `mentions` | array |  |
| `mentions[].offset` | integer | null |  |
| `mentions[].length` | integer | null |  |
| `mentions[].id` | string | null |  |
| `mentions[].type` | string | null |  |
| `read_by_other` | boolean | null | 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` | boolean |  |
| `is_unsent` | boolean | Taken back by its sender: its text is gone. |
| `unsent_at` | string | null (date-time) |  |
| `edit_count` | integer |  |
| `url` | string (uri) | The conversation in Messenger. |
| `source_url` | string (uri) |  |
| `observed_at` | string (date-time) |  |

Example:

```json
{
  "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"
}
```

## Price

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.

## Errors

| Code | Status | Retry | Message |
|---|---|---|---|
| `invalid_options` | 422 | no | `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. |
| `not_found` | 404 | no | 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. |
| `cannot_message` | 409 | no | 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. |
| `conversation_exists` | 409 | no | 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. |
| `message_refused` | 422 | no | 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. |
| `send_unconfirmed` | 502 | no | 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. |
| `account_required` | 422 | no | 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). |
| `account_rate_limited` | 429 | yes | 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. |
| `account_quota_exceeded` | 429 | yes | Your Facebook accounts sent their 5 messages for today; `retry_after` says when the day starts over (midnight UTC). Nothing was sent. |
| `account_unusable` | 409 | no | 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. |
| `site_unavailable` | 503 | yes | Facebook did not answer properly before the message left; nothing was sent, retry later (not charged). |
| `unexpected_answer` | 424 | no | 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). |
| `missing_api_key` | 401 | no | No API key: send it as `Authorization: Bearer <key>`. |
| `invalid_api_key` | 401 | no | The key is not valid, or not anymore. |
| `insufficient_credits` | 402 | no | The call costs more credits than are left. |
| `unknown_operation` | 404 | no | No such source and operation in the catalog. |
| `timeout` | 408 | yes | The call did not finish within its deadline (not charged). |
| `invalid_body` | 422 | no | The body is not a call: source, operation, options. |
| `invalid_options` | 422 | no | An option is missing or out of its contract; `param` names it. |
| `invalid_idempotency_key` | 400 | no | The Idempotency-Key header is not printable ASCII, or too long. |
| `concurrency_limit` | 429 | yes | The plan's calls at a time are all in progress (Free 1, Starter 2, Pro 10, Team 50); retry when one has finished (not charged, never queued). |
| `service_busy` | 503 | yes | Too many calls at once on the account; retry in a few seconds. |
| `balance_unavailable` | 503 | yes | The balance could not be read; retry in a few seconds. |

## Changelog

- **1.0.0** (2026-12-01): 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.

Schema: https://api.lobstr.io/v2/catalog/facebook_marketplace/messages/send · All operations: https://api.lobstr.io/v2/catalog.md
