> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developers.jazzhq.ai/api-reference/vendor-customer-ap-is/lead/replace-lead/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.jazzhq.ai/_mcp/server. # Replace a lead PUT https://api.jazzhq.ai/api/v1/vendors/leads/{leadId} Content-Type: application/json Replaces the lead with the object in the body. Any writable field you omit is **cleared**, so send the whole record - use PATCH if you only want to change a few fields and leave the rest alone. Approval state and archiving are not settable here and are never affected by a replace - use the approve, reject and archive endpoints. Reference: https://developers.jazzhq.ai/api-reference/vendor-customer-ap-is/lead/replace-lead ## Authentication - `X-API-KEY` header (required) — Your vendor API key. Required on every request under /api/v1/vendors/**. ## Request ### Path parameters - `leadId` (long, required) — ID of the lead. ### Body (application/json) This endpoint expects a ReplaceLeadRequest. - `firstName` (string, required) - `emailAddress` (string, required) - `companyName` (string, required) - `lastName` (string, optional, nullable) - `phoneNumber` (string, optional, nullable) - `linkedInUrl` (string, optional, nullable) - `websiteUrl` (string, optional, nullable) - `companySize` (string, optional, nullable) - `industry` (string, optional, nullable) - `jobTitle` (string, optional, nullable) - `city` (string, optional, nullable) - `state` (string, optional, nullable) - `country` (string, optional, nullable) - `source` (long, optional, nullable) — Id of a lead source dropdown value configured for your account. - `status` (long, optional, nullable) — Id of a lead status dropdown value configured for your account. - `leadAge` (integer, optional, nullable) - `productsInterested` (string, optional, nullable) - `businessImpactMetrics` (string, optional, nullable) - `externalId` (string, optional, nullable) — Your own identifier for this lead. Stored and echoed back unchanged. ## Response ### 200 Lead replaced successfully. - `success` (boolean, optional) - `message` (string, optional, nullable) - `data` (Lead, optional) - `timestamp` (datetime, optional) ## Errors ### 400 Bad Request Error A required field was missing or malformed (`VALIDATION_FAILED`), the body wasn't valid JSON (`INVALID_REQUEST`), or the new email address is already used by another of this partner's leads (`DUPLICATE_ENTRY`). - `message` (string, optional) — Machine-readable error code. One of: VALIDATION_FAILED, INVALID_REQUEST, DUPLICATE_ENTRY, RESOURCE_NOT_FOUND, INVALID_STATE_TRANSITION, INTERNAL_SERVER_ERROR. - `status` (integer, optional) - `success` (boolean, optional) - `errors` (list of ValidationErrorDetail, optional) - `timestamp` (datetime, optional) ### 401 Unauthorized Error Authentication failed - the X-API-KEY header was missing or invalid, or the request path is outside the /api/v1/vendors/ namespace this key is authorized for. - `success` (boolean, optional) - `message` (string, optional) — One of: API_KEY_MISSING, INVALID_API_KEY, UNKNOWN_API_NAMESPACE. - `data` (AuthErrorResponseData, optional, nullable) - `timestamp` (datetime, optional) ### 404 Not Found Error The requested resource was not found. - `message` (string, optional) — Machine-readable error code. One of: VALIDATION_FAILED, INVALID_REQUEST, DUPLICATE_ENTRY, RESOURCE_NOT_FOUND, INVALID_STATE_TRANSITION, INTERNAL_SERVER_ERROR. - `status` (integer, optional) - `success` (boolean, optional) - `errors` (list of ValidationErrorDetail, optional) - `timestamp` (datetime, optional) ### 500 Internal Server Error An unexpected error occurred. - `message` (string, optional) — Machine-readable error code. One of: VALIDATION_FAILED, INVALID_REQUEST, DUPLICATE_ENTRY, RESOURCE_NOT_FOUND, INVALID_STATE_TRANSITION, INTERNAL_SERVER_ERROR. - `status` (integer, optional) - `success` (boolean, optional) - `errors` (list of ValidationErrorDetail, optional) - `timestamp` (datetime, optional) ## Types ### Lead - `id` (long, optional) - `partnerId` (long, optional) - `firstName` (string, optional) - `lastName` (string, optional, nullable) - `emailAddress` (string, optional) - `phoneNumber` (string, optional, nullable) - `linkedInUrl` (string, optional, nullable) - `companyName` (string, optional) - `websiteUrl` (string, optional, nullable) - `companySize` (string, optional, nullable) - `industry` (string, optional, nullable) - `jobTitle` (string, optional, nullable) - `city` (string, optional, nullable) - `state` (string, optional, nullable) - `country` (string, optional, nullable) - `source` (long, optional, nullable) — Id of a lead source dropdown value configured for your account. - `status` (long, optional, nullable) — Id of a lead status dropdown value configured for your account. - `leadAge` (integer, optional, nullable) - `productsInterested` (string, optional, nullable) - `businessImpactMetrics` (string, optional, nullable) - `externalId` (string, optional, nullable) — Your own identifier for this lead. Stored and echoed back unchanged. - `approvalStatus` (enum, optional) - Allowed values: `PENDING`, `APPROVED`, `REJECTED` - `rejectReason` (string, optional, nullable) - `rejectComment` (string, optional, nullable) - `lastActiveAt` (datetime, optional, nullable) - `submittedByType` (enum, optional, nullable) — What created the lead. - Allowed values: `PARTNER_USER`, `VENDOR_USER`, `INTEGRATION`, `SYSTEM`, `API` - `isDuplicate` (boolean, optional) — Another active lead or contact already exists with this email address. - `archived` (boolean, optional) — Archived leads are excluded from listings by default. - `createdAt` (datetime, optional) - `updatedAt` (datetime, optional) ### ValidationErrorDetail - `field` (string, optional) — Name of the request field this error relates to. - `error` (string, optional) — Human-readable description of what's wrong. ### AuthErrorResponseData ## Examples **Request** ```json { "firstName": "Jane", "emailAddress": "jane@acme.com", "companyName": "Acme Inc" } ``` **Response** ```json { "success": true, "message": "LEAD_CREATE_SUCCESSFUL", "data": { "id": 300, "partnerId": 1001, "firstName": "Jane", "lastName": "Doe", "emailAddress": "jane@acme.com", "phoneNumber": "string", "linkedInUrl": "string", "companyName": "Acme Inc", "websiteUrl": "string", "companySize": "50-100", "industry": "string", "jobTitle": "VP Sales", "city": "string", "state": "string", "country": "string", "source": 1, "status": 1, "leadAge": 1, "productsInterested": "string", "businessImpactMetrics": "string", "externalId": "string", "approvalStatus": "PENDING", "rejectReason": "string", "rejectComment": "string", "lastActiveAt": "2024-01-15T09:30:00Z", "submittedByType": "PARTNER_USER", "isDuplicate": true, "archived": true, "createdAt": "2024-01-15T09:30:00Z", "updatedAt": "2024-01-15T09:30:00Z" }, "timestamp": "2024-01-15T09:30:00Z" } ``` **SDK Code** ```python import requests url = "https://api.jazzhq.ai/api/v1/vendors/leads/1" payload = { "firstName": "Jane", "emailAddress": "jane@acme.com", "companyName": "Acme Inc" } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.jazzhq.ai/api/v1/vendors/leads/1'; const options = { method: 'PUT', headers: {'X-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"firstName":"Jane","emailAddress":"jane@acme.com","companyName":"Acme Inc"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.jazzhq.ai/api/v1/vendors/leads/1" payload := strings.NewReader("{\n \"firstName\": \"Jane\",\n \"emailAddress\": \"jane@acme.com\",\n \"companyName\": \"Acme Inc\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("X-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.jazzhq.ai/api/v1/vendors/leads/1") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["X-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"firstName\": \"Jane\",\n \"emailAddress\": \"jane@acme.com\",\n \"companyName\": \"Acme Inc\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.jazzhq.ai/api/v1/vendors/leads/1") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"firstName\": \"Jane\",\n \"emailAddress\": \"jane@acme.com\",\n \"companyName\": \"Acme Inc\"\n}") .asString(); ``` ```php request('PUT', 'https://api.jazzhq.ai/api/v1/vendors/leads/1', [ 'body' => '{ "firstName": "Jane", "emailAddress": "jane@acme.com", "companyName": "Acme Inc" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.jazzhq.ai/api/v1/vendors/leads/1"); var request = new RestRequest(Method.PUT); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"firstName\": \"Jane\",\n \"emailAddress\": \"jane@acme.com\",\n \"companyName\": \"Acme Inc\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "firstName": "Jane", "emailAddress": "jane@acme.com", "companyName": "Acme Inc" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.jazzhq.ai/api/v1/vendors/leads/1")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```