---
title: "Create a calendar entry"
method: POST
path: "/v1/calendar-entries"
tags: ["Calendar"]
---

# Create a calendar entry

`POST /v1/calendar-entries`

## Request

- Base URL: `https://api.officina.it`
- URL: `https://api.officina.it/v1/calendar-entries`
- Auth: HTTP bearer

Creates an appointment owned by the authenticated user inside
their company. `end_time` must be strictly after `start_time`.
The response is the fully materialized entry (denormalized
customer / vehicle / calendar / user fields included) so the
client can render the new row without a follow-up GET.

Foreign-key references in the body (`customer_id`, `vehicle_id`,
`worksheet_id`, `work_category_id`, `calendar_id`) must resolve
to resources owned by the authenticated user's company.
Unreachable refs return 422 `parameter_invalid` pointing at the
offending field.

`worksheet_id` links the appointment to a scheda lavoro. Omit
`customer_id` / `vehicle_id` to take them from the worksheet;
when sent, they must be the worksheet's (a worksheet without a
vehicle fits any vehicle of its customer), otherwise the request
returns 422 `parameter_invalid` on `/worksheet_id`. Sending
`worksheet_id` needs `worksheets.read` (the key's scope, or the
app user's permission); without it the request returns 403.

## Request body

- CalendarEntryCreateRequest: Body of `POST /v1/calendar-entries`. `end_time` must be strictly after `start_time`. `user_id` (ownership), `company_id`, and audit timestamps are server-managed and not accepted on the wire. `worksheet_id` links the appointment to a scheda lavoro. `customer_id` and `vehicle_id`, when sent, must be the worksheet's (a worksheet without a vehicle fits any vehicle of its customer); when omitted they are taken from the worksheet. A mismatch returns 422 `parameter_invalid` on `/worksheet_id`. `quote_id` / `checkin_id` are response-only: the underlying repository does not persist them on create today, so they are intentionally absent from this request.
  - `title` string, required
  - `description` string, nullable
  - `start_time` string, date-time, required: RFC 3339 timestamp supplied by the client. Must fall between 1900-01-01 and 2100-12-31. A year outside that window is a typo (2025 mistyped as 0025 is the common one), and the app's own date pickers refuse the same range — a record written with one would not be editable in the web UI afterwards. Out of range → 422 `parameter_invalid` with `param` pointing at the offending field.
  - `end_time` string, date-time, required: RFC 3339 timestamp supplied by the client. Must fall between 1900-01-01 and 2100-12-31. A year outside that window is a typo (2025 mistyped as 0025 is the common one), and the app's own date pickers refuse the same range — a record written with one would not be editable in the web UI afterwards. Out of range → 422 `parameter_invalid` with `param` pointing at the offending field.
  - `color` string, required
  - `email_reminder` boolean
  - `customer_id` string, uuid, nullable
  - `vehicle_id` string, uuid, nullable
  - `worksheet_id` string, uuid, nullable
  - `work_category_id` string, uuid, nullable: Single-category form, accepted in every revision: the document's only category. To set several, send `work_category_ids` instead (not both).
  - `work_category_ids` string[]: The document's work categories, in the order chosen (`work_category_id` in responses reports the first). Trimmed and de-duplicated (first occurrence wins); at most 10, each one of the company's categories (`GET /v1/work-categories`) — an unknown id is reported on `/work_category_ids/{i}`. Do not send together with `work_category_id`: both → `422 parameter_invalid`. Available since revision 2026-10-03.
  - `calendar_id` string, uuid, nullable
  - `auto_reminder_enabled` boolean
  - `auto_reminder_channel` 'email' | 'sms' | 'whatsapp' | 'null', nullable

## Response `201`

Calendar entry created.

- CalendarEntry: A workshop appointment. Belongs to one company (the caller's) and is owned by the user who created it. May reference an optional Customer, Vehicle, scheda lavoro (`worksheet_id`), work category, and parent Calendar. While `worksheet_id` is set, `customer_id` is the worksheet's and so is `vehicle_id` whenever the worksheet has one.
  - `object` 'calendar_entry', required
  - `id` string, uuid, required
  - `title` string, required
  - `description` string, nullable
  - `user_id` string, uuid, required
  - `start_time` string, date-time, required
  - `end_time` string, date-time, required
  - `color` string, required: Hex colour, e.g. #2563eb
  - `email_reminder` boolean, required
  - `customer_id` string, uuid, nullable
  - `vehicle_id` string, uuid, nullable
  - `worksheet_id` string, uuid, nullable
  - `quote_id` string, uuid, nullable
  - `checkin_id` string, uuid, nullable
  - `work_category_id` string, uuid, nullable
  - `work_category_name` string, nullable
  - `work_category_ids` string[], required: Every work category ("categoria") of the document, in the order chosen. `work_category_id` (kept for clients that handle a single category) always equals the first. `[]` when the document has none, never null. Available since revision 2026-10-03.
  - `work_categories` WorkCategory[], required: The same list as `work_category_ids` with each category's name, same order. `work_category_name` is the first one's name. Available since revision 2026-10-03.
    - `object` 'work_category', required
    - `id` string, uuid, required
    - `name` string, required
  - `calendar_id` string, uuid, nullable
  - `auto_reminder_enabled` boolean, required
  - `auto_reminder_channel` 'email' | 'sms' | 'whatsapp' | 'null', nullable
  - `auto_reminder_sent_at` string, date-time, nullable
  - `customer` CalendarEntryCustomer: Slim denormalized view of the linked customer, embedded inside a CalendarEntry. The full Customer resource lives at `/v1/customers/{id}`.
    - `object` 'customer', required
    - `id` string, uuid, required
    - `full_name` string, nullable
    - `email` string, nullable
    - `phone` string, nullable
  - `vehicle` CalendarEntryVehicle: Slim denormalized view of the linked vehicle, embedded inside a CalendarEntry. The full Vehicle resource lives at `/v1/vehicles/{id}`.
    - `object` 'vehicle', required
    - `id` string, uuid, required
    - `license` string, nullable
    - `model` string, required
    - `manufacturer_name` string, required
  - `user` CalendarEntryUser: Slim denormalized view of the owning user, embedded inside a CalendarEntry.
    - `object` 'user', required
    - `id` string, uuid, required
    - `name` string, required
  - `calendar` CalendarEntryCalendar: Slim denormalized view of the parent calendar, embedded inside a CalendarEntry. The Calendar container itself is not exposed on this tier.
    - `object` 'calendar', required
    - `id` string, uuid, required
    - `name` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `deleted_at` string, date-time, nullable

## Other responses

- `400`: Request body is unparseable or X-API-Version is missing.
- `401`: Missing, malformed, expired, or wrong-audience bearer token.
- `402`: The company has no active subscription, or its plan does not include API access. API access is included in the Business and Illimitato plans.
- `403`: The authenticated user lacks the required permission.
- `415`: Content-Type is not `application/json`, or Accept rejects JSON.
- `422`: A request field is missing or invalid (fast-fail).
- `500`: Unhandled server error. Detail is logged, not exposed.

---

[API](https://skmtc.dev/officina/apis/officina-it-api.md) · [All operations](https://skmtc.dev/officina/apis/officina-it-api/llms.txt) · [OpenAPI document](https://skmtc.dev/officina/apis/officina-it-api/revisions/7da3fccfe551?raw)
