-
Notifications
You must be signed in to change notification settings - Fork 15
REST API Calendar
The complete usage guide for the standalone Calendar module of the REST API β the shared team calendar's events and categories. Mirrors the interactive documentation at System β API β Documentation (with its live "Try it" tester).
Note
New to the API? The basics table on REST API: Tickets covers base URL, authentication, the response envelope, error codes, rate limits and PATCH semantics β identical across all modules. Except one thing here β read the datetime warning below.
What's distinctive about Calendar:
| π Naive server-local datetimes | Unlike every other module (ISO 8601 UTC with Z), calendar events are stored without timezone conversion β that's how the UI writes them and how the ICS feed interprets them. This resource accepts and returns naive YYYY-MM-DD HH:MM:SS values and rejects Z/offset designators with a 422, so you can't accidentally shift every meeting by an hour. |
| π€ Generated events are read-only | Rows with source = "asset_warranty" are owned by the warranty sync, which wipes and regenerates them wholesale. The API shows you source on reads (the internal endpoints don't return it at all!) and answers 409 to updates/deletes on generated rows β tighter than the UI, where an edit silently evaporates on the next sync. You can never set source on create. |
| π‘ The ICS feed already exists | For subscribing Outlook/Google/Apple Calendar, use the built-in token-authenticated feed (api/calendar/feed.php?token=β¦, issued per-analyst from the Calendar UI). The REST API is for programmatic event management β creating maintenance windows from a pipeline, syncing from another system. |
| π One shared calendar | Install-wide, no per-analyst or per-company calendars β matching the module. |
A deployment pipeline booking its maintenance window:
B="https://your-server/api/v1"; K="Authorization: Bearer fitsm_β¦"
curl -X POST "$B/calendar/events" -H "$K" -H "Content-Type: application/json" -d '{
"title": "Maintenance window β release 2.4",
"start_at": "2026-07-05 06:00:00",
"end_at": "2026-07-05 08:00:00",
"category_id": 1,
"location": "Production",
"description": "Core switch SFP replacement (CHG-0011)."
}'Provide a from/to window (the UI's exact three-branch overlap logic β an event matches if it starts in, ends in, or spans the window; from inclusive, to exclusive) β or contract_id, or all=true.
| Parameter | Description |
|---|---|
from / to
|
Naive local datetimes β 2026-07-01 00:00:00 (T separator OK, date-only OK) |
contract_id |
Events linked to a contract (window optional) |
all |
true = everything (paginate!) |
category_id |
One category β or categories=1,2,3 for several |
source |
manual (source is null) or a generator name like asset_warranty
|
q |
Search title and location |
page / per_page
|
Pagination β default 1 / 25, max 100 |
The event shape:
{ "id": 12, "title": "Maintenance window β release 2.4",
"description": "Core switch SFP replacement (CHG-0011).",
"category": { "id": 1, "name": "Maintenance", "color": "#ef6c00" },
"start_at": "2026-07-05 06:00:00", "end_at": "2026-07-05 08:00:00",
"all_day": false, "location": "Production",
"contract_id": null,
"source": null,
"created_by": { "id": 1, "name": "Administrator" },
"created_at": "2026-07-03 16:56:41", "updated_at": "2026-07-03 16:56:41" }source: null = a manual event you can edit. source: "asset_warranty" = generated (read-only; created_by is null β the sync's sentinel).
| Field | Required | Description |
|---|---|---|
title |
β | Event title |
start_at |
β | Naive local datetime |
end_at |
Defaults to start_at; can't be before it (422) |
|
all_day |
Boolean | |
description / location
|
Details | |
category_id |
Validated (422 on unknown β friendlier than the UI's raw FK error) |
|
contract_id |
Link to a contract (validated) |
Always creates a manual event (source can never be set). Returns 201.
π’ GET /calendar/events/{id} Β π calendar_events.read Β· π PATCH /calendar/events/{id} Β π calendar_events.update
Everything creatable is patchable; title and start_at can't be cleared.
Warning
A generated event (source set) answers 409 to PATCH β "generated by the 'asset_warranty' sync and read-only β it would be recreated on the next sync anyway."
Deletes a manual event. Generated events answer 409 β retire them by clearing the asset's warranty date (or the warranty-surface setting) and letting the sync take them away.
All categories with colour and live event counts (category management stays in Calendar β Settings):
{ "data": [ { "id": 1, "name": "Maintenance", "color": "#ef6c00",
"description": null, "is_active": true, "event_count": 4 } ] }A read-only key (calendar_events: read + reference: read) posting the day's schedule to chat:
B="https://your-server/api/v1"; K="Authorization: Bearer fitsm_β¦"
TODAY=$(date +%F)
curl -s -H "$K" "$B/calendar/events?from=$TODAY%2000:00:00&to=$TODAY%2023:59:59&per_page=50" \
| jq -r '.data[] | "\(.start_at[11:16]) [\(.category.name // "-")] \(.title)\(if .source then " π€" else "" end)"'And the automation direction β clearing a cancelled maintenance window by title:
ID=$(curl -s -H "$K" "$B/calendar/events?all=true&q=release+2.4" | jq -r '.data[0].id')
curl -s -X DELETE "$B/calendar/events/$ID" -H "$K"Under the hood: REST API β How It Works Β· Other modules: Tickets Β· Assets Β· Problems Β· Changes Β· Knowledge Β· Tasks Β· CMDB Β· Contracts Β· Keys & permissions: System β API (System module) Β· Module docs: Calendar.
FreeITSM β an open-source IT Service Management platform Β· github.com/edmozley/freeitsm Β· MIT licence
- Installation
- β° Scheduled tasks (cron jobs)
- Architecture
- AI Providers
- Internationalisation (i18n)
- Timezones & Time Handling
- Theming & Dark Mode
- β¨οΈ Command palette (βK)
- π Searching inside tickets
- π Attached documents
- MobileβFriendly
-
Security
- Layer 1 β which modules you can enter
- β³ π§© Module Access Control
- β³ π οΈ Module Access β Developer Guide
- Layer 2 β what you can administer
- β³ π Roles & Permissions
- β³ π οΈ Roles β Developer Guide
- β³ π€ Why capabilities are constants
- Layer 3 β the System module
- β³ π Admin Access Control
- Hardening
- β³ π Security review response 2026-08
- β³ π‘οΈ Security hardening 2026-08
- β³ π οΈ Security hardening 2026-08 β Developer Guide
- β³ π‘οΈ Round three β plain English
- β³ π οΈ Round three β Developer Guide
- Single Sign-On (SSO)
- ποΈ LDAP & Active Directory
- Browser Extension
- API Reference
-
π REST API β how it works
- β³ π« REST API: Tickets
- β³ π» REST API: Assets
- β³ π΄ REST API: Problems
- β³ π REST API: Changes
- β³ π REST API: Knowledge
- β³ β REST API: Tasks
- β³ ποΈ REST API: CMDB
- β³ π REST API: Contracts
- β³ ποΈ REST API: Calendar
- β³ πΏ REST API: Software
- β³ π¦ REST API: Service Status
- β³ βοΈ REST API: Morning Checks
- β³ π REST API: Forms
- β³ βοΈ REST API: Workflow
- β³ πΊοΈ REST API: Network Mapper
- β³ π§ Using the API docs page
- β³ π OpenAPI specification
- β³ β OpenAPI: kept correct
- β³ π οΈ Maintaining the catalogue
- Watchtower
-
Tickets
- β³ Mailbox Authentication
- β³ π€ Email send log
- β³ Basic IMAP mailboxes
- β³ Email rendering & images
- β³ SLA Management
- β³ WhatsApp channel
- β³ π¬ Web chat channel
- β³ π£ Slack channel
- β³ π Linking tickets
- β³ ποΈ Canned responses
- β³ βοΈ Limiting replies to particular senders
- β³ βοΈ Email signatures
- β³ π The public web address
- β³ π Raising a ticket for someone else
- β³ π Merging tickets
- β³ β Splitting tickets
- β³ β Selecting several tickets
- β³ π οΈ Snoozing tickets β Developer Guide
- β³ π₯ Collision detection
- β³ β±οΈ Time tracking
- Problem Management
- Tasks
- Assets
- Knowledge
- Change Management
- Calendar
- Morning Checks
- Reporting
- Software
- Forms
- Contracts
- Service Status
- π Notifications
- π¨ War Room
- Self-Service Portal
- LMS
- Process Mapper
- CMDB
- Network Mapper
- Workflows
- Issue trackers (Jira, Azure DevOps)
- System
-
Overview
- β³ π Progress tracker
- β³ Concepts & vocabulary
- β³ Email routing & mailboxes
- β³ Settings: global vs per-company
- β³ Users & self-service
- β³ Staff cross-company access
- β³ Worked examples
- β³ Pitfalls & gotchas
- β³ Scope: what it's for
- β³ π οΈ Developer Guide (make a module multi-company)
- β³ ποΈ Case study: CMDB (a linked graph)
- β³ π§ͺ Test harness (prove it's isolated)