Terms Library
Get Terms Template
Read one terms library template with its text, its versions and the markets bound to it
GET
/
lending-external-securities-v2
/
api
/
markets
/
terms-library
/
{templateId}
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/terms-library/cmwh2t9e10002l80d7s3k5m8c" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/terms-library/${templateId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { success, data, error } = await res.json();
if (!success) throw new Error(`${error.code}: ${error.message}`);
const behind = data.template.markets.filter((market) => market.status === 'TEMPLATE_OUTDATED');
{
"success": true,
"data": {
"template": {
"id": "cmwh2t9e10002l80d7s3k5m8c",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t",
"title": "Secured credit line, house terms",
"version": 3,
"contentHash": "0x6c1f0b2e9a47d385c2e0f81b97a4d6c3e5f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8",
"archived": false,
"archivedAt": null,
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"updatedBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-10T08:15:00.000Z",
"updatedAt": "2026-11-16T13:58:22.000Z",
"contentBytes": 172,
"content": "# Terms of Use\n\n## 1. Lender of record\n\nACME Bank AG acts as lender of record for this market.\n\n## 2. Collateral\n\nPledged tokens stay frozen in the wallet of the borrower.\n",
"usage": {
"markets": 2,
"current": 1,
"outdated": 1,
"customised": 0,
"unpublished": 0
},
"versions": [
{
"id": "cmwj8a1b40011l80dz7c3e9qk",
"version": 3,
"title": "Secured credit line, house terms",
"contentHash": "0x6c1f0b2e9a47d385c2e0f81b97a4d6c3e5f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8",
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-16T13:58:22.000Z"
},
{
"id": "cmwi4f6g20009l80dk1m5p2xr",
"version": 2,
"title": "Secured credit line, house terms",
"contentHash": "0x2b9e7d4c1a0f83e65d2c9b8a7f6e5d4c3b2a1908f7e6d5c4b3a2918f7e6d5c4b",
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-12T10:31:09.000Z"
},
{
"id": "cmwh2t9e30003l80dh8j2n4vs",
"version": 1,
"title": "Secured credit line",
"contentHash": "0x9a8b7c6d5e4f30210fedcba98765432100112233445566778899aabbccddeeff",
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-10T08:15:00.000Z"
}
],
"markets": [
{
"generation": "v2",
"marketAddress": "0x1c74f9a2b0e63d581a47c02f9b8de3517a604c2b",
"templateVersion": 3,
"status": "TEMPLATE"
},
{
"generation": "v2",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"templateVersion": 2,
"status": "TEMPLATE_OUTDATED"
}
]
}
},
"error": null,
"metadata": {
"timestamp": "2026-11-17T10:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
Returns one template of this instance’s terms library in full: the current text, the version history and every market whose terms are bound to it. Archived templates are returned too. See List Terms Templates for how the library works.
Any key of the instance can read a template. Only templates of this instance are found.
Path Parameters
Template ID from List Terms Templates, 1 to 100 characters.
Response Fields
Show child attributes
Show child attributes
The template with the fields of a row on List Terms Templates,
usage included, plus the fields below.Show child attributes
Show child attributes
Every version of the template, newest first, at most 100. The text of an older version is not returned.
Every market whose terms of use are bound to the template.
Show child attributes
Show child attributes
One of
NONE (no terms), UNPUBLISHED (the terms are a draft or offline), CUSTOM (terms written without a template), TEMPLATE_ARCHIVED (the template is archived), CUSTOMISED (the text was edited after binding), TEMPLATE_OUTDATED (the template has a newer version than the market published) or TEMPLATE (the market serves the current version). The same statuses as binding.status on Get Terms.curl "https://api.trusset.org/lending-external-securities-v2/api/markets/terms-library/cmwh2t9e10002l80d7s3k5m8c" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/terms-library/${templateId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { success, data, error } = await res.json();
if (!success) throw new Error(`${error.code}: ${error.message}`);
const behind = data.template.markets.filter((market) => market.status === 'TEMPLATE_OUTDATED');
{
"success": true,
"data": {
"template": {
"id": "cmwh2t9e10002l80d7s3k5m8c",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t",
"title": "Secured credit line, house terms",
"version": 3,
"contentHash": "0x6c1f0b2e9a47d385c2e0f81b97a4d6c3e5f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8",
"archived": false,
"archivedAt": null,
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"updatedBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-10T08:15:00.000Z",
"updatedAt": "2026-11-16T13:58:22.000Z",
"contentBytes": 172,
"content": "# Terms of Use\n\n## 1. Lender of record\n\nACME Bank AG acts as lender of record for this market.\n\n## 2. Collateral\n\nPledged tokens stay frozen in the wallet of the borrower.\n",
"usage": {
"markets": 2,
"current": 1,
"outdated": 1,
"customised": 0,
"unpublished": 0
},
"versions": [
{
"id": "cmwj8a1b40011l80dz7c3e9qk",
"version": 3,
"title": "Secured credit line, house terms",
"contentHash": "0x6c1f0b2e9a47d385c2e0f81b97a4d6c3e5f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8",
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-16T13:58:22.000Z"
},
{
"id": "cmwi4f6g20009l80dk1m5p2xr",
"version": 2,
"title": "Secured credit line, house terms",
"contentHash": "0x2b9e7d4c1a0f83e65d2c9b8a7f6e5d4c3b2a1908f7e6d5c4b3a2918f7e6d5c4b",
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-12T10:31:09.000Z"
},
{
"id": "cmwh2t9e30003l80dh8j2n4vs",
"version": 1,
"title": "Secured credit line",
"contentHash": "0x9a8b7c6d5e4f30210fedcba98765432100112233445566778899aabbccddeeff",
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-10T08:15:00.000Z"
}
],
"markets": [
{
"generation": "v2",
"marketAddress": "0x1c74f9a2b0e63d581a47c02f9b8de3517a604c2b",
"templateVersion": 3,
"status": "TEMPLATE"
},
{
"generation": "v2",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"templateVersion": 2,
"status": "TEMPLATE_OUTDATED"
}
]
}
},
"error": null,
"metadata": {
"timestamp": "2026-11-17T10:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
VALIDATION_ERROR | 400 | templateId is longer than 100 characters |
TEMPLATE_READ_FAILED | 400 | The template could not be read for a reason that carries no code of its own |
TEMPLATE_NOT_FOUND | 404 | No template with this ID exists on this instance |
⌘I
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/terms-library/cmwh2t9e10002l80d7s3k5m8c" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/terms-library/${templateId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { success, data, error } = await res.json();
if (!success) throw new Error(`${error.code}: ${error.message}`);
const behind = data.template.markets.filter((market) => market.status === 'TEMPLATE_OUTDATED');
{
"success": true,
"data": {
"template": {
"id": "cmwh2t9e10002l80d7s3k5m8c",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t",
"title": "Secured credit line, house terms",
"version": 3,
"contentHash": "0x6c1f0b2e9a47d385c2e0f81b97a4d6c3e5f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8",
"archived": false,
"archivedAt": null,
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"updatedBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-10T08:15:00.000Z",
"updatedAt": "2026-11-16T13:58:22.000Z",
"contentBytes": 172,
"content": "# Terms of Use\n\n## 1. Lender of record\n\nACME Bank AG acts as lender of record for this market.\n\n## 2. Collateral\n\nPledged tokens stay frozen in the wallet of the borrower.\n",
"usage": {
"markets": 2,
"current": 1,
"outdated": 1,
"customised": 0,
"unpublished": 0
},
"versions": [
{
"id": "cmwj8a1b40011l80dz7c3e9qk",
"version": 3,
"title": "Secured credit line, house terms",
"contentHash": "0x6c1f0b2e9a47d385c2e0f81b97a4d6c3e5f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8",
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-16T13:58:22.000Z"
},
{
"id": "cmwi4f6g20009l80dk1m5p2xr",
"version": 2,
"title": "Secured credit line, house terms",
"contentHash": "0x2b9e7d4c1a0f83e65d2c9b8a7f6e5d4c3b2a1908f7e6d5c4b3a2918f7e6d5c4b",
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-12T10:31:09.000Z"
},
{
"id": "cmwh2t9e30003l80dh8j2n4vs",
"version": 1,
"title": "Secured credit line",
"contentHash": "0x9a8b7c6d5e4f30210fedcba98765432100112233445566778899aabbccddeeff",
"createdBy": "cmrz3a8q10000cghxf5w2n9k4",
"createdAt": "2026-11-10T08:15:00.000Z"
}
],
"markets": [
{
"generation": "v2",
"marketAddress": "0x1c74f9a2b0e63d581a47c02f9b8de3517a604c2b",
"templateVersion": 3,
"status": "TEMPLATE"
},
{
"generation": "v2",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"templateVersion": 2,
"status": "TEMPLATE_OUTDATED"
}
]
}
},
"error": null,
"metadata": {
"timestamp": "2026-11-17T10:00:00.000Z",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"instanceId": "cmrz4d1v20000cghx8k6p3m7t"
}
}
