Approve or reject a lead
Sets the approval status for a lead that has a pending approval. Approving allows the lead to proceed with delivery. Rejecting updates the lead status to rejected. Setting to pending resets the approval decision.
Authorization
ApiKeyAuth API key generated from your Vayaflow dashboard Settings page
In: header
Path Parameters
The lead ID
Request Body
application/json
The approval decision
"approved" | "rejected" | "pending"Optional reason for the decision
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/approve" body := strings.NewReader(`{ "status": "approved" }`) req, _ := http.NewRequest("POST", 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": {
"leadId": "string",
"approval": {
"status": "string",
"campaignId": "string",
"decidedAt": "string",
"decidedBy": "string",
"reason": "string"
}
}
}{
"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"
}
}Manually deliver a lead
Manually triggers delivery for a lead that is pending action (e.g. waiting for approval or manual review). Creates a new submission and sends the lead through the qualification and delivery pipeline for the specified campaign. The lead must not have a pending or rejected approval status.
Repost a failed lead
Retries delivery for a lead with status failed, rejected, or error. Two modes are supported: simple retry (resends with the same or provided delivery info, skips qualification) and modified retry (provide a modifiedPayload and campaignId to re-qualify with updated data). For simple retry, the previous delivery info is reused automatically if not provided.