curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form \
--header 'Content-Type: application/json' \
--data '
{
"name": "Rounting-form Test Workflow",
"trigger": {
"type": "formSubmitted"
},
"steps": [
{
"action": "email_address",
"stepNumber": 1,
"recipient": "attendee",
"template": "reminder",
"sender": "<string>",
"verifiedEmailId": 31214,
"includeCalendarEvent": true,
"message": {
"subject": "Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com",
"html": "<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>"
},
"autoTranslateEnabled": false,
"sourceLocale": "en",
"id": 67244
}
]
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form"
payload = {
"name": "Rounting-form Test Workflow",
"trigger": { "type": "formSubmitted" },
"steps": [
{
"action": "email_address",
"stepNumber": 1,
"recipient": "attendee",
"template": "reminder",
"sender": "<string>",
"verifiedEmailId": 31214,
"includeCalendarEvent": True,
"message": {
"subject": "Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com",
"html": "<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>"
},
"autoTranslateEnabled": False,
"sourceLocale": "en",
"id": 67244
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Rounting-form Test Workflow',
trigger: {type: 'formSubmitted'},
steps: [
{
action: 'email_address',
stepNumber: 1,
recipient: 'attendee',
template: 'reminder',
sender: '<string>',
verifiedEmailId: 31214,
includeCalendarEvent: true,
message: {
subject: 'Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com',
html: '<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>'
},
autoTranslateEnabled: false,
sourceLocale: 'en',
id: 67244
}
]
})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form', 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}/workflows/{workflowId}/routing-form",
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([
'name' => 'Rounting-form Test Workflow',
'trigger' => [
'type' => 'formSubmitted'
],
'steps' => [
[
'action' => 'email_address',
'stepNumber' => 1,
'recipient' => 'attendee',
'template' => 'reminder',
'sender' => '<string>',
'verifiedEmailId' => 31214,
'includeCalendarEvent' => true,
'message' => [
'subject' => 'Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com',
'html' => '<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>'
],
'autoTranslateEnabled' => false,
'sourceLocale' => 'en',
'id' => 67244
]
]
]),
CURLOPT_HTTPHEADER => [
"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}/workflows/{workflowId}/routing-form"
payload := strings.NewReader("{\n \"name\": \"Rounting-form Test Workflow\",\n \"trigger\": {\n \"type\": \"formSubmitted\"\n },\n \"steps\": [\n {\n \"action\": \"email_address\",\n \"stepNumber\": 1,\n \"recipient\": \"attendee\",\n \"template\": \"reminder\",\n \"sender\": \"<string>\",\n \"verifiedEmailId\": 31214,\n \"includeCalendarEvent\": true,\n \"message\": {\n \"subject\": \"Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com\",\n \"html\": \"<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>\"\n },\n \"autoTranslateEnabled\": false,\n \"sourceLocale\": \"en\",\n \"id\": 67244\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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}/workflows/{workflowId}/routing-form")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Rounting-form Test Workflow\",\n \"trigger\": {\n \"type\": \"formSubmitted\"\n },\n \"steps\": [\n {\n \"action\": \"email_address\",\n \"stepNumber\": 1,\n \"recipient\": \"attendee\",\n \"template\": \"reminder\",\n \"sender\": \"<string>\",\n \"verifiedEmailId\": 31214,\n \"includeCalendarEvent\": true,\n \"message\": {\n \"subject\": \"Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com\",\n \"html\": \"<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>\"\n },\n \"autoTranslateEnabled\": false,\n \"sourceLocale\": \"en\",\n \"id\": 67244\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Rounting-form Test Workflow\",\n \"trigger\": {\n \"type\": \"formSubmitted\"\n },\n \"steps\": [\n {\n \"action\": \"email_address\",\n \"stepNumber\": 1,\n \"recipient\": \"attendee\",\n \"template\": \"reminder\",\n \"sender\": \"<string>\",\n \"verifiedEmailId\": 31214,\n \"includeCalendarEvent\": true,\n \"message\": {\n \"subject\": \"Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com\",\n \"html\": \"<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>\"\n },\n \"autoTranslateEnabled\": false,\n \"sourceLocale\": \"en\",\n \"id\": 67244\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": [
{
"id": 101,
"name": "Platform Test Workflow",
"type": "routing-form",
"activation": {
"isActiveOnAllRoutingForms": false,
"activeOnRoutingFormIds": [
"5cacdec7-1234-6e1b-78d9-7bcda8a1b332"
]
},
"trigger": {
"type": "formSubmitted",
"offset": {
"value": 24,
"unit": "hour"
}
},
"steps": [
{
"id": 67244,
"stepNumber": 1,
"recipient": "const",
"template": "reminder",
"sender": "Cal.com Notifications",
"message": {
"subject": "Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com",
"html": "<p>Reminder for {EVENT_NAME}.</p>",
"text": "Reminder for {EVENT_NAME}."
},
"action": "email_host",
"email": "notifications@example.com",
"phone": "<string>",
"phoneRequired": true,
"includeCalendarEvent": true,
"autoTranslateEnabled": false,
"sourceLocale": "en"
}
],
"userId": 2313,
"teamId": 4214321,
"createdAt": "2024-05-12T10:00:00.000Z",
"updatedAt": "2024-05-12T11:30:00.000Z"
}
]
}Update organization routing form team workflow
Required membership role: team admin. PBAC permission: workflow.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_WORKFLOW_WRITE scope is required.
curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form \
--header 'Content-Type: application/json' \
--data '
{
"name": "Rounting-form Test Workflow",
"trigger": {
"type": "formSubmitted"
},
"steps": [
{
"action": "email_address",
"stepNumber": 1,
"recipient": "attendee",
"template": "reminder",
"sender": "<string>",
"verifiedEmailId": 31214,
"includeCalendarEvent": true,
"message": {
"subject": "Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com",
"html": "<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>"
},
"autoTranslateEnabled": false,
"sourceLocale": "en",
"id": 67244
}
]
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form"
payload = {
"name": "Rounting-form Test Workflow",
"trigger": { "type": "formSubmitted" },
"steps": [
{
"action": "email_address",
"stepNumber": 1,
"recipient": "attendee",
"template": "reminder",
"sender": "<string>",
"verifiedEmailId": 31214,
"includeCalendarEvent": True,
"message": {
"subject": "Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com",
"html": "<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>"
},
"autoTranslateEnabled": False,
"sourceLocale": "en",
"id": 67244
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Rounting-form Test Workflow',
trigger: {type: 'formSubmitted'},
steps: [
{
action: 'email_address',
stepNumber: 1,
recipient: 'attendee',
template: 'reminder',
sender: '<string>',
verifiedEmailId: 31214,
includeCalendarEvent: true,
message: {
subject: 'Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com',
html: '<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>'
},
autoTranslateEnabled: false,
sourceLocale: 'en',
id: 67244
}
]
})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form', 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}/workflows/{workflowId}/routing-form",
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([
'name' => 'Rounting-form Test Workflow',
'trigger' => [
'type' => 'formSubmitted'
],
'steps' => [
[
'action' => 'email_address',
'stepNumber' => 1,
'recipient' => 'attendee',
'template' => 'reminder',
'sender' => '<string>',
'verifiedEmailId' => 31214,
'includeCalendarEvent' => true,
'message' => [
'subject' => 'Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com',
'html' => '<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>'
],
'autoTranslateEnabled' => false,
'sourceLocale' => 'en',
'id' => 67244
]
]
]),
CURLOPT_HTTPHEADER => [
"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}/workflows/{workflowId}/routing-form"
payload := strings.NewReader("{\n \"name\": \"Rounting-form Test Workflow\",\n \"trigger\": {\n \"type\": \"formSubmitted\"\n },\n \"steps\": [\n {\n \"action\": \"email_address\",\n \"stepNumber\": 1,\n \"recipient\": \"attendee\",\n \"template\": \"reminder\",\n \"sender\": \"<string>\",\n \"verifiedEmailId\": 31214,\n \"includeCalendarEvent\": true,\n \"message\": {\n \"subject\": \"Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com\",\n \"html\": \"<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>\"\n },\n \"autoTranslateEnabled\": false,\n \"sourceLocale\": \"en\",\n \"id\": 67244\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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}/workflows/{workflowId}/routing-form")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Rounting-form Test Workflow\",\n \"trigger\": {\n \"type\": \"formSubmitted\"\n },\n \"steps\": [\n {\n \"action\": \"email_address\",\n \"stepNumber\": 1,\n \"recipient\": \"attendee\",\n \"template\": \"reminder\",\n \"sender\": \"<string>\",\n \"verifiedEmailId\": 31214,\n \"includeCalendarEvent\": true,\n \"message\": {\n \"subject\": \"Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com\",\n \"html\": \"<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>\"\n },\n \"autoTranslateEnabled\": false,\n \"sourceLocale\": \"en\",\n \"id\": 67244\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Rounting-form Test Workflow\",\n \"trigger\": {\n \"type\": \"formSubmitted\"\n },\n \"steps\": [\n {\n \"action\": \"email_address\",\n \"stepNumber\": 1,\n \"recipient\": \"attendee\",\n \"template\": \"reminder\",\n \"sender\": \"<string>\",\n \"verifiedEmailId\": 31214,\n \"includeCalendarEvent\": true,\n \"message\": {\n \"subject\": \"Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com\",\n \"html\": \"<p>This is a reminder from {ORGANIZER} of {EVENT_NAME} to {ATTENDEE} starting here {LOCATION} {MEETING_URL} at {START_TIME_h:mma} {TIMEZONE}.</p>\"\n },\n \"autoTranslateEnabled\": false,\n \"sourceLocale\": \"en\",\n \"id\": 67244\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": [
{
"id": 101,
"name": "Platform Test Workflow",
"type": "routing-form",
"activation": {
"isActiveOnAllRoutingForms": false,
"activeOnRoutingFormIds": [
"5cacdec7-1234-6e1b-78d9-7bcda8a1b332"
]
},
"trigger": {
"type": "formSubmitted",
"offset": {
"value": 24,
"unit": "hour"
}
},
"steps": [
{
"id": 67244,
"stepNumber": 1,
"recipient": "const",
"template": "reminder",
"sender": "Cal.com Notifications",
"message": {
"subject": "Reminder: Your Meeting {EVENT_NAME} - {EVENT_DATE_ddd, MMM D, YYYY h:mma} with Cal.com",
"html": "<p>Reminder for {EVENT_NAME}.</p>",
"text": "Reminder for {EVENT_NAME}."
},
"action": "email_host",
"email": "notifications@example.com",
"phone": "<string>",
"phoneRequired": true,
"includeCalendarEvent": true,
"autoTranslateEnabled": false,
"sourceLocale": "en"
}
],
"userId": 2313,
"teamId": 4214321,
"createdAt": "2024-05-12T10:00:00.000Z",
"updatedAt": "2024-05-12T11:30:00.000Z"
}
]
}Headers
For non-platform customers - value must be Bearer <token> where <token> is api key prefixed with cal_
For platform customers - OAuth client secret key
For platform customers - OAuth client ID
Body
Name of the workflow
"Rounting-form Test Workflow"
Trigger configuration for the routing-form workflow, allowed triggers are formSubmitted,formSubmittedNoEvent
- Option 1
- Option 2
Show child attributes
Show child attributes
Steps to execute as part of the routing-form workflow, allowed steps are email_attendee,email_address,sms_attendee,sms_number
- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?