Skip to content

Availability methods: update, delete

The Availability Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for Availability, one group of Availability methods.

Availability.update

Changes the given properties of an Availability. Verb page.

TypeScript
interface AvailabilityVerbs {
  update(input: AvailabilityUpdateInput, options?: SB.CallOptions): SB.Call<Availability>
}

Emits Availability.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Availability.
workerWorkerWho is booked: a Human, or an Agent that takes calls.
hoursjsonOpen hours by weekday, in its time zone.
timezonestringAn IANA time zone.
calendarsstring[]Connected calendars whose busy times it subtracts.
bufferintegerMinutes kept free before and after each Meeting.
noticeintegerThe fewest hours ahead a Meeting can be booked.

Returns

OutputTypeRequiredDescription
availabilityAvailabilityrequiredThe Availability.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const availability = await $.Availability.update({ id: 'availability_8Zj0a7vvRl', worker: 'worker_whZFpOKWIV' })

Availability.delete

Deletes an Availability: a soft delete that keeps its history, undone by Thing.restore. Verb page.

TypeScript
interface AvailabilityVerbs {
  delete(input: AvailabilityDeleteInput, options?: SB.CallOptions): SB.Call<Availability>
}

Emits Availability.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Availability.

Returns

OutputTypeRequiredDescription
availabilityAvailabilityrequiredThe Availability.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const availability = await $.Availability.delete({ id: 'availability_8Zj0a7vvRl' })