E-Signatures
Set Agreement Policy
Switch loan agreements off, to optional or to required on a market
PUT
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
agreement-policy
Set Agreement Policy
curl --request PUT \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"mode": "<string>",
"validityDays": 123,
"autoIssue": true,
"autoIssueMaxAmount": "<string>",
"frameworkValidityDays": 123,
"requestAccess": "<string>",
"signerAddress": "<string>"
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy"
payload = {
"mode": "<string>",
"validityDays": 123,
"autoIssue": True,
"autoIssueMaxAmount": "<string>",
"frameworkValidityDays": 123,
"requestAccess": "<string>",
"signerAddress": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mode: '<string>',
validityDays: 123,
autoIssue: true,
autoIssueMaxAmount: '<string>',
frameworkValidityDays: 123,
requestAccess: '<string>',
signerAddress: '<string>'
})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy', 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://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy",
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([
'mode' => '<string>',
'validityDays' => 123,
'autoIssue' => true,
'autoIssueMaxAmount' => '<string>',
'frameworkValidityDays' => 123,
'requestAccess' => '<string>',
'signerAddress' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"validityDays\": 123,\n \"autoIssue\": true,\n \"autoIssueMaxAmount\": \"<string>\",\n \"frameworkValidityDays\": 123,\n \"requestAccess\": \"<string>\",\n \"signerAddress\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"validityDays\": 123,\n \"autoIssue\": true,\n \"autoIssueMaxAmount\": \"<string>\",\n \"frameworkValidityDays\": 123,\n \"requestAccess\": \"<string>\",\n \"signerAddress\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"<string>\",\n \"validityDays\": 123,\n \"autoIssue\": true,\n \"autoIssueMaxAmount\": \"<string>\",\n \"frameworkValidityDays\": 123,\n \"requestAccess\": \"<string>\",\n \"signerAddress\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"policy": {
"mode": "OPTIONAL",
"validityDays": 14,
"autoIssue": true,
"autoIssueMaxAmount": "50000",
"frameworkValidityDays": 365,
"requestAccess": "ANY",
"source": "MANUAL",
"standingPolicyId": null,
"setByWallet": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"setByThisInstance": true,
"updatedAt": "2026-11-21T15:41:10.402Z",
"enforcement": "BACKEND_CHECK",
"notice": null,
"viewer": {
"isBank": true,
"canConfigure": true,
"planAllows": true
}
},
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
Sets the market’s loan agreement policy. A setting made here always wins: it replaces a policy that came from a standing policy, and no standing policy overwrites it later. Fields you leave out keep their current value.
Switching to
OPTIONAL or REQUIRED needs the Scale plan on the bank’s instance. Switching to OFF is always allowed. Agreements already issued stay as they are; OFF only stops the gate and the binding.
Who can set it
The bank: an API key of an instance with a verified wallet that holdsDEFAULT_ADMIN_ROLE on the market.
Path Parameters
Body Parameters
Issue a borrower’s request at once when its figures are inside the market rules. Default
false.With
autoIssue on, the largest borrow amount issued at once, as a decimal of the borrow asset such as "50000". A larger request stays REQUESTED for the bank. null removes the ceiling. Default null. Left out, the current value stays.7 to 1830. How long a
FRAMEWORK agreement runs when the bank creates one without validUntil. null means no default, so validUntil stays required. Default null.Who may request agreements on this market.
ANY, the default, lets every instance with access to the market request one for its borrowers. BANK_ONLY closes requests: only the bank creates agreements, and a request from another instance answers 403 AGREEMENT_REQUESTS_CLOSED.Response Fields
The policy as Get Agreement Policy returns it.{
"success": true,
"data": {
"policy": {
"mode": "OPTIONAL",
"validityDays": 14,
"autoIssue": true,
"autoIssueMaxAmount": "50000",
"frameworkValidityDays": 365,
"requestAccess": "ANY",
"source": "MANUAL",
"standingPolicyId": null,
"setByWallet": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"setByThisInstance": true,
"updatedAt": "2026-11-21T15:41:10.402Z",
"enforcement": "BACKEND_CHECK",
"notice": null,
"viewer": {
"isBank": true,
"canConfigure": true,
"planAllows": true
}
},
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
DOCUMENT_CONTENT_REFUSED | 400 | The body carries file content. Keep the file with you and send only the salted commitment |
PLAIN_HASH_REFUSED | 400 | The body carries the plain hash of a file (contentHash, sha256 and similar). Send the salted commitment instead |
PERSONAL_DATA_REFUSED | 400 | The body carries a personal data field such as name or email. Use wallet addresses and externalReference only |
VALIDATION_ERROR | 400 | A field is missing, has the wrong type, or is not part of this route |
INVALID_AGREEMENT_POLICY | 400 | mode, validityDays, autoIssue, autoIssueMaxAmount, frameworkValidityDays or requestAccess is out of range |
AGREEMENT_FEATURE_REQUIRED | 402 | Your plan does not include loan agreements. Upgrade to Scale, or keep the policy OFF |
AGREEMENT_BANK_ONLY | 403 | No verified wallet of your instance holds DEFAULT_ADMIN_ROLE on the market |
SIGNER_NOT_MARKET_ADMIN | 403 | signerAddress is not one of your verified admin wallets |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
CHAIN_UNAVAILABLE, SERVICE_UNAVAILABLE | 503 | The market or your instance’s wallets could not be read just now. Nothing was decided. Retry shortly |
⌘I
Set Agreement Policy
curl --request PUT \
--url https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"mode": "<string>",
"validityDays": 123,
"autoIssue": true,
"autoIssueMaxAmount": "<string>",
"frameworkValidityDays": 123,
"requestAccess": "<string>",
"signerAddress": "<string>"
}
'import requests
url = "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy"
payload = {
"mode": "<string>",
"validityDays": 123,
"autoIssue": True,
"autoIssueMaxAmount": "<string>",
"frameworkValidityDays": 123,
"requestAccess": "<string>",
"signerAddress": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mode: '<string>',
validityDays: 123,
autoIssue: true,
autoIssueMaxAmount: '<string>',
frameworkValidityDays: 123,
requestAccess: '<string>',
signerAddress: '<string>'
})
};
fetch('https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy', 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://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy",
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([
'mode' => '<string>',
'validityDays' => 123,
'autoIssue' => true,
'autoIssueMaxAmount' => '<string>',
'frameworkValidityDays' => 123,
'requestAccess' => '<string>',
'signerAddress' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"validityDays\": 123,\n \"autoIssue\": true,\n \"autoIssueMaxAmount\": \"<string>\",\n \"frameworkValidityDays\": 123,\n \"requestAccess\": \"<string>\",\n \"signerAddress\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"validityDays\": 123,\n \"autoIssue\": true,\n \"autoIssueMaxAmount\": \"<string>\",\n \"frameworkValidityDays\": 123,\n \"requestAccess\": \"<string>\",\n \"signerAddress\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/agreement-policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"<string>\",\n \"validityDays\": 123,\n \"autoIssue\": true,\n \"autoIssueMaxAmount\": \"<string>\",\n \"frameworkValidityDays\": 123,\n \"requestAccess\": \"<string>\",\n \"signerAddress\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"policy": {
"mode": "OPTIONAL",
"validityDays": 14,
"autoIssue": true,
"autoIssueMaxAmount": "50000",
"frameworkValidityDays": 365,
"requestAccess": "ANY",
"source": "MANUAL",
"standingPolicyId": null,
"setByWallet": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"setByThisInstance": true,
"updatedAt": "2026-11-21T15:41:10.402Z",
"enforcement": "BACKEND_CHECK",
"notice": null,
"viewer": {
"isBank": true,
"canConfigure": true,
"planAllows": true
}
},
"marketId": "cmwfk2h7x0003jw9w4q8b2n1c"
},
"error": null
}
