A few days ago, a co-worker of mine presented an Eloqua webhook app (Eloqua doesn’t have webhooks natively). And the use case he presented was a webhook to create an Eloqua Custom Data Object from a form submit – in the same Eloqua instance. And I thought: “Ah, intriguing. Never occurred to me to send a webhook from Marketo to Marketo.”
What is a Marketo Webhook?
“Marketo allows the use of Webhooks to communicate with third party web services.” (https://developers.marketo.com/webhooks/). It is an outgoing API call that can be used in a Smart Campaign Flow Step.
So the general concept is to communicate with services other than Marketo, but as Marketo also has a REST API for incoming calls, you can very well send a Webhook to yourself.
Why would you do that?
The API can do things a Smart Campaign Flow Step can’t. Or it can do things more efficiently or at scale. For example: The API can create Custom Object records. Or it can create update person records de-duped by their Marketo ID (instead of their email address). Or many other things I haven’t thought about yet.
But let’s get to one very concrete example:
Create a Custom Object Record from a Form Submit
A form submit creates or updates a person record. All fields on the form will go onto that person record, and if that person already exists in Marketo, the form submit will override data. Also, as it’s a person record, one person has only one First Name, one Last Name – it’s a 1-to-1 relationship. That is all fine and well, but there might be case where you don’t want this, but instead create 1-to-many relationships between one person and many data sets created by form submits. The scenario here came from a case where form submits were used to order specific things, and we wanted to have any person have all their orders in Custom Objects.
How does this work and what are the steps?
Marketo documentation explains the steps in detail:
- Create a role
- Create a user
- Create a Custom Service
https://experienceleague.adobe.com/en/docs/marketo/using/product-docs/administration/additional-integrations/create-a-custom-service-for-use-with-rest-api#_blank
Now you have the endpoint that will receive your request.
The webhooks
- Authentication
You need to two webhooks for this process. One to retrieve authorization, and another to send the data. This process is certainly not the most elegant in the world, and if you’d include the “third party web service” that the Marketo definition of a webhook talks about – see above – you will have a more elegant solution. But we’re trying to do something with Marketo means alone here.
developers.marketo.com is your friend. Once you’ve dove only a little bit into Marketo’s API you will come back here all the time. Here’s the link to Authentication: https://developers.marketo.com/rest-api/authentication/
Follow the steps in this description and create a webhook that looks like this in Marketo:

Note that you have Client ID and Client Secret in the URL and that your Request Type is “GET”, as you want to retrieve something. The thing you want to retrieve is the Access Token that you want to write into a lead field – here “Bearer Token” (API name: “bearerToken”). You will need to add this field as a lead token to you subsequent API call.
2. Send Data to Custom Object
Here’s an example of the webhook call that writes a Custom Object record:

URL: “formSubmit” is the API name of my Custom Object. See the link to Marketo Docs above for reference.
In the Payload Template you add the the CO fields on the left and Lead Tokens from the lead database on the right.
Note that in this call you have to have Custom Headers that contain the Bearer Token you wrote on that lead with Webhook #1.
Conclusion
That’s pretty much the idea. I know that I went over the API stuff rather quickly. If you want to go deeper into the Marketo API – and I recommend you do that! – visit Tyron Pretorius’ API crash course:
https://theworkflowpro.com/marketo-rest-api-course/
Also, familiarize yourself with Postman.