Setting up the rule
Select “Webhook invoked” as the rule trigger.
Set up the rest of rule steps. You will be able to reference the webhook payload (JSON object) in later steps as Step 1 Result. For example, if the payload is
{"message": "hello!"}
, you can useParseJSON([Step 1 Result].ToText(), "message")
to get the message value.
Triggering the rule
The rule is triggered when you send a POST request to the URL provided in Step 1. You will need to provide an API token with write access to the doc using Bearer Authentication.
You can create a new API token from Step 1 of the rule builder or use an existing API token. You can reuse the same API token to trigger multiple rules in the same doc.
You can view and remove API tokens from your account page (under Coda API tokens).
If you provide a JSON payload in the POST request body, the payload will be available in later automation steps as
Step 1 Result
.
Tips & Tricks
The rule must be “on” in order for the webhook to trigger the rule execution.
If you turn on developer mode on your account page (under Labs > Enable Developer Mode), you can find the automation rule id by clicking on the three dot menu for a given rule.
Technical Notes
The Webhook invoked URL pattern is a new trigger automation for Step 1.
A 202 response to the POST request only guarantees that the automation trigger was queued for processing. Depending on a few factors (e.g. how many other API requests your doc is processing), there may be a delay from when the POST request is made and when the automation is run.
The webhook is currently implemented as an API endpoint, so the existing API limitations still apply. Doc size must be below the maximum doc size to use the API, and the requests are subject to the API rate limiting.
If you require unauthenticated webhook endpoints we recommend using Zapier webhooks as an intermediary between your service and the Coda webhook. At this time, our webhook endpoint only supports POST requests with the proper Bearer Authentication.