Leads & Clients API
The Leads & Clients API provides full CRUD operations for managing leads and client records programmatically.
GET /leads
Retrieve a paginated list of leads.
- •**page** (number) — Page number (default: 1)
- •**limit** (number) — Items per page (default: 20, max: 100)
- •**status** (string) — Filter by status (new, contacted, qualified, won, lost)
- •**search** (string) — Search by name, email, or company
- •**sort** (string) — Sort field (createdAt, updatedAt, score)
- •**order** (string) — Sort order (asc, desc)
**Query Parameters:**
- •data — Array of lead objects
- •pagination — Page info including total, page, limit
**Response (200 OK):**
POST /leads
Create a new lead.
- •**name** (string, required) — Contact name
- •**email** (string, required) — Contact email
- •**phone** (string) — Contact phone number
- •**company** (string) — Company name
- •**source** (string) — Lead source (website, referral, social, etc.)
- •**notes** (string) — Additional notes
**Request Body:**
- •Returns the created lead object with generated ID
**Response (201 Created):**
PUT /leads/:id
Update an existing lead.
- •**id** (string, required) — Lead ID
**Path Parameters:**
**Request Body:** Any lead fields to update
- •Returns the updated lead object
**Response (200 OK):**
- •404 — Lead not found
- •400 — Validation errors
**Error Responses:**
Clients Endpoints
Client management follows the same pattern:
- •GET /clients — List clients with pagination and filtering
- •POST /clients — Create a new client
- •GET /clients/:id — Get client details
- •PUT /clients/:id — Update client information
- •DELETE /clients/:id — Archive a client record
Clients can be created from converted leads using POST /leads/:id/convert.
Related Articles
Authentication API
The Authentication API handles user login, registration, email OTP verification, and session management.
API ReferenceTickets & Follow-ups API
The Tickets & Follow-ups API enables you to manage support tickets and schedule follow-ups programmatically.
API ReferenceRate Limits & Errors
Understanding rate limits and error handling is essential for building reliable integrations with the TrackNexus API.