curl --request POST \
--url https://api.sapt.ai/projects/{projectId}/calendar/google/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start": "<string>",
"summary": "<string>",
"end": "<string>",
"durationMinutes": 123,
"timeZone": "<string>",
"description": "<string>",
"calendarId": "<string>",
"attendee": {
"name": "<string>",
"email": "[email protected]",
"phone": "<string>"
},
"metadata": {},
"conflictCheck": true
}
'import requests
url = "https://api.sapt.ai/projects/{projectId}/calendar/google/events"
payload = {
"start": "<string>",
"summary": "<string>",
"end": "<string>",
"durationMinutes": 123,
"timeZone": "<string>",
"description": "<string>",
"calendarId": "<string>",
"attendee": {
"name": "<string>",
"email": "[email protected]",
"phone": "<string>"
},
"metadata": {},
"conflictCheck": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '<string>',
summary: '<string>',
end: '<string>',
durationMinutes: 123,
timeZone: '<string>',
description: '<string>',
calendarId: '<string>',
attendee: {name: '<string>', email: '[email protected]', phone: '<string>'},
metadata: {},
conflictCheck: true
})
};
fetch('https://api.sapt.ai/projects/{projectId}/calendar/google/events', 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.sapt.ai/projects/{projectId}/calendar/google/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start' => '<string>',
'summary' => '<string>',
'end' => '<string>',
'durationMinutes' => 123,
'timeZone' => '<string>',
'description' => '<string>',
'calendarId' => '<string>',
'attendee' => [
'name' => '<string>',
'email' => '[email protected]',
'phone' => '<string>'
],
'metadata' => [
],
'conflictCheck' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.sapt.ai/projects/{projectId}/calendar/google/events"
payload := strings.NewReader("{\n \"start\": \"<string>\",\n \"summary\": \"<string>\",\n \"end\": \"<string>\",\n \"durationMinutes\": 123,\n \"timeZone\": \"<string>\",\n \"description\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\"\n },\n \"metadata\": {},\n \"conflictCheck\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.sapt.ai/projects/{projectId}/calendar/google/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"<string>\",\n \"summary\": \"<string>\",\n \"end\": \"<string>\",\n \"durationMinutes\": 123,\n \"timeZone\": \"<string>\",\n \"description\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\"\n },\n \"metadata\": {},\n \"conflictCheck\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/calendar/google/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start\": \"<string>\",\n \"summary\": \"<string>\",\n \"end\": \"<string>\",\n \"durationMinutes\": 123,\n \"timeZone\": \"<string>\",\n \"description\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\"\n },\n \"metadata\": {},\n \"conflictCheck\": true\n}"
response = http.request(request)
puts response.read_body{
"bookingUid": "<string>",
"start": "<string>",
"end": "<string>",
"htmlLink": "<string>",
"calendarId": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Create a Google Calendar booking
Write a booking event onto the connected Google Calendar (primary by default). Sends a real Google invite when an attendee email is supplied, and re-checks freeBusy — returning 409 if the slot was taken. Requires the connection to have granted the calendar.events write scope.
curl --request POST \
--url https://api.sapt.ai/projects/{projectId}/calendar/google/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start": "<string>",
"summary": "<string>",
"end": "<string>",
"durationMinutes": 123,
"timeZone": "<string>",
"description": "<string>",
"calendarId": "<string>",
"attendee": {
"name": "<string>",
"email": "[email protected]",
"phone": "<string>"
},
"metadata": {},
"conflictCheck": true
}
'import requests
url = "https://api.sapt.ai/projects/{projectId}/calendar/google/events"
payload = {
"start": "<string>",
"summary": "<string>",
"end": "<string>",
"durationMinutes": 123,
"timeZone": "<string>",
"description": "<string>",
"calendarId": "<string>",
"attendee": {
"name": "<string>",
"email": "[email protected]",
"phone": "<string>"
},
"metadata": {},
"conflictCheck": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '<string>',
summary: '<string>',
end: '<string>',
durationMinutes: 123,
timeZone: '<string>',
description: '<string>',
calendarId: '<string>',
attendee: {name: '<string>', email: '[email protected]', phone: '<string>'},
metadata: {},
conflictCheck: true
})
};
fetch('https://api.sapt.ai/projects/{projectId}/calendar/google/events', 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.sapt.ai/projects/{projectId}/calendar/google/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start' => '<string>',
'summary' => '<string>',
'end' => '<string>',
'durationMinutes' => 123,
'timeZone' => '<string>',
'description' => '<string>',
'calendarId' => '<string>',
'attendee' => [
'name' => '<string>',
'email' => '[email protected]',
'phone' => '<string>'
],
'metadata' => [
],
'conflictCheck' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.sapt.ai/projects/{projectId}/calendar/google/events"
payload := strings.NewReader("{\n \"start\": \"<string>\",\n \"summary\": \"<string>\",\n \"end\": \"<string>\",\n \"durationMinutes\": 123,\n \"timeZone\": \"<string>\",\n \"description\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\"\n },\n \"metadata\": {},\n \"conflictCheck\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.sapt.ai/projects/{projectId}/calendar/google/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"<string>\",\n \"summary\": \"<string>\",\n \"end\": \"<string>\",\n \"durationMinutes\": 123,\n \"timeZone\": \"<string>\",\n \"description\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\"\n },\n \"metadata\": {},\n \"conflictCheck\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/calendar/google/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start\": \"<string>\",\n \"summary\": \"<string>\",\n \"end\": \"<string>\",\n \"durationMinutes\": 123,\n \"timeZone\": \"<string>\",\n \"description\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"attendee\": {\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\"\n },\n \"metadata\": {},\n \"conflictCheck\": true\n}"
response = http.request(request)
puts response.read_body{
"bookingUid": "<string>",
"start": "<string>",
"end": "<string>",
"htmlLink": "<string>",
"calendarId": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
JWT token obtained from /api/auth/token endpoint. Token is verified using JWKS and must include a valid user identifier.
Path Parameters
Body
Event start (ISO timestamp).
Event title on the calendar.
1Event end (ISO). Defaults to start + durationMinutes.
IANA zone for start/end, e.g. America/Phoenix.
Calendar to write to. Defaults to the connected primary calendar.
When an email is present, the lead is invited to the event.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Re-check freeBusy before insert and 409 on a collision. Default true.