Leads API ========= Leads ----- .. list-table:: :header-rows: 1 :widths: 30 10 20 40 * - Endpoint - Method - Permission - Description * - ``/api/v1/leads/`` - GET - central_ops, oem (own only) - List leads. Filters: ``status``, ``source``, ``city``, ``state``, ``assigned_to``, ``created_after``, ``created_before``, ``search`` * - ``/api/v1/leads/`` - POST - central_ops, oem - Create lead. Body: ``{customer_name, customer_phone, address_line1, city, state, pincode, source, charger_model}`` * - ``/api/v1/leads/{id}/`` - GET - central_ops, oem (own), field_team (assigned) - Get lead detail with documents, survey status, installation status * - ``/api/v1/leads/{id}/`` - PATCH - central_ops - Update lead: status, assigned_to, intro_call_completed, charger_model * - ``/api/v1/leads/{id}/timeline/`` - GET - central_ops - Get full activity timeline (status changes, calls, documents, survey, installation events) * - ``/api/v1/leads/import/`` - POST - central_ops - Bulk import leads from CSV file. Returns import summary with success/error counts Documents --------- .. list-table:: :header-rows: 1 :widths: 30 10 20 40 * - Endpoint - Method - Permission - Description * - ``/api/v1/leads/{id}/documents/`` - GET - central_ops, customer (own lead) - List documents for a lead * - ``/api/v1/leads/{id}/documents/`` - POST - central_ops, customer (own lead) - Upload document. Body (multipart): ``{document_type, file, notes}`` * - ``/api/v1/leads/{id}/documents/{doc_id}/`` - GET - central_ops - Download/view document * - ``/api/v1/leads/{id}/documents/{doc_id}/`` - DELETE - central_ops - Remove document Lead Sources ------------ .. list-table:: :header-rows: 1 :widths: 30 10 20 40 * - Endpoint - Method - Permission - Description * - ``/api/v1/lead-sources/`` - GET - central_ops, oem - List lead sources * - ``/api/v1/lead-sources/`` - POST - central_ops - Create lead source. Body: ``{name, oem, source_type}`` * - ``/api/v1/lead-sources/{id}/`` - PATCH - central_ops - Update lead source