> For the complete documentation index, see [llms.txt](https://docs.zero.inc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zero.inc/features/agents/agent-examples/webhook-from-cal.com.md).

# Webhook from Cal.com

## Goal

1. A new inbound lead submitted a demo request form
2. After submitting the form, they are redirected to a [Cal.com](http://cal.com) meeting booking page
3. Set up a webhook in [Cal.com](http://cal.com) to update a contact-level custom property “Call Booked” by toggling it to “Yes”

**Note**: This agent assumes you already have an inbound lead agent set up, so all inbound form submissions are already contacts in your Zero workspace.

## Preparation steps

{% stepper %}
{% step %}

### Create a new Contact-level custom property

<figure><img src="/files/rQva1dRkTrfKXNvYo7to" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create a new Agent *draft* in Zero

1. Give it a name
2. Select trigger: A webhook call is received
3. Copy the Webhook URL and save

<figure><img src="/files/gATPFlYPjdgygd7hkS3W" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configure the Cal.com webhook

**Note**: you can trigger a webhook for a specific event, or across all events under your account. This example is for a specific event.

**Steps:**

* Go to your [**Event Types**](https://app.cal.com/event-types) page and edit the event you want to trigger the webhook
* Go to Webhooks and create a new - it should look like this:

<figure><img src="/files/o52Uq4NveAHQIEryc9b9" alt=""><figcaption></figcaption></figure>

* Paste the Zero webhook URL from the previous step to the Subscriber URL field
* Enable webhook
* Set event trigger(s) - in this example we’ll use only Booking Created
* Select Custom Payload Template and paste the below into the box (we only want to send the email of the person who booked the call) and save.

`{`\
`"email": "{{attendees.0.email}}"`\
`}`

Check [Cal.com Webhooks documentation](https://cal.com/docs/developing/guides/automation/webhooks) for more information
{% endstep %}
{% endstepper %}

## Zero Agent

{% stepper %}
{% step %}

### Trigger: A webhook call is received

Add variable “email” and select “Email address” from the dropdown

<figure><img src="/files/k8Udhq1vReCf8Y1HeYxu" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Action 1: Find records

Now we need to find the contact from Zero who booked the call via [Cal.com](http://cal.com).

**Important**: add the filter “**Email”** and map the “**email”** variable from the webhook, so we find the matching record.

<figure><img src="/files/Z7byBmSUGI2pEBGdzwpN" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Action 2: Edit record

Set Call Booked = Yes

<figure><img src="/files/3RcsY1UikKZbg2PQjZCR" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zero.inc/features/agents/agent-examples/webhook-from-cal.com.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
