Send a message
Sends a reply with a connected Leboncoin account in one of its conversations, as its messages page does, and answers the message as Leboncoin keeps it.
leboncoin/messages/send20 credits a callv1.0.0When to use it
You buy or sell on Leboncoin with a connected account and want to answer someone in a conversation the account already has: give conversation (its id or its link, as leboncoin/conversations/list returns them) and text. The answer is the message as leboncoin/messages/list reads it. 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 leboncoin/messages/list before sending again. An account sends at most 5 messages a day here, 20 to 40 seconds apart. A first message to a listing's seller is not offered yet.
Try it
The options on the left write the call; the answer on the right is the contract's example. With your API key, the same call returns live data.
curl https://api.lobstr.io/v2/run \ -H "Authorization: Bearer $LOBSTR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "source": "leboncoin", "operation": "messages/send", "options": { "conversation": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "text": "Merci pour votre retour, je reviens vers vous rapidement." } }'
An example answer. Run it on your own input.
{ "object": "run", "id": "run_r7jl5eeoa4752s7jgtxh5rvfma", "livemode": true, "source": "leboncoin", "operation": "messages/send", "version": "1.0.0", "schema_url": "https://api.lobstr.io/v2/catalog/leboncoin/messages/send", "options": { "conversation": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "text": "Merci pour votre retour, je reviens vers vous rapidement." }, "fields": null, "status": "succeeded", "count": 1, "has_more": false, "next": null, "cost": { "credits": 20 }, "results": [ { "object": "message", "id": "f8797b50-ed9f-11f1-8080-808080808080", "position": 1, "conversation_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "text": "Merci pour votre retour, je reviens vers vous rapidement.", "kind": "text", "template": null, "sent_at": "2026-12-01T15:57:54Z", "from_account": true, "read": true, "read_by_other": false, "attachments": [], "source_url": "https://www.leboncoin.fr/messages/id/0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "observed_at": "2026-12-01T15:57:55Z" } ] }
Options
conversationstringrequiredtextstringrequiredaccountstringRecord
Each record of results, in the envelope every call returns (Run an operation).
objectstringidstringpositionintegerconversation_idstringid.textstringkindstringtemplate.idstringtemplate.modifiedbooleansent_atdatefrom_accountbooleanreadbooleanread_by_otherbooleanattachmentslistsource_urlstringobserved_atdateErrors
Its own, besides those of every call (Errors). A failed call is free.
| Code | Status | What it means |
|---|---|---|
invalid_options | 422 | Pass conversation (a conversation's id or its link, as leboncoin/conversations/list gives them) and text (2,000 characters at most). |
conversation_not_found | 404 | This account has no such conversation: it is another account's, or it was deleted. List the account's own with leboncoin/conversations/list (not charged). |
message_refused | 409 | Leboncoin refused the message: the conversation is closed or blocked, or the text is not allowed. Nothing was sent (not charged). |
send_unconfirmed | 502 | The message may have been sent, but Leboncoin's answer was lost on the way. Check the conversation with leboncoin/messages/list before sending it again (not charged). |
account_required | 422 | You have no connected Leboncoin account. Connect one with POST /v2/accounts {"site": "leboncoin", "cookies": ...}, the cookies of a browser where you are logged in to Leboncoin (https://docs.lobstr.io/accounts). |
account_rate_limited | 429 | This Leboncoin account cannot send right now: it waits 20 to 40 seconds between two messages, sends 5 a day, and Leboncoin can slow it down. retry_after says when it can again, in seconds. Retrying before then gets this same answer: nothing is queued. Retryable. |
account_quota_exceeded | 429 | This Leboncoin account sent its messages for today; retry_after says when the day starts over (midnight UTC). Retryable. |
account_unusable | 409 | Leboncoin logged this account out. Connect it again with POST /v2/accounts and fresh cookies from a browser where you are logged in (the same login keeps its id). |
site_challenge | 503 | Leboncoin asked this account to prove it is a person. Open leboncoin.fr in the browser the account syncs from, then retry (not charged). Retryable. |
site_unavailable | 503 | Leboncoin did not answer properly; retry later (not charged). Retryable. |
unexpected_answer | 424 | Leboncoin answered in a shape we do not read yet; we are told and fix it (not charged). |
Price
20 credits a message sent. A message Leboncoin refuses, a call your account's pace or daily count holds back, and a failed call are free. What a credit costs on each plan: Credits and pricing.
Each connected account makes one call every 20 seconds, plus 0 to 20 seconds and 5 a day; a busy account answers at once with account_rate_limited and retry_after.
Changelog
1.0.02026-12-01