curl --request POST \
--url https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses \
--header 'Authorization: <authorization>'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses', 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}/routing-forms/{routingFormId}/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"eventTypeId": 123,
"routing": {
"teamMemberIds": [
101,
102
],
"queuedResponseId": "123",
"responseId": 123,
"teamMemberEmail": "john.doe@example.com",
"skipContactOwner": true,
"crmAppSlug": "salesforce",
"crmOwnerRecordType": "Account",
"crmRecordOwnerFallbackTeamMemberIds": [
103,
104
],
"crmRecordOwnerFallbackMode": "relationship"
},
"routingCustomMessage": "This is a custom message.",
"routingExternalRedirectUrl": "https://example.com/",
"slots": {}
}
}Create routing form response and get available slots
Required membership role: org admin. PBAC permission: routingForm.create. Learn more about API access control at https://cal.com/docs/api-reference/v2/access-control. If accessed using an OAuth access token, the ORG_ROUTING_FORM_WRITE scope is required.
curl --request POST \
--url https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses \
--header 'Authorization: <authorization>'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses', 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}/routing-forms/{routingFormId}/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/routing-forms/{routingFormId}/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"eventTypeId": 123,
"routing": {
"teamMemberIds": [
101,
102
],
"queuedResponseId": "123",
"responseId": 123,
"teamMemberEmail": "john.doe@example.com",
"skipContactOwner": true,
"crmAppSlug": "salesforce",
"crmOwnerRecordType": "Account",
"crmRecordOwnerFallbackTeamMemberIds": [
103,
104
],
"crmRecordOwnerFallbackMode": "relationship"
},
"routingCustomMessage": "This is a custom message.",
"routingExternalRedirectUrl": "https://example.com/",
"slots": {}
}
}Headers
value must be Bearer <token> where <token> is api key prefixed with cal_
Query Parameters
Time starting from which available slots should be checked.
Must be in UTC timezone as ISO 8601 datestring.
You can pass date without hours which defaults to start of day or specify hours:
2024-08-13 (will have hours 00:00:00 aka at very beginning of the date) or you can specify hours manually like 2024-08-13T09:00:00Z
"2050-09-05"
Time until which available slots should be checked.
Must be in UTC timezone as ISO 8601 datestring.
You can pass date without hours which defaults to end of day or specify hours:
2024-08-20 (will have hours 23:59:59 aka at the very end of the date) or you can specify hours manually like 2024-08-20T18:00:00Z
"2050-09-06"
Time zone in which the available slots should be returned. Defaults to UTC.
"Europe/Rome"
If event type has multiple possible durations then you can specify the desired duration here. Also, if you are fetching slots for a dynamic event then you can specify the duration her which defaults to 30, meaning that returned slots will be each 30 minutes long.
"60"
Format of slot times in response. Use 'range' to get start and end times.
range, time "range"
The unique identifier of the booking being rescheduled. When provided will ensure that the original booking time appears within the returned available slots when rescheduling.
"abc123def456"
Only for round robin event types that allow the person rescheduling to choose the host. True returns slots of the original host, false returns slots of any available host. Ignored for other event types.
true
Whether to queue the form response.
true
Was this page helpful?