schedulableResourceAvailability
query · in the family Reading your records
What it does
One resource’s availability facts over a window (at most 31 days) — its advisory hours, capacity and the reserved bookings; compose free slots from them.
ONE resource's availability facts over [from, to): the advisory weekly hours + the capacity + the reserved bookings overlapping the window. The resource must exist in your org group. The client composes free slots. Requires authentication (template class).
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Reading your records — Looking up and listing the records of your organization.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows
api:schedulableResourceAvailability
Arguments
Returns
SchedulableResourceAvailability SchedulableResourceAvailability! — The availability answer — the srcd's own words: availability = resource hours − booked appointments (derived; the client composes free slots; zero server timezone math — hours are naive wall-clock advisory).
Example request
query ExampleSchedulableResourceAvailability($resourceId: ID!, $from: String!, $to: String!) {
schedulableResourceAvailability(resourceId: $resourceId, from: $from, to: $to) {
resourceId
capacity
}
}Variables:
{
"resourceId": "01900000-0000-7000-8000-23b0d8150000",
"from": "<from>",
"to": "<to>"
}Example response
{
"data": {
"schedulableResourceAvailability": {
"resourceId": "01900000-0000-7000-8000-23b0d8150000",
"capacity": 1
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)