> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.biposervice.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.biposervice.com/_mcp/server.

# User Role Access - UPSERT

POST https://server.bipocloud.com/tenant/intapi/Interface/Import#postIntapiInterfaceImport96
Content-Type: application/json

This API is used to set the access of a user role for a System in BIPO.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| InterfaceCode | String | Yes | `BIPO-URA` |
| UserRoleCode | String | Yes | User Role Code. Must already exist in BIPO. |
| System | String | Yes | System the access applies to: `Personnel`, `Payroll`, `Leave`, `Attendance`, `Claim`, `Appraisal`, `LifeCycle`, `EForm`, `Interface`, `AI` or `Casual`. |
| ReadAccess | String | No | Read access condition, in BIPO's data access condition format. Replaces the saved value. |
| WriteAccess | String | No | Write access condition, in BIPO's data access condition format. Replaces the saved value. |
| LockAccess | String | No | Replaces the saved value. |
| DisableTemplate | Number | No | `1` or `0`. Replaces the saved value. |
| DisableQuery | Number | No | `1` or `0`. Replaces the saved value. |
| AllowLargeDataDownload | Number | No | `1` or `0`. Replaces the saved value. |
| ModifyBankDetail | String | No | Replaces the saved value. |
| AppendEmployeeAccess | String | No | Employee access codes, separated by commas. Added to the saved list. |
| LeaveCodeAccess | String | No | Leave Codes, separated by commas. Added to the saved list. |
| ClaimCodeAccess | String | No | Claim Codes, separated by commas. Added to the saved list. |
| PayGroupAccess | String | No | Pay Groups, separated by commas. Added to the saved list. |
| AppendPTTypes | String | No | Codes separated by commas. Added to the saved list. |
| ShowCompleteStatus | String | No | Codes separated by commas. Added to the saved list. |
| EFormCodes | String | No | eForm Codes, separated by commas. Added to the saved list. |

Note: `UserRoleCode` and `System` together identify the record. A new pair adds a row; an existing pair updates it.

Note: For the fields marked "Added to the saved list", this API only adds codes. It cannot remove codes that are already saved. Sending `*` means all.

Note: There is no DELETE for role access. Deleting the User Role removes its access.

Note: A role created for a Menu Access that includes Payroll already has a default Payroll access row, so an Import for `Payroll` updates that row.

Note: This API is for the Butter application integration only. A Butter licence is required.

Reference: https://developer.biposervice.com/bipo-portal/hrms-v-2/system-misc-integration/security/user-access-provision/user-role-access-upsert

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects a string.

- `string`

## Response

### 200

OK

- `data` (IntapiInterfaceImportPostIntapiInterfaceImport96PostResponsesContentApplicationJsonSchemaData, required)
- `errors` (list of any, required)
- `messages` (list of string, required)
- `errorCode` (any, optional)

## Types

### IntapiInterfaceImportPostIntapiInterfaceImport96PostResponsesContentApplicationJsonSchemaData

- `key` (string, required)
- `validRecords` (list of IntapiInterfaceImportPostIntapiInterfaceImport96PostResponsesContentApplicationJsonSchemaDataValidRecordsItems, required)
- `invalidRecords` (list of any, required)

### IntapiInterfaceImportPostIntapiInterfaceImport96PostResponsesContentApplicationJsonSchemaDataValidRecordsItems

- `key` (string, required)
- `message` (string, required)

## Examples

**Request**

```json
"{\n  \"InterfaceCode\": \"BIPO-URA\",\n  \"Data\": [\n    {\n      //User Role Code + System together are the key\n      \"UserRoleCode\": \"SAMPLE_ROLE\",\n      \"System\": \"Personnel\",\n      //Code list: codes sent are added to the saved list, never removed\n      \"AppendEmployeeAccess\": \"PRJ-001\",\n      //1 or 0: replaces the saved value\n      \"DisableQuery\": 0\n    }\n  ]\n}"
```

**Response**

```json
{
  "data": {
    "key": "UserRoleCode;System",
    "validRecords": [
      {
        "key": "SAMPLE_ROLE;Personnel",
        "message": "Added"
      }
    ],
    "invalidRecords": []
  },
  "errors": [],
  "messages": [
    "1 record(s) imported."
  ]
}
```

**SDK Code**

```python Success - access added
import requests

url = "https://server.bipocloud.com/tenant/intapi/Interface/Import#postIntapiInterfaceImport96"

payload = "{
  \"InterfaceCode\": \"BIPO-URA\",
  \"Data\": [
    {
      //User Role Code + System together are the key
      \"UserRoleCode\": \"SAMPLE_ROLE\",
      \"System\": \"Personnel\",
      //Code list: codes sent are added to the saved list, never removed
      \"AppendEmployeeAccess\": \"PRJ-001\",
      //1 or 0: replaces the saved value
      \"DisableQuery\": 0
    }
  ]
}"
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Success - access added
const url = 'https://server.bipocloud.com/tenant/intapi/Interface/Import#postIntapiInterfaceImport96';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '"{\n  \"InterfaceCode\": \"BIPO-URA\",\n  \"Data\": [\n    {\n      //User Role Code + System together are the key\n      \"UserRoleCode\": \"SAMPLE_ROLE\",\n      \"System\": \"Personnel\",\n      //Code list: codes sent are added to the saved list, never removed\n      \"AppendEmployeeAccess\": \"PRJ-001\",\n      //1 or 0: replaces the saved value\n      \"DisableQuery\": 0\n    }\n  ]\n}"'
};

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

```go Success - access added
package main

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

func main() {

	url := "https://server.bipocloud.com/tenant/intapi/Interface/Import#postIntapiInterfaceImport96"

	payload := strings.NewReader("\"{\\n  \\\"InterfaceCode\\\": \\\"BIPO-URA\\\",\\n  \\\"Data\\\": [\\n    {\\n      //User Role Code + System together are the key\\n      \\\"UserRoleCode\\\": \\\"SAMPLE_ROLE\\\",\\n      \\\"System\\\": \\\"Personnel\\\",\\n      //Code list: codes sent are added to the saved list, never removed\\n      \\\"AppendEmployeeAccess\\\": \\\"PRJ-001\\\",\\n      //1 or 0: replaces the saved value\\n      \\\"DisableQuery\\\": 0\\n    }\\n  ]\\n}\"")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 Success - access added
require 'uri'
require 'net/http'

url = URI("https://server.bipocloud.com/tenant/intapi/Interface/Import#postIntapiInterfaceImport96")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "\"{\\n  \\\"InterfaceCode\\\": \\\"BIPO-URA\\\",\\n  \\\"Data\\\": [\\n    {\\n      //User Role Code + System together are the key\\n      \\\"UserRoleCode\\\": \\\"SAMPLE_ROLE\\\",\\n      \\\"System\\\": \\\"Personnel\\\",\\n      //Code list: codes sent are added to the saved list, never removed\\n      \\\"AppendEmployeeAccess\\\": \\\"PRJ-001\\\",\\n      //1 or 0: replaces the saved value\\n      \\\"DisableQuery\\\": 0\\n    }\\n  ]\\n}\""

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

```java Success - access added
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://server.bipocloud.com/tenant/intapi/Interface/Import#postIntapiInterfaceImport96")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("\"{\\n  \\\"InterfaceCode\\\": \\\"BIPO-URA\\\",\\n  \\\"Data\\\": [\\n    {\\n      //User Role Code + System together are the key\\n      \\\"UserRoleCode\\\": \\\"SAMPLE_ROLE\\\",\\n      \\\"System\\\": \\\"Personnel\\\",\\n      //Code list: codes sent are added to the saved list, never removed\\n      \\\"AppendEmployeeAccess\\\": \\\"PRJ-001\\\",\\n      //1 or 0: replaces the saved value\\n      \\\"DisableQuery\\\": 0\\n    }\\n  ]\\n}\"")
  .asString();
```

```php Success - access added
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://server.bipocloud.com/tenant/intapi/Interface/Import#postIntapiInterfaceImport96', [
  'body' => '"{\\n  \\"InterfaceCode\\": \\"BIPO-URA\\",\\n  \\"Data\\": [\\n    {\\n      //User Role Code + System together are the key\\n      \\"UserRoleCode\\": \\"SAMPLE_ROLE\\",\\n      \\"System\\": \\"Personnel\\",\\n      //Code list: codes sent are added to the saved list, never removed\\n      \\"AppendEmployeeAccess\\": \\"PRJ-001\\",\\n      //1 or 0: replaces the saved value\\n      \\"DisableQuery\\": 0\\n    }\\n  ]\\n}"',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Success - access added
using RestSharp;

var client = new RestClient("https://server.bipocloud.com/tenant/intapi/Interface/Import#postIntapiInterfaceImport96");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "\"{\\n  \\\"InterfaceCode\\\": \\\"BIPO-URA\\\",\\n  \\\"Data\\\": [\\n    {\\n      //User Role Code + System together are the key\\n      \\\"UserRoleCode\\\": \\\"SAMPLE_ROLE\\\",\\n      \\\"System\\\": \\\"Personnel\\\",\\n      //Code list: codes sent are added to the saved list, never removed\\n      \\\"AppendEmployeeAccess\\\": \\\"PRJ-001\\\",\\n      //1 or 0: replaces the saved value\\n      \\\"DisableQuery\\\": 0\\n    }\\n  ]\\n}\"", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Success - access added
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = "{
  \"InterfaceCode\": \"BIPO-URA\",
  \"Data\": [
    {
      //User Role Code + System together are the key
      \"UserRoleCode\": \"SAMPLE_ROLE\",
      \"System\": \"Personnel\",
      //Code list: codes sent are added to the saved list, never removed
      \"AppendEmployeeAccess\": \"PRJ-001\",
      //1 or 0: replaces the saved value
      \"DisableQuery\": 0
    }
  ]
}" as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://server.bipocloud.com/tenant/intapi/Interface/Import#postIntapiInterfaceImport96")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```