Register

How can I use an automation to send a Webhook?

Marketing Automations are no longer limited to the actions you can perform within your Moosend account. The Send Webhook action allows you to connect an automation with any 3rd party system like Zapier or your own application. When the action runs, it sends a JSON object using a POST request to a pre-defined endpoint.

You can use the Send Webhook action to keep your internal systems in-sync with the actions your end-users perform in your emails or website. For example, you can build a simple application that registers purchases to your CRM and use a Moosend automation to send a webhook to your app whenever someone purchases in your website! You can also use tools like Zapier to connect Moosend with other 3rd party systems without writing a single line of code - I 'll repeat that! No code required!

 

If you need the technical details of what exactly is sent over to your app or 3rd party system through the Webhook:

HTTP Method:  POST
POST Payload Type:  JSON 

Payload JSON Schema: (You can also conveniently find the schema here)

{
    "title": "SendToWebhookContext",
        "type": "object",
        "properties": {
        "UserId": {
            "required": true,
                "type": "string"
        },
        "StepId": {
            "required": true,
                "type": "string"
        },
        "AutomationId": {
            "required": true,
                "type": "string"
        },
        "Event": {
            "required": true,
                "type": [
                    "object",
                    "null"
                ],
                "properties": {
                "Id": {
                    "required": true,
                        "type": "string"
                },
                "Ab": {
                    "required": true,
                        "type": [
                        "integer",
                        "null"
                    ]
                },
                "UserId": {
                    "required": true,
                        "type": "string"
                },
                "SessionId": {
                    "required": false,
                        "type": [
                        "string",
                        "null"
                    ]
                },
                "EventName": {
                    "required": true,
                        "type": [
                        "string",
                        "null"
                    ]
                },
                "Timestamp": {
                    "required": true,
                        "type": "string"
                },
                "PingContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "Hash": {
                            "required": true,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "Components": {
                            "required": true,
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "additionalProperties": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    }
                },
                "LinkContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "LinkId": {
                            "required": true,
                                "type": "string"
                        },
                        "LinkUrl": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "LinkUrlHash": {
                            "required": false,
                                "type": "string"
                        }
                    }
                },
                "BounceContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "BounceType": {
                            "required": true,
                                "type": "integer"
                        },
                        "BounceText": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "NumberOfRetries": {
                            "required": false,
                                "type": "integer"
                        }
                    }
                },
                "DeviceContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "Id": {
                            "required": false,
                                "type": "string"
                        },
                        "Name": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "OsName": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "OsFamily": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "OsCompany": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "DeviceName": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "DeviceFamily": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "DeviceEngine": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "DeviceVersion": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "DeviceCompany": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "UserAgentString": {
                            "required": true,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "UserAgentType": {
                            "required": false,
                                "type": "integer",
                                "enum": [
                                0,
                                1,
                                2
                            ]
                        }
                    }
                },
                "WebsiteContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "WebsiteId": {
                            "required": true,
                                "type": "string"
                        },
                        "SessionId": {
                            "required": false,
                                "type": "string"
                        },
                        "PageUrl": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        }
                    }
                },
                "ContactContext": {
                    "required": true,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "Id": {
                            "required": true,
                                "type": "string"
                        },
                        "Name": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "MailingListId": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "MailingListMemberId": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "EmailAddress": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "ContactToken": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "ContactType": {
                            "required": false,
                                "type": "integer",
                                "enum": [
                                0
                            ]
                        }
                    }
                },
                "LocationContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "LocationId": {
                            "required": false,
                                "type": "integer"
                        },
                        "IpAddress": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "City": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "Area": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "Region": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "Postcode": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "LocaleCode": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "CountryCode": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "CountryName": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "ContinentCode": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        },
                        "ContinentName": {
                            "required": false,
                                "type": [
                                "string",
                                "null"
                            ]
                        }
                    }
                },
                "PurchaseContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "TotalPrice": {
                            "required": false,
                                "type": "number"
                        },
                        "Products": {
                            "required": false,
                                "type": [
                                    "array",
                                    "null"
                                ],
                                "items": {
                                "type": [
                                        "object",
                                        "null"
                                    ],
                                    "properties": {
                                    "ItemUrl": {
                                        "required": false,
                                            "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "ItemCode": {
                                        "required": false,
                                            "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "ItemName": {
                                        "required": false,
                                            "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "ItemImage": {
                                        "required": false,
                                            "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "ItemTitle": {
                                        "required": false,
                                            "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "ItemSupplier": {
                                        "required": false,
                                            "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "ItemCategory": {
                                        "required": false,
                                            "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "ItemQuantity": {
                                        "required": false,
                                            "type": "integer"
                                    },
                                    "ItemPrice": {
                                        "required": false,
                                            "type": "number"
                                    },
                                    "ItemTotalPrice": {
                                        "required": false,
                                            "type": "number"
                                    },
                                    "ItemDescription": {
                                        "required": false,
                                            "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "ItemManufacturer": {
                                        "required": false,
                                            "type": [
                                            "string",
                                            "null"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "CampaignContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "CampaignId": {
                            "required": true,
                                "type": "string"
                        }
                    }
                },
                "AddToCartContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "Product": {
                            "required": false,
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "properties": {
                                "ItemUrl": {
                                    "required": true,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemCode": {
                                    "required": true,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemName": {
                                    "required": true,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemImage": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemTitle": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemSupplier": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemCategory": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemQuantity": {
                                    "required": false,
                                        "type": "integer"
                                },
                                "ItemPrice": {
                                    "required": false,
                                        "type": "number"
                                },
                                "ItemTotalPrice": {
                                    "required": false,
                                        "type": "number"
                                },
                                "ItemDescription": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemManufacturer": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        }
                    }
                },
                "ComplaintContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "Fbtype": {
                            "required": true,
                                "type": [
                                "string",
                                "null"
                            ]
                        }
                    }
                },
                "ProductViewContext": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                        "Product": {
                            "required": true,
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "properties": {
                                "ItemUrl": {
                                    "required": true,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemCode": {
                                    "required": true,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemName": {
                                    "required": true,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemImage": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemTitle": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemSupplier": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemCategory": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemQuantity": {
                                    "required": false,
                                        "type": "integer"
                                },
                                "ItemPrice": {
                                    "required": false,
                                        "type": "number"
                                },
                                "ItemTotalPrice": {
                                    "required": false,
                                        "type": "number"
                                },
                                "ItemDescription": {
                                    "required": false,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "ItemManufacturer": {
                                    "required": true,
                                        "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        }
                    }
                },
                "ContactChangedContexts": {
                    "required": false,
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                        "type": [
                                "object",
                                "null"
                            ],
                            "properties": {
                            "FieldName": {
                                "required": true,
                                    "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "NewFieldValue": {
                                "required": true,
                                    "type": [
                                        "object",
                                        "null"
                                    ],
                                    "properties": {}
                            },
                            "OldFieldValue": {
                                "required": true,
                                    "type": [
                                        "object",
                                        "null"
                                    ],
                                    "properties": {}
                            }
                        }
                    }
                },
                "Properties": {
                    "required": false,
                        "type": [
                            "object",
                            "null"
                        ],
                        "additionalProperties": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            }
        }
    }
}