Test in the sandbox
All push tests use made-up data against the sandbox at https://api-sandbox.marsx.media. An event sent there never reaches a dealer. Steps 1 to 6 check your sender. Step 7 is optional: it hands your four endpoints to MarsX for its tests, if you host them.
Get sandbox access
Section titled “Get sandbox access”You make the test key in the sandbox console, not in Concour. A live connection in Concour has no Make a test key, because it holds live keys only.
-
Get access. MarsX gives your developer access to the sandbox console. If you have no access yet, contact MarsX.
-
Sign in. Open the sandbox console and enter the email address MarsX gave developer access. The console emails you a code. Enter it. If the code does not arrive, check your Junk and quarantine folders, then contact support.
-
Make the test key. Open Developers, then API keys, then Make a test key. The Signing secret is shown once, in the dialog Your test key: keep it on your server.
The sandbox console is where test keys are made. It opens the sign-in page. Sign in with the email address MarsX gave developer access: the console emails you a code.
No account? MarsX sets up partner access.
What you need
Section titled “What you need”The test key and the live key are separate. The sandbox console shows the connection reference.
- The sandbox connection reference:
conn_and 16 lower-case base32 characters. The examples useconn_exampleexample22, which is made up. - The sandbox signing secret, which starts with
whsec_.
The seven steps
Section titled “The seven steps”-
Check your signing code offline. Use the test vector on Sign requests. Your code must produce the expected
webhook-signaturebefore you send anything. -
Send a
lead.new. Send the event below. Expect202withaccepted. -
Send the same
webhook-idagain. Use the same body, envelopetimestampincluded, and a freshwebhook-timestampand signature. Expect202withduplicate. Nothing new is stored. -
Send a bad signature, then an old timestamp. Change one character of the signature. Then sign with a
webhook-timestampmore than 300 seconds in the past. Expect401each time. -
Send a
lead.update, then alead.withdraw. The update needs a highersource_revision. Give the withdraw the next revision, arequest_typeand arequest_reference. Expect202each time. Read the note below about the final state. -
Cause faults on purpose. Use the
x-marsx-sandbox-scenarioheader, as below. Expect the answers in the table. -
Optional: host your four endpoints in your sandbox. Going live does not need them. Then give MarsX the details in Concour and ask it to run its tests. See Test your endpoints.
Step 2: a lead to send
Section titled “Step 2: a lead to send”Every value is made up. Sign it as in Sign requests: the string to sign is the webhook-id, a full stop, the webhook-timestamp, a full stop, then the exact body.
{ "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" }}This curl script signs the body and sends it. It needs openssl. --proto '=https' makes curl refuse any URL that is not https, and curl does not follow redirects unless you add -L.
export MARSX_CONNECTION="conn_exampleexample22" # use your own sandbox referenceexport MARSX_SIGNING_SECRET="whsec_..." # use your own sandbox secret
BODY='{ "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" }}'WEBHOOK_ID="msg_test_0004"TS=$(date +%s)
KEY_HEX=$(printf '%s' "${MARSX_SIGNING_SECRET#whsec_}" | openssl base64 -d -A | od -An -tx1 | tr -d ' \n')SIG=$(printf '%s.%s.%s' "$WEBHOOK_ID" "$TS" "$BODY" | openssl dgst -sha256 -mac HMAC -macopt "hexkey:$KEY_HEX" -binary | openssl base64 -A)
curl --proto '=https' -sS -i \ "https://api-sandbox.marsx.media/v1/sources/$MARSX_CONNECTION/events" \ -H "Content-Type: application/json" \ -H "webhook-id: $WEBHOOK_ID" \ -H "webhook-timestamp: $TS" \ -H "webhook-signature: v1,$SIG" \ --data-binary "$BODY"The answer is 202 with this body:
{"result":"accepted","webhook_id":"msg_test_0004","request_id":"req_..."}For step 3, run the script again with no change. The webhook-timestamp and signature are fresh, and the body (envelope timestamp included) and webhook-id are the same, so the answer says duplicate. For Node.js and Python samples of the same request, see the Quick start.
Step 5: the final state of a lead
Section titled “Step 5: the final state of a lead”A lead.new or lead.update still queued when a lead.withdraw is stored ends quarantined with the reason privacy_marker_set. This is intended: MarsX restricts a lead the moment it stores a privacy event. So the lead in step 5 may never show applied. To see each outcome, use the status read.
Send a test lead from Concour
Section titled “Send a test lead from Concour”You can also send made-up leads from Concour with no code. Open Developers, then Send a test lead. It works on a test connection only: a live key cannot be used there.
- Pick an example. The Example event is New, Update, Withdraw or Delete. Send a new test lead first, because an update, a withdraw and a delete change a lead you sent before.
- Try a mistake (optional). Choose None, Dealer code not on the list, Phone number not in a valid format, Source record ID missing, Wrong signature or Timestamp too old. For Withdraw and Delete only Wrong signature and Timestamp too old are offered.
- Sign with one of your test keys.
- Choose Send test lead. The page shows the request MarsX would receive, with the signature hidden, and then What happened, worded as your request log words it.
The lead goes to the sandbox address. It never reaches a dealer, and it is counted as a test. If the page says you are sending test leads too quickly, wait a minute. A test lead sent from Concour does not tick Signature checked: send a signed event from your own system for that. A request refused for its signature is not written to your request log.
Cause a fault on purpose (step 6)
Section titled “Cause a fault on purpose (step 6)”In the sandbox, add x-marsx-sandbox-scenario to one request to make MarsX misbehave on that request. Production ignores the header.
| Header value | What MarsX does | What you do |
|---|---|---|
503 |
Stores nothing. Answers 503 with Retry-After: 1 |
Retry with the same webhook-id and body for 202 |
drop-202 |
Stores the event. Answers 504 with Retry-After: 1 |
Retry with the same webhook-id and body. You get 202 with duplicate |
No other scenario exists. Any other value gives 202. To see 429, send more than 100 requests in 10 seconds. On every retry, use a fresh webhook-timestamp and a fresh signature, and keep the same body. Responses and retries has the full rules.
If you use the shared sheet
Section titled “If you use the shared sheet”Run these tests with invented rows that you agree with MarsX first. MarsX confirms each result by email.
| Row you add | Result in MarsX status |
|---|---|
A valid new row |
Accepted, then Applied |
A new row without a required field |
Rejected |
An update with a higher revision |
Applied |
| A row with the same revision and other content | Set aside: revision_conflict |
A withdraw row, then a new row for the same lead |
Set aside: privacy_marker_set |
The shared sheet page explains the sheet and its statuses.
Step 7: host your endpoints (optional)
Section titled “Step 7: host your endpoints (optional)”Skip this step if you do not host the four endpoints. Build the four endpoints in your sandbox, with made-up data only. Enter the base URL, the token URL and one read-only OAuth client in Concour, under Your endpoints on the Developers page, and choose Save and check. Seed the data in Test your endpoints. Then email support@marsx.media the two cursor values and a technical contact. MarsX replies within 1 business day.

