MarsX Lead Intake API v1
Send a lead. Get a 202.
Sign one JSON event, post it to MarsX and read the answer. A 202 means the lead is stored and queued. Your first test lead takes about 20 minutes.
- HMAC signed
- HTTPS only
- Sandbox first
POST /v1/sources/conn_exampleexample22/events
webhook-id: msg_test_0004
webhook-timestamp: 1791100800
webhook-signature: v1,<base64>
content-type: application/json
{"type":"lead.new","data":{ ... }}202 Accepted
{
"result": "accepted",
"webhook_id": "msg_test_0004",
"request_id": "req_example_0001"
}Three steps to your first lead
About 20 minutes to your first 202
Get your sandbox details
Your developer makes the test key in the sandbox console, not in Concour: Developers, then API keys, then Make a test key.
Get sandbox accessSign and send a lead
Run a short script in curl, Node.js or Python. It signs one test lead and posts it to the sandbox.
Open the quick startRead the 202
A 202 means MarsX stored the event and queued it. Then run the sandbox steps, including a bad signature.
Run the sandbox steps
Open Concour opens the Developers home, where the API keys card opens your keys.
No account? MarsX sets up partner access.
What do you want to do?
Section titled “What do you want to do?”How it fits together
Section titled “How it fits together”Concour is where a brand’s dealers follow up customer enquiries. Your company collects those enquiries first, from a website chat, a form, a marketplace or an advert. Each enquiry is a lead. Push means your system sends each lead event to MarsX as it happens, and MarsX passes it to Concour.
- You call one endpoint.
POST /v1/sources/{connection}/events, signed with HMACv1. - Optionally, you host four. An OAuth token URL,
GET /v1/changes,GET /v1/privacy-eventsandGET /v1/leads/{partner_lead_id}. If you host them, MarsX only reads them, every 15 minutes, to catch an event that never arrived. Going live does not need them. - Only a
202confirms. Anything else, retry or fix, as Responses and retries says.
Leads reach MarsX by one of three routes: API push, the target, the shared sheet, which is available now and needs nothing built, or your own AI agent through the MCP server. MarsX sets the route for each connection, and your onboarding pack states it. MarsX closes the sheet once push is live. See How leads reach MarsX.
Using an AI coding agent?
Paste this prompt into your agent. It points the agent at this documentation and sets the rules for the whole job. You can also read it as plain text at /agent-prompt.txt.
The sandbox (api-sandbox.marsx.media) opens when MarsX sends your connection details. The live address (api.marsx.media) opens at go-live.
Read the prompt
You are helping us build our side of the MarsX Lead Intake API v1, so that our customer enquiries reach Concour. Before you write any code, read https://docs.marsx.media/llms-full.txt and https://docs.marsx.media/openapi.yaml in full. They are the only source of truth. Ask me before you assume anything they do not settle. If we have not yet received sandbox details from MarsX, stop after reading the documents and planning the work.
Scope. First ask me which route our connection uses: API push, the shared sheet or the AI agent (MCP) route. MarsX sets it, and our onboarding pack states it. Then build only that route:
(1) API push: the sender that calls POST /v1/sources/{connection}/events, and, only if we choose the optional safety net, the four endpoints we may host: the OAuth token URL, GET /v1/changes, GET /v1/privacy-events and GET /v1/leads/{partner_lead_id}. We do not need them to go live. If we host them, MarsX reads those four every 15 minutes. The status read is optional.
(2) Shared-sheet automation, only if we are on the shared sheet and want to automate it: one whole row per call, spreadsheets.values.append on Leads!A:AQ with RAW (columns AK and AL stay empty, AM to AQ are the five optional extras), the first empty row below the filled rows (row 7 on a new sheet), a higher source_revision for each change, and the MarsX status column for results.
(3) AI agent (MCP), only if our own AI agent sends the leads: connect it to https://api-sandbox.marsx.media/mcp with an OAuth client credentials token of scope events:write from /oauth/token, and use the six tools exactly as the AI agent (MCP) page says. The four endpoints of (1) stay optional.
Rules that never change:
- Obey the field rules and the allowed values exactly, including the ten source_channel values and the fields required from contract version 1.3: phone, email, model_interest, test_drive_requested and enquiry_notes, plus the location, which from contract version 1.9 is customer_city or preferred_dealer_code, either one alone and both accepted. Contract version 1.5 adds five optional extras (customer_address, customer_gps, lead_score, creative_label, staff_notes): send them when you can and leave them out when unknown, with no not-known value. Contract version 1.7.0 gives every text field a maximum length (maxLength in each tool's input schema) and refuses control characters other than tab, line feed and carriage return: never send a value longer than its limit. Contract version 1.8.0: send one JSON-RPC request for each MCP call and never a batch, which MarsX refuses with the error -32600; send every privacy request at once, and if the status answers queued with the reason clearing_awaiting_confirmation or clearing_held_for_investigation, do not send the request again. Contract version 1.4 also requires campaign, and model_interest is never not_specified. Where the data is genuinely missing, send the not-known value (not_provided for email, not_specified for preferred_dealer_code and campaign, unknown for test_drive_requested, none for enquiry_notes). model_interest and customer_city always need a real value. Never invent a value.
- Sign with HMAC v1 only, as the Sign requests page says. Reproduce its test vector before you send anything.
- Refuse any URL that is not https before you attach credentials or data. Do not follow redirects. Treat a 3xx as a failure.
- Only a 202 confirms that MarsX has an event. Retry with the same webhook-id and the same body (the envelope timestamp included), a fresh webhook-timestamp and a fresh signature, on the schedule on the Responses and retries page. 400, 401, 404, 409, 413 and 415 are not retried on that schedule: fix the cause, then send the event again with a fresh webhook-timestamp and signature. A 409 means the webhook-id was already used for a different event, so send that event with a new webhook-id. Put at most 4 signatures in webhook-signature.
- Send each withdrawal and erasure at once. Never batch it and never hold it behind another event.
- Build and test against the sandbox first, https://api-sandbox.marsx.media, with invented data only. Keep the base URL, connection reference and signing secret in configuration, so going live is a configuration change.
- Read secrets from environment variables. Never put them in code or logs, and never log customer data.
You are done when you have shown me: (1) the test vector reproduced; (2) every step of the sandbox test page run, with the results it gives; (3) the Postman collection passing, if we use it; (4) if we host them, each of the four endpoints validated against openapi.yaml, with the cases on the Changes and privacy events page covered: an empty feed, a malformed cursor, an expired cursor (410), and a restricted or erased lead.
Run the Postman collection with npx newman if it is available. If not, tell me to run it in Postman.
MarsX's endpoint tests (R1 to R5), creating the test key in the sandbox console, and going live are human steps after you finish. Do not go live. A person requests the live key, MarsX approves it, and a person sends the first live lead. Support is support@marsx.media, Monday to Saturday 08:00 to 20:00 WIB, with a reply within 1 business day.Write to the MarsX technical contact at support@marsx.media. Support is open Monday to Saturday, 08:00 to 20:00 WIB, and MarsX replies within 1 business day. If an error came back, quote the instance reference in it. Never send secrets, passwords or lead data by email or WhatsApp. See contact and support.
There is no public sign-up. Sign in to Concour if MarsX has set up your access.
No account? MarsX sets up partner access.
