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
number
required
The ID of the custom category to update
Query Parameters
string
required
Your SmartLead API key
Body Parameters
Send at least one field. Only the fields you send are changed.string
New category name (max 255 characters, surrounding spaces are trimmed). Must not match another global or custom category name (case-insensitive).
string | null
Values:
positive, negative, or null (neutral)string
Hex colour, e.g.
#FFC107curl -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
boolean
true when the category was updatedobject
The updated category, with the same fields as Create Lead Category:
id, name, user_id, sentiment_type, colour_code, created_atResponse Codes
Success
Category updated successfully
Bad Request
Validation failed or the body was empty
Unauthorized
Invalid or missing API key, or the key belongs to a client account
Forbidden
The category is a global (system) category and cannot be modified
Not Found
No custom category with this ID exists in your account
Conflict
Another category with this name already exists
Internal Server Error
Server error occurred
{
"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
