LeadSail
Leads

Update a lead

Partially updates a lead. Supports updating contact info, questionnaire answers, notes, and flags.

PATCH
/api/v1/leads/{leadId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key generated from your Vayaflow dashboard Settings page

In: header

Path Parameters

leadId*string

The lead ID

Request Body

application/json

firstName?string
Length1 <= length
lastName?string
Length1 <= length
email?string
Formatemail
phone?string
Length10 <= length
country?string
Length2 <= length <= 2
address?
dateOfBirth?string
Match^\d{4}-\d{2}-\d{2}$
timezone?string
timezoneSource?string
Value in"ip" | "zip" | "area_code" | "user_input" | "inferred"
questionnaire?array<>
deleteQuestionnaireKeys?array<>
notes?array<>
customFields?
attribution?
compliance?
status?string
Value in"new" | "pending" | "processing" | "qualified" | "disqualified" | "missing_data" | "queued" | "pending_action" | "no_answer" | "voicemail" | "contacted" | "scheduled_callback" | "no_contact" | "pending_signature" | "document_sent" | "signed" | "delivered" | "accepted" | "duplicate" | "failed" | "error" | "rejected" | "dnc"
detail?string
flags?
approval?
campaign?
tags?array<>
clientLeadId?string
repostedTo?array<>
latestSubmittedAt?|
lastActivityAt?|
deliveredAt?|
submissionCount?integer
Range0 <= value

Response Body

application/json

application/json

application/json

application/json

package mainimport (  "fmt"  "net/http"  "io/ioutil"  "strings")func main() {  url := "https://api.leadsail.app/api/v1/leads/string"  body := strings.NewReader(`{}`)  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": null
}
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input data",
    "details": [
      "string"
    ]
  }
}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Resource not found"
  }
}