> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mercoa.com/embedded-ap-ar/api-reference/entity/approval-policy/history/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mercoa.com/_mcp/server. # Get History GET https://api.mercoa.com/entity/{entityId}/approval-policies/history Retrieve the history of approval policy changes for an entity Reference: https://docs.mercoa.com/embedded-ap-ar/api-reference/entity/approval-policy/history ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `entityId` (string, required) — Entity ID or Entity ForeignID ## Response ### 200 - `list of object` - `id` (string, required) — The ID of the approval policy history - `policies` (list of object, required) - `id` (string, required) - `trigger` (list of object, required) - `type`: `amount` - `amount` (double, required) - `currency` (enum, required) - Allowed values: `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYN`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `COP`, `COU`, `CRC`, `CUC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRU`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `CNY`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLE`, `SLL`, `SOS`, `SRD`, `SSP`, `STN`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `UYI`, `UYU`, `UYW`, `UZS`, `VED`, `VES`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XSU`, `XTS`, `XUA`, `XXX`, `YER`, `ZAR`, `ZMW`, `ZWL` - `comparison` (enum, optional) — The comparison operator to use when comparing the amount to the trigger amount. Defaults to gte. - Allowed values: `eq`, `gt`, `gte`, `lt`, `lte` - `type`: `vendor` - `vendorIds` (list of string, required) - `type`: `metadata` - `key` (string, required) — The metadata key to match - `value` (list of string, required) — The metadata value the invoice must have to trigger this policy - `type`: `catchall` - `rule` (object, required) - `type`: `approver` - `identifierList` (object, required) — List of users or roles that should be used to determine eligible approvers - `type`: `rolesList` - `value` (list of string, required) - `type`: `userList` - `value` (list of string, required) - `numApprovers` (integer, required) — Number of approvals required to approve an invoice - `autoAssign` (boolean, optional) — If true, the policy will automatically assign approvers to the invoice. If more than one approver is eligible, the policy will assign all eligible approvers to the invoice. - `type`: `automatic` - `upstreamPolicyId` (string, required) - `createdAt` (datetime, required) - `updatedAt` (datetime, required) - `userId` (string, required) — The user ID of the user who edited the approval policy - `createdAt` (datetime, required) ## Errors ### 400 Bad Request - `errorName` ("BadRequest", required) - `content` (string, required) ### 401 Unauthorized - `errorName` ("Unauthorized", required) - `content` (string, required) ### 403 Forbidden - `errorName` ("Forbidden", required) - `content` (string, required) ### 404 Not Found - `errorName` ("NotFound", required) - `content` (string, required) ### 409 Conflict - `errorName` ("Conflict", required) - `content` (string, required) ### 500 Internal Server Error - `errorName` ("InternalServerError", required) - `content` (string, required) ### 501 Unimplemented - `errorName` ("Unimplemented", required) - `content` (string, required) ## Examples **Response** ```json [ { "id": "id", "policies": [ { "id": "id", "trigger": [ { "type": "amount", "amount": 1.1, "currency": "AED", "comparison": "eq" }, { "type": "amount", "amount": 1.1, "currency": "AED", "comparison": "eq" } ], "rule": { "type": "approver", "identifierList": { "type": "rolesList", "value": [ "identifierList", "identifierList" ] }, "numApprovers": 1, "autoAssign": true }, "upstreamPolicyId": "upstreamPolicyId", "createdAt": "2024-01-15T09:30:00Z", "updatedAt": "2024-01-15T09:30:00Z" }, { "id": "id", "trigger": [ { "type": "amount", "amount": 1.1, "currency": "AED", "comparison": "eq" }, { "type": "amount", "amount": 1.1, "currency": "AED", "comparison": "eq" } ], "rule": { "type": "approver", "identifierList": { "type": "rolesList", "value": [ "identifierList", "identifierList" ] }, "numApprovers": 1, "autoAssign": true }, "upstreamPolicyId": "upstreamPolicyId", "createdAt": "2024-01-15T09:30:00Z", "updatedAt": "2024-01-15T09:30:00Z" } ], "userId": "userId", "createdAt": "2024-01-15T09:30:00Z" }, { "id": "id", "policies": [ { "id": "id", "trigger": [ { "type": "amount", "amount": 1.1, "currency": "AED", "comparison": "eq" }, { "type": "amount", "amount": 1.1, "currency": "AED", "comparison": "eq" } ], "rule": { "type": "approver", "identifierList": { "type": "rolesList", "value": [ "identifierList", "identifierList" ] }, "numApprovers": 1, "autoAssign": true }, "upstreamPolicyId": "upstreamPolicyId", "createdAt": "2024-01-15T09:30:00Z", "updatedAt": "2024-01-15T09:30:00Z" }, { "id": "id", "trigger": [ { "type": "amount", "amount": 1.1, "currency": "AED", "comparison": "eq" }, { "type": "amount", "amount": 1.1, "currency": "AED", "comparison": "eq" } ], "rule": { "type": "approver", "identifierList": { "type": "rolesList", "value": [ "identifierList", "identifierList" ] }, "numApprovers": 1, "autoAssign": true }, "upstreamPolicyId": "upstreamPolicyId", "createdAt": "2024-01-15T09:30:00Z", "updatedAt": "2024-01-15T09:30:00Z" } ], "userId": "userId", "createdAt": "2024-01-15T09:30:00Z" } ] ``` **SDK Code** ```python import requests url = "https://api.mercoa.com/entity/entityId/approval-policies/history" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript import { MercoaClient } from "@mercoa/javascript"; const client = new MercoaClient({ token: "YOUR_TOKEN" }); await client.entity.approvalPolicy.history("entityId"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.mercoa.com/entity/entityId/approval-policies/history" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.mercoa.com/entity/entityId/approval-policies/history") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.mercoa.com/entity/entityId/approval-policies/history") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.mercoa.com/entity/entityId/approval-policies/history', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.mercoa.com/entity/entityId/approval-policies/history"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.mercoa.com/entity/entityId/approval-policies/history")! 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() ```