EVoShifts EN

Dokumentacja API

Wszystkie ścieżki API EVoShifts v1 tylko do odczytu: parametry, odpowiedzi, błędy i przykłady, wygenerowane z opisu OpenAPI.

Adres bazowy https://evoshift.app/api/v1. Każde zapytanie wymaga klucza API w nagłówku Authorization: Bearer evs_... (uwierzytelnianie); błędy, stronicowanie, daty i kwoty opisują zasady. Ten sam opis dla generatorów kodu i narzędzi do API: openapi.yaml (OpenAPI 3.0.3).

Opisy pól i parametrów pochodzą ze specyfikacji OpenAPI i są po angielsku.

GET /meThe key itself
GET /workplacesThe key's workplaces
GET /workplaces/{workplaceId}/peoplePeople of a workplace
GET /workplaces/{workplaceId}/shiftsShifts of a date range
GET /workplaces/{workplaceId}/worked-timeWorked time of a month
GET /workplaces/{workplaceId}/daily-salesDaily sales of a date range
GET /workplaces/{workplaceId}/absencesApproved absences overlapping a date range

GET /me

The key itself. The key's name, its levels, the AI assistants switch, its expiry and its workplaces. Needs no level.

Nie wymaga żadnego poziomu dostępu: wystarczy ważny klucz.

Odpowiedź: 200

The key.

PoleTypOpis
dataobject
data.keyIdstringThe key's id (not the secret).
data.namestringThe name the owner gave it.
data.accessobjectA level per resource (write is for AI assistants only; announcements and pay are write-only, nothing of them is ever read).
data.access.rosterstringjedna z wartości none, read, write.
data.access.timestringjedna z wartości none, read, write.
data.access.salesstringjedna z wartości none, read, write.
data.access.absencesstringjedna z wartości none, read, write.
data.access.financesstringjedna z wartości none, read, write.
data.access.announcementsstringjedna z wartości none, read, write.
data.access.paystringjedna z wartości none, read, write.
data.aiAssistantsbooleanWhether the key may also be used by AI assistants through the MCP server.
data.aiWritesbooleanWhether an AI assistant may also propose changes with it (MCP propose_* tools and apply_proposal, for the resources at write). Never through this API.
data.expiresAtstring (date-time) lub nullWhen the key stops working (UTC).
data.workplaceIdslista: stringThe workplaces the key was given (see GET /workplaces for those still readable).

Przykładowa odpowiedź

{
  "data": {
    "keyId": "k_3Hq9Zt2mWx",
    "name": "Accounting office",
    "access": {
      "roster": "none",
      "time": "read",
      "sales": "read",
      "absences": "read",
      "finances": "none"
    },
    "aiAssistants": false,
    "aiWrites": false,
    "expiresAt": "2026-12-31T23:59:59.999Z",
    "workplaceIds": [
      "wp_gdansk"
    ]
  }
}

Błędy

StatusZnaczenie
401unauthenticated (no key sent), invalid_key (malformed, unknown or replaced by a regenerated one), revoked_key, key_outdated (a key without access levels; create a new one) or expired_key (regenerate it in the app).
402plan_inactive: a workplace of the key has no running trial or Premium plan (it ended, or the owner is on the free Start plan). The key is kept and works again once the plan is active.
405method_not_allowed: the API is read-only, only GET is accepted (Allow: GET).
429rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds.
500internal: something went wrong on our side; retry later with back-off.

Przykłady

curl

curl -s "https://evoshift.app/api/v1/me" \
  -H "Authorization: Bearer $EVOSHIFTS_API_KEY"

JavaScript

// Node.js 18+ (or any runtime with fetch), on a server: never in a browser page.
const res = await fetch(`https://evoshift.app/api/v1/me`, {
  headers: { Authorization: `Bearer ${process.env.EVOSHIFTS_API_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error.code}`);
console.log(body.data);

Python

import os, requests

res = requests.get(
    "https://evoshift.app/api/v1/me",
    headers={"Authorization": f"Bearer {os.environ['EVOSHIFTS_API_KEY']}"},
    timeout=30,
)
res.raise_for_status()
print(res.json()["data"])

GET /workplaces

The key's workplaces. The workplaces of the key that still belong to its owner, with their time zone and currency. Needs no level. Not paged (nextCursor is always null).

Nie wymaga żadnego poziomu dostępu: wystarczy ważny klucz.

Odpowiedź: 200

Every workplace of the key.

PoleTypOpis
datalista: object
data[].idstring
data[].namestring
data[].addressstring lub null
data[].timezonestringIANA time zone of the workplace; shift times are local to it.
data[].currencystringISO 4217 currency of every amount of this workplace.
nextCursorstring lub nullPass it as cursor for the next page; null on the last page.

Przykładowa odpowiedź

{
  "data": [
    {
      "id": "wp_gdansk",
      "name": "Kawiarnia Aurora Gdańsk",
      "address": "ul. Długa 5",
      "timezone": "Europe/Warsaw",
      "currency": "PLN"
    }
  ],
  "nextCursor": null
}

Błędy

StatusZnaczenie
401unauthenticated (no key sent), invalid_key (malformed, unknown or replaced by a regenerated one), revoked_key, key_outdated (a key without access levels; create a new one) or expired_key (regenerate it in the app).
402plan_inactive: a workplace of the key has no running trial or Premium plan (it ended, or the owner is on the free Start plan). The key is kept and works again once the plan is active.
405method_not_allowed: the API is read-only, only GET is accepted (Allow: GET).
429rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds.
500internal: something went wrong on our side; retry later with back-off.

Przykłady

curl

curl -s "https://evoshift.app/api/v1/workplaces" \
  -H "Authorization: Bearer $EVOSHIFTS_API_KEY"

JavaScript

// Node.js 18+ (or any runtime with fetch), on a server: never in a browser page.
const res = await fetch(`https://evoshift.app/api/v1/workplaces`, {
  headers: { Authorization: `Bearer ${process.env.EVOSHIFTS_API_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error.code}`);
console.log(body.data);

Python

import os, requests

res = requests.get(
    "https://evoshift.app/api/v1/workplaces",
    headers={"Authorization": f"Bearer {os.environ['EVOSHIFTS_API_KEY']}"},
    timeout=30,
)
res.raise_for_status()
print(res.json()["data"])

GET /workplaces/{workplaceId}/people

People of a workplace. Everyone with an engagement at the workplace, also those who no longer work there (active false), sorted by display name. Public profile and role only; never contact details or pay terms.

Wymaga odczytu jednego z zasobów: Grafik i zmiany, Przepracowane godziny, Zatwierdzone nieobecności

Parametry

NazwaMiejsceTypWymaganyOpis
workplaceIdpathstringtakA workplace id from GET /workplaces.
limitqueryintegernieItems per page. domyślnie 100. 1–500.
cursorquerystringnieThe previous page's nextCursor, unchanged. Send the same other parameters with it.

Odpowiedź: 200

A page of people, by display name.

PoleTypOpis
datalista: object
data[].idstringThe person's id (also in shifts, worked time and absences).
data[].displayNamestring
data[].rolestring lub nullTheir role at this workplace, as the owner named it.
data[].permissionstring lub nullTheir permission at this workplace. jedna z wartości OWNER, MANAGER_FINANCIAL, MANAGER, MANAGER_OPERATIONAL, EMPLOYEE.
data[].activebooleanFalse once they no longer work there.
data[].startDatestring (date) lub null
data[].endDatestring (date) lub null
nextCursorstring lub nullPass it as cursor for the next page; null on the last page.

Przykładowa odpowiedź

{
  "data": [
    {
      "id": "user_123",
      "displayName": "Anna Nowak",
      "role": "Barista",
      "permission": "EMPLOYEE",
      "active": true,
      "startDate": "2025-03-01",
      "endDate": null
    },
    {
      "id": "user_456",
      "displayName": "Jan Kowalski",
      "role": "Manager",
      "permission": "MANAGER",
      "active": true,
      "startDate": "2024-09-15",
      "endDate": null
    }
  ],
  "nextCursor": null
}

Błędy

StatusZnaczenie
400invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor.
401unauthenticated (no key sent), invalid_key (malformed, unknown or replaced by a regenerated one), revoked_key, key_outdated (a key without access levels; create a new one) or expired_key (regenerate it in the app).
402plan_inactive: a workplace of the key has no running trial or Premium plan (it ended, or the owner is on the free Start plan). The key is kept and works again once the plan is active.
403missing_scope: the key has no read access to any resource that opens this route.
404not_found: an unknown route or API version, or a workplace that is not the key's or no longer its owner's (an unknown version is answered before the key is checked, without rate-limit headers).
405method_not_allowed: the API is read-only, only GET is accepted (Allow: GET).
429rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds.
500internal: something went wrong on our side; retry later with back-off.

Przykłady

curl

curl -s "https://evoshift.app/api/v1/workplaces/wp_gdansk/people" \
  -H "Authorization: Bearer $EVOSHIFTS_API_KEY"

JavaScript

// Node.js 18+ (or any runtime with fetch), on a server: never in a browser page.
const res = await fetch(`https://evoshift.app/api/v1/workplaces/wp_gdansk/people`, {
  headers: { Authorization: `Bearer ${process.env.EVOSHIFTS_API_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error.code}`);
console.log(body.data);

Python

import os, requests

res = requests.get(
    "https://evoshift.app/api/v1/workplaces/wp_gdansk/people",
    headers={"Authorization": f"Bearer {os.environ['EVOSHIFTS_API_KEY']}"},
    timeout=30,
)
res.raise_for_status()
print(res.json()["data"])

GET /workplaces/{workplaceId}/shifts

Shifts of a date range. Published and draft shifts (see published) whose date is in the range, also open shifts (nobody assigned). Never their cost.

Wymaga odczytu zasobu: Grafik i zmiany

Parametry

NazwaMiejsceTypWymaganyOpis
workplaceIdpathstringtakA workplace id from GET /workplaces.
fromquerystring (date)takFirst day (YYYY-MM-DD), included. The range is at most 92 days.
toquerystring (date)takLast day (YYYY-MM-DD), included; on or after from, at most 91 days after it.
limitqueryintegernieItems per page. domyślnie 100. 1–500.
cursorquerystringnieThe previous page's nextCursor, unchanged. Send the same other parameters with it.

Odpowiedź: 200

A page of shifts, by date and then id.

PoleTypOpis
datalista: object
data[].idstring
data[].datestring (date)The day the shift belongs to (it may end the next day).
data[].rosterIdstringThe month's roster, workplaceId_YYYY_MM.
data[].publishedbooleanFalse for a draft the team does not see yet.
data[].rolestring lub null
data[].userIdstring lub nullThe planned person; null for an open shift.
data[].workedBystring lub nullWho worked it: a colleague who covered, else the planned person; null when nobody did (notWorked) or the shift is open.
data[].openbooleanNobody is assigned yet.
data[].notWorkedbooleanNobody came; no hours count.
data[].plannedobject lub nullLocal wall times of the workplace (no offset); null when neither is set.
data[].planned.startstring lub null
data[].planned.endstring lub null
data[].actualobject lub nullLocal wall times of the workplace (no offset); null when neither is set.
data[].actual.startstring lub null
data[].actual.endstring lub null
nextCursorstring lub nullPass it as cursor for the next page; null on the last page.

Przykładowa odpowiedź

{
  "data": [
    {
      "id": "shift_123",
      "date": "2026-03-02",
      "rosterId": "wp_gdansk_2026_03",
      "published": true,
      "role": "Barista",
      "userId": "user_123",
      "workedBy": "user_123",
      "open": false,
      "notWorked": false,
      "planned": {
        "start": "2026-03-02T08:00:00",
        "end": "2026-03-02T16:00:00"
      },
      "actual": {
        "start": "2026-03-02T07:58:00",
        "end": "2026-03-02T16:04:00"
      }
    },
    {
      "id": "shift_124",
      "date": "2026-03-02",
      "rosterId": "wp_gdansk_2026_03",
      "published": false,
      "role": "Barista",
      "userId": null,
      "workedBy": null,
      "open": true,
      "notWorked": false,
      "planned": {
        "start": "2026-03-02T16:00:00",
        "end": "2026-03-02T22:00:00"
      },
      "actual": null
    }
  ],
  "nextCursor": "eyJkIjoiMjAyNi0wMy0wMiIsImlkIjoic2hpZnRfMTI0In0"
}

Błędy

StatusZnaczenie
400invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor.
401unauthenticated (no key sent), invalid_key (malformed, unknown or replaced by a regenerated one), revoked_key, key_outdated (a key without access levels; create a new one) or expired_key (regenerate it in the app).
402plan_inactive: a workplace of the key has no running trial or Premium plan (it ended, or the owner is on the free Start plan). The key is kept and works again once the plan is active.
403missing_scope: the key has no read access to any resource that opens this route.
404not_found: an unknown route or API version, or a workplace that is not the key's or no longer its owner's (an unknown version is answered before the key is checked, without rate-limit headers).
405method_not_allowed: the API is read-only, only GET is accepted (Allow: GET).
429rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds.
500internal: something went wrong on our side; retry later with back-off.

Przykłady

curl

curl -s "https://evoshift.app/api/v1/workplaces/wp_gdansk/shifts?from=2026-03-01&to=2026-03-31" \
  -H "Authorization: Bearer $EVOSHIFTS_API_KEY"

JavaScript

// Node.js 18+ (or any runtime with fetch), on a server: never in a browser page.
const query = new URLSearchParams({ from: "2026-03-01", to: "2026-03-31" });
const res = await fetch(`https://evoshift.app/api/v1/workplaces/wp_gdansk/shifts?${query}`, {
  headers: { Authorization: `Bearer ${process.env.EVOSHIFTS_API_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error.code}`);
console.log(body.data);

Python

import os, requests

res = requests.get(
    "https://evoshift.app/api/v1/workplaces/wp_gdansk/shifts",
    headers={"Authorization": f"Bearer {os.environ['EVOSHIFTS_API_KEY']}"},
    params={"from": "2026-03-01", "to": "2026-03-31"},
    timeout=30,
)
res.raise_for_status()
print(res.json()["data"])

GET /workplaces/{workplaceId}/worked-time

Worked time of a month. Per person and day, the same calculation as the app's working-time record and accountant exports (published or clocked shifts, the workplace's break and clock-review rules, overtime only on employment contracts). Days of absence are counted, never their kind. Only days with hours or an absence are listed.

Wymaga odczytu zasobu: Przepracowane godziny

Parametry

NazwaMiejsceTypWymaganyOpis
workplaceIdpathstringtakA workplace id from GET /workplaces.
monthquerystringtakThe month, YYYY-MM.
limitqueryintegernieItems per page. domyślnie 100. 1–500.
cursorquerystringnieThe previous page's nextCursor, unchanged. Send the same other parameters with it.

Odpowiedź: 200

A page of people with their month's hours.

PoleTypOpis
datalista: object
data[].userIdstring
data[].displayNamestring
data[].rolestring lub null
data[].totalsobjectThe month's totals.
data[].totals.hoursnumberHours worked in the month.
data[].totals.nightHoursnumberOf those.
data[].totals.overtime50numberOvertime hours at the 50% supplement.
data[].totals.overtime100numberOvertime hours at the 100% supplement.
data[].totals.workedDaysintegerDays with worked hours.
data[].totals.absenceDaysintegerDays of absence (never their kind).
data[].dayslista: objectOnly days with hours or an absence.
data[].days[].datestring (date)
data[].days[].hoursnumberHours worked that day (after unpaid breaks).
data[].days[].nightHoursnumberOf those.
data[].days[].overtime50numberOvertime hours at the 50% supplement.
data[].days[].overtime100numberOvertime hours at the 100% supplement.
data[].days[].absentbooleanA day of absence (never its kind).
data[].days[].fromPlanbooleanThe hours come from the plan (nobody clocked).
data[].days[].spanslista: object
data[].days[].spans[].fromstring
data[].days[].spans[].tostring
data[].days[].spans[].endsNextDayboolean
data[].days[].spans[].unpaidBreakMinutesinteger
nextCursorstring lub nullPass it as cursor for the next page; null on the last page.

Przykładowa odpowiedź

{
  "data": [
    {
      "userId": "user_123",
      "displayName": "Anna Nowak",
      "role": "Barista",
      "totals": {
        "hours": 152,
        "nightHours": 0,
        "overtime50": 0,
        "overtime100": 0,
        "workedDays": 19,
        "absenceDays": 2
      },
      "days": [
        {
          "date": "2026-03-02",
          "hours": 8,
          "nightHours": 0,
          "overtime50": 0,
          "overtime100": 0,
          "absent": false,
          "fromPlan": false,
          "spans": [
            {
              "from": "08:00",
              "to": "16:00",
              "endsNextDay": false,
              "unpaidBreakMinutes": 0
            }
          ]
        }
      ]
    }
  ],
  "nextCursor": null
}

Błędy

StatusZnaczenie
400invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor.
401unauthenticated (no key sent), invalid_key (malformed, unknown or replaced by a regenerated one), revoked_key, key_outdated (a key without access levels; create a new one) or expired_key (regenerate it in the app).
402plan_inactive: a workplace of the key has no running trial or Premium plan (it ended, or the owner is on the free Start plan). The key is kept and works again once the plan is active.
403missing_scope: the key has no read access to any resource that opens this route.
404not_found: an unknown route or API version, or a workplace that is not the key's or no longer its owner's (an unknown version is answered before the key is checked, without rate-limit headers).
405method_not_allowed: the API is read-only, only GET is accepted (Allow: GET).
429rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds.
500internal: something went wrong on our side; retry later with back-off.

Przykłady

curl

curl -s "https://evoshift.app/api/v1/workplaces/wp_gdansk/worked-time?month=2026-03" \
  -H "Authorization: Bearer $EVOSHIFTS_API_KEY"

JavaScript

// Node.js 18+ (or any runtime with fetch), on a server: never in a browser page.
const query = new URLSearchParams({ month: "2026-03" });
const res = await fetch(`https://evoshift.app/api/v1/workplaces/wp_gdansk/worked-time?${query}`, {
  headers: { Authorization: `Bearer ${process.env.EVOSHIFTS_API_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error.code}`);
console.log(body.data);

Python

import os, requests

res = requests.get(
    "https://evoshift.app/api/v1/workplaces/wp_gdansk/worked-time",
    headers={"Authorization": f"Bearer {os.environ['EVOSHIFTS_API_KEY']}"},
    params={"month": "2026-03"},
    timeout=30,
)
res.raise_for_status()
print(res.json()["data"])

GET /workplaces/{workplaceId}/daily-sales

Daily sales of a date range. One item per day that has a daily record in the range (days without one are left out). Amounts are in the workplace's currency. With finances at read, every day also carries labour, the day's labour cost and hours in total (never anyone's pay).

Wymaga odczytu zasobu: Sprzedaż dzienna

Parametry

NazwaMiejsceTypWymaganyOpis
workplaceIdpathstringtakA workplace id from GET /workplaces.
fromquerystring (date)takFirst day (YYYY-MM-DD), included. The range is at most 92 days.
toquerystring (date)takLast day (YYYY-MM-DD), included; on or after from, at most 91 days after it.
limitqueryintegernieItems per page. domyślnie 100. 1–500.
cursorquerystringnieThe previous page's nextCursor, unchanged. Send the same other parameters with it.

Odpowiedź: 200

A page of days, by date.

PoleTypOpis
datalista: object
data[].datestring (date)
data[].netSalesnumber lub nullNet takings; null until entered or imported.
data[].grossSalesnumber lub nullGross takings; null until entered or imported.
data[].targetNetSalesnumber lub nullThe day's net sales target.
data[].sourcestring lub nullWhere the takings came from: typed in the app (MANUAL), a file or e-mail (CSV), a till (POS); null without takings. jedna z wartości MANUAL, CSV, POS.
data[].closedbooleanThe day was closed (reconciled) in the app.
data[].labourobjectOnly with finances at read. The day's totals for all shifts; never anyone's pay.
data[].labour.plannedCostnumber lub null
data[].labour.plannedHoursnumber lub null
data[].labour.actualCostnumber lub null
data[].labour.actualHoursnumber lub null
data[].labour.actualLabourPercentnumber lub nullActual labour cost as a percentage of net sales.
nextCursorstring lub nullPass it as cursor for the next page; null on the last page.

Przykładowa odpowiedź

{
  "data": [
    {
      "date": "2026-03-01",
      "netSales": 4000,
      "grossSales": 4320,
      "targetNetSales": 4000,
      "source": "POS",
      "closed": false,
      "labour": {
        "plannedCost": 400,
        "plannedHours": 16,
        "actualCost": 380,
        "actualHours": 15,
        "actualLabourPercent": 9.5
      }
    },
    {
      "date": "2026-03-03",
      "netSales": null,
      "grossSales": null,
      "targetNetSales": 3500,
      "source": null,
      "closed": false,
      "labour": {
        "plannedCost": 410,
        "plannedHours": 16,
        "actualCost": null,
        "actualHours": null,
        "actualLabourPercent": null
      }
    }
  ],
  "nextCursor": null
}

Błędy

StatusZnaczenie
400invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor.
401unauthenticated (no key sent), invalid_key (malformed, unknown or replaced by a regenerated one), revoked_key, key_outdated (a key without access levels; create a new one) or expired_key (regenerate it in the app).
402plan_inactive: a workplace of the key has no running trial or Premium plan (it ended, or the owner is on the free Start plan). The key is kept and works again once the plan is active.
403missing_scope: the key has no read access to any resource that opens this route.
404not_found: an unknown route or API version, or a workplace that is not the key's or no longer its owner's (an unknown version is answered before the key is checked, without rate-limit headers).
405method_not_allowed: the API is read-only, only GET is accepted (Allow: GET).
429rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds.
500internal: something went wrong on our side; retry later with back-off.

Przykłady

curl

curl -s "https://evoshift.app/api/v1/workplaces/wp_gdansk/daily-sales?from=2026-03-01&to=2026-03-31" \
  -H "Authorization: Bearer $EVOSHIFTS_API_KEY"

JavaScript

// Node.js 18+ (or any runtime with fetch), on a server: never in a browser page.
const query = new URLSearchParams({ from: "2026-03-01", to: "2026-03-31" });
const res = await fetch(`https://evoshift.app/api/v1/workplaces/wp_gdansk/daily-sales?${query}`, {
  headers: { Authorization: `Bearer ${process.env.EVOSHIFTS_API_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error.code}`);
console.log(body.data);

Python

import os, requests

res = requests.get(
    "https://evoshift.app/api/v1/workplaces/wp_gdansk/daily-sales",
    headers={"Authorization": f"Bearer {os.environ['EVOSHIFTS_API_KEY']}"},
    params={"from": "2026-03-01", "to": "2026-03-31"},
    timeout=30,
)
res.raise_for_status()
print(res.json()["data"])

GET /workplaces/{workplaceId}/absences

Approved absences overlapping a date range. Approved absences that overlap the range: the workplace's own, those for all of a person's workplaces (allWorkplaces) and its company's, asked for at another workplace of the same company by someone who also works here. Person and dates only; never the kind, the reason or an attached certificate.

Wymaga odczytu zasobu: Zatwierdzone nieobecności

Parametry

NazwaMiejsceTypWymaganyOpis
workplaceIdpathstringtakA workplace id from GET /workplaces.
fromquerystring (date)takFirst day (YYYY-MM-DD), included. The range is at most 92 days.
toquerystring (date)takLast day (YYYY-MM-DD), included; on or after from, at most 91 days after it.
limitqueryintegernieItems per page. domyślnie 100. 1–500.
cursorquerystringnieThe previous page's nextCursor, unchanged. Send the same other parameters with it.

Odpowiedź: 200

A page of absences, by start date and then id.

PoleTypOpis
datalista: object
data[].idstring
data[].userIdstring lub null
data[].startDatestring (date) lub nullFirst day, included.
data[].endDatestring (date) lub nullLast day, included.
data[].startTimestring lub nullHH:mm when only part of one day is off.
data[].endTimestring lub nullHH:mm when only part of one day is off.
data[].allWorkplacesbooleanThe absence covers all of the person's workplaces.
nextCursorstring lub nullPass it as cursor for the next page; null on the last page.

Przykładowa odpowiedź

{
  "data": [
    {
      "id": "abs_999",
      "userId": "user_123",
      "startDate": "2026-03-04",
      "endDate": "2026-03-06",
      "startTime": null,
      "endTime": null,
      "allWorkplaces": false
    },
    {
      "id": "abs_1001",
      "userId": "user_456",
      "startDate": "2026-03-09",
      "endDate": "2026-03-09",
      "startTime": "12:00",
      "endTime": "16:00",
      "allWorkplaces": true
    }
  ],
  "nextCursor": null
}

Błędy

StatusZnaczenie
400invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor.
401unauthenticated (no key sent), invalid_key (malformed, unknown or replaced by a regenerated one), revoked_key, key_outdated (a key without access levels; create a new one) or expired_key (regenerate it in the app).
402plan_inactive: a workplace of the key has no running trial or Premium plan (it ended, or the owner is on the free Start plan). The key is kept and works again once the plan is active.
403missing_scope: the key has no read access to any resource that opens this route.
404not_found: an unknown route or API version, or a workplace that is not the key's or no longer its owner's (an unknown version is answered before the key is checked, without rate-limit headers).
405method_not_allowed: the API is read-only, only GET is accepted (Allow: GET).
429rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds.
500internal: something went wrong on our side; retry later with back-off.

Przykłady

curl

curl -s "https://evoshift.app/api/v1/workplaces/wp_gdansk/absences?from=2026-03-01&to=2026-03-31" \
  -H "Authorization: Bearer $EVOSHIFTS_API_KEY"

JavaScript

// Node.js 18+ (or any runtime with fetch), on a server: never in a browser page.
const query = new URLSearchParams({ from: "2026-03-01", to: "2026-03-31" });
const res = await fetch(`https://evoshift.app/api/v1/workplaces/wp_gdansk/absences?${query}`, {
  headers: { Authorization: `Bearer ${process.env.EVOSHIFTS_API_KEY}` },
});
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error.code}`);
console.log(body.data);

Python

import os, requests

res = requests.get(
    "https://evoshift.app/api/v1/workplaces/wp_gdansk/absences",
    headers={"Authorization": f"Bearer {os.environ['EVOSHIFTS_API_KEY']}"},
    params={"from": "2026-03-01", "to": "2026-03-31"},
    timeout=30,
)
res.raise_for_status()
print(res.json()["data"])

Odpowiedzi z błędem

Każda odpowiedź z błędem ma postać {"error": {"code": "...", "message": "..."}}. Co zrobić przy każdym kodzie: błędy.

KodZnaczenie
BadRequestinvalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor.
Unauthorizedunauthenticated (no key sent), invalid_key (malformed, unknown or replaced by a regenerated one), revoked_key, key_outdated (a key without access levels; create a new one) or expired_key (regenerate it in the app).
PlanInactiveplan_inactive: a workplace of the key has no running trial or Premium plan (it ended, or the owner is on the free Start plan). The key is kept and works again once the plan is active.
MissingScopemissing_scope: the key has no read access to any resource that opens this route.
NotFoundnot_found: an unknown route or API version, or a workplace that is not the key's or no longer its owner's (an unknown version is answered before the key is checked, without rate-limit headers).
MethodNotAllowedmethod_not_allowed: the API is read-only, only GET is accepted (Allow: GET).
RateLimitedrate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds.
InternalErrorinternal: something went wrong on our side; retry later with back-off.

Pytania o API? Napisz do nas, podając ścieżkę, czas i kod błędu; nigdy sam klucz.

Napisz do nas