Send a lead event
Push is one POST for each lead event. MarsX stores the event, answers 202 and applies it a moment later. This page covers the request. Sign requests covers the signature.
What you call and what you host
Section titled “What you call and what you host”| Role | Method and path | Hosted by |
|---|---|---|
| You call 1 | POST /v1/sources/{connection}/events |
MarsX |
| You host 4 | An OAuth 2.0 token URL, GET /v1/changes, GET /v1/privacy-events, GET /v1/leads/{partner_lead_id}. MarsX reads them |
You |
| Optional | GET /v1/sources/{connection}/events/{webhook_id}, the event status |
MarsX |
| Only when MarsX asks | PUT /v1/sources/{connection}/files/{file_name}, the privacy list. MarsX asks for it only after a gap in the privacy feed. See the cursor rules |
MarsX |
{connection} is your connection reference: conn_ and 16 lower-case base32 characters, such as the made-up conn_exampleexample22. MarsX sends it with your access, and the sandbox console shows it on Developers.
Once your four endpoints are live, MarsX reads changes and privacy-events every 15 minutes to find an event that never arrived. It never writes to your system. See Host the four endpoints.
Where to send
Section titled “Where to send”| Environment | Address | Use |
|---|---|---|
| Sandbox | https://api-sandbox.marsx.media |
Made-up data only. Events here never reach a dealer |
| Production | https://api.marsx.media |
Live leads |
Both hosts are HTTPS only. Every request goes to a connection: the link between your company and MarsX. MarsX gives each connection a reference such as conn_exampleexample22, and a separate one for the sandbox and for production. You do not choose it. Your developer makes the test key and its signing secret in the sandbox console, with Make a test key (see Get sandbox access and HTTPS and secrets). The live key is separate: it is made in Concour at go-live.
The request
Section titled “The request”POST /v1/sources/conn_exampleexample22/eventsHost: api-sandbox.marsx.mediaContent-Type: application/jsonwebhook-id: msg_test_0004webhook-timestamp: 1791100800webhook-signature: v1,<base64 signature>
{ ...the event, below... }{ "result": "accepted", "webhook_id": "msg_test_0004", "request_id": "req_example_0001"}| Item | Rule |
|---|---|
| Events per request | One. There are no batches |
| Content type | application/json. A parameter such as charset=utf-8 is accepted and ignored. Any other type gets 415 |
| Body | UTF-8 JSON, no byte-order mark, at most 32,768 bytes. A lead with every field filled is about 4 KB. MarsX refuses a body above 64 KiB with 413 before it checks the signature |
webhook-id |
A new one for each event: 1 to 128 characters from A-Z a-z 0-9 _ -. No full stop, colon, plus, slash or space. Any other id gets the same 401 as a bad signature. MarsX binds the id to the first event sent under it: a different event under a used id gets 409 (Responses and retries) |
webhook-timestamp |
Whole seconds since the Unix epoch, within 300 seconds of the MarsX clock |
| Timeout | Set 15 to 30 seconds on your side |
| Where to sign | On your server, never in a browser or an app |
The four events
Section titled “The four events”type |
Send it when, and what data holds |
|---|---|
lead.new |
A new enquiry. The full state of the lead, with record_action new |
lead.update |
A lead changes. The full current state, not only the changes. source_revision (higher than before) and updated_at are required. Keep the original created_at, and set a new updated_at and a new timestamp |
lead.withdraw |
The customer withdraws consent or asks to restrict processing. Send it at once. Identity fields, request_type (withdraw_consent or restriction), request_time and request_reference. No contact data |
lead.delete |
The customer asks for erasure. Send it at once. As lead.withdraw, with request_type erasure |
lead.withdraw and lead.delete carry exactly these fields in data: partner_lead_id, record_action (withdraw or delete), source_revision, created_at, updated_at, request_type (erasure on lead.delete), request_time and request_reference. They carry no contact fields.
The top-level timestamp is when the event happened, as ISO 8601 with an offset, for example 2026-10-01T10:30:00+07:00. It is not the time of delivery, and it is not created_at, which is when the customer made the enquiry. It stays the same on every retry. The time of each attempt is the webhook-timestamp header, which changes on every retry. The envelope is type, timestamp and data. data.record_action must match type. Revisions and privacy events explains the order rules.
A first event
Section titled “A first event”A lead.new with every required field and one common optional one:
{ "type": "lead.new", "timestamp": "2026-10-01T10:30:00+07:00", "data": { "partner_lead_id": "SRC-TEST-0004", "record_action": "new", "created_at": "2026-10-01T10:29:30+07:00", "customer_name": "Contoh Pelanggan Tiga", "phone": "+6280000000003", "email": "contoh.pelanggan3@contoh.example", "source_channel": "website_form", "contact_consent": "yes", "consent_time": "2026-10-01T10:29:20+07:00", "model_interest": "Model A", "customer_province": "Jawa Barat", "customer_city": "Kota Bandung", "preferred_dealer_code": "D0001", "test_drive_requested": "N", "enquiry_notes": "Ingin meminta penawaran.", "campaign": "campaign-test" }}Required: partner_lead_id, record_action, created_at, customer_name, phone, email, model_interest, campaign, test_drive_requested, enquiry_notes, source_channel, contact_consent and consent_time.
One location, either value (from contract version 1.9). A real customer_city or an actual preferred_dealer_code is required, and one of the two is enough: send the one you have and leave the other out. Both together are accepted. not_specified is not an actual dealership, so it only passes alongside a real city, and a value of spaces only counts as neither. Since contract version 1.3 (8 October 2026) phone, email, model_interest, test_drive_requested and enquiry_notes are required on every route, as is the location: from version 1.9 either customer_city or preferred_dealer_code. Contract version 1.4 (8 October 2026) is a breaking change: campaign is required too, and model_interest no longer accepts not_specified. Where you genuinely lack the data, send the not-known value instead of inventing one: email not_provided; preferred_dealer_code not_specified; test_drive_requested unknown; enquiry_notes none; campaign not_specified when there is no ad. A real model and a real city are always needed. See Lead fields.
customer_province is optional. On lead.new, a missing source_revision means 1 and a missing updated_at means created_at. Every field, with its format, is in Lead fields.
Rules that cause most 400 answers
Section titled “Rules that cause most 400 answers”A 400 lists each problem with a pointer but not the rule. Check these first.
| Field | Rule |
|---|---|
partner_lead_id |
1 to 64 characters from A-Z a-z 0-9 . _ - |
phone |
+628 then digits only. Turn 0812... into +62812... and 62812... into +62812.... Any other number (a landline, a foreign number) gets 400, and phone is required, so a lead with no Indonesian mobile number cannot be sent |
| Date-times | ISO 8601 with a capital T and seconds, then a capital Z or an offset with a colon such as +07:00. +0700 or no offset gets 400 |
contact_consent |
yes only |
| Empty fields | Send nothing for a field you have no value for. null gets 400 everywhere except phone_verified. Never send "" |
| Unknown members | An unknown member inside data, or one not meant for the event (a contact field on lead.withdraw), gets 400 with the pointer /data, which does not name it |
The full rule table is in Lead fields.
Pick the source channel
Section titled “Pick the source channel”source_channel is a closed list of 10 values. Any other value gets 400 and nothing is stored.
| The lead came from | Send |
|---|---|
| Facebook or Instagram instant form | meta_lead_form |
| TikTok instant form | tiktok_lead_form |
| Google Ads lead form asset | google_lead_form |
| Instant form of another ad network | other_ad_lead_form |
| Chat widget or AI assistant on a website | chat |
| Form on a website | website_form |
| Listing page of an online marketplace | marketplace |
| WhatsApp conversation | whatsapp |
| Instagram direct message | instagram_dm |
| Event booth, phone call, walk-in, referral, or anything not above | other |
Values for models, provinces and dealer codes are in Allowed values.
Consent
Section titled “Consent”Your own consent flow decides what counts as consent, and it must be explicit. Send contact_consent yes and a consent_time that records when it was given. A lead without consent is not sent. It gets 400 and nothing is stored. consent_reference, notice_version and consent_purpose are optional.
Never send KTP or family-card numbers, income, financing documents or chat transcripts. Never send status, assignment, follow-up, test drives, sales or SPK numbers: dealers record those in Concour.

