> ## Client identification
>
> Requests to this API should include a `Client-Platform` header alongside
> `Authorization`, identifying the application, tool, or model making the
> request. This is used for integration support and analytics.
>
> Use your model or tool name, for example `claude-code` or `chatgpt`.
>
> Example:
>
> ```bash
> curl https://api.salaryboxapp.com/... \
>   -H "Authorization: Api-Key <api-key>" \
>   -H "Client-Platform: claude-code"
> ```

# List Staff Schedules

GET https://api.salaryboxapp.com/v2/customer/v1/attendance/schedules

Returns each staff member's planned schedule for every date in a range of up to 60 days (future dates allowed): whether the date is a day off and which shifts are planned. This is the plan, not what happened.

`schedule_type` is:
- `fixed`: a weekly pattern, optionally only on certain weeks of the month (for example "2nd and 4th Saturday off").
- `flexible`: a roster set date by date. Unrostered dates have no shifts.
- `standard`: an older weekly pattern (shown as fixed in the app) where date-specific changes override the week.
- `null`: no schedule; every date has no shifts.

A date can have several shifts (split shifts). A shift whose `end_time` is before its `start_time` ends the next day. Holidays and leaves are not part of the schedule.


Reference: https://docs.salarybox.in/api-reference/attendance/schedules-retrieve

## Authentication

- `Authorization` header (required) (prefixed with ` Api-Key   `) — Format: "Api-Key \{api-key}"

## Request

### Query parameters

- `start_date` (date, required) — First day, `YYYY-MM-DD`.
- `end_date` (date, required) — Last day, `YYYY-MM-DD`. The range can cover at most 60 days.
- `salarybox_ids` (list of string, optional) — Repeatable. Limits the result to these staff members, for example `salarybox_ids=SBK7Q2M9TX&salarybox_ids=SBK3H8D1LP`.
- `branch_names` (list of string, optional) — Repeatable. Exact branch names (case-sensitive).
- `department_names` (list of string, optional) — Repeatable. Exact department names (case-sensitive).
- `page` (integer, optional) — Page number, starting at 1.
- `page_size` (integer, optional) — Results per page. Default and maximum 500.

## Response

### 200

One entry per matching staff member on this page.

- `message` (string, required)
- `status` (boolean, required)
- `data` (list of EmployeeSchedule, required)
- `count` (integer, required) — Total number of matching staff members across all pages.
- `prev` (string, required, nullable) — URL of the previous page, or `null` on the first page.
- `next` (string, required, nullable) — URL of the next page, or `null` on the last page.

## Errors

### 400 Bad Request Error

The dates are missing, invalid, in the wrong order, or more than 60 days apart.

- `message` (string, required)
- `status` (boolean, required)
- `errors` (map from string to any, optional, nullable)

### 404 Not Found Error

The requested page does not exist.

- `message` (string, required)
- `status` (boolean, required)
- `errors` (map from string to any, optional, nullable)

## Types

### EmployeeSchedule

- `salarybox_id` (string, required) — The staff member's SalaryBox ID.
- `employee_id` (string, required, nullable) — Your company's own employee ID for this person. `null` or an empty string when not set.
- `name` (string, required) — Full name from the staff profile.
- `branches` (list of string, required) — Names of the branches the person is assigned to. Deleted branches are left out.
- `departments` (list of string, required) — Names of the departments the person is in. Deleted departments are left out.
- `schedule_type` (enum, required, nullable) — The kind of schedule the staff member is on (their current schedule). - `fixed`: the same weekly pattern every week. - `flexible`: a roster set date by date. - `standard`: an older weekly pattern, shown as fixed in the app, where date-specific shifts replace the weekly pattern on those dates. - `null`: no schedule set up.
  - Allowed values: `fixed`, `flexible`, `standard`
- `days` (list of EmployeeScheduleDay, required) — One item for every date from `start_date` to `end_date`, in date order.

### EmployeeScheduleDay

The staff member's plan for one date.

- `date` (date, required) — The date, `YYYY-MM-DD`.
- `is_day_off` (boolean, required) — True when the schedule has a day off (week off) on this date. False on working days and on dates with nothing scheduled.
- `shifts` (list of ScheduledShift, required) — Shifts scheduled on this date, possibly more than one. Empty on a day off and on dates with nothing scheduled.

### ScheduledShift

A shift the staff member is scheduled for on a date.

- `name` (string, required, nullable) — Shift name as set up in SalaryBox (see List Shifts).
- `start_time` (string, required) — Shift start as a local wall-clock time in the staff member's time zone, `HH:MM:SS`, with no date or offset.
- `end_time` (string, required) — Shift end, `HH:MM:SS`. When it is earlier than `start_time` (for example `22:00:00` to `06:00:00`), the shift ends on the next calendar day.

## Examples

**Response**

```json
{
  "message": "Success",
  "status": true,
  "data": [
    {
      "salarybox_id": "SBK7Q2M9TX",
      "employee_id": "EMP-0042",
      "name": "Aarav Sharma",
      "branches": [
        "Bengaluru HQ"
      ],
      "departments": [
        "Sales"
      ],
      "schedule_type": "fixed",
      "days": [
        {
          "date": "2026-11-05",
          "is_day_off": false,
          "shifts": [
            {
              "name": "General Shift",
              "start_time": "09:30:00",
              "end_time": "18:30:00"
            }
          ]
        },
        {
          "date": "2026-11-06",
          "is_day_off": false,
          "shifts": [
            {
              "name": "General Shift",
              "start_time": "09:30:00",
              "end_time": "18:30:00"
            }
          ]
        },
        {
          "date": "2026-11-07",
          "is_day_off": true,
          "shifts": []
        }
      ]
    },
    {
      "salarybox_id": "SBH2W7C4ZN",
      "employee_id": "EMP-0071",
      "name": "Imran Qureshi",
      "branches": [
        "Pune Plant"
      ],
      "departments": [
        "Production"
      ],
      "schedule_type": "flexible",
      "days": [
        {
          "date": "2026-11-05",
          "is_day_off": false,
          "shifts": [
            {
              "name": "Night Shift",
              "start_time": "22:00:00",
              "end_time": "06:00:00"
            }
          ]
        },
        {
          "date": "2026-11-06",
          "is_day_off": false,
          "shifts": [
            {
              "name": "Morning Split",
              "start_time": "06:00:00",
              "end_time": "10:00:00"
            },
            {
              "name": "Evening Split",
              "start_time": "17:00:00",
              "end_time": "21:00:00"
            }
          ]
        },
        {
          "date": "2026-11-07",
          "is_day_off": false,
          "shifts": []
        }
      ]
    },
    {
      "salarybox_id": "SBT5L9Q3MV",
      "employee_id": null,
      "name": "Kavya Reddy",
      "branches": [],
      "departments": [],
      "schedule_type": null,
      "days": [
        {
          "date": "2026-11-05",
          "is_day_off": false,
          "shifts": []
        },
        {
          "date": "2026-11-06",
          "is_day_off": false,
          "shifts": []
        },
        {
          "date": "2026-11-07",
          "is_day_off": false,
          "shifts": []
        }
      ]
    }
  ],
  "count": 3,
  "prev": null,
  "next": null
}
```

**SDK Code**

```python Example
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/attendance/schedules"

querystring = {"end_date":"2026-11-07","start_date":"2026-11-05"}

headers = {"Authorization": "Api-Key  <apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Example
const url = 'https://api.salaryboxapp.com/v2/customer/v1/attendance/schedules?end_date=2026-11-07&start_date=2026-11-05';
const options = {method: 'GET', headers: {Authorization: 'Api-Key  <apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.salaryboxapp.com/v2/customer/v1/attendance/schedules?end_date=2026-11-07&start_date=2026-11-05"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Api-Key  <apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example
require 'uri'
require 'net/http'

url = URI("https://api.salaryboxapp.com/v2/customer/v1/attendance/schedules?end_date=2026-11-07&start_date=2026-11-05")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'

response = http.request(request)
puts response.read_body
```

```java Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.salaryboxapp.com/v2/customer/v1/attendance/schedules?end_date=2026-11-07&start_date=2026-11-05")
  .header("Authorization", "Api-Key  <apiKey>")
  .asString();
```

```php Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.salaryboxapp.com/v2/customer/v1/attendance/schedules?end_date=2026-11-07&start_date=2026-11-05', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Example
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/attendance/schedules?end_date=2026-11-07&start_date=2026-11-05");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Example
import Foundation

let headers = ["Authorization": "Api-Key  <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/attendance/schedules?end_date=2026-11-07&start_date=2026-11-05")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```