Custom Function pass a dynamic variable to cal.com

Does anyone know how to setup a custom function for booking a specific cal dot comevent type and also pass along to cal dot com the reason/context for setting up the call that I conveniently saved as a dynamic variable called {{clientInquiry}}. The mapping to the cal dot com meeting is to fill in the {{notes}} header.

The below is the error. You can see that the {{clientInquiry}} is passing into the {{notes}} header.

“Axios Error: error code: ERR_BAD_REQUEST, error message: Request failed with status code 400 response status: 400 response data: [{“status”:“1”,“timestamp”:“2”,“path”:“3”,“error”:“4”},“error”,“2026-03-07T00:12:02.894Z”,“/v2/bookings?eventTypeId=4768921&notes=I%20just%20need%20help%20with%20immigration%20visa%20to%20Canada”,{“code”:“5”,“message”:“6”,“details”:“7”},“BadRequestException”,"call property is wrong,property call should not exist , name property is wrong,property name should not exist , args property is wrong,property args should not exist , start property is wrong,start must be a valid ISO 8601 date string , attendee property is wrong,attendee should not be null or undefined , eventTypeId or eventTypeSlug + username property is wrong,Either eventTypeId or eventTypeSlug + username or eventTypeSlug + teamSlug must be provided ",{“message”:“6”,“error”:“8”,“statusCode”:400},“Bad Request”]”

This is my JSON schema:

{
“type”: “object”,
“required”: [
“start”,
“attendee”
],
“properties”: {
“start”: {
“type”: “string”,
“description”: “ISO 8601 date string for appointment start time”
},
“eventTypeId”: {
“type”: “number”,
“const”: 4768921
},
“attendee”: {
“type”: “object”,
“properties”: {
“name”: {
“type”: “string”,
“description”: “{{clientFullName}}”
},
“email”: {
“type”: “string”,
“description”: “{{clientEmailAddress}}”
}
}
}
}
}

From what I know, you first have to ensure the fields exist in cal dot com Event settings (under advanced settings) and then use the proper json schema to book i.e.
{
“start”: “{{appointmentStart}}”, // this has to be in ISO format like so: 2026-03-10T14:00:00Z
“eventTypeId”: [event type id] ,
“attendee”: {
“name”: “{{clientFullName}}”,
“email”: “{{clientEmailAddress}}”
},
“notes”: “{{clientInquiry}}”
}

You can either have these variables in notes section of your cal booking or in individual fields. Fields like name, phone, email and notes are predefined.

We’d love to get your feedback!

[

](https://portal.usepylon.com/retell-ai/csat?data=eyJjb250YWN0SUQiOiJjMjFlMjZiNy1lMGUwLTQxOTQtODkyMC0wYmE4NTlhZWQ0NzMiLCJ1c2VySUQiOiIiLCJzdXJ2ZXlJRCI6ImE4NTk3N2FhLWU1YTItNDVkZC04NjAzLWJiMmJhMDQ3YjUxZiIsInNjb3JlIjoxfQ==)[

](https://portal.usepylon.com/retell-ai/csat?data=eyJjb250YWN0SUQiOiJjMjFlMjZiNy1lMGUwLTQxOTQtODkyMC0wYmE4NTlhZWQ0NzMiLCJ1c2VySUQiOiIiLCJzdXJ2ZXlJRCI6ImE4NTk3N2FhLWU1YTItNDVkZC04NjAzLWJiMmJhMDQ3YjUxZiIsInNjb3JlIjoyfQ==)[

](https://portal.usepylon.com/retell-ai/csat?data=eyJjb250YWN0SUQiOiJjMjFlMjZiNy1lMGUwLTQxOTQtODkyMC0wYmE4NTlhZWQ0NzMiLCJ1c2VySUQiOiIiLCJzdXJ2ZXlJRCI6ImE4NTk3N2FhLWU1YTItNDVkZC04NjAzLWJiMmJhMDQ3YjUxZiIsInNjb3JlIjozfQ==)[

](https://portal.usepylon.com/retell-ai/csat?data=eyJjb250YWN0SUQiOiJjMjFlMjZiNy1lMGUwLTQxOTQtODkyMC0wYmE4NTlhZWQ0NzMiLCJ1c2VySUQiOiIiLCJzdXJ2ZXlJRCI6ImE4NTk3N2FhLWU1YTItNDVkZC04NjAzLWJiMmJhMDQ3YjUxZiIsInNjb3JlIjo0fQ==)[

](https://portal.usepylon.com/retell-ai/csat?data=eyJjb250YWN0SUQiOiJjMjFlMjZiNy1lMGUwLTQxOTQtODkyMC0wYmE4NTlhZWQ0NzMiLCJ1c2VySUQiOiIiLCJzdXJ2ZXlJRCI6ImE4NTk3N2FhLWU1YTItNDVkZC04NjAzLWJiMmJhMDQ3YjUxZiIsInNjb3JlIjo1fQ==) [

Powered by

Pylon

](https://usepylon.com)

Unsubscribe