Update an approval section
Updates an existing approval section. The type field is required in the body and must match the section’s type. The organizationId path parameter supports both the Findity id and the partner-side externalId.
curl --request PUT \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "DEPARTMENT",
"active": true,
"sortOrder": 0,
"numberOfRequiredApprovals": 2,
"sendToUnauthorizedApprovers": false
}
'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}"
payload = {
"type": "DEPARTMENT",
"active": True,
"sortOrder": 0,
"numberOfRequiredApprovals": 2,
"sendToUnauthorizedApprovers": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'DEPARTMENT',
active: true,
sortOrder: 0,
numberOfRequiredApprovals: 2,
sendToUnauthorizedApprovers: false
})
};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'DEPARTMENT',
'active' => true,
'sortOrder' => 0,
'numberOfRequiredApprovals' => 2,
'sendToUnauthorizedApprovers' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}"
payload := strings.NewReader("{\n \"type\": \"DEPARTMENT\",\n \"active\": true,\n \"sortOrder\": 0,\n \"numberOfRequiredApprovals\": 2,\n \"sendToUnauthorizedApprovers\": false\n}")
req, _ := http.NewRequest("PUT", 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(string(body))
}HttpResponse<String> response = Unirest.put("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"DEPARTMENT\",\n \"active\": true,\n \"sortOrder\": 0,\n \"numberOfRequiredApprovals\": 2,\n \"sendToUnauthorizedApprovers\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"DEPARTMENT\",\n \"active\": true,\n \"sortOrder\": 0,\n \"numberOfRequiredApprovals\": 2,\n \"sendToUnauthorizedApprovers\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "abcdd5f401cf43549a688045b5ceef9b",
"active": true,
"type": "DEPARTMENT",
"numberOfRequiredApprovals": 2,
"sendToUnauthorizedApprovers": false,
"sortOrder": 0
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the organization. String in UUID without dashes (32-character hex string) if access is done via values from Findity system otherwise, id of external system can be used
UUID without dashes (32-character hex string)
^[0-9a-fA-F]{32}$Body
Request body for updating an existing approval section. Only the fields present in the body are updated.
Type of the approval section. Must match the existing section's type and is used to validate the request.
DEPARTMENT, DIMENSION Whether the section is active. When omitted the current value is preserved.
Zero-based position of the section within the organization's list of approval sections. Changing sortOrder reorders sibling sections accordingly. When omitted the current value is preserved.
x >= 0Whether expense reports should be sent to approvers who are not otherwise authorized on the section item. When omitted the current value is preserved.
Number of sequential approvals required for expense reports evaluated against this section. Must be at least 1 and cannot exceed the value set on the main approval setup. When null or omitted the current value is preserved.
1 <= x <= 3Response
Approval section successfully updated
A single approval section — either based on organizational units (DEPARTMENT) or on a custom dimension (DIMENSION).
Findity identifier of the approval section.
^[0-9a-fA-F]{32}$Whether the section is active for approval routing.
Type of the approval section. DEPARTMENT — based on organizational unit structure; DIMENSION — based on a custom expense dimension.
DEPARTMENT, DIMENSION Zero-based position of the section within the organization's list of approval sections.
x >= 0Number of sequential approvals required for expense reports evaluated against this section.
1 <= x <= 3Whether expense reports are sent to approvers who are not otherwise authorized on the section item.
Custom dimension the section is bound to. Present only when type is DIMENSION.
curl --request PUT \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "DEPARTMENT",
"active": true,
"sortOrder": 0,
"numberOfRequiredApprovals": 2,
"sendToUnauthorizedApprovers": false
}
'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}"
payload = {
"type": "DEPARTMENT",
"active": True,
"sortOrder": 0,
"numberOfRequiredApprovals": 2,
"sendToUnauthorizedApprovers": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'DEPARTMENT',
active: true,
sortOrder: 0,
numberOfRequiredApprovals: 2,
sendToUnauthorizedApprovers: false
})
};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'DEPARTMENT',
'active' => true,
'sortOrder' => 0,
'numberOfRequiredApprovals' => 2,
'sendToUnauthorizedApprovers' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}"
payload := strings.NewReader("{\n \"type\": \"DEPARTMENT\",\n \"active\": true,\n \"sortOrder\": 0,\n \"numberOfRequiredApprovals\": 2,\n \"sendToUnauthorizedApprovers\": false\n}")
req, _ := http.NewRequest("PUT", 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(string(body))
}HttpResponse<String> response = Unirest.put("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"DEPARTMENT\",\n \"active\": true,\n \"sortOrder\": 0,\n \"numberOfRequiredApprovals\": 2,\n \"sendToUnauthorizedApprovers\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/sections/{sectionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"DEPARTMENT\",\n \"active\": true,\n \"sortOrder\": 0,\n \"numberOfRequiredApprovals\": 2,\n \"sendToUnauthorizedApprovers\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "abcdd5f401cf43549a688045b5ceef9b",
"active": true,
"type": "DEPARTMENT",
"numberOfRequiredApprovals": 2,
"sendToUnauthorizedApprovers": false,
"sortOrder": 0
}
