Leads API
The Leads API provides full CRUD operations for managing leads in Skode CRM. All endpoints require authentication via API key or OAuth token. Responses are JSON-formatted with pagination support for list endpoints.
List Leads
Retrieve a paginated list of leads with optional filtering and sorting.
curl -X GET "https://api.skodeai.com/v1/leads?page=1&per_page=25&status=new&sort=-created_at" \
-H "Authorization: Bearer sk_live_your_api_key"
Query parameters: page, per_page (max 100), status, source, owner_id, created_after, created_before, sort (prefix with - for descending).
Get a Lead
Retrieve a single lead by ID, including all fields and related data.
curl -X GET "https://api.skodeai.com/v1/leads/lead_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
Create a Lead
const response = await fetch('https://api.skodeai.com/v1/leads', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Jane Doe',
email: 'jane@example.com',
phone: '+1-555-0123',
company: 'Example Corp',
source: 'website',
deal_value: 25000,
custom_fields: {
industry: 'Technology',
employees: '50-200'
}
})
});
Required fields: name. Optional: email, phone, company, source, deal_value, status, owner_id, tags, custom_fields.
Update a Lead
curl -X PATCH "https://api.skodeai.com/v1/leads/lead_abc123" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"status": "qualified", "deal_value": 50000}'
Send only the fields you want to update. All other fields remain unchanged.
Delete a Lead
curl -X DELETE "https://api.skodeai.com/v1/leads/lead_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
Returns 204 No Content on success. Deleted leads are moved to trash and can be restored within 30 days.
Search Leads
curl -X POST "https://api.skodeai.com/v1/leads/search" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{"query": "example.com", "fields": ["email", "company"]}'