Skip to main content

Resource availability — deleteAvailability mutation

Integrations can remove a persisted clinician availability or unavailability block through the public API.

Affected mutation: deleteAvailability

Availability: Practices using the New Semble Appointment System only. The mutation is not available on the legacy appointment system.

Summary

deleteAvailability removes an existing ResourceAvailability row identified by id. The rule is deleted in Semble and no longer affects scheduling or slot queries.

The mutation applies to the entire persisted rule — ad-hoc or recurring, availability or unavailability. It does not remove a single occurrence from a recurring series. To stop a recurring rule from a given date, set endDate with updateAvailability instead. To skip individual days while keeping the series, add exclusions with updateAvailability — see Create ad hoc availability for a single day.

The response is the deleted ResourceAvailability under data (a snapshot of the rule as it was before removal).

Input

ArgumentRequiredNotes
idyesResource availability ID

Example

mutation DeleteAvailability($id: ID!) {
deleteAvailability(id: $id) {
data {
id
comment
unavailability
startDate
endDate
startTime
endTime
user {
id
}
room {
id
}
}
}
}

Variables:

{
"id": "RULE_ID"
}

Use the id returned from createAvailability or read with availabilityRule.

Validation errors

SituationMessage (summary)
Missing idVariable "$id" of required type "ID!" was not provided
Invalid id formatID must be a valid ID
Unknown ruleResource availability with id "…" not found.
Already deletedResource availability with id "…" not found.

Rules are scoped to the authenticated practice. A second delete for the same id returns not found.

Permissions

The mutation requires the settingsAvailabilities permission (same as createAvailability, updateAvailability, and availabilityRule).

Integration guidance

  • Full rule removal only: Use this mutation when the entire availability or unavailability block should be removed. Partial changes to recurring rules belong on updateAvailability.
  • End a series instead of deleting: To keep past occurrences but stop a recurring rule from a date forward, prefer updateAvailability with a new endDate — see Update a recurring availability pattern.
  • Confirm before delete: availabilityRule can re-read the rule by id before calling deleteAvailability.
  • Idempotency: Treat a not-found response after delete as success if your integration may retry; the rule is already gone.

See also