Skip to main content

Update a recurring availability pattern

updateAvailability can change endDate, comment, and exclusions on an existing rule. It cannot change the recurrence pattern (frequency, interval, daysOfTheWeek), daily times, clinician, room, or availability vs unavailability.

To change any of those fields from a given date forward, end the existing rule on the last day the old pattern should apply, then create a new rule starting the next calendar day with the updated pattern.

When to use this pattern

  • Change which weekdays a recurring availability applies to
  • Change the recurrence interval (for example, every week to every two weeks)
  • Change startTime or endTime from a future date onward
  • Reassign the rule to a different clinician or room from a future date

This guide focuses on recurrence changes; the same two-step approach applies to the other immutable fields listed above.

Prerequisites

Example scenario

A clinician has recurring availability every Monday, Wednesday, and Friday from 09:00–17:00, running from 2026-07-01 with no end date.

From 1 September 2026 onward, the pattern should be Tuesday and Thursday from 10:00–16:00.

StepActionDate / pattern
1Set endDate on the existing rule2026-08-31 (last day of the old pattern)
2Create a new recurring rulestartDate: 2026-09-01 (day after the old rule ends)

Step 1: Authenticate

Before making any requests, make sure you have a valid token. Refer to the Authentication section for more details.

Step 2: End the existing rule on the transition date

Call updateAvailability and set endDate to the last calendar day the current pattern should apply. This is the day before the new pattern starts.

Using the example above, set endDate to 2026-08-31:

curl -X POST https://open.semble.io/graphql \
-H "Content-Type: application/json" \
-H "x-token: yourtoken" \
-d '{
"query": "mutation UpdateAvailability($data: UpdateResourceAvailabilityInput!) { updateAvailability(data: $data) { data { id endDate recurrence { daysOfTheWeek } } } }",
"variables": {
"data": {
"id": "EXISTING_AVAILABILITY_ID",
"endDate": "2026-08-31"
}
}
}'

Notes:

  • endDate must be on or after the rule's startDate and cannot be in the past.
  • Plan the transition in advance; you cannot set endDate to a date that has already passed.

Step 3: Create a new rule from the next day

Call createAvailability with startDate set to the day after the endDate you set in step 2. Provide the new recurrence pattern, times, and the same user and room as the original rule (unless you are intentionally reassigning them).

Using the example above, create a rule starting 2026-09-01 with Tuesday and Thursday (daysOfTheWeek: [2, 4]) and updated hours:

curl -X POST https://open.semble.io/graphql \
-H "Content-Type: application/json" \
-H "x-token: yourtoken" \
-d '{
"query": "mutation CreateAvailability($data: CreateResourceAvailabilityInput!) { createAvailability(data: $data) { data { id startDate endDate startTime endTime recurrence { frequency interval daysOfTheWeek } } } }",
"variables": {
"data": {
"comment": "Weekly clinic (Tue/Thu)",
"unavailability": false,
"user": "CLINICIAN_ID",
"room": "ROOM_ID",
"startDate": "2026-09-01",
"endDate": "2026-12-31",
"startTime": "10:00",
"endTime": "16:00",
"recurrence": {
"frequency": "weekly",
"interval": 1,
"daysOfTheWeek": [2, 4]
}
}
}
}'

Set endDate on the new rule to match how long the updated pattern should run, or omit it for an open-ended series. Weekday indices are 0 (Sunday) through 6 (Saturday).

Summary

  1. Call updateAvailability with endDate set to the last day the current pattern should apply.
  2. Call createAvailability with startDate set to the next calendar day, using the new recurrence pattern and any updated times, clinician, or room.

The original rule ID remains in place with a bounded date range; the new rule carries the updated pattern from the transition date forward. Store both IDs in your integration if you sync availability rules locally.

See also