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

# Approve or Reject New Joinee

PUT https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision
Content-Type: application/json

Approves or rejects a pending join request. Approving adds the person as staff, as approving in the app does, so it counts towards your plan's staff limit. Shared rules: see [Writing data](/conventions#writing-data).
- The request is named by the joinee's `name`, as List New Joinee Requests shows it (matched ignoring case). When two pending requests share the name, the response is `400` on `name`; send the joinee's full `phone_number` (and `dial_code` when it isn't 91) to pick one.
- `action` is `APPROVE` or `REJECT`. `reason` is optional with `REJECT`, at max 500 characters.
- Approving uses the joinee's name and phone and the email, date of birth and address they entered. You can also send the fields Add Staff takes to set up the new staff member, for example `branch_names` (default: the main branch), `department_names`, `job_title`, `joining_date`, `employee_type`, `employee_id` or `email`. They are refused with `REJECT`. Add Staff's checks apply: staff limit, phone number, Employee ID.
- The joinee is notified either way. No pending request with that name: `404` "New joinee request not found."
- Repeating the request after it succeeded returns `404`, which is harmless.


Reference: https://docs.salarybox.in/api-reference/staff/requests-new-joinees-decision-update

## Authentication

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

## Request

### Body (application/json)

This endpoint expects a NewJoineeDecisionRequest.

- `name` (string, required) — The joinee's name as List New Joinee Requests shows it, matched ignoring case.
- `action` (enum, required)
  - Allowed values: `APPROVE`, `REJECT`
- `phone_number` (string, optional) — The joinee's full phone number, only to pick between pending requests with the same name.
- `dial_code` (string, optional) — With `phone_number`, when it isn't `91`.
- `reason` (string, optional) — `REJECT` only.
- `branch_names` (list of string, optional) — `APPROVE` only. Exact branch names; default the main branch.
- `department_names` (list of string, optional) — `APPROVE` only. Exact department names.
- `job_title` (string, optional) — `APPROVE` only.
- `joining_date` (date, optional) — `APPROVE` only. `YYYY-MM-DD`.

## Response

### 200

The decision was saved. When approved, `salarybox_id` is the new staff member's.

- `message` (string, required)
- `status` (boolean, required)
- `data` (NewJoineeDecisionResponseData, required)

## Errors

### 400 Bad Request Error

Validation failed, two pending requests share the name, or adding the staff member failed a check.

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

### 403 Forbidden Error

The requester is not an Admin.

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

### 404 Not Found Error

No pending join request has that name.

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

## Types

### NewJoineeDecisionResponseData

- `name` (string, required)
- `status` (enum, required)
  - Allowed values: `approved`, `declined`
- `salarybox_id` (string, optional) — The new staff member's SalaryBox ID. Only when approved.

## Examples

### Approved

**Response**

```json
{
  "message": "New joinee decision saved successfully",
  "status": true,
  "data": {
    "name": "Ravi Kumar",
    "status": "approved",
    "salarybox_id": "SBK7Q2M9TX"
  }
}
```

**SDK Code**

```python Approved
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision"

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

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

print(response.json())
```

```javascript Approved
const url = 'https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision';
const options = {method: 'PUT', 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 Approved
package main

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

func main() {

	url := "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision"

	req, _ := http.NewRequest("PUT", 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 Approved
require 'uri'
require 'net/http'

url = URI("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")

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

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

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

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

HttpResponse<String> response = Unirest.put("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")
  .header("Authorization", "Api-Key  <apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

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

```csharp Approved
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Approved
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Declined

**Response**

```json
{
  "message": "New joinee decision saved successfully",
  "status": true,
  "data": {
    "name": "Priya Shah",
    "status": "declined"
  }
}
```

**SDK Code**

```python Declined
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision"

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

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

print(response.json())
```

```javascript Declined
const url = 'https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision';
const options = {method: 'PUT', 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 Declined
package main

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

func main() {

	url := "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision"

	req, _ := http.NewRequest("PUT", 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 Declined
require 'uri'
require 'net/http'

url = URI("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")

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

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

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

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

HttpResponse<String> response = Unirest.put("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")
  .header("Authorization", "Api-Key  <apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

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

```csharp Declined
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Declined
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Approve

**Request**

```json
{
  "name": "Ravi Kumar",
  "action": "APPROVE",
  "branch_names": [
    "Pune"
  ],
  "job_title": "Sales Executive"
}
```

**Response**

```json
{
  "message": "New joinee decision saved successfully",
  "status": true,
  "data": {
    "name": "Ravi Kumar",
    "status": "approved",
    "salarybox_id": "SBK7Q2M9TX"
  }
}
```

**SDK Code**

```python Approve
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision"

payload = {
    "name": "Ravi Kumar",
    "action": "APPROVE",
    "branch_names": ["Pune"],
    "job_title": "Sales Executive"
}
headers = {
    "Authorization": "Api-Key  <apiKey>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Approve
const url = 'https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Ravi Kumar","action":"APPROVE","branch_names":["Pune"],"job_title":"Sales Executive"}'
};

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

```go Approve
package main

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

func main() {

	url := "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision"

	payload := strings.NewReader("{\n  \"name\": \"Ravi Kumar\",\n  \"action\": \"APPROVE\",\n  \"branch_names\": [\n    \"Pune\"\n  ],\n  \"job_title\": \"Sales Executive\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Api-Key  <apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Ravi Kumar\",\n  \"action\": \"APPROVE\",\n  \"branch_names\": [\n    \"Pune\"\n  ],\n  \"job_title\": \"Sales Executive\"\n}"

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

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

HttpResponse<String> response = Unirest.put("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Ravi Kumar\",\n  \"action\": \"APPROVE\",\n  \"branch_names\": [\n    \"Pune\"\n  ],\n  \"job_title\": \"Sales Executive\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision', [
  'body' => '{
  "name": "Ravi Kumar",
  "action": "APPROVE",
  "branch_names": [
    "Pune"
  ],
  "job_title": "Sales Executive"
}',
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Approve
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Ravi Kumar\",\n  \"action\": \"APPROVE\",\n  \"branch_names\": [\n    \"Pune\"\n  ],\n  \"job_title\": \"Sales Executive\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Approve
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Ravi Kumar",
  "action": "APPROVE",
  "branch_names": ["Pune"],
  "job_title": "Sales Executive"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### Reject

**Request**

```json
{
  "name": "Priya Shah",
  "action": "REJECT",
  "reason": "Position already filled"
}
```

**Response**

```json
{
  "message": "New joinee decision saved successfully",
  "status": true,
  "data": {
    "name": "Ravi Kumar",
    "status": "approved",
    "salarybox_id": "SBK7Q2M9TX"
  }
}
```

**SDK Code**

```python Reject
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision"

payload = {
    "name": "Priya Shah",
    "action": "REJECT",
    "reason": "Position already filled"
}
headers = {
    "Authorization": "Api-Key  <apiKey>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Reject
const url = 'https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Priya Shah","action":"REJECT","reason":"Position already filled"}'
};

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

```go Reject
package main

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

func main() {

	url := "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision"

	payload := strings.NewReader("{\n  \"name\": \"Priya Shah\",\n  \"action\": \"REJECT\",\n  \"reason\": \"Position already filled\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Api-Key  <apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Priya Shah\",\n  \"action\": \"REJECT\",\n  \"reason\": \"Position already filled\"\n}"

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

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

HttpResponse<String> response = Unirest.put("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Priya Shah\",\n  \"action\": \"REJECT\",\n  \"reason\": \"Position already filled\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision', [
  'body' => '{
  "name": "Priya Shah",
  "action": "REJECT",
  "reason": "Position already filled"
}',
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Reject
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Priya Shah\",\n  \"action\": \"REJECT\",\n  \"reason\": \"Position already filled\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Reject
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Priya Shah",
  "action": "REJECT",
  "reason": "Position already filled"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/requests/new-joinees/decision")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```