curl -X PATCH "https://server.smartlead.ai/api/v1/leads/categories/789?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Follow Up In Q1",
"sentiment_type": null,
"colour_code": "#FFC107"
}'
import requests
API_KEY = "YOUR_API_KEY"
category_id = 789
response = requests.patch(
f"https://server.smartlead.ai/api/v1/leads/categories/{category_id}",
params={"api_key": API_KEY},
json={
"name": "Follow Up In Q1",
"sentiment_type": None,
"colour_code": "#FFC107"
}
)
result = response.json()
if result.get('ok'):
print(f"Updated category {result['data']['id']}")
const API_KEY = 'YOUR_API_KEY';
const categoryId = 789;
const response = await fetch(
`https://server.smartlead.ai/api/v1/leads/categories/${categoryId}?api_key=${API_KEY}`,
{
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'Follow Up In Q1',
sentiment_type: null,
colour_code: '#FFC107'
})
}
);
const result = await response.json();
if (result.ok) {
console.log(`Updated category ${result.data.id}`);
}
{
"ok": true,
"data": {
"id": 789,
"name": "Follow Up In Q1",
"user_id": 12345,
"sentiment_type": null,
"colour_code": "#FFC107",
"created_at": "2025-11-20T14:22:00.000Z"
}
}
{
"ok": false,
"message": "Default categories cannot be modified or deleted"
}
{
"ok": false,
"message": "Lead category not found"
}
{
"ok": false,
"message": "A category with this name already exists"
}
Lead Categories
Update Lead Category
Update the name, sentiment, or colour of a custom lead category
PATCH
/
api
/
v1
/
leads
/
categories
/
{category_id}
curl -X PATCH "https://server.smartlead.ai/api/v1/leads/categories/789?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Follow Up In Q1",
"sentiment_type": null,
"colour_code": "#FFC107"
}'
import requests
API_KEY = "YOUR_API_KEY"
category_id = 789
response = requests.patch(
f"https://server.smartlead.ai/api/v1/leads/categories/{category_id}",
params={"api_key": API_KEY},
json={
"name": "Follow Up In Q1",
"sentiment_type": None,
"colour_code": "#FFC107"
}
)
result = response.json()
if result.get('ok'):
print(f"Updated category {result['data']['id']}")
const API_KEY = 'YOUR_API_KEY';
const categoryId = 789;
const response = await fetch(
`https://server.smartlead.ai/api/v1/leads/categories/${categoryId}?api_key=${API_KEY}`,
{
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'Follow Up In Q1',
sentiment_type: null,
colour_code: '#FFC107'
})
}
);
const result = await response.json();
if (result.ok) {
console.log(`Updated category ${result.data.id}`);
}
{
"ok": true,
"data": {
"id": 789,
"name": "Follow Up In Q1",
"user_id": 12345,
"sentiment_type": null,
"colour_code": "#FFC107",
"created_at": "2025-11-20T14:22:00.000Z"
}
}
{
"ok": false,
"message": "Default categories cannot be modified or deleted"
}
{
"ok": false,
"message": "Lead category not found"
}
{
"ok": false,
"message": "A category with this name already exists"
}
Only custom categories you created can be updated. Global (system) categories such as Interested, Not Interested, or Out Of Office are read-only and return
403.Path Parameters
Query Parameters
Body Parameters
Send at least one field. Only the fields you send are changed.New category name (max 255 characters, surrounding spaces are trimmed). Must not match another global or custom category name (case-insensitive).
curl -X PATCH "https://server.smartlead.ai/api/v1/leads/categories/789?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Follow Up In Q1",
"sentiment_type": null,
"colour_code": "#FFC107"
}'
import requests
API_KEY = "YOUR_API_KEY"
category_id = 789
response = requests.patch(
f"https://server.smartlead.ai/api/v1/leads/categories/{category_id}",
params={"api_key": API_KEY},
json={
"name": "Follow Up In Q1",
"sentiment_type": None,
"colour_code": "#FFC107"
}
)
result = response.json()
if result.get('ok'):
print(f"Updated category {result['data']['id']}")
const API_KEY = 'YOUR_API_KEY';
const categoryId = 789;
const response = await fetch(
`https://server.smartlead.ai/api/v1/leads/categories/${categoryId}?api_key=${API_KEY}`,
{
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'Follow Up In Q1',
sentiment_type: null,
colour_code: '#FFC107'
})
}
);
const result = await response.json();
if (result.ok) {
console.log(`Updated category ${result.data.id}`);
}
Response Fields
The updated category, with the same fields as Create Lead Category:
id, name, user_id, sentiment_type, colour_code, created_atResponse Codes
{
"ok": true,
"data": {
"id": 789,
"name": "Follow Up In Q1",
"user_id": 12345,
"sentiment_type": null,
"colour_code": "#FFC107",
"created_at": "2025-11-20T14:22:00.000Z"
}
}
{
"ok": false,
"message": "Default categories cannot be modified or deleted"
}
{
"ok": false,
"message": "Lead category not found"
}
{
"ok": false,
"message": "A category with this name already exists"
}
Related Endpoints
- Get Lead Categories - Find category IDs
- Create Lead Category - Add a custom category
- Delete Lead Category - Remove a custom category
