> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Terms Version

> Read one saved version of a market terms of use in full

Returns the full text of one saved version of the market's terms of use. Use it to show exactly what a market presented at a given point, or to compare two versions listed by [List Terms Versions](/endpoints/lending/list-terms-versions).

The version is returned whether or not that save was published, and whether or not the terms are live today. Drafts are readable here by every instance that holds the market, because terms are stored against the market's address rather than against the instance that wrote them.

## Path Parameters

<ParamField path="marketId" type="string" required>Market ID.</ParamField>

<ParamField path="version" type="string" required>
  Version number, as one to six digits. Anything else is refused with `VALIDATION_ERROR`.
</ParamField>

## Query Parameters

<ParamField query="format" type="string" default="markdown">
  `markdown` or `html`. Any other value is refused with `VALIDATION_ERROR`.
</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="terms" type="object">
      <Expandable>
        <ResponseField name="id" type="string">Version record ID.</ResponseField>
        <ResponseField name="marketAddress" type="string">Market the terms belong to, lowercased.</ResponseField>
        <ResponseField name="title" type="string">Document title at that version. `null` when none was set.</ResponseField>
        <ResponseField name="version" type="integer">Version number.</ResponseField>
        <ResponseField name="contentHash" type="string">keccak256 over the UTF-8 bytes of the markdown at that version.</ResponseField>
        <ResponseField name="curatorAddress" type="string">The wallet that saved it: the lender of record, or a wallet holding the market's admin or issuer role.</ResponseField>
        <ResponseField name="published" type="boolean">Whether that save published the document or kept it as a draft.</ResponseField>
        <ResponseField name="createdAt" type="string">ISO 8601 time of the save.</ResponseField>
        <ResponseField name="updatedAt" type="string">Equal to `createdAt`. A version is never edited.</ResponseField>
        <ResponseField name="templateId" type="string">Always `null` here. The template binding is not recorded per version.</ResponseField>
        <ResponseField name="templateVersion" type="integer">Always `null` here.</ResponseField>
        <ResponseField name="customised" type="boolean">Always `false` here.</ResponseField>
        <ResponseField name="contentBytes" type="integer">Size of the markdown in bytes.</ResponseField>
        <ResponseField name="format" type="string">Echoes the requested format.</ResponseField>
        <ResponseField name="content" type="string">Raw markdown. Present when `format` is `markdown`.</ResponseField>
        <ResponseField name="plainText" type="string">Plain-text rendering. Present when `format` is `markdown`.</ResponseField>
        <ResponseField name="html" type="string">Sanitized HTML rendering. Present when `format` is `html`.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

A version carries no `publishedAt`, and no `binding` block travels with it. Read the binding of the live document on [Get Terms](/endpoints/lending/get-terms).

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/terms/versions/2" \
    -H "X-API-Key: trusset_your_key_here"
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/terms/versions/${version}`,
    { headers: { 'X-API-Key': 'trusset_your_key_here' } }
  );
  const { success, data, error } = await res.json();
  if (!success) throw new Error(`${error.code}: ${error.message}`);
  console.log(data.terms.contentHash, data.terms.published);
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "terms": {
        "id": "sectermsv_002",
        "marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
        "title": "ACME Secured Lending Facility: Terms of Use",
        "version": 2,
        "contentHash": "0x5d4b74a6814f6236b5572f4165ae340dfd276faf02d78da3f5672a452ee9f289",
        "curatorAddress": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
        "published": false,
        "createdAt": "2026-09-02T16:41:09.000Z",
        "updatedAt": "2026-09-02T16:41:09.000Z",
        "templateId": null,
        "templateVersion": null,
        "customised": false,
        "contentBytes": 86,
        "format": "markdown",
        "content": "# Terms of Use\n\n## 1. Parties\n\nACME Bank AG acts as lender of record for this market.\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"
      }
    }
  }
  ```

  ```json Error - Version Not Found theme={null}
  {
    "success": false,
    "error": {
      "code": "TERMS_VERSION_NOT_FOUND",
      "message": "No such terms version"
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code                      | HTTP  | Cause                                                                       |
| ------------------------- | ----- | --------------------------------------------------------------------------- |
| `MISSING_MARKET_ID`       | `400` | The market ID is longer than 100 characters                                 |
| `VALIDATION_ERROR`        | `400` | `version` is not one to six digits, or `format` is not `markdown` or `html` |
| `MARKET_NOT_FOUND`        | `404` | No market with this ID on your instance                                     |
| `TERMS_VERSION_NOT_FOUND` | `404` | The market has no terms, or no version with this number                     |
