Update main approval setup
Updates the main approval setup for an organization. The approval workflow must already be active (created via POST) before it can be updated. The approvalId path parameter must match the id of the existing approval setup for the organization. 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/{approvalId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"numberOfRequiredApprovals": 1,
"defaultApprover": {
"id": "ff8080819e01726d019e0172af210527"
}
}
'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/{approvalId}"
payload = {
"numberOfRequiredApprovals": 1,
"defaultApprover": { "id": "ff8080819e01726d019e0172af210527" }
}
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({
numberOfRequiredApprovals: 1,
defaultApprover: {id: 'ff8080819e01726d019e0172af210527'}
})
};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/{approvalId}', 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/{approvalId}",
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([
'numberOfRequiredApprovals' => 1,
'defaultApprover' => [
'id' => 'ff8080819e01726d019e0172af210527'
]
]),
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/{approvalId}"
payload := strings.NewReader("{\n \"numberOfRequiredApprovals\": 1,\n \"defaultApprover\": {\n \"id\": \"ff8080819e01726d019e0172af210527\"\n }\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/{approvalId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"numberOfRequiredApprovals\": 1,\n \"defaultApprover\": {\n \"id\": \"ff8080819e01726d019e0172af210527\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/{approvalId}")
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 \"numberOfRequiredApprovals\": 1,\n \"defaultApprover\": {\n \"id\": \"ff8080819e01726d019e0172af210527\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "ff8080819e01726d019e0172adb90350",
"numberOfRequiredApprovals": 3,
"requiresApproval": true,
"defaultApprover": {
"firstName": "firstName",
"lastName": "lastName",
"id": "ff8080819e01726d019e0172af210527",
"email": "firstName.lastName@test.com",
"externalId": "personIdFromExternalSystem"
}
}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
Number of sequential approvals an expense report must receive before it can be submitted. Only applicable when requiresApproval is true. Must be between 1 and 3.
1 <= x <= 3The person designated as the default approver when no other approver is assigned to a submitter. Required when requiresApproval is true. Identify the person by providing either their Findity id or their externalId. In case that id is provided, externalId will be disregarded.
Hide child attributes
Hide child attributes
Findity unique identifier of the person to set as default approver. Provide either id or externalId — id takes precedence if both are given.
^[0-9a-fA-F]{32}$External system identifier of the person to set as default approver. Used when the caller identifies persons by their external system id. Ignored if id is also provided.
255Response
Approval setup successfully updated
UUID without dashes (32-character hex string)
^[0-9a-fA-F]{32}$Indicates whether the organization requires approval for expense reports. true = approval is required; false = no approval is required.
Number of sequential approvals an expense report must receive before it can proceed. Optional; only applicable when requiresApproval is true.
1 <= x <= 3One person has to be set as default approver. Required only when requiresApproval is true.
Hide child attributes
Hide child attributes
UUID without dashes (32-character hex string)
^[0-9a-fA-F]{32}$First name of person who has been set as default approver
255Last name of person who has been set as default approver
255e-mail of person who has been set as default approver
255id from external systemdefined for this person
255curl --request PUT \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/{approvalId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"numberOfRequiredApprovals": 1,
"defaultApprover": {
"id": "ff8080819e01726d019e0172af210527"
}
}
'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/{approvalId}"
payload = {
"numberOfRequiredApprovals": 1,
"defaultApprover": { "id": "ff8080819e01726d019e0172af210527" }
}
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({
numberOfRequiredApprovals: 1,
defaultApprover: {id: 'ff8080819e01726d019e0172af210527'}
})
};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/{approvalId}', 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/{approvalId}",
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([
'numberOfRequiredApprovals' => 1,
'defaultApprover' => [
'id' => 'ff8080819e01726d019e0172af210527'
]
]),
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/{approvalId}"
payload := strings.NewReader("{\n \"numberOfRequiredApprovals\": 1,\n \"defaultApprover\": {\n \"id\": \"ff8080819e01726d019e0172af210527\"\n }\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/{approvalId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"numberOfRequiredApprovals\": 1,\n \"defaultApprover\": {\n \"id\": \"ff8080819e01726d019e0172af210527\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/approval/{approvalId}")
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 \"numberOfRequiredApprovals\": 1,\n \"defaultApprover\": {\n \"id\": \"ff8080819e01726d019e0172af210527\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "ff8080819e01726d019e0172adb90350",
"numberOfRequiredApprovals": 3,
"requiresApproval": true,
"defaultApprover": {
"firstName": "firstName",
"lastName": "lastName",
"id": "ff8080819e01726d019e0172af210527",
"email": "firstName.lastName@test.com",
"externalId": "personIdFromExternalSystem"
}
}
