LeadSail
Leads

Bulk update leads

Updates multiple leads at once. Supports updating status, questionnaire answers, and other fields.

PATCH
/api/v1/leads/bulk

Authorization

ApiKeyAuth
X-API-Key<token>

API key generated from your Vayaflow dashboard Settings page

In: header

Request Body

application/json

leadIds*array<>

Array of lead IDs to update

updates*

Fields to update on each lead

Response Body

application/json

application/json

application/json

package mainimport (  "fmt"  "net/http"  "io/ioutil"  "strings")func main() {  url := "https://api.leadsail.app/api/v1/leads/bulk"  body := strings.NewReader(`{    "leadIds": [      "string"    ],    "updates": {      "property1": null,      "property2": null    }  }`)  req, _ := http.NewRequest("PATCH", url, body)  req.Header.Add("Content-Type", "application/json")  res, _ := http.DefaultClient.Do(req)  defer res.Body.Close()  body, _ := ioutil.ReadAll(res.Body)  fmt.Println(res)  fmt.Println(string(body))}
{
  "success": true,
  "data": {
    "modifiedCount": 0
  }
}
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input data",
    "details": [
      "string"
    ]
  }
}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}