Edit team routing form routes
curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/routes \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"operations": [
{
"type": "add",
"route": {
"conditions": [
{
"field": "Company size",
"value": "<string>"
}
],
"action": {
"type": "eventTypeRedirectUrl",
"eventTypeSlug": "acme/discovery-call"
},
"name": "Enterprise",
"match": "all"
},
"position": 1
}
],
"examples": [
{
"answers": {
"Company size": "51-200"
},
"expectedRoute": "route-enterprise"
}
],
"dryRun": true,
"expectedUpdatedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/routes"
payload = {
"operations": [
{
"type": "add",
"route": {
"conditions": [
{
"field": "Company size",
"value": "<string>"
}
],
"action": {
"type": "eventTypeRedirectUrl",
"eventTypeSlug": "acme/discovery-call"
},
"name": "Enterprise",
"match": "all"
},
"position": 1
}
],
"examples": [
{
"answers": { "Company size": "51-200" },
"expectedRoute": "route-enterprise"
}
],
"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',
route: {
conditions: [{field: 'Company size', value: '<string>'}],
action: {type: 'eventTypeRedirectUrl', eventTypeSlug: 'acme/discovery-call'},
name: 'Enterprise',
match: 'all'
},
position: 1
}
],
examples: [{answers: {'Company size': '51-200'}, expectedRoute: 'route-enterprise'}],
dryRun: true,
expectedUpdatedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/routes', 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}/routes",
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',
'route' => [
'conditions' => [
[
'field' => 'Company size',
'value' => '<string>'
]
],
'action' => [
'type' => 'eventTypeRedirectUrl',
'eventTypeSlug' => 'acme/discovery-call'
],
'name' => 'Enterprise',
'match' => 'all'
],
'position' => 1
]
],
'examples' => [
[
'answers' => [
'Company size' => '51-200'
],
'expectedRoute' => 'route-enterprise'
]
],
'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}/routes"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"type\": \"add\",\n \"route\": {\n \"conditions\": [\n {\n \"field\": \"Company size\",\n \"value\": \"<string>\"\n }\n ],\n \"action\": {\n \"type\": \"eventTypeRedirectUrl\",\n \"eventTypeSlug\": \"acme/discovery-call\"\n },\n \"name\": \"Enterprise\",\n \"match\": \"all\"\n },\n \"position\": 1\n }\n ],\n \"examples\": [\n {\n \"answers\": {\n \"Company size\": \"51-200\"\n },\n \"expectedRoute\": \"route-enterprise\"\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}/routes")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"type\": \"add\",\n \"route\": {\n \"conditions\": [\n {\n \"field\": \"Company size\",\n \"value\": \"<string>\"\n }\n ],\n \"action\": {\n \"type\": \"eventTypeRedirectUrl\",\n \"eventTypeSlug\": \"acme/discovery-call\"\n },\n \"name\": \"Enterprise\",\n \"match\": \"all\"\n },\n \"position\": 1\n }\n ],\n \"examples\": [\n {\n \"answers\": {\n \"Company size\": \"51-200\"\n },\n \"expectedRoute\": \"route-enterprise\"\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}/routes")
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 \"route\": {\n \"conditions\": [\n {\n \"field\": \"Company size\",\n \"value\": \"<string>\"\n }\n ],\n \"action\": {\n \"type\": \"eventTypeRedirectUrl\",\n \"eventTypeSlug\": \"acme/discovery-call\"\n },\n \"name\": \"Enterprise\",\n \"match\": \"all\"\n },\n \"position\": 1\n }\n ],\n \"examples\": [\n {\n \"answers\": {\n \"Company size\": \"51-200\"\n },\n \"expectedRoute\": \"route-enterprise\"\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",
"routeId": "route-enterprise",
"description": "Added route \"Enterprise\" at position 0."
}
],
"warnings": [
"<string>"
],
"before": [
{
"id": "a1b2c3d4-...",
"name": "Enterprise leads",
"kind": "route",
"action": {
"type": "customPageMessage",
"value": "acme/discovery-call",
"eventTypeId": 123
},
"conditions": "\"Company size\" equals \"51-200\"",
"advancedRouting": [
"<string>"
]
}
],
"after": [
{
"id": "a1b2c3d4-...",
"name": "Enterprise leads",
"kind": "route",
"action": {
"type": "customPageMessage",
"value": "acme/discovery-call",
"eventTypeId": 123
},
"conditions": "\"Company size\" equals \"51-200\"",
"advancedRouting": [
"<string>"
]
}
],
"updatedAt": "2024-03-28T10:00:00.000Z"
}
}Routing Forms
Edit team routing form routes
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}
/
routes
Edit team routing form routes
curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/routes \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"operations": [
{
"type": "add",
"route": {
"conditions": [
{
"field": "Company size",
"value": "<string>"
}
],
"action": {
"type": "eventTypeRedirectUrl",
"eventTypeSlug": "acme/discovery-call"
},
"name": "Enterprise",
"match": "all"
},
"position": 1
}
],
"examples": [
{
"answers": {
"Company size": "51-200"
},
"expectedRoute": "route-enterprise"
}
],
"dryRun": true,
"expectedUpdatedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/routes"
payload = {
"operations": [
{
"type": "add",
"route": {
"conditions": [
{
"field": "Company size",
"value": "<string>"
}
],
"action": {
"type": "eventTypeRedirectUrl",
"eventTypeSlug": "acme/discovery-call"
},
"name": "Enterprise",
"match": "all"
},
"position": 1
}
],
"examples": [
{
"answers": { "Company size": "51-200" },
"expectedRoute": "route-enterprise"
}
],
"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',
route: {
conditions: [{field: 'Company size', value: '<string>'}],
action: {type: 'eventTypeRedirectUrl', eventTypeSlug: 'acme/discovery-call'},
name: 'Enterprise',
match: 'all'
},
position: 1
}
],
examples: [{answers: {'Company size': '51-200'}, expectedRoute: 'route-enterprise'}],
dryRun: true,
expectedUpdatedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/routes', 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}/routes",
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',
'route' => [
'conditions' => [
[
'field' => 'Company size',
'value' => '<string>'
]
],
'action' => [
'type' => 'eventTypeRedirectUrl',
'eventTypeSlug' => 'acme/discovery-call'
],
'name' => 'Enterprise',
'match' => 'all'
],
'position' => 1
]
],
'examples' => [
[
'answers' => [
'Company size' => '51-200'
],
'expectedRoute' => 'route-enterprise'
]
],
'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}/routes"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"type\": \"add\",\n \"route\": {\n \"conditions\": [\n {\n \"field\": \"Company size\",\n \"value\": \"<string>\"\n }\n ],\n \"action\": {\n \"type\": \"eventTypeRedirectUrl\",\n \"eventTypeSlug\": \"acme/discovery-call\"\n },\n \"name\": \"Enterprise\",\n \"match\": \"all\"\n },\n \"position\": 1\n }\n ],\n \"examples\": [\n {\n \"answers\": {\n \"Company size\": \"51-200\"\n },\n \"expectedRoute\": \"route-enterprise\"\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}/routes")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"type\": \"add\",\n \"route\": {\n \"conditions\": [\n {\n \"field\": \"Company size\",\n \"value\": \"<string>\"\n }\n ],\n \"action\": {\n \"type\": \"eventTypeRedirectUrl\",\n \"eventTypeSlug\": \"acme/discovery-call\"\n },\n \"name\": \"Enterprise\",\n \"match\": \"all\"\n },\n \"position\": 1\n }\n ],\n \"examples\": [\n {\n \"answers\": {\n \"Company size\": \"51-200\"\n },\n \"expectedRoute\": \"route-enterprise\"\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}/routes")
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 \"route\": {\n \"conditions\": [\n {\n \"field\": \"Company size\",\n \"value\": \"<string>\"\n }\n ],\n \"action\": {\n \"type\": \"eventTypeRedirectUrl\",\n \"eventTypeSlug\": \"acme/discovery-call\"\n },\n \"name\": \"Enterprise\",\n \"match\": \"all\"\n },\n \"position\": 1\n }\n ],\n \"examples\": [\n {\n \"answers\": {\n \"Company size\": \"51-200\"\n },\n \"expectedRoute\": \"route-enterprise\"\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",
"routeId": "route-enterprise",
"description": "Added route \"Enterprise\" at position 0."
}
],
"warnings": [
"<string>"
],
"before": [
{
"id": "a1b2c3d4-...",
"name": "Enterprise leads",
"kind": "route",
"action": {
"type": "customPageMessage",
"value": "acme/discovery-call",
"eventTypeId": 123
},
"conditions": "\"Company size\" equals \"51-200\"",
"advancedRouting": [
"<string>"
]
}
],
"after": [
{
"id": "a1b2c3d4-...",
"name": "Enterprise leads",
"kind": "route",
"action": {
"type": "customPageMessage",
"value": "acme/discovery-call",
"eventTypeId": 123
},
"conditions": "\"Company size\" equals \"51-200\"",
"advancedRouting": [
"<string>"
]
}
],
"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- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Show child attributes
Show child attributes
Maximum array length:
20Show 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?