curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Platform Test Workflow",
"trigger": {
"offset": {
"value": 24,
"unit": "hour"
},
"type": "beforeEvent"
},
"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}"
payload = {
"name": "Platform Test Workflow",
"trigger": {
"offset": {
"value": 24,
"unit": "hour"
},
"type": "beforeEvent"
},
"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: 'Platform Test Workflow',
trigger: {offset: {value: 24, unit: 'hour'}, type: 'beforeEvent'},
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}', 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}",
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' => 'Platform Test Workflow',
'trigger' => [
'offset' => [
'value' => 24,
'unit' => 'hour'
],
'type' => 'beforeEvent'
],
'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}"
payload := strings.NewReader("{\n \"name\": \"Platform Test Workflow\",\n \"trigger\": {\n \"offset\": {\n \"value\": 24,\n \"unit\": \"hour\"\n },\n \"type\": \"beforeEvent\"\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}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Platform Test Workflow\",\n \"trigger\": {\n \"offset\": {\n \"value\": 24,\n \"unit\": \"hour\"\n },\n \"type\": \"beforeEvent\"\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}")
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\": \"Platform Test Workflow\",\n \"trigger\": {\n \"offset\": {\n \"value\": 24,\n \"unit\": \"hour\"\n },\n \"type\": \"beforeEvent\"\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": "event-type",
"activation": {
"isActiveOnAllEventTypes": false,
"activeOnEventTypeIds": [
698191,
698192
]
},
"trigger": {
"type": "beforeEvent",
"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 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} \
--header 'Content-Type: application/json' \
--data '
{
"name": "Platform Test Workflow",
"trigger": {
"offset": {
"value": 24,
"unit": "hour"
},
"type": "beforeEvent"
},
"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}"
payload = {
"name": "Platform Test Workflow",
"trigger": {
"offset": {
"value": 24,
"unit": "hour"
},
"type": "beforeEvent"
},
"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: 'Platform Test Workflow',
trigger: {offset: {value: 24, unit: 'hour'}, type: 'beforeEvent'},
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}', 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}",
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' => 'Platform Test Workflow',
'trigger' => [
'offset' => [
'value' => 24,
'unit' => 'hour'
],
'type' => 'beforeEvent'
],
'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}"
payload := strings.NewReader("{\n \"name\": \"Platform Test Workflow\",\n \"trigger\": {\n \"offset\": {\n \"value\": 24,\n \"unit\": \"hour\"\n },\n \"type\": \"beforeEvent\"\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}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Platform Test Workflow\",\n \"trigger\": {\n \"offset\": {\n \"value\": 24,\n \"unit\": \"hour\"\n },\n \"type\": \"beforeEvent\"\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}")
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\": \"Platform Test Workflow\",\n \"trigger\": {\n \"offset\": {\n \"value\": 24,\n \"unit\": \"hour\"\n },\n \"type\": \"beforeEvent\"\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": "event-type",
"activation": {
"isActiveOnAllEventTypes": false,
"activeOnEventTypeIds": [
698191,
698192
]
},
"trigger": {
"type": "beforeEvent",
"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
"Platform Test Workflow"
Activation settings for the workflow
Show child attributes
Show child attributes
Trigger configuration for the event-type workflow, allowed triggers are beforeEvent,eventCancelled,newEvent,afterEvent,rescheduleEvent,afterHostsCalVideoNoShow,afterGuestsCalVideoNoShow,bookingRejected,bookingRequested,bookingPaymentInitiated,bookingPaid,bookingNoShowUpdated
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
Show child attributes
Show child attributes
Steps to execute as part of the event-type workflow, allowed steps are email_host,email_attendee,email_address,sms_attendee,sms_number,whatsapp_attendee,whatsapp_number,cal_ai_phone_call
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
Was this page helpful?