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 /me | The key itself |
GET /workplaces | The key's workplaces |
GET /workplaces/{workplaceId}/people | People of a workplace |
GET /workplaces/{workplaceId}/shifts | Shifts of a date range |
GET /workplaces/{workplaceId}/worked-time | Worked time of a month |
GET /workplaces/{workplaceId}/daily-sales | Daily sales of a date range |
GET /workplaces/{workplaceId}/absences | Approved 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.
| Pole | Typ | Opis |
|---|---|---|
data | object | |
data. | string | The key's id (not the secret). |
data. | string | The name the owner gave it. |
data. | object | A level per resource (write is for AI assistants only; announcements and pay are write-only, nothing of them is ever read). |
data. | string | jedna z wartości none, read, write. |
data. | string | jedna z wartości none, read, write. |
data. | string | jedna z wartości none, read, write. |
data. | string | jedna z wartości none, read, write. |
data. | string | jedna z wartości none, read, write. |
data. | string | jedna z wartości none, read, write. |
data. | string | jedna z wartości none, read, write. |
data. | boolean | Whether the key may also be used by AI assistants through the MCP server. |
data. | boolean | Whether 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. | string (date-time) lub null | When the key stops working (UTC). |
data. | lista: string | The 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
| Status | Znaczenie |
|---|---|
401 | unauthenticated (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). |
402 | plan_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. |
405 | method_not_allowed: the API is read-only, only GET is accepted (Allow: GET). |
429 | rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds. |
500 | internal: 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.
| Pole | Typ | Opis |
|---|---|---|
data | lista: object | |
data[]. | string | |
data[]. | string | |
data[]. | string lub null | |
data[]. | string | IANA time zone of the workplace; shift times are local to it. |
data[]. | string | ISO 4217 currency of every amount of this workplace. |
nextCursor | string lub null | Pass 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
| Status | Znaczenie |
|---|---|
401 | unauthenticated (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). |
402 | plan_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. |
405 | method_not_allowed: the API is read-only, only GET is accepted (Allow: GET). |
429 | rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds. |
500 | internal: 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
| Nazwa | Miejsce | Typ | Wymagany | Opis |
|---|---|---|---|---|
workplaceId | path | string | tak | A workplace id from GET /workplaces. |
limit | query | integer | nie | Items per page. domyślnie 100. 1–500. |
cursor | query | string | nie | The previous page's nextCursor, unchanged. Send the same other parameters with it. |
Odpowiedź: 200
A page of people, by display name.
| Pole | Typ | Opis |
|---|---|---|
data | lista: object | |
data[]. | string | The person's id (also in shifts, worked time and absences). |
data[]. | string | |
data[]. | string lub null | Their role at this workplace, as the owner named it. |
data[]. | string lub null | Their permission at this workplace. jedna z wartości OWNER, MANAGER_FINANCIAL, MANAGER, MANAGER_OPERATIONAL, EMPLOYEE. |
data[]. | boolean | False once they no longer work there. |
data[]. | string (date) lub null | |
data[]. | string (date) lub null | |
nextCursor | string lub null | Pass 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
| Status | Znaczenie |
|---|---|
400 | invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor. |
401 | unauthenticated (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). |
402 | plan_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. |
403 | missing_scope: the key has no read access to any resource that opens this route. |
404 | not_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). |
405 | method_not_allowed: the API is read-only, only GET is accepted (Allow: GET). |
429 | rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds. |
500 | internal: 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
| Nazwa | Miejsce | Typ | Wymagany | Opis |
|---|---|---|---|---|
workplaceId | path | string | tak | A workplace id from GET /workplaces. |
from | query | string (date) | tak | First day (YYYY-MM-DD), included. The range is at most 92 days. |
to | query | string (date) | tak | Last day (YYYY-MM-DD), included; on or after from, at most 91 days after it. |
limit | query | integer | nie | Items per page. domyślnie 100. 1–500. |
cursor | query | string | nie | The previous page's nextCursor, unchanged. Send the same other parameters with it. |
Odpowiedź: 200
A page of shifts, by date and then id.
| Pole | Typ | Opis |
|---|---|---|
data | lista: object | |
data[]. | string | |
data[]. | string (date) | The day the shift belongs to (it may end the next day). |
data[]. | string | The month's roster, workplaceId_YYYY_MM. |
data[]. | boolean | False for a draft the team does not see yet. |
data[]. | string lub null | |
data[]. | string lub null | The planned person; null for an open shift. |
data[]. | string lub null | Who worked it: a colleague who covered, else the planned person; null when nobody did (notWorked) or the shift is open. |
data[]. | boolean | Nobody is assigned yet. |
data[]. | boolean | Nobody came; no hours count. |
data[]. | object lub null | Local wall times of the workplace (no offset); null when neither is set. |
data[]. | string lub null | |
data[]. | string lub null | |
data[]. | object lub null | Local wall times of the workplace (no offset); null when neither is set. |
data[]. | string lub null | |
data[]. | string lub null | |
nextCursor | string lub null | Pass 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
| Status | Znaczenie |
|---|---|
400 | invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor. |
401 | unauthenticated (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). |
402 | plan_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. |
403 | missing_scope: the key has no read access to any resource that opens this route. |
404 | not_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). |
405 | method_not_allowed: the API is read-only, only GET is accepted (Allow: GET). |
429 | rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds. |
500 | internal: 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
| Nazwa | Miejsce | Typ | Wymagany | Opis |
|---|---|---|---|---|
workplaceId | path | string | tak | A workplace id from GET /workplaces. |
month | query | string | tak | The month, YYYY-MM. |
limit | query | integer | nie | Items per page. domyślnie 100. 1–500. |
cursor | query | string | nie | The previous page's nextCursor, unchanged. Send the same other parameters with it. |
Odpowiedź: 200
A page of people with their month's hours.
| Pole | Typ | Opis |
|---|---|---|
data | lista: object | |
data[]. | string | |
data[]. | string | |
data[]. | string lub null | |
data[]. | object | The month's totals. |
data[]. | number | Hours worked in the month. |
data[]. | number | Of those. |
data[]. | number | Overtime hours at the 50% supplement. |
data[]. | number | Overtime hours at the 100% supplement. |
data[]. | integer | Days with worked hours. |
data[]. | integer | Days of absence (never their kind). |
data[]. | lista: object | Only days with hours or an absence. |
data[]. | string (date) | |
data[]. | number | Hours worked that day (after unpaid breaks). |
data[]. | number | Of those. |
data[]. | number | Overtime hours at the 50% supplement. |
data[]. | number | Overtime hours at the 100% supplement. |
data[]. | boolean | A day of absence (never its kind). |
data[]. | boolean | The hours come from the plan (nobody clocked). |
data[]. | lista: object | |
data[]. | string | |
data[]. | string | |
data[]. | boolean | |
data[]. | integer | |
nextCursor | string lub null | Pass 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
| Status | Znaczenie |
|---|---|
400 | invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor. |
401 | unauthenticated (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). |
402 | plan_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. |
403 | missing_scope: the key has no read access to any resource that opens this route. |
404 | not_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). |
405 | method_not_allowed: the API is read-only, only GET is accepted (Allow: GET). |
429 | rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds. |
500 | internal: 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
| Nazwa | Miejsce | Typ | Wymagany | Opis |
|---|---|---|---|---|
workplaceId | path | string | tak | A workplace id from GET /workplaces. |
from | query | string (date) | tak | First day (YYYY-MM-DD), included. The range is at most 92 days. |
to | query | string (date) | tak | Last day (YYYY-MM-DD), included; on or after from, at most 91 days after it. |
limit | query | integer | nie | Items per page. domyślnie 100. 1–500. |
cursor | query | string | nie | The previous page's nextCursor, unchanged. Send the same other parameters with it. |
Odpowiedź: 200
A page of days, by date.
| Pole | Typ | Opis |
|---|---|---|
data | lista: object | |
data[]. | string (date) | |
data[]. | number lub null | Net takings; null until entered or imported. |
data[]. | number lub null | Gross takings; null until entered or imported. |
data[]. | number lub null | The day's net sales target. |
data[]. | string lub null | Where 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[]. | boolean | The day was closed (reconciled) in the app. |
data[]. | object | Only with finances at read. The day's totals for all shifts; never anyone's pay. |
data[]. | number lub null | |
data[]. | number lub null | |
data[]. | number lub null | |
data[]. | number lub null | |
data[]. | number lub null | Actual labour cost as a percentage of net sales. |
nextCursor | string lub null | Pass 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
| Status | Znaczenie |
|---|---|
400 | invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor. |
401 | unauthenticated (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). |
402 | plan_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. |
403 | missing_scope: the key has no read access to any resource that opens this route. |
404 | not_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). |
405 | method_not_allowed: the API is read-only, only GET is accepted (Allow: GET). |
429 | rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds. |
500 | internal: 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
| Nazwa | Miejsce | Typ | Wymagany | Opis |
|---|---|---|---|---|
workplaceId | path | string | tak | A workplace id from GET /workplaces. |
from | query | string (date) | tak | First day (YYYY-MM-DD), included. The range is at most 92 days. |
to | query | string (date) | tak | Last day (YYYY-MM-DD), included; on or after from, at most 91 days after it. |
limit | query | integer | nie | Items per page. domyślnie 100. 1–500. |
cursor | query | string | nie | The previous page's nextCursor, unchanged. Send the same other parameters with it. |
Odpowiedź: 200
A page of absences, by start date and then id.
| Pole | Typ | Opis |
|---|---|---|
data | lista: object | |
data[]. | string | |
data[]. | string lub null | |
data[]. | string (date) lub null | First day, included. |
data[]. | string (date) lub null | Last day, included. |
data[]. | string lub null | HH:mm when only part of one day is off. |
data[]. | string lub null | HH:mm when only part of one day is off. |
data[]. | boolean | The absence covers all of the person's workplaces. |
nextCursor | string lub null | Pass 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
| Status | Znaczenie |
|---|---|
400 | invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor. |
401 | unauthenticated (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). |
402 | plan_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. |
403 | missing_scope: the key has no read access to any resource that opens this route. |
404 | not_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). |
405 | method_not_allowed: the API is read-only, only GET is accepted (Allow: GET). |
429 | rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds. |
500 | internal: 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.
| Kod | Znaczenie |
|---|---|
BadRequest | invalid_range (from/to missing, not real dates, reversed or longer than 92 days), invalid_month, invalid_limit or invalid_cursor. |
Unauthorized | unauthenticated (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). |
PlanInactive | plan_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. |
MissingScope | missing_scope: the key has no read access to any resource that opens this route. |
NotFound | not_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). |
MethodNotAllowed | method_not_allowed: the API is read-only, only GET is accepted (Allow: GET). |
RateLimited | rate_limited: more than 60 requests in the current minute for this key. Wait Retry-After seconds. |
InternalError | internal: something went wrong on our side; retry later with back-off. |