curl --request PATCH \
--url https://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"companyName": "Acme Inc.",
"jobTitle": "Head of Growth",
"website": "https://acme.com",
"linkedinProfile": "https://www.linkedin.com/in/janedoe",
"location": "Berlin, Germany",
"tags": [
"vip",
"q4"
],
"customFields": {},
"customFieldLabels": {},
"customFieldTypes": {}
}
'import requests
url = "https://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}"
payload = {
"email": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"companyName": "Acme Inc.",
"jobTitle": "Head of Growth",
"website": "https://acme.com",
"linkedinProfile": "https://www.linkedin.com/in/janedoe",
"location": "Berlin, Germany",
"tags": ["vip", "q4"],
"customFields": {},
"customFieldLabels": {},
"customFieldTypes": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
firstName: 'Jane',
lastName: 'Doe',
companyName: 'Acme Inc.',
jobTitle: 'Head of Growth',
website: 'https://acme.com',
linkedinProfile: 'https://www.linkedin.com/in/janedoe',
location: 'Berlin, Germany',
tags: ['vip', 'q4'],
customFields: {},
customFieldLabels: {},
customFieldTypes: {}
})
};
fetch('https://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}', 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://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}",
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([
'email' => '[email protected]',
'firstName' => 'Jane',
'lastName' => 'Doe',
'companyName' => 'Acme Inc.',
'jobTitle' => 'Head of Growth',
'website' => 'https://acme.com',
'linkedinProfile' => 'https://www.linkedin.com/in/janedoe',
'location' => 'Berlin, Germany',
'tags' => [
'vip',
'q4'
],
'customFields' => [
],
'customFieldLabels' => [
],
'customFieldTypes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"companyName\": \"Acme Inc.\",\n \"jobTitle\": \"Head of Growth\",\n \"website\": \"https://acme.com\",\n \"linkedinProfile\": \"https://www.linkedin.com/in/janedoe\",\n \"location\": \"Berlin, Germany\",\n \"tags\": [\n \"vip\",\n \"q4\"\n ],\n \"customFields\": {},\n \"customFieldLabels\": {},\n \"customFieldTypes\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"companyName\": \"Acme Inc.\",\n \"jobTitle\": \"Head of Growth\",\n \"website\": \"https://acme.com\",\n \"linkedinProfile\": \"https://www.linkedin.com/in/janedoe\",\n \"location\": \"Berlin, Germany\",\n \"tags\": [\n \"vip\",\n \"q4\"\n ],\n \"customFields\": {},\n \"customFieldLabels\": {},\n \"customFieldTypes\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"companyName\": \"Acme Inc.\",\n \"jobTitle\": \"Head of Growth\",\n \"website\": \"https://acme.com\",\n \"linkedinProfile\": \"https://www.linkedin.com/in/janedoe\",\n \"location\": \"Berlin, Germany\",\n \"tags\": [\n \"vip\",\n \"q4\"\n ],\n \"customFields\": {},\n \"customFieldLabels\": {},\n \"customFieldTypes\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "c9e5b1a3-7f24-4d80-a6b9-2e4f8c0d1a37",
"email": "[email protected]",
"tags": [
"vip",
"q4"
],
"customFields": {
"industry": "SaaS"
},
"status": "not_contacted",
"verification": {
"status": "valid",
"subStatus": "email_ok"
},
"metrics": {
"sent": 2,
"opened": 1,
"clicked": 0,
"replied": 0
},
"createdAt": "2023-11-07T05:31:56Z",
"firstName": "Jane",
"lastName": "Doe",
"companyName": "Acme Inc",
"jobTitle": "VP Sales",
"website": "https://acme.com",
"linkedinProfile": "https://www.linkedin.com/in/janedoe",
"location": "New York, US",
"provider": "google",
"sequenceProgress": {
"totalSteps": 3,
"sentCount": 1,
"plannedCount": 1,
"failedCount": 0,
"nextPlannedAt": "2023-11-07T05:31:56Z"
},
"lastContactedAt": "2023-11-07T05:31:56Z",
"lastRepliedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "validation_failed",
"message": "One or more fields are invalid.",
"status": 400,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"details": [
"name should not be empty"
]
}
}{
"error": {
"type": "authentication_error",
"code": "unauthenticated",
"message": "Missing or invalid API key.",
"status": 401,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "authorization_error",
"code": "permission_denied",
"message": "This API key is missing the required scope.",
"status": 403,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "not_found",
"message": "Resource not found.",
"status": 404,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "conflict",
"message": "The request conflicts with an existing resource.",
"status": 409,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_reused",
"message": "The Idempotency-Key was already used with a different request body. Use a new key for a new operation.",
"status": 422,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests. Retry after the interval in the Retry-After header.",
"status": 429,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"retryAfter": 30
}
}Update a lead
Update a lead’s fields, tags, custom fields, or status. The email address can only be changed while the lead has not been contacted yet. Reply-based statuses can only be set once the lead has replied.
Requires one of the following scopes: leads:write, leads:all, all:all.
curl --request PATCH \
--url https://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"companyName": "Acme Inc.",
"jobTitle": "Head of Growth",
"website": "https://acme.com",
"linkedinProfile": "https://www.linkedin.com/in/janedoe",
"location": "Berlin, Germany",
"tags": [
"vip",
"q4"
],
"customFields": {},
"customFieldLabels": {},
"customFieldTypes": {}
}
'import requests
url = "https://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}"
payload = {
"email": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"companyName": "Acme Inc.",
"jobTitle": "Head of Growth",
"website": "https://acme.com",
"linkedinProfile": "https://www.linkedin.com/in/janedoe",
"location": "Berlin, Germany",
"tags": ["vip", "q4"],
"customFields": {},
"customFieldLabels": {},
"customFieldTypes": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
firstName: 'Jane',
lastName: 'Doe',
companyName: 'Acme Inc.',
jobTitle: 'Head of Growth',
website: 'https://acme.com',
linkedinProfile: 'https://www.linkedin.com/in/janedoe',
location: 'Berlin, Germany',
tags: ['vip', 'q4'],
customFields: {},
customFieldLabels: {},
customFieldTypes: {}
})
};
fetch('https://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}', 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://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}",
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([
'email' => '[email protected]',
'firstName' => 'Jane',
'lastName' => 'Doe',
'companyName' => 'Acme Inc.',
'jobTitle' => 'Head of Growth',
'website' => 'https://acme.com',
'linkedinProfile' => 'https://www.linkedin.com/in/janedoe',
'location' => 'Berlin, Germany',
'tags' => [
'vip',
'q4'
],
'customFields' => [
],
'customFieldLabels' => [
],
'customFieldTypes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"companyName\": \"Acme Inc.\",\n \"jobTitle\": \"Head of Growth\",\n \"website\": \"https://acme.com\",\n \"linkedinProfile\": \"https://www.linkedin.com/in/janedoe\",\n \"location\": \"Berlin, Germany\",\n \"tags\": [\n \"vip\",\n \"q4\"\n ],\n \"customFields\": {},\n \"customFieldLabels\": {},\n \"customFieldTypes\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"companyName\": \"Acme Inc.\",\n \"jobTitle\": \"Head of Growth\",\n \"website\": \"https://acme.com\",\n \"linkedinProfile\": \"https://www.linkedin.com/in/janedoe\",\n \"location\": \"Berlin, Germany\",\n \"tags\": [\n \"vip\",\n \"q4\"\n ],\n \"customFields\": {},\n \"customFieldLabels\": {},\n \"customFieldTypes\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mailbeast.ai/v1/campaigns/{cid}/leads/{leadId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"companyName\": \"Acme Inc.\",\n \"jobTitle\": \"Head of Growth\",\n \"website\": \"https://acme.com\",\n \"linkedinProfile\": \"https://www.linkedin.com/in/janedoe\",\n \"location\": \"Berlin, Germany\",\n \"tags\": [\n \"vip\",\n \"q4\"\n ],\n \"customFields\": {},\n \"customFieldLabels\": {},\n \"customFieldTypes\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "c9e5b1a3-7f24-4d80-a6b9-2e4f8c0d1a37",
"email": "[email protected]",
"tags": [
"vip",
"q4"
],
"customFields": {
"industry": "SaaS"
},
"status": "not_contacted",
"verification": {
"status": "valid",
"subStatus": "email_ok"
},
"metrics": {
"sent": 2,
"opened": 1,
"clicked": 0,
"replied": 0
},
"createdAt": "2023-11-07T05:31:56Z",
"firstName": "Jane",
"lastName": "Doe",
"companyName": "Acme Inc",
"jobTitle": "VP Sales",
"website": "https://acme.com",
"linkedinProfile": "https://www.linkedin.com/in/janedoe",
"location": "New York, US",
"provider": "google",
"sequenceProgress": {
"totalSteps": 3,
"sentCount": 1,
"plannedCount": 1,
"failedCount": 0,
"nextPlannedAt": "2023-11-07T05:31:56Z"
},
"lastContactedAt": "2023-11-07T05:31:56Z",
"lastRepliedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request_error",
"code": "validation_failed",
"message": "One or more fields are invalid.",
"status": 400,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"details": [
"name should not be empty"
]
}
}{
"error": {
"type": "authentication_error",
"code": "unauthenticated",
"message": "Missing or invalid API key.",
"status": 401,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "authorization_error",
"code": "permission_denied",
"message": "This API key is missing the required scope.",
"status": 403,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "not_found",
"message": "Resource not found.",
"status": 404,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "conflict",
"message": "The request conflicts with an existing resource.",
"status": 409,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_reused",
"message": "The Idempotency-Key was already used with a different request body. Use a new key for a new operation.",
"status": 422,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests. Retry after the interval in the Retry-After header.",
"status": 429,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"retryAfter": 30
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional. A unique key you generate (max 255 chars, such as a UUID) that makes this request safe to retry. Retrying with the same key replays the original response instead of repeating the operation. Reusing a key with a different body returns 422.
255"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Path Parameters
"a7d4e2f1-08b3-4c65-9e7a-1b2c3d4e5f60"
"c9e5b1a3-7f24-4d80-a6b9-2e4f8c0d1a37"
Body
The email can only be changed while the lead has not been contacted yet.
254128"Jane"
128"Doe"
256"Acme Inc."
128"Head of Growth"
512"https://acme.com"
512"https://www.linkedin.com/in/janedoe"
128"Berlin, Germany"
["vip", "q4"]
Custom fields - each key must be lowercase letters, digits and underscores, starting with a letter, up to 64 characters (e.g. fund_manager); a key outside that form is rejected. The number of fields per campaign is capped, and each value is length-limited.
Display labels for custom-field columns (applied on first definition).
Show child attributes
Show child attributes
Data types for custom-field columns (text | url | number | date | image; applied on first definition).
Show child attributes
Show child attributes
Only user-settable statuses are allowed; platform-managed ones such as email_sent or scheduled are rejected. Reply-based statuses (lead_replied_*, lead_converted) require the lead to have already replied. lead_lost and blacklisted can be set at any time.
lead_replied_interested, lead_replied_meeting_request, lead_replied_out_of_office, lead_replied_wrong_person, lead_replied_not_interested, lead_replied_unsubscribed, lead_replied_uncategorized, lead_converted, lead_lost, blacklisted Response
"c9e5b1a3-7f24-4d80-a6b9-2e4f8c0d1a37"
["vip", "q4"]
{ "industry": "SaaS" }
not_contacted, scheduled, email_sent, failed, skipped, lead_replied_interested, lead_replied_meeting_request, lead_replied_out_of_office, lead_replied_bounce, lead_replied_wrong_person, lead_replied_not_interested, lead_replied_unsubscribed, lead_replied_uncategorized, lead_converted, lead_lost, blacklisted "not_contacted"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"Jane"
"Doe"
"Acme Inc"
"VP Sales"
"https://acme.com"
"https://www.linkedin.com/in/janedoe"
"New York, US"
"google"
Live sequence progress - included on the single-lead detail view.
Show child attributes
Show child attributes