API documentation POST /leads/edit
Edit a lead
POST https://demo.trafficmanager.com/api/v1/leads/edit
Use this endpoint to complete a lead after it has been sent with the new lead API: pass back the
leadId you received and only the fields you have collected in the meantime, for example the city or the postal code. The response repeats the same code / message / clickid / leadId values, so the endpoint can be called again whenever you obtain another field.
Advertisers updating their own leads should use PUT /leads/{id} instead, which also changes the lead status and authenticates with the advertiser key.
Authentication:
The request must be authenticated with the following HTTP headers:x-api-key: Your API key, found on the Security pagex-user-id: Your User ID, found on the Security page
If the HTTP headers are not passed, but you are logged in to the TrafficManager panel, the current user is used instead (so you can easily preview or download the data using your browser)
GET Parameters:
- none
POST Parameters:
Always required:
leadId: the lead UUID returned by the new lead API
Lead fields:
Send only the fields you want to change. A field that is not present in the request keeps its current value; a field sent empty is stored empty.
name: Full namegiven-name: First name / Given namefamily-name: Last name / Surname / Family name or equivalenttel: Full telephone number, with or without country codeemail: User email addressstreet-address: Full address. Multiple lines of text are allowed.address-level2: The second administrative level, usually the city/town/village.address-level1: The first administrative level in the address: State, country, province or similar.postal-code: A postal code (ZIP code in the United States)- any other field you can send when creating the lead, and any new one you need to add
The value of the order and the status of the lead cannot be changed with this endpoint. A field that selects a product variation is refused with a 400, because the price of the order depends on it.
Response codes:
200: The request has been processed.400: Invalid request. The leadId is missing or malformed, or a field is not accepted.403: Authentication failed.404: Lead not found, or not accessible with these credentials.409: The lead can no longer be edited.
Returned values:
code: see Response codes above. The same four fields are returned on errors too, with clickid and leadId set to null when the lead could not be identified.message:
- "OK": the lead has been updated.
- "NO_CHANGES": the request did not contain any field to update, or the values sent were already stored.
- "NOT_EDITABLE": the lead is no longer in a status that allows editing. Only leads that are still pending or marked as a potential double can be edited.
Note: new messages could be added at any time without prior notice.clickid: the clickid of the leadleadId: the lead UUID, as sent in the request
When the lead has already been forwarded to a logistics partner that supports order updates, the new data is sent to them as well; the partner may refuse the update, for example when the order has already been taken in charge by an operator. This does not affect the response: the lead is updated in the platform in any case.
Custom fields are updated in the platform only, so please contact your account manager if you rely on those reaching the advertiser.
Request example
curl --location --request POST 'https://demo.trafficmanager.com/api/v1/leads/edit' \ --header 'x-user-id: 04120c02-b144-439f-9f0a-85824e66fc00' \ --header 'x-api-key: TM04dca746122da971e02d55d496ebc457f20a8300' \ --form 'leadId=01913190-5ec5-72a5-a23b-7609ad5328d0' \ --form 'address-level2=Roma' \ --form 'postal-code=00100'
Response example
Lead updated:
{
"code": 200,
"message": "OK",
"clickid": "TMd59e6a59297f6b698469b3f02cd57f40",
"leadId": "01913190-5ec5-72a5-a23b-7609ad5328d0"
}
Lead no longer editable:
{
"code": 409,
"message": "NOT_EDITABLE",
"clickid": "TMd59e6a59297f6b698469b3f02cd57f40",
"leadId": "01913190-5ec5-72a5-a23b-7609ad5328d0"
}
English
العربية
Dansk
Deutsch
Español
Suomi
Italiano
한국어
Português
Українська
Русский
Svenska
中文