Skip to main content
Documentation

Scheduling

scheduling.time_off

List who is off and cannot be given a slot in a window
Read-onlyRead budget

REST

Shipping
POST /api/v1/scheduling/time_off

MCP tool

Live
scheduling.time_off

Exposed on: REST API · Shop MCP server · Claude connector · Dash (in-app copilot) · Zapier. Part of the Scheduling domain.

Operating contract

Who is unavailable, and when. Two different things share this list and the difference is the whole point: an APPROVED row is somebody who is definitely off, and a PENDING row is somebody who has asked and not been answered.

NEVER SCHEDULE AGAINST A PENDING ROW AS IF IT WERE FREE, and never promise it either. Say the request is outstanding; the manager decides.

all_day: false means a partial day, and start_time/end_time are the hours in the shop's own clock. A half-day off is invisible if you only read the dates.

This is the roster half of the availability question. The other half is the shop's business hours, on shop.settings, which say which weekdays it works at all. Neither is a holiday calendar; this product has none.

status of declined or cancelled is history — those people are working. They are included only when you ask for them.

Approving, declining and filing a request are all absent from this registry on purpose. A day off is a conversation between a person and their employer, and a machine that answers one has committed the shop to a staffing decision nobody made.

TRUNCATION: total is the exact number of matching rows and omitted is how many are not here. When omitted is not 0, narrow the window — a roster read with rows missing is a schedule with people on it who are not coming in.

Who may call it

Permission
shop.manageThe caller must hold shop.manage at the ACT level. A read-only dashboard grant on the same section is refused.
Plan
Every planNo plan gate. Available on every Service VIN plan.
Retries
naturalNaturally idempotent — running it twice leaves the same world as running it once. A retrying integration needs no key.
Rate class
readCounted against the read budget — the widest of the four.

Partial answers

omitted is how many matching records are not in the response, and 0 is a real answer meaning you have all of them. There is no cursor here — narrow the filter instead.

Do not summarise from a truncated response

When `omitted` is not 0 there are more time-off rows in this window. Narrow `from`/`until` or raise `limit` before planning a week around it.

Input

FieldTypeDescription
fromrequiredstring

The first day of the window, YYYY-MM-DD in the shop's timezone.

untilrequiredstring

The last day of the window, YYYY-MM-DD, inclusive.

staff_idstringuuid

Narrow to one person's staff profile id, as returned by jobs.staff.

include_decided_againstboolean

True also returns declined and cancelled requests. Defaults to false.

limitinteger1–200

How many rows to return, 1-200. Defaults to 100.

Default: 100

Output

FieldTypeDescription
itemsobject[]

items[].idstring

items[].staff_idstring

items[].kindstring

items[].statusstring

items[].starts_onstring

items[].ends_onstring

items[].all_dayboolean

items[].start_timestring | null

items[].end_timestring | null

items[].notestring | null

totalnumber

omittednumber

pending_countnumber

Examples

Built from this capability's own schema — required fields and the ones carrying a default, and nothing invented. Paste one and it validates.

curl
export SERVICEVIN_API_KEY=svk_live_…

curl -X POST https://www.servicevin.com/api/v1/scheduling/time_off \
  -H "Authorization: Bearer $SERVICEVIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"…","until":"…","limit":100}'

TypeScript (fetch)
const res = await fetch("https://www.servicevin.com/api/v1/scheduling/time_off", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SERVICEVIN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "from": "…",
    "until": "…",
    "limit": 100
  }),
});

// Success and failure are both envelopes. Switch on error.code, never
// on error.message — the codes are stable, the messages are for people.
const payload = await res.json();
if (!res.ok) throw new Error(payload.error.code);
const data = payload.data;

Python (requests)
import os, requests

res = requests.post(
    "https://www.servicevin.com/api/v1/scheduling/time_off",
    headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
    json={
    "from": "…",
    "until": "…",
    "limit": 100
},
    timeout=30,
)
payload = res.json()
if not res.ok:
    raise RuntimeError(payload["error"]["code"])
data = payload["data"]

MCP tools/call — https://www.servicevin.com/api/mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "scheduling.time_off",
    "arguments": {
      "from": "…",
      "until": "…",
      "limit": 100
    }
  }
}

Refusals

The four gates run in this order on every surface, and the order is not arbitrary — see Authentication.

StatusCodeWhen
404not_foundThe id is unknown, or the feature is not enabled for this account. Deliberately the same answer for both.
403forbiddenThis login does not hold shop.manage.
422validation_errorAn argument was wrong. The message names the field.
429rate_limitedToo many read calls. Back off and retry.
500internal_errorSomething failed on our side. Nothing was changed.