Fire a conversion pixel event
Sends a server-side conversion event to Facebook CAPI or TikTok Events API for a specific lead. The lead's contact info (email, phone), IP address, user agent, and platform click IDs (fbclid, ttclid, etc.) are automatically pulled from the lead record and included in the event payload. Use testEventCode to send events in test mode without affecting production data.
Authorization
ApiKeyAuth API key generated from your Vayaflow dashboard Settings page
In: header
Request Body
application/json
The lead to fire the pixel event for
The pixel ID from your ad platform (e.g. Facebook Pixel ID or TikTok Pixel ID)
Ad platform to send the event to
"facebook" | "tiktok"Conversion event name (e.g. "Lead", "Purchase", "CompleteRegistration")
Monetary value of the conversion event
ISO 4217 currency code for the event value
Where the conversion occurred. Defaults to system_generated for server-side events.
"website" | "phone_call" | "chat" | "system_generated"Test event code from the ad platform. When provided, the event is sent in test mode and does not affect production data.
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/pixels/fire" body := strings.NewReader(`{ "leadId": "lead_abc123", "pixelId": "123456789", "platform": "facebook", "eventName": "Lead" }`) 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": {
"success": true,
"platform": "string",
"eventName": "string",
"pixelId": "string",
"leadId": "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"
}
}