Function to create a calendar event (optionally a recurring series). The event is also created in the owner's Google and Microsoft calendar if connected
https://rest.crmango.com/api/CreateCalendarEvent
Bearer
varchar
Auth token (required in Authorization header)
owner_id
integer
User ID whose calendar the event belongs to (required for create)
Reference: GetAllUsers
title
varchar
Event title, max 255 characters (required for create). Characters ' " ; \ ? / @ # $ = > < are removed
date_from
varchar
Event start - unix timestamp or date and time, e.g. 2026-10-07 14:00 (required for create)
date_to
varchar
Event end - same format (required for create). If equal to date_from, the event lasts 1 hour
description
varchar
Event description (plain text, HTML tags are removed), max 10000 characters
type
integer
Event type: 0 or omitted = automatic (up to 30 minutes = phone call, otherwise meeting), 1-99 basic type, 100+ custom activity type
is_private
integer
Private event (0 = public, 1 = private)
company_id
integer
ID of the related company
branch_id
integer
ID of the related company branch
guests
array
List of guest e-mail addresses (max 100). On update the whole list is replaced, empty list removes the guests
color
varchar
Event color in format #RRGGBB (empty, #fff and #ffffff = no color)
address
varchar
Event address, max 255 characters
latitude
decimal
Latitude (-90 to 90)
longitude
decimal
Longitude (-180 to 180)
notification_type
integer
Notification unit (1-4). Notification is set only if type, value and who are all filled
notification_value
integer
How many units before the start the notification is sent (min 1)
notification_who
integer
Who receives the notification (1-7)
repeat_type
varchar
Recurrence: daily, weekly, monthly, yearly or custom (every repeat_interval days). Maximum 100 dates
repeat_end_date
date
Last day of the recurrence, inclusive (Y-m-d). Required with repeat_type
repeat_interval
integer
For repeat_type custom: repeat every N days (1-365)
Function to create a calendar event
code
integer
HTTP status code (201 = Created)
message
varchar
Confirmation message
resource_id
integer
ID of the created event (the first date for a series)
resource_ids
array
IDs of all created events (more than one for a series)
series_id
varchar
Series ID (null if the event is not recurring)
sync.google
varchar
Synchronization with the owner's Google and Microsoft calendar: ok, failed, partial (series - only some dates), not_connected
sync.microsoft
varchar
Synchronization with the owner's Google and Microsoft calendar: ok, failed, partial (series - only some dates), not_connected
curl --request POST \
--url 'https://rest.crmango.com/api/CreateCalendarEvent' \
--header 'Authorization: Bearer auth_token' \
--header 'Content-Type: application/json' \
--data '{
{
"owner_id": 5,
"title": "Weekly sync",
"date_from": "2026-11-02 10:00",
"date_to": "2026-11-02 11:00",
"description": "Team meeting",
"type": 0,
"is_private": 0,
"company_id": 8,
"guests": [
"client@example.com"
],
"color": "#00ff00",
"address": "Bratislava",
"notification_type": 1,
"notification_value": 30,
"notification_who": 1,
"repeat_type": "weekly",
"repeat_end_date": "2026-11-23"
}
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://rest.crmango.com/api/CreateCalendarEvent',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
{
"owner_id": 5,
"title": "Weekly sync",
"date_from": "2026-11-02 10:00",
"date_to": "2026-11-02 11:00",
"description": "Team meeting",
"type": 0,
"is_private": 0,
"company_id": 8,
"guests": [
"client@example.com"
],
"color": "#00ff00",
"address": "Bratislava",
"notification_type": 1,
"notification_value": 30,
"notification_who": 1,
"repeat_type": "weekly",
"repeat_end_date": "2026-11-23"
}
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer auth_token',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
echo $response;
var data = JSON.stringify({
{
"owner_id": 5,
"title": "Weekly sync",
"date_from": "2026-11-02 10:00",
"date_to": "2026-11-02 11:00",
"description": "Team meeting",
"type": 0,
"is_private": 0,
"company_id": 8,
"guests": [
"client@example.com"
],
"color": "#00ff00",
"address": "Bratislava",
"notification_type": 1,
"notification_value": 30,
"notification_who": 1,
"repeat_type": "weekly",
"repeat_end_date": "2026-11-23"
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://rest.crmango.com/api/CreateCalendarEvent");
xhr.setRequestHeader("Authorization", "Bearer auth_token");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
import requests
import json
url = "https://rest.crmango.com/api/CreateCalendarEvent"
payload = json.dumps({
{
"owner_id": 5,
"title": "Weekly sync",
"date_from": "2026-11-02 10:00",
"date_to": "2026-11-02 11:00",
"description": "Team meeting",
"type": 0,
"is_private": 0,
"company_id": 8,
"guests": [
"client@example.com"
],
"color": "#00ff00",
"address": "Bratislava",
"notification_type": 1,
"notification_value": 30,
"notification_who": 1,
"repeat_type": "weekly",
"repeat_end_date": "2026-11-23"
}
})
headers = {
'Authorization': 'Bearer auth_token',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
{
"code": 201,
"message": "Calendar series was created",
"resource_id": 1301,
"resource_ids": [
1301,
1302,
1303,
1304
],
"series_id": "5_1790000000000_1234",
"sync": {
"google": "ok",
"microsoft": "not_connected"
}
}
{
"code": "int",
"message": "string"
}