Weekly Template Guide
Create named company snapshots of open weekday intervals at /v3/weeklyTemplate, then copy those hours onto a weekly allocation or weekly operating hours.
When to Use
- Store a reusable company snapshot of open weekday intervals (for example, “Front desk” Monday–Friday 09:00–17:00).
- Copy those hours onto a weekly allocation or an entity’s weekly operating hours without keeping a live link back to the template.
- List, replace, or delete templates for the authenticated company.
Concepts
A weekly template is a company-scoped name plus open weekday intervals only. It is not a weekly allocation, not weekly operating hours, and not an unavailability record. Responses are { id, name, weeklyAvailability }. There are no dates, ServiceId, ResourceId, bookingsPerSlot, or legacyId on the resource.
Applying a template is a snapshot copy: it copies the stored hours onto a weekly allocation or weekly operating hours. Saving an allocation or operating-hours card does not PUT the template. Reloading hours does not infer a template by matching the current schedule.
Creating, updating, or deleting a template does not change GET /v3/availability. Availability changes only after the copied hours are saved on a weekly allocation or an entity’s weekly operating hours.
These routes are company-scoped like other /v3 company resources. There is no v1 alias for weekly templates.
Endpoint Overview
| Endpoint | Purpose |
|---|---|
POST /v3/weeklyTemplate | Create a template (name and weeklyAvailability required). Returns 200. |
GET /v3/weeklyTemplate | List templates for the authenticated company (ordered by name, then created time). |
GET /v3/weeklyTemplate/:id | Retrieve one template. |
PUT /v3/weeklyTemplate/:id | Replace weeklyAvailability. name is optional. There is no PATCH. |
DELETE /v3/weeklyTemplate/:id | Hard-delete the template. Allocations and operating hours are unchanged. |
All routes require authentication plus verifyCompany. :id is a UUID.
Payload Shape
{
"name": "Front",
"weeklyAvailability": [
{ "dayOfWeek": 1, "startTime": "09:00:00", "endTime": "17:00:00" },
{ "dayOfWeek": 2, "startTime": "09:00:00", "endTime": "17:00:00" }
]
}| Field | Constraints |
|---|---|
name | Required on create; optional on PUT. String, 1–100 characters after trim (STRING(100)). Unique per company: comparison is trim + case-insensitive. Stored trimmed; original casing is kept. |
weeklyAvailability | Required on create and PUT. Array of at least one open interval. |
dayOfWeek | Integer 0 (Sunday) through 6 (Saturday). Multiple windows per day are allowed. |
startTime / endTime | HH:MM:SS. |
Successful create, get, list, and update responses wrap that shape in { "success": true, "data": … } (data is an array on list). Hard delete returns { "success": true } with no data.
Do not send ServiceId, ResourceId, bookingsPerSlot, startDate, or endDate on the template body.
Errors
- 400 — Empty
weeklyAvailability, missingnameon create, name longer than 100 characters after trim, invaliddayOfWeekor time format, or a forbidden body field (ServiceId,ResourceId,bookingsPerSlot,startDate,endDate). - 400 — Name collision for the same company (trim + case-insensitive), including unique-constraint races. Message:
A weekly template with this name already exists. - 404 — The path id is not a template in the authenticated company (including another company’s id).
- 401 / 403 — Missing or insufficient authentication.
See Also
Updated 1 day ago
