
# Leads
 
The Leads API allows you to create, view, update, and delete individual, or a batch, of Leads.

## Leads Properties
 
| Attributes      | Type     | Description                                                        
| --------------- | -------- | ---------------------------------------- 
| leads_id        | integer  | Unique identifier for the leads                                    
| form_id         | integer  | Unique identifier for the form                  
| form_data       | json     | detail data of particular form                    
| created_at      | datetime | Timestamp of when the lead was created    
| user_agent      | integer  | user agent details                
| lead_ip         | string   | ip of device through which lead created                   
| os              | string   | operating system of the lead device 
| browser         | string   | browser through which lead is created                
| location        | string   | device location through which lead created                    
| lead_status     | string   | status of the lead                         

## List all leads

```shell
curl -X GET https://vedaay-api.mulika.in/leads
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
'{
    "status": "success",
    "message": "5 leads retrieved successfully",
    "code": 200,
    "pagination": {
        "current_page": 1,
        "per_page": 10,
        "total_records": 5,
        "total_pages": 1
    },
    "data": [
        {
            "leads_id": "9",
            "form_id": "31",
            "form_data": "{\"blood_group\": \"02-01-2002\", \"player_role\": \"gautam@gmail.com\", \"fitness_cert\": \"7484516254\", \"sport_category\": \"gautam\", \"emergency_phone\": \"male\"}",
            "created_at": "2026-03-13 10:03:56"
        },
        {
            "leads_id": "8",
            "form_id": "31",
            "form_data": "{\"blood_group\": \"02-01-2002\", \"player_role\": \"gautam@gmail.com\", \"fitness_cert\": \"7484516254\", \"sport_category\": \"gautam\", \"emergency_phone\": \"male\"}",
            "created_at": "2026-03-13 10:03:08"
        },
        {
            "leads_id": "5",
            "form_id": "30",
            "form_data": "{\"blood_group\": \"02-01-2002\", \"player_role\": \"gautam@gmail.com\", \"fitness_cert\": \"7484516254\", \"sport_category\": \"gautam\", \"emergency_phone\": \"male\"}",
            "created_at": "2026-03-12 18:10:57"
        },
        {
            "leads_id": "4",
            "form_id": "29",
            "form_data": "{\"dob\": \"02-01-2002\", \"email\": \"vishal@gmail.com\", \"gender\": \"male\", \"full_name\": \"gautam\", \"mobile_number\": \"7484516254\"}",
            "created_at": "2026-03-12 18:05:21"
        },
        {
            "leads_id": "2",
            "form_id": "29",
            "form_data": "{\"dob\": \"01-01-2002\", \"email\": \"kamlesh@gmail.com\", \"gender\": \"male\", \"full_name\": \"kamlesh\", \"mobile_number\": \"9484516254\"}",
            "created_at": "2026-03-12 17:35:24"
        }
    ]
}'
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #27cf3d; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /leads
</span>  
 

1. GET /leads 
2. GET /leads?page=1&per_page=10
3. GET /leads?search=courses
4. GET /leads?exclude=2
5. GET /leads?include=4
6. GET /leads?order=asc
7. GET /leads?order=desc 
8. GET /leads?filters[form_id]=29,30 
 
 
| Parameters | Type     | Description                           
| ---------- | -------- | ----------------------------------- 
| page       | integer  | Current page of the collection. Default is 1.    
| per_page   | integer  | Maximum number of items to be returned in the result set. Default is 10.  
| search     | string   | Limit results to those matching a  string.                 
| exclude    | array    | Ensure the result set excludes specific  IDs.               
| include    | array    | Limit the result set to specific  IDs.
| order      | string   | Order sort attribute ascending or descending.  asc, desc. Default is desc
|filters     | integer  | get the lead by the form single and multiple ex- filters[column_name]=value                 
      


## Get Single leads

```shell
curl -X GET https://vedaay-api.mulika.in/leads/4
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
 '{
    "status": "success",
    "message": "leads retrieved successfully",
    "code": 200,
    "data": {
        "leads_id": "4",
        "form_id": "29",
        "form_data": "{\"dob\": \"02-01-2002\", \"email\": \"vishal@gmail.com\", \"gender\": \"male\", \"full_name\": \"gautam\", \"mobile_number\": \"7484516254\"}",
        "created_at": "2026-03-12 18:05:21"
    }
}'
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #27cf3d; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /leads/{leadsId}
</span> 

### Parameters

| Parameter | Type    | Description                       |
| --------- | ------- | --------------------------------- |
| leads_id  | integer | Unique identifier for the leads   |

 

## Create leads

```shell
curl -X POST https://vedaay-api.mulika.in/leads \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{ 
    "form_id": 36,
    "form_data": {
        "sport_category": "cricket",
        "player_role": "baller", 
        "fitness_cert": "district champian",
        "blood_group": "O",
        "emergency_phone": "9478564512" 
    } 
}'
 ```
> Responce:

```json
   '{
    "status": "success",
    "message": "Lead created successfully",
    "code": 200,
    "data": {
        "leads_id": 14,
        "leads_data": {
            "leads_id": "14",
            "form_id": "36",
            "form_data": "{\"blood_group\": \"O\", \"player_role\": \"baller\", \"fitness_cert\": \"district champian\", \"sport_category\": \"cricket\", \"emergency_phone\": \"9478564512\"}",
            "created_at": "2026-03-21 10:56:11",
            "user_agent": "36",
            "leads_ip": "120120"
        }
    }
}'
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #08c0b7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">POST</span> /leads
</span> 
 
 
## Delete lead

```shell
curl -X DELETE https://vedaay-api.mulika.in/leads/5
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
{
    "status": "success",
    "message": "leads deleted successfully",
    "code": 200,
    "data": {
        "leads_id": "5"
    }
}
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span style="background: #c91c05; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">DELETE</span>/leads/{leadsId}  
</span>
  

## Export Leads

```shell
curl -X GET https://vedaay-api.mulika.in/leads/export?lead_ids=36 \
-H "Content-Type: application/json" \
-H  Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE

```
> Responce:

```json
   '{
    "status": "success",
    "message": "1 leads exported successfully",
    "code": 200,
    "download_url": "https://dev-api.vedaay.mulika.in/download_exported_leads",
    "filename": "leads_export_2026-05-28_10-45-52.csv"
}'
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #27cf3d; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /leads/export
</span>

 1.  GET /leads/export?lead_ids=24,25,26
 2.  GET /leads/export?form_ids=61,51
 3.  GET /leads/export?date_range=2026-03-25to2026-03-28
 4.  GET /leads/export?date_range=2026-04-17to2026-06-01&form_ids=149

### Parameter

| Parameter  | Type    | Description                   |
| ---------- | ------- | ----------------------------- |
| lead_ids   | integer | export leads by leads id      |
| form_ids   | integer | export leads by form id       |
| date_range | integer | export leads date range wise  | 

## Download Exported Leads CSV

```shell
curl -X POST https://vedaay-api.mulika.in/download_exported_leads \
-H "Content-Type: application/json" \
-H  Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE

```

> Responce:

```json
"leads_export_2026-05-28_10-45-52.csv"
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #27cf3d; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /download_exported_leads 
</span>
