Terms of Use
Get Terms
Read the published terms of use for a market
GET
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
terms
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/terms" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/terms?format=html`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { success, data, error } = await res.json();
if (!success) throw new Error(`${error.code}: ${error.message}`);
document.getElementById('terms')!.innerHTML = data.terms.html;
{
"success": true,
"data": {
"terms": {
"id": "secterms_001",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"title": "ACME Secured Lending Facility: Terms of Use",
"version": 3,
"contentHash": "0xf0b3379e4102181f66822fd86cd5c1f93e448e5bdfd3f8961151b05c5feacc5a",
"curatorAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"published": true,
"publishedAt": "2026-09-10T09:12:44.000Z",
"createdAt": "2026-08-28T14:03:07.000Z",
"updatedAt": "2026-09-10T09:12:44.000Z",
"templateId": null,
"templateVersion": null,
"customised": false,
"contentBytes": 225,
"format": "markdown",
"content": "# Terms of Use\n\n## 1. Parties\n\nACME Bank AG acts as lender of record for this market.\n\n## 2. Collateral\n\n- Pledged tokens stay frozen in the wallet of the borrower.\n- A loan below the liquidation threshold can be liquidated.\n",
"plainText": "ACME SECURED LENDING FACILITY: TERMS OF USE\n===========================================\n\nTERMS OF USE\n------------\n\n1. Parties\n\nACME Bank AG acts as lender of record for this market.\n\n2. Collateral\n\n - Pledged tokens stay frozen in the wallet of the borrower.\n - A loan below the liquidation threshold can be liquidated.\n"
},
"binding": null
}
}
{
"success": false,
"error": {
"code": "TERMS_NOT_PUBLISHED",
"message": "The lender of record has not published terms of use for this market yet."
}
}
Returns the terms of use published for the market. The lender of record authors them through Save Terms, as can a wallet holding the market’s admin or issuer role. A borrow button cannot be shipped compliantly without them. This is where an integrating application fetches them: by API key, on the market it already knows, in the form it renders.
The document is stored against the market’s contract address, not against an instance. Every instance that holds the market reads the same terms, including the issuer instance that deployed it.
Only published terms are returned. A draft, or terms the author took down with Unpublish Terms, reads as if no terms exist. Loan builds on such a market, Open Loan and Borrow More, carry a
The markdown form travels with its plain-text rendering in the same response, so displaying terms in a surface that has no markdown renderer never costs a second request. The plain text carries the title in capitals, drops a leading heading that repeats it, and keeps lists as indentation.
The HTML form is sanitized before it leaves, because the terms are authored by one tenant and displayed inside another’s application. Tags outside a fixed allowlist of headings, paragraphs, lists, emphasis, code, quotes, links and tables are removed, and links keep only
TERMS_NOT_PUBLISHED warning, and nothing on chain enforces it.
Path Parameters
string
required
Query Parameters
string
default:"markdown"
markdown or html. Any other value is refused with VALIDATION_ERROR.Response Fields
object
Show child attributes
Show child attributes
object
Show child attributes
Show child attributes
string
Terms record ID.
string
Market the terms belong to, lowercased.
string
Document title.
null when the author set none.integer
Current version number. Every version a save writes takes the number after the newest version so far, staged drafts included, so the current number skips the numbers of drafts saved in between.
string
keccak256 over the UTF-8 bytes of the stored markdown. Changes whenever the text changes.
string
The wallet that saved the current version: the lender of record, or a wallet holding the market’s admin or issuer role.
boolean
Always
true on this endpoint.string
ISO 8601 time of the save that published the current version.
string
ISO 8601 time the terms were first saved.
string
ISO 8601 time of the last write to the record.
string
The terms library template the document was bound from.
null when the author wrote it directly.integer
Template version at the time of binding.
null without a template.boolean
True when the author edited the text after binding a template.
integer
Size of the stored markdown in bytes.
string
Echoes the requested format.
string
Raw markdown. Present when
format is markdown.string
Plain-text rendering. Present when
format is markdown.string
Sanitized HTML rendering. Present when
format is html.object
How the document relates to a terms library template.
null when it was not bound from one.Show child attributes
Show child attributes
string
Template ID.
integer
Template version the market’s terms were bound at.
boolean
True when the text was edited after binding.
string
TEMPLATE_ARCHIVED when the template was archived. Otherwise CUSTOMISED when the text was edited, then TEMPLATE_OUTDATED when the template has a newer version, and TEMPLATE when none of these apply.object
id, title, currentVersion, archived and authorInstanceId of the template. null when the template could not be read.boolean
True when the template moved on and the market’s text was not customised.
http, https, mailto and # targets.
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/terms" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/terms?format=html`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { success, data, error } = await res.json();
if (!success) throw new Error(`${error.code}: ${error.message}`);
document.getElementById('terms')!.innerHTML = data.terms.html;
{
"success": true,
"data": {
"terms": {
"id": "secterms_001",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"title": "ACME Secured Lending Facility: Terms of Use",
"version": 3,
"contentHash": "0xf0b3379e4102181f66822fd86cd5c1f93e448e5bdfd3f8961151b05c5feacc5a",
"curatorAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"published": true,
"publishedAt": "2026-09-10T09:12:44.000Z",
"createdAt": "2026-08-28T14:03:07.000Z",
"updatedAt": "2026-09-10T09:12:44.000Z",
"templateId": null,
"templateVersion": null,
"customised": false,
"contentBytes": 225,
"format": "markdown",
"content": "# Terms of Use\n\n## 1. Parties\n\nACME Bank AG acts as lender of record for this market.\n\n## 2. Collateral\n\n- Pledged tokens stay frozen in the wallet of the borrower.\n- A loan below the liquidation threshold can be liquidated.\n",
"plainText": "ACME SECURED LENDING FACILITY: TERMS OF USE\n===========================================\n\nTERMS OF USE\n------------\n\n1. Parties\n\nACME Bank AG acts as lender of record for this market.\n\n2. Collateral\n\n - Pledged tokens stay frozen in the wallet of the borrower.\n - A loan below the liquidation threshold can be liquidated.\n"
},
"binding": null
}
}
{
"success": false,
"error": {
"code": "TERMS_NOT_PUBLISHED",
"message": "The lender of record has not published terms of use for this market yet."
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
MISSING_MARKET_ID | 400 | The market ID is longer than 100 characters |
NO_MARKET_ADDRESS | 400 | The market has no on-chain address |
VALIDATION_ERROR | 400 | format is not markdown or html |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
TERMS_NOT_PUBLISHED | 404 | No terms exist for this market, or they are a draft or were unpublished |
⌘I
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/terms" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/terms?format=html`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { success, data, error } = await res.json();
if (!success) throw new Error(`${error.code}: ${error.message}`);
document.getElementById('terms')!.innerHTML = data.terms.html;
{
"success": true,
"data": {
"terms": {
"id": "secterms_001",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"title": "ACME Secured Lending Facility: Terms of Use",
"version": 3,
"contentHash": "0xf0b3379e4102181f66822fd86cd5c1f93e448e5bdfd3f8961151b05c5feacc5a",
"curatorAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
"published": true,
"publishedAt": "2026-09-10T09:12:44.000Z",
"createdAt": "2026-08-28T14:03:07.000Z",
"updatedAt": "2026-09-10T09:12:44.000Z",
"templateId": null,
"templateVersion": null,
"customised": false,
"contentBytes": 225,
"format": "markdown",
"content": "# Terms of Use\n\n## 1. Parties\n\nACME Bank AG acts as lender of record for this market.\n\n## 2. Collateral\n\n- Pledged tokens stay frozen in the wallet of the borrower.\n- A loan below the liquidation threshold can be liquidated.\n",
"plainText": "ACME SECURED LENDING FACILITY: TERMS OF USE\n===========================================\n\nTERMS OF USE\n------------\n\n1. Parties\n\nACME Bank AG acts as lender of record for this market.\n\n2. Collateral\n\n - Pledged tokens stay frozen in the wallet of the borrower.\n - A loan below the liquidation threshold can be liquidated.\n"
},
"binding": null
}
}
{
"success": false,
"error": {
"code": "TERMS_NOT_PUBLISHED",
"message": "The lender of record has not published terms of use for this market yet."
}
}
