Edit a terms library template, or archive and restore it
PUT
/
lending-external-securities-v2
/
api
/
markets
/
terms-library
/
{templateId}
curl -X PUT "https://api.trusset.org/lending-external-securities-v2/api/markets/terms-library/cmwh2t9e10002l80d7s3k5m8c" \ -H "X-API-Key: trusset_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "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" }'
{ "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": 0, "outdated": 2, "customised": 0, "unpublished": 0 } }, "changed": true }, "error": null, "metadata": { "timestamp": "2026-11-16T13:58:22.000Z", "requestId": "550e8400-e29b-41d4-a716-446655440000", "instanceId": "cmrz4d1v20000cghx8k6p3m7t" }}
Changes one template of this instance’s terms library. Send only the fields to change: a field you leave out keeps its value. This is a database write: nothing is signed and nothing goes on chain.A change to the title or the text writes a new template version and answers changed: true. Markets bound to the template keep the version they published until they are bound again with Save Terms and the same templateId. Until then they read TEMPLATE_OUTDATED, as Get Terms Template and Get Terms report. A standing policy publishes the version that is current when a market is adopted.archived: true archives the template, as Archive Terms Template does, and archived: false restores it. Archiving alone writes no version and answers changed: false. A request that changes nothing writes nothing and answers changed: false as well.Only an account Trusset approved as a lender of record can author templates. Any other account is refused with 403 CURATOR_NOT_APPROVED before the body is read.
New text as markdown, under the rules of Create Terms Template: at most 262,144 bytes of UTF-8, not blank, no control characters other than tab, newline and carriage return.
boolean
true to archive the template, false to restore it. Archiving is refused with 409 TEMPLATE_IN_USE while the template is still bound to a published, non-customised market or to any standing policy, switched off or not. See Archive Terms Template.
Response Fields
object
Show child attributes
object
The template after the change, with the fields of Get Terms Template except versions and markets. content and usage are included.
boolean
true when the title or the text changed and a new version was written. false when only archived changed, or nothing did.
curl -X PUT "https://api.trusset.org/lending-external-securities-v2/api/markets/terms-library/cmwh2t9e10002l80d7s3k5m8c" \ -H "X-API-Key: trusset_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "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" }'
{ "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": 0, "outdated": 2, "customised": 0, "unpublished": 0 } }, "changed": true }, "error": null, "metadata": { "timestamp": "2026-11-16T13:58:22.000Z", "requestId": "550e8400-e29b-41d4-a716-446655440000", "instanceId": "cmrz4d1v20000cghx8k6p3m7t" }}
Error Codes
Code
HTTP
Cause
VALIDATION_ERROR
400
templateId or a field breaks its type or length rule
INVALID_TERMS_TITLE
400
The title is blank after trimming, or contains control characters
INVALID_TERMS_CONTENT
400
The document is blank, or contains control characters other than tab, newline and carriage return
TEMPLATE_SAVE_FAILED
400
The template could not be saved for a reason that carries no code of its own
CURATOR_NOT_APPROVED
403
Trusset has not approved this account to act as a lender of record
TEMPLATE_NOT_FOUND
404
No template with this ID exists on this instance
TEMPLATE_IN_USE
409
archived: true, and the template is still bound to a published, non-customised market or to a standing policy. error.details names them, see Archive Terms Template
TERMS_TOO_LARGE
413
The document exceeds 262,144 bytes of UTF-8, or the request body is over 1 MB
RATE_LIMIT_EXCEEDED
429
More than 10 writes in the minute
⌘I
curl -X PUT "https://api.trusset.org/lending-external-securities-v2/api/markets/terms-library/cmwh2t9e10002l80d7s3k5m8c" \ -H "X-API-Key: trusset_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "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" }'