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
startTimeorendTimefrom 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
- The practice uses the New Semble Appointment System.
- You have the
settingsAvailabilitiespermission. - You know the ID of the recurring availability to change (from
createAvailabilityoravailabilityRule).
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.
| Step | Action | Date / pattern |
|---|---|---|
| 1 | Set endDate on the existing rule | 2026-08-31 (last day of the old pattern) |
| 2 | Create a new recurring rule | startDate: 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
- Javascript
- Python
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"
}
}
}'
const fetch = require('node-fetch');
const query = `
mutation UpdateAvailability($data: UpdateResourceAvailabilityInput!) {
updateAvailability(data: $data) {
data {
id
endDate
recurrence {
daysOfTheWeek
}
}
}
}
`;
const variables = {
data: {
id: 'EXISTING_AVAILABILITY_ID',
endDate: '2026-08-31',
},
};
fetch('https://open.semble.io/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-token': 'yourtoken',
},
body: JSON.stringify({ query, variables }),
})
.then((res) => res.json())
.then((res) => console.log(res.data));
import requests
import json
query = """
mutation UpdateAvailability($data: UpdateResourceAvailabilityInput!) {
updateAvailability(data: $data) {
data {
id
endDate
recurrence {
daysOfTheWeek
}
}
}
}
"""
variables = {
"data": {
"id": "EXISTING_AVAILABILITY_ID",
"endDate": "2026-08-31"
}
}
headers = {
'Content-Type': 'application/json',
'x-token': 'yourtoken',
}
response = requests.post(
'https://open.semble.io/graphql',
headers=headers,
data=json.dumps({"query": query, "variables": variables})
)
print(response.json())
Notes:
endDatemust be on or after the rule'sstartDateand cannot be in the past.- Plan the transition in advance; you cannot set
endDateto 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
- Javascript
- Python
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]
}
}
}
}'
const fetch = require('node-fetch');
const query = `
mutation CreateAvailability($data: CreateResourceAvailabilityInput!) {
createAvailability(data: $data) {
data {
id
startDate
endDate
startTime
endTime
recurrence {
frequency
interval
daysOfTheWeek
}
}
}
}
`;
const 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],
},
},
};
fetch('https://open.semble.io/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-token': 'yourtoken',
},
body: JSON.stringify({ query, variables }),
})
.then((res) => res.json())
.then((res) => console.log(res.data));
import requests
import json
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]
}
}
}
headers = {
'Content-Type': 'application/json',
'x-token': 'yourtoken',
}
response = requests.post(
'https://open.semble.io/graphql',
headers=headers,
data=json.dumps({"query": query, "variables": variables})
)
print(response.json())
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
- Call
updateAvailabilitywithendDateset to the last day the current pattern should apply. - Call
createAvailabilitywithstartDateset 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
- Release notes:
updateAvailability - Release notes:
createAvailability - How-to: Create ad hoc availability for a single day — override one occurrence without splitting the series
- How-to: Get started with the New Semble Appointment System