ListBridge

Docs · API reference

Messages

Leboncoin text and photos, with explicit account opt-in and honest synchronization state.

Enable an account

Messaging is included for every client, without a pilot or client allowlist. It consumes no credits and creates no messaging meter events. Publication pricing and the existing monthly connected-account billing unit are unchanged. Live API requests still require an active subscription.

State and opt-in
GET /api/v1/accounts/{account_id}/messaging
PATCH /api/v1/accounts/{account_id}/messaging
Content-Type: application/json

{"enabled":true}

All requests use the normal API-key HMAC signature; every mutation requires an Idempotency-Key. Sending and presence return 409 messaging_disabled until enabled. Disabling stops polling, presence and unsent work but preserves retained history. Tenant, key-mode, marketplace and account mismatches return 404.

Freshness and renewable presence

Renew while the inbox is open
POST /api/v1/accounts/{account_id}/messaging/presence
Content-Type: application/json

{"active":true}

Background synchronization targets 300 seconds with bounded jitter. Active presence targets 60 seconds under shared account budgets and backoff, not a delivery SLA. Renew before the 300-second TTL expires, using a fresh idempotency key per renewal; there is no daily duration cap. Send active=false on close or let the heartbeat expire.

Inspect enabled, status, last_error_code, partial, stale, last_successful_sync_at, next_sync_at, presence_active and presence_expires_at. Null synchronization timestamps mean no successful observation yet; stale becomes true without a full successful cycle for ten minutes. Read pages expose the same state under meta, plus per-conversation error_code, history_gap and next_attempt_at. A pending or partial cycle is not a successful full refresh.

A nonretryable invalid_upstream_response while enumerating conversations stops polling with status sync_failed and next_sync_at null. Fix the upstream contract issue, then explicitly enable messaging again using the existing configuration endpoint; scheduled recovery and presence do not restart stopped polling. Retryable upstream failures keep their existing backoff.

Read the local inbox

Cursor-paginated local reads
GET /api/v1/accounts/{account_id}/conversations?limit=25
GET /api/v1/accounts/{account_id}/conversations/{conversation_id}/messages?limit=25

Both return data, next_cursor and meta. Follow the opaque next_cursor (URL-encoded) until null. The limit defaults to 25 and is capped at 100. Pages use descending local ingestion order and a stable ID cursor scoped to account, mode and collection. GET never contacts the marketplace and never marks messages read; retained history remains readable after opt-out, subject to the existing global live-access guard.

A conversation contains id (ListBridge UUID), marketplace_conversation_id (opaque Leboncoin conversation ID), listing_remote_id, nullable listing_title, listing_status, counterpart_name, counterpart_id, item_type, role, role_source, last_message_at, last_synced_at, error_code, history_gap, next_attempt_at and history_complete. Use the ListBridge UUID in API paths; the marketplace ID is a reference, not a verified permalink.

Nullable counterpart_name and counterpart_id map native v3 partners[0].name and partners[0].id: when multiple partners are present, these fields describe only the first partner, not necessarily the item owner. Nullable item_type preserves item.type: observed ad means an ad thread and cs means customer support, not an ad. listing_title is populated from item.subject only for item_type: "ad", including ads not published through ListBridge; other or unknown item types return null rather than treating every subject as a listing title. Nullable listing_status preserves item.status, observed as active or deleted. This is messaging-context status, not dashboard status or proof of listing expiry.

Nullable role describes the connected account by comparing native v3 owner identities: seller when item.owner_id matches metadata.current_user; otherwise buyer when it matches any partners[].id, not just the first partner. Missing or unmatched identities leave role and role_source null. Both resolved roles use role_source: "leboncoin_item_owner". Leboncoin exposes the native owner, not an explicit role discriminator; ListBridge derives the role from those identities without consulting local listing ownership, another marketplace request or a new public user_id field. Outgoing flags and event headers never establish a role.

Personal-data retention decision: counterpart_name and counterpart_id, together with item_type, listing_title and listing_status, are retained conversation metadata, outside the 30-day message-content erasure policy. They may outlive every message in the thread: there is no time-based conversation purge. They are removed when the conversation is deleted, including the account-to-conversation cascade. The title remains plaintext metadata; this policy does not restore expired message content.

Message-list meta adds marketplace_conversation_id, conversation_last_synced_at, conversation_error_code, conversation_history_gap and conversation_next_attempt_at to the common synchronization state.

Message fields are id, client_message_id, direction, type, content, event, status, error_code, sent_at, expires_at and attachments. Each attachment contains id, status, error_code, next_attempt_at, mime_type, byte_size and expires_at. Direction is incoming|outgoing; the legacy type remains text|image|mixed|unsupported. Integration messages can still have type unsupported while exposing a structured event; direction does not establish buyer/seller role.

Conversation synchronization follows native v3 pages without assuming a fixed upstream page size; ListBridge rejects pages above a 200-conversation safety cap. Bounded work resumes across syncs until the 50 most recent conversations are imported or metadata.next_page_hash is missing, null or empty. The web client sends that hash as page_hash with no size/limit parameters (static evidence, not live-pagination verification). Subsequent cycles observe new activity in this recent window, not older inbox archives. Local next_cursor only pages retained conversations. A successful cycle does not establish complete inbox or message history.

Initial import covers the latest 50 messages per conversation, followed by incremental observations. history_complete is always false: this is not a full archive. Message content, raw event text (including headers that can contain personal data) and photos expire after 30 days and are excluded from reads even before background purge. Event text uses the same per-message expiry-bound encryption keys: destroying those keys also makes expired content unreadable in database snapshots. Keys must be excluded from database and VM backups; losing them makes the corresponding content unavailable. Production activation requires independently running erasure and verified key-storage backup exclusions. Minimal status/deduplication metadata and non-textual event kind can outlive content. Unclaimed uploads expire after 24 hours by default.

A full remote message page with no known overlap can indicate more than 50 new messages between observations. history_gap stays true and the conversation reports partial coverage rather than silently claiming every intervening message was recovered. Remote message-history pagination is not yet verified.

Structured marketplace events

Message event is null for ordinary messages. Integration/system messages expose this separate object; it does not replace legacy type or send status. Source is leboncoin_integration or leboncoin_system. Optional raw fields scope, header, integration_id and sub_type are nullable and preserved without turning them into native enums. For negotiation events, integration_id identifies the negotiation, not an individual offer: the same value was observed across eight messages with successive offer amounts. Do not use it to uniquely identify or deduplicate individual offers or messages.

Example message.event · retained GET only
{
  "source": "leboncoin_integration",
  "scope": "fr.leboncoin.consumergoods_negotiation",
  "header": "Offre reçue",
  "kind": "offer_received",
  "integration_id": "opaque-negotiation-id",
  "amount_cents": 180,
  "list_price_cents": null,
  "sub_type": null
}

Kind is ListBridge's scope-plus-header classification, not a native discriminator. Below, N means fr.leboncoin.consumergoods_negotiation, P means fr.leboncoin.consumergoods_purchase, and R means fr.leboncoin.rating. The patterns come from observed messages; unknown combinations use other while retaining raw fields. A matching label in another scope does not inherit a classification.

ScopeObserved header patternkind
NOffre reçue / envoyée / refusée / acceptéeoffer_received / offer_sent / offer_refused / offer_accepted
NOffre expirée / annuléeoffer_expired / offer_cancelled
NOffre en cours / En attente de votre réponseoffer_pending
NEn attente de l’acheteuroffer_awaiting_buyer
NAnnonce supprimée / Annonce en pauselisting_deleted / listing_paused
NArticle déjà vendu / Paiement sécuriséitem_already_sold / secure_payment
PTransaction sécuriséepurchase_secure_transaction
PCommande envoyée !purchase_shipped
PVotre colis est arrivé à destination !purchase_arrived
PDisponibilité confirmée !purchase_availability_confirmed
PVotre colis a été livré !purchase_delivered
PTout est OKpurchase_completed
P<pseudo> a acheté votre article !purchase_made
PVotre QR code de dépôt est disponible !purchase_dropoff_qr_available
PPaiement sécurisépurchase_secure_payment
PVotre bon d’envoi est disponible !purchase_shipping_label_available
PVotre commande est disponible !purchase_order_available
PVotre Transaction sécurisée est validée !purchase_transaction_validated
PAvez-vous envoyé le colis ?purchase_shipment_reminder
PVotre paiement sécurisé est validé !purchase_payment_validated
PVendu !purchase_sold
PVous avez déclenché le paiement !purchase_payment_triggered
PVotre paiement va bientôt arriver !purchase_payment_pending
PBaisse de prix envoyée ! / Baisse de prix acceptée !purchase_price_drop_sent / purchase_price_drop_accepted
RObserved rating messages, including Recommandation / Félicitations pour votre achat !rating
Other / unknownOther integrations and system subtypes (e.g. THOR_REMINDER_SELLER, FAVOURITE_AD)other

amount_cents and list_price_cents are nullable integers derived from explicit euro amounts in integration typeAttributes.text and corroborating top-level text, not native numeric or authoritative negotiated prices. One amount sets amount_cents only. Exactly two joined by “au lieu de” set the first as amount_cents and the second as list_price_cents, normalizing spaces/NBSP/narrow NBSP. The latter is the listing price displayed on that card, not necessarily the listing's current price. The first can exceed the second. Other two-or-more-amount texts, conflicting sources, negative/over-precision/overflowing values yield both null; header, subText and bare digits are not sources. System amounts are null.

No native counter-offer discriminator has been identified so far, and ListBridge exposes no counter-offer kind: an offer sent or price drop does not prove one. An offer_expired event establishes no fixed deadline; listing_deleted here classifies a message, not the listing.deleted webhook. Webhook event includes kind and nullable amount_cents/list_price_cents without raw text; expired source events have null amounts.

Queue a reply

Text, photos, or both
POST /api/v1/accounts/{account_id}/conversations/{conversation_id}/messages
Content-Type: application/json

{"client_message_id":"reply-42","content":"Oui, disponible.","attachment_ids":[]}
202 · queued, not delivered
{"id":"local-message-uuid","status":"queued","job_id":"local-job-uuid"}

client_message_id is required (at most 191 UTF-8 bytes). Text is optional (at most 10,000 characters and 20,000 UTF-8 bytes) when attachments are supplied. Retry the identical conversation/content/attachment set with the same client_message_id: even with another HTTP idempotency key it identifies the same intent and job. Conflicting reuse returns 422 client_message_id_conflict. Do not create a new identity to retry an uncertain send.

An expired intent identity returns 410 client_message_id_expired rather than recreating an old reply. Accepted requests can have no remote identifier; ListBridge never repeats that POST to obtain one. Verification is bounded, and unconfirmed state remains explicit rather than being promoted to delivered.

queued/sending describe local work. accepted means Leboncoin accepted the outgoing message-send request, not an offer acceptance. confirmed means a later observation matched it. Neither is a delivered or read receipt. uncertain means the request may have reached the marketplace and is reconciled without replaying an ambiguous POST. failed is a definite terminal failure; received is an incoming observation.

Upload and retrieve photos

Raw binary body — not multipart
POST /api/v1/accounts/{account_id}/message-attachments
Content-Type: image/jpeg
X-Signature: v1={HMAC over canonical request, hashing exact image bytes}
Idempotency-Key: {unique-upload-key}

{raw JPEG bytes}

Use image/jpeg, image/png or image/webp matching the sniffed bytes, never multipart/FormData or base64 JSON. HMAC must hash and send the same raw binary bytes. No filename header is required. A 201 response contains id, mime_type, byte_size and expires_at; include that ID in attachment_ids. Photo-only replies are supported.

Up to 10 images per message, 10 MiB each, 20 MiB total, with inspected dimensions up to 12,000 pixels per side and 40 million pixels. Uploads are private, mode/account-scoped, unexpired and claimable once. Retrieve bytes with a signed GET /api/v1/accounts/{account_id}/message-attachments/{attachment_id}; inaccessible images return 404 and expired ones 410. No private object path or upstream signed image URL is exposed.

Incoming attachment metadata includes status, error_code and next_attempt_at. A pending download returns 409 attachment_pending with Retry-After; a known unavailable or invalid image returns 422 attachment_unavailable without hiding the message or its other photos. Transient attempted downloads have three attempts; budget refusals do not consume an attempt. An unavailable live photo-send configuration causes a definite failure before sending, rather than being retried indefinitely.

Reconcile webhook signals

Subscribe to message.received, message.accepted, message.confirmed and message.failed. All four use the same envelope/data keys; only event/state values change. message.accepted means send acceptance, never offer acceptance. Nested data.event is null without a structured event; otherwise it contains kind and nullable amount_cents/list_price_cents. Raw header, scope, content, integration ID and subtype are excluded, as are title, participant metadata, photo bytes and sent_at. Fetch retained local state; deduplicate delivery IDs and allow out-of-order delivery without downgrading confirmed state. Delayed events may reference expired content.

message.accepted · complete envelope
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "event": "message.accepted",
  "created_at": "2026-11-06T10:00:00+00:00",
  "mode": "live",
  "data": {
    "account_id": "d4f87a80-3f10-4a72-b0fd-5ae82be4e3a1",
    "conversation_id": "bf2fd4ab-423f-4c35-a620-f9ef5a713bb8",
    "marketplace_conversation_id": "opaque-leboncoin-conversation-id",
    "message_id": "2250c168-0d28-4e4c-b783-e16d2012516c",
    "status": "accepted",
    "direction": "outgoing",
    "type": "text",
    "error_code": null,
    "event": null
  }
}
Webhook signature, retries and ordering reference