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

GET https://api.salaryboxapp.com/v2/customer/v1/staff/inactive

Returns staff who have been marked inactive (for example because they left), with their leaving date (`date_of_leaving`) and when their account was deactivated (`deactivated_on`). Includes staff deactivated by an admin and those deactivated automatically by SalaryBox, for example when the plan's staff limit was reduced. A person made active again moves back to List Staff.

Ordered by `deactivated_on`, newest first; rows with no `deactivated_on` come last. There is no date filter: page through and stop once `deactivated_on` is older than the period you need.

Takes the same filters as List Staff. Returns a shorter profile than Get Staff Member (no addresses).


Reference: https://docs.salarybox.in/api-reference/staff/inactive-retrieve

## Authentication

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

## Request

### Query parameters

- `salarybox_id` (string, optional) — Return only the staff member with this SalaryBox ID.
- `employee_id` (string, optional) — Return only staff with exactly this company employee ID (case-sensitive).
- `name` (string, optional) — Free-text search over name, phone number and employee ID, ignoring case. For example `kumar` matches "Ravi Kumar".
- `branches` (list of integer, optional) — Repeatable. Branch ID from List Branches, for example `branches=101&branches=104`.
- `departments` (list of integer, optional) — Repeatable. Department ID from List Departments, for example `departments=7&departments=9`.
- `job_title` (string, optional) — Return only staff with exactly this job title (case-sensitive).
- `phone_number` (string, optional) — Return staff whose full phone number contains these digits. Leave out the country code.
- `page` (integer, optional) — Page number, starting at 1.
- `page_size` (integer, optional) — Results per page. Default 25, maximum 500.

## Response

### 200

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

## Errors

### 400 Bad Request Error

A filter value is not valid, for example a non-numeric or comma-separated branch or department ID.

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

## Types

### InactiveEmployee

- `salarybox_id` (string, required) — The staff member's SalaryBox ID, the unique key for a person across this API. Never changes.
- `employee_id` (string, required, nullable) — The company's own employee ID or code for this person, as entered on their profile. `null` or an empty string when not set. Not guaranteed to be unique.
- `name` (string, required) — Full name as entered on the staff profile.
- `branches` (list of string, required) — Names of the branches the person was assigned to (inactive staff keep their assignments). Deleted branches are left out. Empty list when there are none.
- `departments` (list of string, required) — Names of the departments the person was assigned to. Deleted departments are left out. Empty list when there are none.
- `job_title` (string, required, nullable) — Job title (designation) from the profile. Empty string when not set.
- `phone_number` (string, required, nullable) — Mobile number without the country code. Masked. Every digit except the last 4 is replaced by `X` (for example `XXXXXX9999`). The full number is visible only in the SalaryBox app.
- `dial_code` (string, required, nullable) — Country calling code for `phone_number`, without the `+` (for example `"91"` for India). `null` when not set.
- `email` (string, required, nullable) — Email address from the profile. Masked. The part before `@` keeps only its first and last character and everything between becomes `X` (for example `rXXXXXXXXr@example.com`); a 2-character local part shows its first character plus `X`; the `@domain` is shown in full. The full address is visible only in the SalaryBox app. Empty string when not set.
- `employee_type` (string, required, nullable) — Employment type from the profile, one of `Full Time`, `Permanent`, `Part Time`, `Consultant`, `Temporary`, `Probation`, `Intern`, `Contract`. `null` when not set.
- `joining_date` (date, required, nullable) — Date the person joined your company, as entered on the profile (`YYYY-MM-DD`). `null` when not set.
- `date_of_leaving` (date, required, nullable) — The leaving date (last working day) entered on the staff profile (`YYYY-MM-DD`). `null` when it was not entered. It is set by a person and can differ from `deactivated_on`: for example an admin may deactivate someone days after their last working day, or enter a leaving date in the future.
- `deactivated_on` (datetime, required, nullable) — The moment the account was last marked inactive, recorded automatically by SalaryBox. ISO 8601 date-time in UTC (ends in `Z`) and may include fractional seconds, for example `2026-10-01T05:42:17.381204Z`. Convert to your company's time zone (see Get Company Profile `time_zone`) before using it as a date. `null` when no time was recorded, which can happen for older records.

## Examples

**Response**

```json
{
  "message": "Success",
  "status": true,
  "data": [
    {
      "salarybox_id": "SBM3X9K2QD",
      "employee_id": "EMP-0031",
      "name": "Ravi Kumar",
      "branches": [
        "Bengaluru HQ"
      ],
      "departments": [
        "Sales"
      ],
      "job_title": "Sales Executive",
      "phone_number": "XXXXXX3210",
      "dial_code": "91",
      "email": "rXXXXXXXXr@example.com",
      "employee_type": "Full Time",
      "joining_date": "2023-04-01",
      "date_of_leaving": "2026-09-30",
      "deactivated_on": "2026-10-01T05:42:17.381204Z"
    },
    {
      "salarybox_id": "SBP8D4N6WE",
      "employee_id": "EMP-0019",
      "name": "Sneha Patil",
      "branches": [
        "Pune Plant"
      ],
      "departments": [],
      "job_title": "Quality Inspector",
      "phone_number": "XXXXXX4455",
      "dial_code": "91",
      "email": "",
      "employee_type": "Contract",
      "joining_date": "2021-11-15",
      "date_of_leaving": null,
      "deactivated_on": "2026-08-14T10:05:00Z"
    }
  ],
  "count": 2,
  "next": null,
  "prev": null
}
```

**SDK Code**

```python Example
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/staff/inactive"

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/staff/inactive';
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/staff/inactive"

	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/staff/inactive")

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

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

```csharp Example
using RestSharp;

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