Edit team routing form fields
curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"operations": [
{
"type": "add",
"field": {
"label": "Lead source",
"type": "select",
"required": false,
"hidden": false,
"identifier": "lead_source",
"options": [
"Partner",
"Website"
]
},
"position": 0
}
],
"dryRun": true,
"expectedUpdatedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields"
payload = {
"operations": [
{
"type": "add",
"field": {
"label": "Lead source",
"type": "select",
"required": False,
"hidden": False,
"identifier": "lead_source",
"options": ["Partner", "Website"]
},
"position": 0
}
],
"dryRun": True,
"expectedUpdatedAt": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [
{
type: 'add',
field: {
label: 'Lead source',
type: 'select',
required: false,
hidden: false,
identifier: 'lead_source',
options: ['Partner', 'Website']
},
position: 0
}
],
dryRun: true,
expectedUpdatedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
[
'type' => 'add',
'field' => [
'label' => 'Lead source',
'type' => 'select',
'required' => false,
'hidden' => false,
'identifier' => 'lead_source',
'options' => [
'Partner',
'Website'
]
],
'position' => 0
]
],
'dryRun' => true,
'expectedUpdatedAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"type\": \"add\",\n \"field\": {\n \"label\": \"Lead source\",\n \"type\": \"select\",\n \"required\": false,\n \"hidden\": false,\n \"identifier\": \"lead_source\",\n \"options\": [\n \"Partner\",\n \"Website\"\n ]\n },\n \"position\": 0\n }\n ],\n \"dryRun\": true,\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"type\": \"add\",\n \"field\": {\n \"label\": \"Lead source\",\n \"type\": \"select\",\n \"required\": false,\n \"hidden\": false,\n \"identifier\": \"lead_source\",\n \"options\": [\n \"Partner\",\n \"Website\"\n ]\n },\n \"position\": 0\n }\n ],\n \"dryRun\": true,\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"type\": \"add\",\n \"field\": {\n \"label\": \"Lead source\",\n \"type\": \"select\",\n \"required\": false,\n \"hidden\": false,\n \"identifier\": \"lead_source\",\n \"options\": [\n \"Partner\",\n \"Website\"\n ]\n },\n \"position\": 0\n }\n ],\n \"dryRun\": true,\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"formId": "a1b2c3d4-...",
"dryRun": true,
"changes": [
{
"type": "add",
"fieldId": "a1b2c3d4-...",
"description": "Added question \"Lead source\" (text) at position 2."
}
],
"warnings": [
"<string>"
],
"before": [
{
"id": "a1b2c3d4-...",
"label": "Company size",
"identifier": "companySize",
"type": "select",
"required": true,
"hidden": false,
"options": [
{
"id": "a1b2c3d4-...",
"label": "51-200"
}
]
}
],
"after": [
{
"id": "a1b2c3d4-...",
"label": "Company size",
"identifier": "companySize",
"type": "select",
"required": true,
"hidden": false,
"options": [
{
"id": "a1b2c3d4-...",
"label": "51-200"
}
]
}
],
"updatedAt": "2024-03-28T10:00:00.000Z"
}
}Routing Forms
Edit team routing form fields
Required membership role: team admin. PBAC permission: routingForm.update. Learn more about API access control at https://cal.com/docs/api-reference/v2/access-control. If accessed using an OAuth access token, the TEAM_ROUTING_FORM_WRITE scope is required. Previews by default (dryRun defaults to true); send dryRun: false with expectedUpdatedAt to save.
PATCH
/
v2
/
organizations
/
{orgId}
/
teams
/
{teamId}
/
routing-forms
/
{routingFormId}
/
fields
Edit team routing form fields
curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"operations": [
{
"type": "add",
"field": {
"label": "Lead source",
"type": "select",
"required": false,
"hidden": false,
"identifier": "lead_source",
"options": [
"Partner",
"Website"
]
},
"position": 0
}
],
"dryRun": true,
"expectedUpdatedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields"
payload = {
"operations": [
{
"type": "add",
"field": {
"label": "Lead source",
"type": "select",
"required": False,
"hidden": False,
"identifier": "lead_source",
"options": ["Partner", "Website"]
},
"position": 0
}
],
"dryRun": True,
"expectedUpdatedAt": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [
{
type: 'add',
field: {
label: 'Lead source',
type: 'select',
required: false,
hidden: false,
identifier: 'lead_source',
options: ['Partner', 'Website']
},
position: 0
}
],
dryRun: true,
expectedUpdatedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'operations' => [
[
'type' => 'add',
'field' => [
'label' => 'Lead source',
'type' => 'select',
'required' => false,
'hidden' => false,
'identifier' => 'lead_source',
'options' => [
'Partner',
'Website'
]
],
'position' => 0
]
],
'dryRun' => true,
'expectedUpdatedAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"type\": \"add\",\n \"field\": {\n \"label\": \"Lead source\",\n \"type\": \"select\",\n \"required\": false,\n \"hidden\": false,\n \"identifier\": \"lead_source\",\n \"options\": [\n \"Partner\",\n \"Website\"\n ]\n },\n \"position\": 0\n }\n ],\n \"dryRun\": true,\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"type\": \"add\",\n \"field\": {\n \"label\": \"Lead source\",\n \"type\": \"select\",\n \"required\": false,\n \"hidden\": false,\n \"identifier\": \"lead_source\",\n \"options\": [\n \"Partner\",\n \"Website\"\n ]\n },\n \"position\": 0\n }\n ],\n \"dryRun\": true,\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"type\": \"add\",\n \"field\": {\n \"label\": \"Lead source\",\n \"type\": \"select\",\n \"required\": false,\n \"hidden\": false,\n \"identifier\": \"lead_source\",\n \"options\": [\n \"Partner\",\n \"Website\"\n ]\n },\n \"position\": 0\n }\n ],\n \"dryRun\": true,\n \"expectedUpdatedAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"formId": "a1b2c3d4-...",
"dryRun": true,
"changes": [
{
"type": "add",
"fieldId": "a1b2c3d4-...",
"description": "Added question \"Lead source\" (text) at position 2."
}
],
"warnings": [
"<string>"
],
"before": [
{
"id": "a1b2c3d4-...",
"label": "Company size",
"identifier": "companySize",
"type": "select",
"required": true,
"hidden": false,
"options": [
{
"id": "a1b2c3d4-...",
"label": "51-200"
}
]
}
],
"after": [
{
"id": "a1b2c3d4-...",
"label": "Company size",
"identifier": "companySize",
"type": "select",
"required": true,
"hidden": false,
"options": [
{
"id": "a1b2c3d4-...",
"label": "51-200"
}
]
}
],
"updatedAt": "2024-03-28T10:00:00.000Z"
}
}Headers
value must be Bearer <token> where <token> is api key prefixed with cal_
Body
application/json
Required array length:
1 - 50 elements- Add question
- Update question
- Remove question
Show child attributes
Show child attributes
Preview changes without saving. Defaults to true.
Required when dryRun is false: the updatedAt from the preview or from get_routing_form.
Was this page helpful?