---
title: "Published shifts"
method: GET
path: "/shifts"
tags: ["schedules"]
---

# Published shifts

`GET /shifts`

## Request

- Base URL: `https://api.taktovka.com/v1`
- URL: `https://api.taktovka.com/v1/shifts`
- Auth: HTTP bearer

Shifts starting in the range, from the latest published version of each week. With `employee`, the shifts the person works (a seat they gave back is not theirs). `from` and `to` are local dates, both included, at most 93 days apart; `next_cursor` is always null.

## Query parameters

- `from` string, date, required
- `to` string, date, required
- `location` string, uuid
- `employee` string, uuid

## Response `200`

OK

- object
  - `data` Shift[], required
    - `id` string, uuid, required
    - `schedule_id` string, uuid, required
    - `version` integer, required: The published version the shift is read from
    - `location_id` string, uuid, required
    - `position_id` string, uuid, nullable, required
    - `date` string, date, required: Local date the shift starts on
    - `start_local` string, required: Wall-clock time at the location, HH:MM
    - `end_local` string, required: Wall-clock end; not after start_local means the next day
    - `tz` string, required: IANA time zone of the location when the version was published
    - `starts_at` string, date-time, required: ISO 8601 instant with the location's offset at that moment
    - `ends_at` string, date-time, required: ISO 8601 instant with the location's offset at that moment
    - `break_min` integer, required: Unpaid break, minutes
    - `minutes` integer, required: Elapsed minutes from start to end
    - `paid_minutes` integer, required: Elapsed minutes less the break
    - `headcount` integer, required: People the shift needs
    - `assignments` object[], required
      - `employee_id` string, uuid, required
      - `state` 'assigned' | 'confirmed' | 'swap_requested' | 'declined', required: declined: the person gave the seat back and does not work it
  - `next_cursor` string, nullable, required

## Other responses

- `400`: validation_failed, range_too_long or key_in_query
- `401`: unauthenticated, invalid_key, key_revoked or key_expired
- `403`: insufficient_scope (with required_scope)
- `429`: rate_limited (with retry_after and a Retry-After header)

---

[API](https://skmtc.dev/taktovka/apis/taktovka-api.md) · [All operations](https://skmtc.dev/taktovka/apis/taktovka-api/llms.txt) · [OpenAPI document](https://skmtc.dev/taktovka/apis/taktovka-api/revisions/612199b365e1?raw)
