> For the complete documentation index, see [llms.txt](https://docs.samesystem.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.samesystem.dev/api-v1-reference/schedule/get-planned-actual-schedule.md).

# Get planned/actual schedule

This collection is designed to retrieve worktime, absence, bonuses, salary and lend out data. It can contain either the actual or the planned schedule depending on the query parameter \&planned=true.

Per default this request contains all events from the schedule like working hours, absence hours and bonusses.

## Actual schedule

The actual schedule is the state of the schedule at any given point.

## Planned schedule

Planned schedule is the published state of the schedule, hence a snapshot of how it looked at that exact moment in time when the schedule was published to the employees.

Note: The setting *"Use plan releasing"* will have to be enabled in the Department settings on the Department tab.

## 93-day maximum date-range limit

We have a 93-day maximum date-range limit. If you try to fetch data for more than 93 days, you will receive an error.

## Open shifts

The response does not include Open-shifts in this endpoint. If you compare the results from the API with report from Statistics - Hours/Salary, you will see a difference in data.

## Data returned

### Day-section

An employee is returned per day with all of the events that happen on that day. In the first part of the response is the day information.

### Public Holiday-section

Public Holiday is null if there is none on the given day, and it delivers this information if there is.If the Public Holiday is set to "deduct from contract hours", then amount and cost will be 0.

### User-section

The "id" is the internal id. The "salary\_number" is also what is called "wage earner number".

### Events-section

The events-array can contain both "work" and "absence" events. "Zones" is a functionality that can be enabled, so you can specify where the employee is located in the shop."With\_breaks" means that we include the unpaid break as hours, while "without\_breaks" mean we exclude it.

### Absence-section

The absence event is very similar to events-section. The only difference for the absence event is that it has "name" and "code" fields. Name is what is seen in the schedule. Code is what can be defined for reports and such.

### Bonuses-section

This includes information about bonuses that such as "inconvenient hours" (or "forskudttidstillæg" in Danish) or overtime. Not all bonuses have "start\_time" and "end\_time" data available - it depends on the specific setup, and it will need to be coordinated with your Customer Success Manager.

### Tasks-section

This section includes information about tasks in this shift.

```json
{"openapi":"3.0.0","info":{"title":"SameSystem API V1","version":"1.1.3"},"servers":[{"url":"https://api.samesystem.com/api/v1/","description":""}],"paths":{"/{clientToken}/export/calendar":{"get":{"tags":["Schedule"],"summary":"Get planned/actual schedule","description":"This collection is designed to retrieve worktime, absence, bonuses, salary and lend out data. It can contain either the actual or the planned schedule depending on the query parameter &planned=true.\n\nPer default this request contains all events from the schedule like working hours, absence hours and bonusses.\n\n# Actual schedule\nThe actual schedule is the state of the schedule at any given point.\n\n# Planned schedule\nPlanned schedule is the published state of the schedule, hence a snapshot of how it looked at that exact moment in time when the schedule was published to the employees.\n\nNote: The setting *\"Use plan releasing\"* will have to be enabled in the Department settings on the Department tab.\n\n# 93-day maximum date-range limit\nWe have a 93-day maximum date-range limit. If you try to fetch data for more than 93 days, you will receive an error.\n\n# Open shifts\nThe response does not include Open-shifts in this endpoint.\nIf you compare the results from the API with report from Statistics - Hours/Salary, you will see a difference in data.\n\n# Data returned\n## Day-section\nAn employee is returned per day with all of the events that happen on that day. In the first part of the response is the day information.\n\n## Public Holiday-section\nPublic Holiday is null if there is none on the given day, and it delivers this information if there is.If the Public Holiday is set to \"deduct from contract hours\", then amount and cost will be 0.\n\n## User-section\nThe \"id\" is the internal id. The \"salary_number\" is also what is called \"wage earner number\".\n\n## Events-section\nThe events-array can contain both \"work\" and \"absence\" events.\n\"Zones\" is a functionality that can be enabled, so you can specify where the employee is located in the shop.\"With_breaks\" means that we include the unpaid break as hours, while \"without_breaks\" mean we exclude it.\n\n## Absence-section\nThe absence event is very similar to events-section.\nThe only difference for the absence event is that it has \"name\" and \"code\" fields. Name is what is seen in the schedule. Code is what can be defined for reports and such.\n\n## Bonuses-section\nThis includes information about bonuses that such as \"inconvenient hours\" (or \"forskudttidstillæg\" in Danish) or overtime.\nNot all bonuses have \"start_time\" and \"end_time\" data available - it depends on the specific setup, and it will need to be coordinated with your Customer Success Manager.\n\n## Tasks-section\nThis section includes information about tasks in this shift.","operationId":"get-clientToken-export-calendar","parameters":[{"name":"clientToken","in":"path","description":"Token in a form of \"c\\<clientId\\>\".","required":true,"schema":{"type":"string"}},{"name":"start_date","in":"query","description":"Worktime export starting date. If no dates are parsed, current month will be returned","required":false,"schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","description":"Worktime export ending date. If no dates are parsed, current month will be returned","required":false,"schema":{"type":"string","format":"date"}},{"name":"shop_ids","in":"query","description":"If no shops are parsed, then all shops will be returned","required":false,"schema":{"type":"string"}},{"name":"user_ids","in":"query","description":" If no users are parsed, then all users will be returned","required":false,"schema":{"type":"string"}},{"name":"last_changed","in":"query","description":"All days that have been changed from that date and onwards will be returned","required":false,"schema":{"type":"string","format":"date"}},{"name":"bonuses","in":"query","description":"False or else bonuses are returned per default","required":false,"schema":{"type":"boolean"}},{"name":"salary","in":"query","description":"False or else salary is returned per default","required":false,"schema":{"type":"boolean"}},{"name":"planned","in":"query","description":"if set to true, only planned schedule is returned. If set to false or omitted the actual schedule is returned.","required":false,"schema":{"type":"boolean"}},{"name":"include_lent_out","in":"query","description":"if set to true, information about lent outs are included.","required":false,"schema":{"type":"boolean","default":false}},{"name":"tasks","in":"query","description":"if set to true, information about tasks are included.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Schedule"}}}}}}}}},"components":{"schemas":{"Schedule":{"type":"object","properties":{"date":{"type":"string","description":"Date of the schedule"},"status":{"type":"string","description":"Status. Can be one of the following:\n- unreleased : The schedule is not yet published.\n- released   : The schedule is published.\n- confirmed  : The day in the schedule is confirmed by manager."},"cost":{"type":"number","description":"Cost of the day."},"compensation":{"type":"object","description":"Sum of salary compensation amounts for this employee. Requires client setting \"Use expected compensations in statistics\" on the Schedule tab in General setting.","nullable":true},"public_holiday":{"type":"object","properties":{"name":{"type":"string","description":"Name of public holiday."},"closed":{"type":"boolean","description":"Is department closed or not."},"amount":{"type":"number","description":"Number of hours counted for this holiday."},"cost":{"type":"number","description":"The cost per schedule (day per employee). If public holiday is set to \"deduct from contract hours\" then cost will be 0.0"}},"description":"If date is not a public holiday, the value will be null.","nullable":true},"department":{"type":"object","properties":{"id":{"type":"string","description":"Internal id of the department"},"nr":{"type":"string","description":"Department number"},"external_department_number":{"type":"string","description":"External department number"},"salary_department_number":{"type":"string","description":"Department number for salary"},"opening_hour":{"type":"string","description":"Opening hours this day.","nullable":true},"closing_hour":{"type":"string","description":"Closing hours this day","nullable":true}}},"user":{"type":"object","properties":{"id":{"type":"integer","description":"Internal id of the employee","format":"int64"},"name":{"type":"string","description":"Name of the employee"},"role_name":{"type":"string","description":"Title/role of the employee"},"salary_number":{"type":"string","description":"Salary number also known as \"wage_earner_number\". Used to identify user in a payroll system"}}},"events":{"type":"object","properties":{"work":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleWork"}},"absence":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleAbsence"}}}},"bonuses":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleBonus"}},"lent_out_department":{"type":"object","properties":{"department_id":{"type":"integer","description":"Internal department id of the lent out department","format":"int64","nullable":true},"name":{"type":"string","description":"Name of the lent out department","nullable":true},"external_department_id":{"type":"string","description":"External department id of the lent out department","nullable":true},"cost_center":{"type":"string","description":"Cost center of the lent out department","nullable":true},"department_number":{"type":"string","description":"Department number of the lent out department","nullable":true},"salary_department_number":{"type":"string","description":"Salary department number of the lent out department","nullable":true},"opening_hour":{"type":"string","description":"Opening hour of the lent out department","nullable":true},"closing_hour":{"type":"string","description":"Closing hour of the lent out department","nullable":true}},"description":"if ?include_lent_out=true this object is returned with information about lent outs."},"tasks":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleTask"}}},"description":""},"ScheduleWork":{"type":"object","properties":{"id":{"type":"integer","description":"The internal id of the work event.","format":"int64"},"zone":{"type":"string","description":"Name of the zone. If a zone is not selected for work, it will be null.","nullable":true},"start_time":{"type":"number","description":"Work start time"},"end_time":{"type":"number","description":"Work end time."},"cost":{"type":"number","description":"Cost of the work for this employee on the given day."},"total_hours":{"type":"object","properties":{"with_breaks":{"type":"string","description":"Include unpaid breaks as hours."},"without_breaks":{"type":"string","description":"Exclude unpaid breaks as hours."}},"description":"Calculated total hours with breaks and without breaks. \"With breaks\" means we include unpaid break as hours, while \"without_breaks\" mean we exclude it."},"breaks":{"type":"object","properties":{"paid":{"type":"string","description":"Number of hours paid.","format":"time"},"unpaid":{"type":"string","description":"Number of hours unpaid."},"placed_breaks":{"type":"array","description":"Information about placed breaks.","items":{"type":"object","properties":{"start_time":{"type":"string","description":"Start time of the break.","format":"time"},"end_time":{"type":"string","description":"End time of the break.","format":"time"},"paid":{"type":"boolean","description":"Indication if break is paid or not."},"amount":{"type":"string","description":"Amount of hours."}}}}},"description":"Information about breaks."}}},"ScheduleAbsence":{"type":"object","properties":{"id":{"type":"integer","description":"Id of the absence event","format":"int64"},"name":{"type":"string","description":"Name of absence"},"type_id":{"type":"integer","description":"Internal id for the absence type"},"code":{"type":"string","description":"Your own code/id for the absence. Can be used by the payroll system"},"zone":{"type":"string","description":"Name of the zone","nullable":true},"start_time":{"type":"string","description":"Absence start time. Will be null for all day absence.","format":"time","nullable":true},"end_time":{"type":"string","description":"Absence end time. Will be null for all day absence","format":"time","nullable":true},"cost":{"type":"number","description":"Cost of the absence"},"total_hours":{"type":"object","properties":{"with_breaks":{"type":"string"},"without_breaks":{"type":"string"}},"description":"Calculated total hours with and without breaks"},"breaks":{"type":"object","properties":{"paid":{"type":"string"},"unpaid":{"type":"string"},"placed_breaks":{"type":"array","items":{"type":"object","properties":{"start_time":{"type":"string","description":"Start time of the break","format":"time"},"end_time":{"type":"string","description":"End time of the break","format":"time"},"paid":{"type":"boolean","description":"Is the break paid or not"},"amount":{"type":"string","description":"Amount of hours","format":"time"}}}}},"description":"Information about breaks"}}},"ScheduleBonus":{"title":"ScheduleBonus","type":"object","properties":{"name":{"type":"string","description":"Name of the bonus"},"start_time":{"type":"string","description":"Start time for the bonus"},"end_time":{"type":"string","description":"End time for the bonus","format":"time"},"amount":{"type":"string","description":"Amount of hours","format":"time"},"cost":{"type":"number","description":"Cost of the bonus"},"bonus_type_id":{"type":"integer","description":"Id of the bonus type."},"bonus_type_rate":{"type":"number","description":"Name of the bonus type"},"bonus_type_rate_type":{"type":"string","description":"Type of the bonus type."}}},"ScheduleTask":{"type":"object","properties":{"id":{"type":"integer","description":"ID of the task in this shift"},"task_type_id":{"type":"integer","description":"ID of the task type."},"name":{"type":"string","description":"Name of the task."},"start_time":{"type":"number","description":"Start time of the task.","format":"float"},"end_time":{"type":"number","description":"End time of the task.","format":"float"},"hours":{"type":"number","description":"Total number of hours for this task.","format":"float"},"productivity_percent":{"type":"number","description":"The productivty percentage of the task.","format":"float"}},"description":"Task in schedule"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.samesystem.dev/api-v1-reference/schedule/get-planned-actual-schedule.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
