curl "https://server.smartlead.ai/api/v1/leads/fetch-categories?api_key=YOUR_KEY"
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://server.smartlead.ai/api/v1/leads/fetch-categories",
params={"api_key": API_KEY}
)
categories = response.json()
print(f"Total categories: {len(categories)}")
# Filter by sentiment
positive_categories = [c for c in categories if c['sentiment_type'] == 'positive']
print(f"Positive sentiment categories: {len(positive_categories)}")
const API_KEY = 'YOUR_API_KEY';
const response = await fetch(
`https://server.smartlead.ai/api/v1/leads/fetch-categories?api_key=${API_KEY}`
);
const categories = await response.json();
console.log(`Total categories: ${categories.length}`);
// Filter by sentiment
const positiveCategories = categories.filter(c => c.sentiment_type === 'positive');
console.log(`Positive sentiment categories: ${positiveCategories.length}`);
[
{
"id": 1,
"name": "Interested",
"sentiment_type": "positive",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": 2,
"name": "Not Interested",
"sentiment_type": "negative",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": 3,
"name": "Meeting Booked",
"sentiment_type": "positive",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": 789,
"name": "Follow Up Later",
"sentiment_type": null,
"created_at": "2025-11-20T14:22:00.000Z"
}
]
{
"message": "Invalid API Key"
}
Lead Categories
Get Lead Categories
Retrieve all available lead categories including global and user-specific categories
GET
/
api
/
v1
/
leads
/
fetch-categories
curl "https://server.smartlead.ai/api/v1/leads/fetch-categories?api_key=YOUR_KEY"
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://server.smartlead.ai/api/v1/leads/fetch-categories",
params={"api_key": API_KEY}
)
categories = response.json()
print(f"Total categories: {len(categories)}")
# Filter by sentiment
positive_categories = [c for c in categories if c['sentiment_type'] == 'positive']
print(f"Positive sentiment categories: {len(positive_categories)}")
const API_KEY = 'YOUR_API_KEY';
const response = await fetch(
`https://server.smartlead.ai/api/v1/leads/fetch-categories?api_key=${API_KEY}`
);
const categories = await response.json();
console.log(`Total categories: ${categories.length}`);
// Filter by sentiment
const positiveCategories = categories.filter(c => c.sentiment_type === 'positive');
console.log(`Positive sentiment categories: ${positiveCategories.length}`);
[
{
"id": 1,
"name": "Interested",
"sentiment_type": "positive",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": 2,
"name": "Not Interested",
"sentiment_type": "negative",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": 3,
"name": "Meeting Booked",
"sentiment_type": "positive",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": 789,
"name": "Follow Up Later",
"sentiment_type": null,
"created_at": "2025-11-20T14:22:00.000Z"
}
]
{
"message": "Invalid API Key"
}
Query Parameters
string
required
Your SmartLead API key
curl "https://server.smartlead.ai/api/v1/leads/fetch-categories?api_key=YOUR_KEY"
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://server.smartlead.ai/api/v1/leads/fetch-categories",
params={"api_key": API_KEY}
)
categories = response.json()
print(f"Total categories: {len(categories)}")
# Filter by sentiment
positive_categories = [c for c in categories if c['sentiment_type'] == 'positive']
print(f"Positive sentiment categories: {len(positive_categories)}")
const API_KEY = 'YOUR_API_KEY';
const response = await fetch(
`https://server.smartlead.ai/api/v1/leads/fetch-categories?api_key=${API_KEY}`
);
const categories = await response.json();
console.log(`Total categories: ${categories.length}`);
// Filter by sentiment
const positiveCategories = categories.filter(c => c.sentiment_type === 'positive');
console.log(`Positive sentiment categories: ${positiveCategories.length}`);
Response Fields
The response is an array of category objects, each containing:number
Unique category identifier
string
Category name (e.g., “Interested”, “Not Interested”, “Meeting Booked”)
string | null
Sentiment classification of the category. Values:
positive, negative, or null (neutral)timestamp
ISO 8601 timestamp of when the category was created
Response Codes
Success
Categories retrieved successfully
Unauthorized
Invalid or missing API key
Internal Server Error
Server error occurred
[
{
"id": 1,
"name": "Interested",
"sentiment_type": "positive",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": 2,
"name": "Not Interested",
"sentiment_type": "negative",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": 3,
"name": "Meeting Booked",
"sentiment_type": "positive",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"id": 789,
"name": "Follow Up Later",
"sentiment_type": null,
"created_at": "2025-11-20T14:22:00.000Z"
}
]
{
"message": "Invalid API Key"
}
Usage Notes
Categories are sorted by ID in ascending order. Global categories (available to all users) have lower IDs, while user-created categories have higher IDs.
Use the category ID when updating a lead’s category via the Update Lead Category endpoint. The sentiment type helps you filter leads for reporting and analytics.
Related Endpoints
- Get Campaign Leads - Filter leads by category
- Get Lead by Email - View lead’s assigned category
- Create Lead Category - Add a custom category
- Update Lead Category - Rename or recolour a custom category
- Delete Lead Category - Remove a custom category
