VayaFlow
Pixels

Fire a conversion pixel event

Sends a server-side conversion event to Facebook CAPI or TikTok Events API for a specific contact. The contact's contact info (email, phone), IP address, user agent, and platform click IDs (fbclid, ttclid, etc.) are automatically pulled from the contact record and included in the event payload. Use testEventCode to send events in test mode without affecting production data.

POST
/api/v1/pixels/fire

Authorization

ApiKeyAuth
X-API-Key<token>

API key generated from your Vayaflow dashboard Settings page

In: header

Request Body

application/json

contactId*string

The contact to fire the pixel event for

pixelId*string

The pixel ID from your ad platform (e.g. Facebook Pixel ID or TikTok Pixel ID)

platform*string

Ad platform to send the event to

Value in"facebook" | "tiktok"
eventName*string

Conversion event name (e.g. "Lead", "Purchase", "CompleteRegistration")

eventValue?number

Monetary value of the conversion event

currency?string

ISO 4217 currency code for the event value

actionSource?string

Where the conversion occurred. Defaults to system_generated for server-side events.

Value in"website" | "phone_call" | "chat" | "system_generated"
testEventCode?string

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.vayaflow.com/api/v1/pixels/fire"  body := strings.NewReader(`{    "contactId": "contact_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",
    "contactId": "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"
  }
}