> ## 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 Attendance Settings

GET https://api.salaryboxapp.com/v2/customer/v1/attendance/employee-settings

Returns each staff member's attendance settings: time zone, whether they can see their own attendance, how they may mark attendance (smartphone modes and biometric devices), and the rules that turn punches into a daily status. Values are the ones SalaryBox applies, including defaults where nothing was saved.

**Automation rules**
- `auto_present`: marked present every working day, even without punching.
- `present_on_punch_in`: marked present on punch-in.
- `half_day_on_late_by_duration_seconds`: half day when the first punch-in is at least this late.
- `half_day_on_duration_seconds`: half day after working at least this long.
- `present_on_duration_seconds`: present after working at least this long. This is also the minimum hours used for overtime.

Later rules in this list override earlier ones. If your plan does not include attendance automation, everyone gets the defaults (`present_on_punch_in` true, the rest off). If your plan includes it but a staff member has no rules saved, the company-wide attendance settings apply.


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

## Authentication

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

## Request

### Query parameters

- `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 EmployeeAttendanceSetting, 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

### 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

### EmployeeAttendanceSetting

- `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.
- `timezone` (string, required) — The time zone the person's attendance is recorded in (IANA name). Their own setting, or your company's time zone when they have none (`Asia/Kolkata` if the company has none either). Never `null`.
- `can_view_own_attendance` (boolean, required) — True when the person can see their own attendance in the SalaryBox app. Their own setting when saved, otherwise their older per-person "view own attendance" setting, and true when neither was ever set.
- `attendance_modes` (AttendanceModes, required) — How the staff member is allowed to mark attendance.
- `automation_rules` (AutomationRules, required) — Rules that turn the staff member's punches into a daily status. See "Automation rules" in the endpoint description for the order they are applied in. All durations are in seconds; `null` means the rule is off.

### AttendanceModes

How the staff member is allowed to mark attendance.

- `smartphone` (AttendanceModesSmartphone, required) — Marking attendance from the SalaryBox app on their phone.
- `biometric` (AttendanceModesBiometric, required) — Marking attendance on a biometric device.

### AutomationRules

Rules that turn the staff member's punches into a daily status. See "Automation rules" in the endpoint description for the order they are applied in. All durations are in seconds; `null` means the rule is off.

- `auto_present` (boolean, required) — True when the person is marked present automatically every working day, even without a punch. Holidays and their days off are skipped.
- `present_on_punch_in` (boolean, required) — True when a punch-in marks the day present.
- `present_on_duration_seconds` (integer, required, nullable) — Mark the day present once the person has worked at least this long. Also the expected working time for overtime and for per-hour salary when set. For example `28800` is 8 hours.
- `half_day_on_duration_seconds` (integer, required, nullable) — Mark the day a half day once the person has worked at least this long (unless the present duration above is also reached). For example `14400` is 4 hours.
- `half_day_on_late_by_duration_seconds` (integer, required, nullable) — Mark the day a half day when the first punch-in of the day is at least this late against the shift start. For example `7200` is 2 hours late.

### AttendanceModesSmartphone

Marking attendance from the SalaryBox app on their phone.

- `enabled` (boolean, required) — True when the person can punch from their phone. When nothing has been saved for this setting, it is true.
- `geofence` (boolean, required, nullable) — True when phone punches are only allowed inside the person's allowed location (geofence); false when turned off; `null` when it has never been set.
- `modes` (list of enum, required) — Extra checks required for a phone punch. Empty list when none are required. - `qr`: the person scans a QR code to punch. - `selfie`: the person takes a photo when punching. - `face_recognition`: the photo is also matched against their registered face. Shown when face match is turned on for the person.
  - Allowed values: `qr`, `selfie`, `face_recognition`

### AttendanceModesBiometric

Marking attendance on a biometric device.

- `enabled` (boolean, required) — True when biometric attendance is turned on for the person. False when it is off or was never set.

## Examples

**Response**

```json
{
  "message": "Success",
  "status": true,
  "data": [
    {
      "salarybox_id": "SBK7Q2M9TX",
      "employee_id": "EMP-0042",
      "name": "Aarav Sharma",
      "branches": [
        "Bengaluru HQ"
      ],
      "departments": [
        "Sales"
      ],
      "timezone": "Asia/Kolkata",
      "can_view_own_attendance": true,
      "attendance_modes": {
        "smartphone": {
          "enabled": true,
          "geofence": true,
          "modes": [
            "selfie",
            "face_recognition"
          ]
        },
        "biometric": {
          "enabled": false
        }
      },
      "automation_rules": {
        "auto_present": false,
        "present_on_punch_in": true,
        "present_on_duration_seconds": 28800,
        "half_day_on_duration_seconds": 14400,
        "half_day_on_late_by_duration_seconds": 7200
      }
    },
    {
      "salarybox_id": "SBR4T8W2PL",
      "employee_id": "EMP-0063",
      "name": "Rohan Verma",
      "branches": [
        "Pune Plant"
      ],
      "departments": [],
      "timezone": "Asia/Kolkata",
      "can_view_own_attendance": false,
      "attendance_modes": {
        "smartphone": {
          "enabled": true,
          "geofence": null,
          "modes": []
        },
        "biometric": {
          "enabled": true
        }
      },
      "automation_rules": {
        "auto_present": false,
        "present_on_punch_in": true,
        "present_on_duration_seconds": null,
        "half_day_on_duration_seconds": null,
        "half_day_on_late_by_duration_seconds": null
      }
    }
  ],
  "count": 2,
  "prev": null,
  "next": null
}
```

**SDK Code**

```python Example
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/attendance/employee-settings"

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

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

print(response.json())
```

```javascript Example
const url = 'https://api.salaryboxapp.com/v2/customer/v1/attendance/employee-settings';
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/employee-settings"

	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/employee-settings")

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/employee-settings")
  .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/employee-settings', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

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

```csharp Example
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/attendance/employee-settings");
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/employee-settings")! 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()
```