curl --request PATCH \
--url https://app.pipecorn.com/api/v2/searches/{id}/leads/status \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"lead_ids": [
"0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e"
],
"reason": "Not in our ICP"
}
'import requests
url = "https://app.pipecorn.com/api/v2/searches/{id}/leads/status"
payload = {
"lead_ids": ["0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e"],
"reason": "Not in our ICP"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({lead_ids: ['0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e'], reason: 'Not in our ICP'})
};
fetch('https://app.pipecorn.com/api/v2/searches/{id}/leads/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.pipecorn.com/api/v2/searches/{id}/leads/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'lead_ids' => [
'0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e'
],
'reason' => 'Not in our ICP'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.pipecorn.com/api/v2/searches/{id}/leads/status"
payload := strings.NewReader("{\n \"lead_ids\": [\n \"0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e\"\n ],\n \"reason\": \"Not in our ICP\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<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(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.pipecorn.com/api/v2/searches/{id}/leads/status")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lead_ids\": [\n \"0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e\"\n ],\n \"reason\": \"Not in our ICP\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pipecorn.com/api/v2/searches/{id}/leads/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lead_ids\": [\n \"0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e\"\n ],\n \"reason\": \"Not in our ICP\"\n}"
response = http.request(request)
puts response.read_body{
"search_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "qualified",
"rejection_reasons": [
"Not in our ICP"
],
"updated": 1,
"unknown_lead_ids": []
}{
"error": "status must be one of: qualified, disqualified"
}{
"error": "Search not found"
}{
"error": "Unauthorized parameters detected",
"unauthorized_params": [
"<string>"
],
"permitted_params": [
"<string>"
]
}Update the Status of Leads
Marks leads of a search as qualified or disqualified, the same status the app shows in a saved list and that GET /searches/{id} returns and filters on. Leads are identified by the lead.id that GET /searches/{id} returns. Disqualifying replaces any existing rejection reason; qualifying clears it. Costs no credits or quota. You can update your own searches, or those of your workspace members when you authenticate with a workspace key.
curl --request PATCH \
--url https://app.pipecorn.com/api/v2/searches/{id}/leads/status \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"lead_ids": [
"0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e"
],
"reason": "Not in our ICP"
}
'import requests
url = "https://app.pipecorn.com/api/v2/searches/{id}/leads/status"
payload = {
"lead_ids": ["0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e"],
"reason": "Not in our ICP"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({lead_ids: ['0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e'], reason: 'Not in our ICP'})
};
fetch('https://app.pipecorn.com/api/v2/searches/{id}/leads/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.pipecorn.com/api/v2/searches/{id}/leads/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'lead_ids' => [
'0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e'
],
'reason' => 'Not in our ICP'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.pipecorn.com/api/v2/searches/{id}/leads/status"
payload := strings.NewReader("{\n \"lead_ids\": [\n \"0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e\"\n ],\n \"reason\": \"Not in our ICP\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<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(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.pipecorn.com/api/v2/searches/{id}/leads/status")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lead_ids\": [\n \"0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e\"\n ],\n \"reason\": \"Not in our ICP\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pipecorn.com/api/v2/searches/{id}/leads/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lead_ids\": [\n \"0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e\"\n ],\n \"reason\": \"Not in our ICP\"\n}"
response = http.request(request)
puts response.read_body{
"search_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "qualified",
"rejection_reasons": [
"Not in our ICP"
],
"updated": 1,
"unknown_lead_ids": []
}{
"error": "status must be one of: qualified, disqualified"
}{
"error": "Search not found"
}{
"error": "Unauthorized parameters detected",
"unauthorized_params": [
"<string>"
],
"permitted_params": [
"<string>"
]
}Description
Marks leads of a search as qualified or disqualified. It is the status the app shows in a saved list, and the oneGET /searches/{id} returns as status and rejection_reasons and filters on with ?status=. Use it to write back a verdict on each lead, for instance after checking them against your ICP.
Leads are identified by the lead.id that GET /searches/{id} returns for each lead. You can update your own searches, or those of your workspace members when you authenticate with a workspace key. It costs no credits or quota.
Parameters
Path Parameters
id(required, string, UUID): The ID of the search
Body Parameters
lead_ids(required, array of strings): IDs of the leads to update, fromlead.idinGET /searches/{id}. 1 to 1000status(required, string):qualifiedordisqualifiedreason(optional, string): Why the leads are disqualified. Defaults toManually disqualified. Ignored when qualifying
Example
curl -X PATCH https://app.pipecorn.com/api/v2/searches/0d6f1c5e-1b7a-4c1e-9a43-6f8e2a1b9c77/leads/status \
-H "X-API-KEY: $PIPECORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lead_ids": ["0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e", "5e1f2a3b-4c5d-4e6f-9a7b-8c9d0e1f2a3b"],
"status": "disqualified",
"reason": "Not in our ICP"
}'
Responses
200 OK
{
"search_id": "0d6f1c5e-1b7a-4c1e-9a43-6f8e2a1b9c77",
"status": "disqualified",
"rejection_reasons": ["Not in our ICP"],
"updated": 1,
"unknown_lead_ids": ["5e1f2a3b-4c5d-4e6f-9a7b-8c9d0e1f2a3b"]
}
updatedis the number of leads whose status was set.unknown_lead_idslists the IDs that matched no lead of this search. The other IDs are still applied.
400 Bad Request
lead_ids is missing, empty, not an array of strings or longer than 1000; status is not qualified or disqualified; reason is not a string; or the body is not valid JSON.
{
"error": "status must be one of: qualified, disqualified"
}
404 Not Found
The search does not exist, or it belongs to another user outside your account (or outside your workspace, with a workspace key).{
"error": "Search not found"
}
422 Unprocessable Entity
The body carries a parameter this endpoint does not take.{
"error": "Unauthorized parameters detected",
"unauthorized_params": ["linkedin_urls"],
"permitted_params": ["lead_ids", "status", "reason"]
}
Notes
- Disqualifying replaces any rejection reason the leads already carry; qualifying clears it
- The search’s qualified and disqualified counts are refreshed after the update
Authorizations
Your API key
Path Parameters
ID of the search
Body
IDs of the leads to update, as GET /searches/{id} returns them in lead.id. 1 to 1000.
1 - 1000 elements["0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e"]
qualified keeps the leads, disqualified rejects them.
qualified, disqualified Why the leads are disqualified, returned as rejection_reasons. Ignored when qualifying. Defaults to Manually disqualified.
"Not in our ICP"
Response
Leads updated
ID of the search
qualified, disqualified Rejection reasons the leads now carry; empty when qualifying
["Not in our ICP"]
Number of leads updated
1
IDs that matched no lead of the search
[]
Was this page helpful?