Skip to content

Lead lookup

GET /v1/leads/{partner_lead_id} returns what you would send as the latest event for one lead. MarsX calls it when the feeds show a lead it lacks, or holds at an older revision. The answer has the same data shape as a push event.

URL-encode the ID in the path. Use the access token from your token URL.

Lead state at your end Answer
Live 200 with the full current state
Withdrawn or restricted 200 with the withdrawal form: identity and privacy request fields only
Erased and no longer held 404, for an authenticated caller only

A live lead gets 200 with the full current state. The answer always carries source_revision and updated_at, because MarsX compares revisions. Use record_action new until the lead has changed, then update.

Request
GET /v1/leads/SRC-TEST-0001
Authorization: Bearer <access_token>
Accept: application/json
Response: 200
{
"partner_lead_id": "SRC-TEST-0001",
"partner_customer_id": "SRC-CUST-TEST-0001",
"source_revision": 1,
"record_action": "new",
"created_at": "2026-10-01T09:15:00+07:00",
"updated_at": "2026-10-01T09:15:00+07:00",
"customer_name": "Contoh Pelanggan",
"phone": "+6280000000001",
"email": "contoh.pelanggan@contoh.example",
"model_interest": "Model A",
"purchase_timeframe": "3 bulan ke depan",
"test_drive_requested": "N",
"enquiry_notes": "Ingin meminta penawaran untuk Model A.",
"customer_province": "Jawa Barat",
"customer_city": "Kota Bandung",
"preferred_dealer_code": "D0001",
"source_channel": "chat",
"campaign": "campaign-test",
"session_id": "SESSION-TEST-0001",
"consent_reference": "CONSENT-TEST-0001",
"contact_consent": "yes",
"consent_time": "2026-10-01T09:14:40+07:00",
"notice_version": "NOTICE-TEST-1",
"consent_purpose": "sales_follow_up",
"ai_intent_label": "ingin_penawaran",
"ai_summary": "Pelanggan meminta penawaran Model A."
}

The body is the data object only, not the event envelope with type and timestamp. The fields are in Lead fields.

A lead with a withdrawal or restriction gets 200 with identity and privacy request fields only. It carries no contact, interest or profile data. It carries the withdrawal’s own source_revision and updated_at, not those of the last lead update.

Request
GET /v1/leads/SRC-TEST-0001
Authorization: Bearer <access_token>
Accept: application/json
Response: 200
{
"partner_lead_id": "SRC-TEST-0001",
"source_revision": 3,
"record_action": "withdraw",
"created_at": "2026-10-01T09:15:00+07:00",
"updated_at": "2026-10-04T15:00:00+07:00",
"request_type": "withdraw_consent",
"request_time": "2026-10-04T14:59:30+07:00",
"request_reference": "PRIV-TEST-0001"
}

If you still hold an erased lead as a suppression record, answer 200 with the same form and record_action delete. Use 404 only when you hold nothing for that ID.

Answer 404. MarsX finds the erasure in privacy-events.

Request
GET /v1/leads/SRC-TEST-0007
Authorization: Bearer <access_token>
Accept: application/json
Response: 404
{
"type": "urn:marsx:problem:not-found",
"title": "The lead was not found",
"status": 404
}

MarsX acts on the status code, not on the problem type. You may use your own problem type.