KLOKIN Schedules API

The Schedules API from KLOKIN — 9 operation(s) for schedules.

GitHub OpenAPI

Operations 13

GET /schedules List schedules #
POST /schedules Create a schedule (draft) #
GET /schedules/{id} Get a schedule with its shifts and live DK violations #
DELETE /schedules/{id} Delete a schedule (cascades to shifts) #
GET /schedules/{id}/validate Validate a schedule against DK rules (preview, no changes) #
POST /schedules/{id}/publish Publish a schedule and notify affected employees #
POST /schedules/{id}/shifts Add a shift to a schedule #
PUT /shifts/{id} Update a shift #
DELETE /shifts/{id} Delete a shift #
GET /shift-templates List reusable shift templates #
POST /shift-templates Create a shift template #
DELETE /shift-templates/{id} Delete a shift template #
GET /my/schedule Current employee's own published shifts (Mano grafikas) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/klokin-io:klokin-io-schedules-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

klokin-io-schedules-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Klokin Schedules API
  version: 1.0.0
  description: 'REST API for the Klokin employee time-tracking platform.


    ## Authentication

    Most endpoints accept a Bearer token in the `Authorization` header — either

    a JWT obtained from `POST /v1/auth/login`, or an organization API key

    (`klkn_…`) created on the "API raktai" admin page. API keys carry an

    explicit permission list; JWT users get their role''s permissions.


    ## Organization context

    Multi-tenant requests resolve the organization from the `X-Organization`

    header (organization domain). Super-admin JWTs may operate across

    organizations; everyone else is scoped to their own.


    ## Errors

    Errors return `{ "error": "" }` (messages are in Lithuanian) and,

    where applicable, a stable machine-readable `code` such as

    `PLAN_LIMIT_REACHED`, `PLAN_FEATURE_REQUIRED` or `RATE_LIMIT_EXCEEDED`.


    ## Rate limiting

    API-key requests are rate limited per minute by the organization''s plan:

    STARTAS 30, VERSLAS 60, PAŽENGĘS 300, ĮMONĖ unlimited. Every response

    carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`

    (seconds until the window resets). Exceeding the limit returns `429` with a

    `Retry-After` header and `code: RATE_LIMIT_EXCEEDED`. The admin dashboard

    (JWT) is not subject to these limits.


    ## Versioning

    The API is versioned in the path (`/v1`). Backwards-incompatible changes

    ship under a new version; additive changes may appear within `/v1`.'
servers:
- url: /v1
security:
- bearerAuth: []
tags:
- name: Schedules
paths:
  /schedules:
    get:
      tags:
      - Schedules
      summary: List schedules
      description: Requires `schedules.read` and the `schedules` plan feature.
      parameters:
      - name: storeId
        in: query
        schema:
          type: string
          format: uuid
      - name: status
        in: query
        schema:
          type: string
          enum:
          - draft
          - published
          - archived
      responses:
        '200':
          description: Schedules
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Schedule'
        '403':
          $ref: '#/components/responses/Forbidden'
      operationId: getSchedules
      x-operation-id-source: derived
    post:
      tags:
      - Schedules
      summary: Create a schedule (draft)
      description: Requires `schedules.create`. One schedule per store per period.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - storeId
              - periodStart
              - periodEnd
              properties:
                storeId:
                  type: string
                  format: uuid
                periodStart:
                  type: string
                  format: date
                periodEnd:
                  type: string
                  format: date
      responses:
        '201':
          description: Created schedule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Schedule'
        '409':
          description: A schedule already exists for this store and period
      operationId: postSchedules
      x-operation-id-source: derived
  /schedules/{id}:
    get:
      tags:
      - Schedules
      summary: Get a schedule with its shifts and live DK violations
      parameters:
      - $ref: '#/components/parameters/IdPath'
      responses:
        '200':
          description: Schedule with shifts and violations
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Schedule'
                - type: object
                  properties:
                    shifts:
                      type: array
                      items:
                        $ref: '#/components/schemas/Shift'
                    violations:
                      type: array
                      items:
                        $ref: '#/components/schemas/Violation'
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: getSchedulesById
      x-operation-id-source: derived
    delete:
      tags:
      - Schedules
      summary: Delete a schedule (cascades to shifts)
      description: Requires `schedules.delete`.
      parameters:
      - $ref: '#/components/parameters/IdPath'
      responses:
        '200':
          description: Deleted
      operationId: deleteSchedulesById
      x-operation-id-source: derived
  /schedules/{id}/validate:
    get:
      tags:
      - Schedules
      summary: Validate a schedule against DK rules (preview, no changes)
      parameters:
      - $ref: '#/components/parameters/IdPath'
      responses:
        '200':
          description: Violations and whether any are blocking
          content:
            application/json:
              schema:
                type: object
                properties:
                  violations:
                    type: array
                    items:
                      $ref: '#/components/schemas/Violation'
                  blocking:
                    type: boolean
      operationId: getSchedulesByIdValidate
      x-operation-id-source: derived
  /schedules/{id}/publish:
    post:
      tags:
      - Schedules
      summary: Publish a schedule and notify affected employees
      description: 'Requires `schedules.publish`. Blocks with 422 `DK_VIOLATION` if any

        error-severity Darbo kodeksas rule is violated. Warnings (e.g. publishing

        fewer than 7 days ahead) do not block and are returned in the response.'
      parameters:
      - $ref: '#/components/parameters/IdPath'
      responses:
        '200':
          description: Published
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  notifiedEmployees:
                    type: integer
                  warnings:
                    type: array
                    items:
                      $ref: '#/components/schemas/Violation'
        '422':
          description: Blocked by a DK violation
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    example: DK_VIOLATION
                  violations:
                    type: array
                    items:
                      $ref: '#/components/schemas/Violation'
      operationId: postSchedulesByIdPublish
      x-operation-id-source: derived
  /schedules/{id}/shifts:
    post:
      tags:
      - Schedules
      summary: Add a shift to a schedule
      description: Requires `schedules.update`. Omit employeeId for an open shift.
      parameters:
      - $ref: '#/components/parameters/IdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - startsAt
              - endsAt
              properties:
                employeeId:
                  type: string
                  format: uuid
                startsAt:
                  type: string
                  format: date-time
                endsAt:
                  type: string
                  format: date-time
                breakMinutes:
                  type: integer
                  default: 0
                type:
                  type: string
                  enum:
                  - regular
                  - substitution
                  - on_call
                  default: regular
                substitutedEmployeeId:
                  type: string
                  format: uuid
                templateId:
                  type: string
                  format: uuid
                notes:
                  type: string
      responses:
        '201':
          description: Created shift
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Shift'
      operationId: postSchedulesByIdShifts
      x-operation-id-source: derived
  /shifts/{id}:
    put:
      tags:
      - Schedules
      summary: Update a shift
      description: Requires `schedules.update`.
      parameters:
      - $ref: '#/components/parameters/IdPath'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                employeeId:
                  type:
                  - string
                  - 'null'
                  format: uuid
                startsAt:
                  type: string
                  format: date-time
                endsAt:
                  type: string
                  format: date-time
                breakMinutes:
                  type: integer
                type:
                  type: string
                  enum:
                  - regular
                  - substitution
                  - on_call
                substitutedEmployeeId:
                  type:
                  - string
                  - 'null'
                  format: uuid
                notes:
                  type:
                  - string
                  - 'null'
      responses:
        '200':
          description: Updated shift
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Shift'
      operationId: putShiftsById
      x-operation-id-source: derived
    delete:
      tags:
      - Schedules
      summary: Delete a shift
      parameters:
      - $ref: '#/components/parameters/IdPath'
      responses:
        '200':
          description: Deleted
      operationId: deleteShiftsById
      x-operation-id-source: derived
  /shift-templates:
    get:
      tags:
      - Schedules
      summary: List reusable shift templates
      responses:
        '200':
          description: Templates
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ShiftTemplate'
      operationId: getShiftTemplates
      x-operation-id-source: derived
    post:
      tags:
      - Schedules
      summary: Create a shift template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              - startTime
              - endTime
              properties:
                name:
                  type: string
                startTime:
                  type: string
                  example: 07:00
                endTime:
                  type: string
                  example: '15:00'
                breakMinutes:
                  type: integer
                  default: 0
                crossesMidnight:
                  type: boolean
                  default: false
      responses:
        '201':
          description: Created template
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShiftTemplate'
      operationId: postShiftTemplates
      x-operation-id-source: derived
  /shift-templates/{id}:
    delete:
      tags:
      - Schedules
      summary: Delete a shift template
      parameters:
      - $ref: '#/components/parameters/IdPath'
      responses:
        '200':
          description: Deleted
      operationId: deleteShiftTemplatesById
      x-operation-id-source: derived
  /my/schedule:
    get:
      tags:
      - Schedules
      summary: Current employee's own published shifts (Mano grafikas)
      description: Employee portal token. Only published schedules are visible.
      parameters:
      - name: from
        in: query
        schema:
          type: string
          format: date-time
      - name: to
        in: query
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: The employee's shifts
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Shift'
      operationId: getMySchedule
      x-operation-id-source: derived
components:
  schemas:
    Error:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          description: Human-readable message (Lithuanian)
        code:
          type: string
          description: Stable machine-readable code, present on plan/limit errors.
          enum:
          - PLAN_LIMIT_REACHED
          - PLAN_FEATURE_REQUIRED
        feature:
          type: string
        plan:
          $ref: '#/components/schemas/PlanId'
    PlanId:
      type: string
      enum:
      - startas
      - verslas
      - pazenges
      - imone
    Schedule:
      type: object
      properties:
        id:
          type: string
          format: uuid
        organizationId:
          type: string
          format: uuid
        storeId:
          type: string
          format: uuid
        periodStart:
          type: string
          format: date
        periodEnd:
          type: string
          format: date
        status:
          type: string
          enum:
          - draft
          - published
          - archived
        publishedAt:
          type:
          - string
          - 'null'
          format: date-time
        publishedBy:
          type:
          - string
          - 'null'
          format: uuid
        shiftCount:
          type: integer
        createdAt:
          type: string
          format: date-time
    ShiftTemplate:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        startTime:
          type: string
          example: 07:00:00
        endTime:
          type: string
          example: '15:00:00'
        breakMinutes:
          type: integer
        crossesMidnight:
          type: boolean
    Shift:
      type: object
      properties:
        id:
          type: string
          format: uuid
        scheduleId:
          type: string
          format: uuid
        employeeId:
          type:
          - string
          - 'null'
          format: uuid
          description: null = open (unassigned) shift
        employeeName:
          type: string
        storeId:
          type: string
          format: uuid
        startsAt:
          type: string
          format: date-time
        endsAt:
          type: string
          format: date-time
        breakMinutes:
          type: integer
        type:
          type: string
          enum:
          - regular
          - substitution
          - on_call
        substitutedEmployeeId:
          type:
          - string
          - 'null'
          format: uuid
        templateId:
          type:
          - string
          - 'null'
          format: uuid
        notes:
          type:
          - string
          - 'null'
    Violation:
      type: object
      description: A Darbo kodeksas (DK) scheduling-rule finding.
      properties:
        code:
          type: string
          enum:
          - MAX_SHIFT_HOURS
          - OVERLAPPING_SHIFTS
          - MIN_DAILY_REST
          - MAX_WEEKLY_HOURS
          - MIN_WEEKLY_REST
          - PUBLISH_NOTICE
        severity:
          type: string
          enum:
          - error
          - warning
        message:
          type: string
          description: Human-readable (Lithuanian)
        employeeId:
          type:
          - string
          - 'null'
          format: uuid
        shiftIds:
          type: array
          items:
            type: string
            format: uuid
  parameters:
    IdPath:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Missing permission or plan feature
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Admin JWT from POST /v1/auth/login, or a `klkn_…` API key.