> ## 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.

# Create Standing Policy

> Record how this institution takes markets of one deployer or one collateral token

Creates a standing policy for one deployer wallet or one collateral token and answers `201`. This is a database write: nothing is signed and nothing goes on chain. What a policy does, and what it never does, is set out on [List Standing Policies](https://docs.trusset.org/endpoints/operators/list-standing-policies.md).

> [!NOTE]
>
> A policy never takes a role. Every market it matches is still adopted with one transaction signed by the lender's own wallet through [Accept Lender Role](https://docs.trusset.org/endpoints/operators/accept-lender-role.md).

Only an account Trusset approved as a lender of record can write policies. Any other account is refused with `403 CURATOR_NOT_APPROVED` before the body is read. An instance holds one policy per `kind` and `address`: a second one is refused with `409 STANDING_POLICY_EXISTS`, so change the existing one with [Update Standing Policy](https://docs.trusset.org/endpoints/operators/update-standing-policy.md).

## Body Parameters

**kind** `string` *required*

`DEPLOYER` to match markets deployed by `address`, or `COLLATERAL_TOKEN` to match markets whose collateral token is `address`. When a market matches an enabled policy of each kind, the `DEPLOYER` policy wins.

**address** `string` *required*

The deployer wallet or collateral token, `0x` followed by 40 hex characters, not the zero address. Matched exactly and stored lowercased.

**label** `string`

Your name for the policy, at most 120 characters. Trimmed, and a blank label is stored as `null`.

**termsTemplateId** `string | null`

A template of this instance's [terms library](https://docs.trusset.org/endpoints/lending/list-terms-templates.md), 1 to 100 characters. [Confirm Lender Role](https://docs.trusset.org/endpoints/operators/confirm-lender-role.md) publishes it as the terms of use of a market adopted under the policy while the market has none. An archived template is refused with `409 TEMPLATE_ARCHIVED`. Omit it or send `null` to bind none.

**agreementPolicy** `object | null`

The [loan agreement](https://docs.trusset.org/endpoints/lending/loan-agreements.md#standing-policies) policy a market adopted under this policy starts with: `{ mode, validityDays?, autoIssue?, autoIssueMaxAmount?, frameworkValidityDays?, requestAccess? }`, with `mode` `OFF`, `OPTIONAL` or `REQUIRED`, `validityDays` 1 to 365 (default 30), `autoIssue` (default `false`), `autoIssueMaxAmount` a decimal borrow amount or `null`, `frameworkValidityDays` 7 to 1830 or `null`, and `requestAccess` `ANY` (default) or `BANK_ONLY`. Any other key is refused. A mode other than `OFF` needs the Scale plan (`402 AGREEMENT_FEATURE_REQUIRED`). It applies only to markets adopted after it is saved, and never over a market's own policy. The response adds `agreementPolicySetAt`.

**acceptanceTerms** `object | null`

The adoption values the issuer app pre-fills for a matching market. Every key is optional. Any key not listed here is refused with `400 VALIDATION_ERROR`. Leave a key out to leave it unset: `null` or an empty string as a value is refused with `400 VALIDATION_ERROR`. An empty object is stored as `null`.

**admin** `string`

Address, not the zero address. The `admin` party of [Accept Lender Role](https://docs.trusset.org/endpoints/operators/accept-lender-role.md#parties).

**issuer** `string`

Address. The `issuer` party.

**collateralAgent** `string`

Address. The `collateralAgent` party.

**saleRecipient** `string`

Address. The `saleRecipient` party.

**liquidationOperator** `string`

Address. The `liquidationOperator` party.

**oracleOwner** `string`

Address. The `oracleOwner` party.

**priceSigner** `string`

Address. The `priceSigner` party.

**identityRegistry** `string`

Address. The borrower register, as `identityRegistry` on Accept Lender Role.

**realizationMode** `string`

`EXCHANGE_SALE`, `ISSUER_REDEMPTION` or `AUCTION`. It is pre-filled only where the market's price source offers it: `EXCHANGE_SALE` only on a `MARKET`-priced market, `AUCTION` only on a market priced any other way.

**liquidityCommitment** `string`

Decimal amount of the borrow asset as a string, with up to 18 decimals, for example `"250000"`.

**maxFixedRateBps** `integer`

Fixed-rate ceiling in basis points, an integer from 1 to 50000.

**enabled** `boolean` (default: true)

`false` creates the policy switched off. A switched-off policy matches no market.

## Response Fields

**data** `object`

**policy** `object`

The policy as written, with the fields of a row on [List Standing Policies](https://docs.trusset.org/endpoints/operators/list-standing-policies.md#response-fields) except `template`.

The queue reflects a write at once: [List Queued Markets](https://docs.trusset.org/endpoints/operators/list-queued-markets.md) is read fresh on the next call.

```bash cURL theme={null}
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/standing-policies" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "DEPLOYER",
    "address": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
    "label": "ACME Industrial AG",
    "termsTemplateId": "cmwh2t9e10002l80d7s3k5m8c",
    "acceptanceTerms": {
      "admin": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
      "issuer": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
      "realizationMode": "ISSUER_REDEMPTION",
      "liquidityCommitment": "250000",
      "maxFixedRateBps": 1200
    }
  }'
```

```typescript TypeScript theme={null}
const res = await fetch(
  'https://api.trusset.org/lending-external-securities-v2/api/markets/standing-policies',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'trusset_your_key_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      kind: 'DEPLOYER',
      address: '0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52',
      label: 'ACME Industrial AG',
      termsTemplateId: 'cmwh2t9e10002l80d7s3k5m8c',
      acceptanceTerms: {
        admin: '0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93',
        issuer: '0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93',
        realizationMode: 'ISSUER_REDEMPTION',
        liquidityCommitment: '250000',
        maxFixedRateBps: 1200
      }
    })
  }
);
const { success, data, error } = await res.json();
if (!success) throw new Error(`${error.code}: ${error.message}`);
const policyId = data.policy.id;
```

```json Created theme={null}
{
  "success": true,
  "data": {
    "policy": {
      "id": "cmwh3p7k20004l80dq2x9v1ab",
      "instanceId": "cmrz4d1v20000cghx8k6p3m7t",
      "kind": "DEPLOYER",
      "address": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
      "label": "ACME Industrial AG",
      "termsTemplateId": "cmwh2t9e10002l80d7s3k5m8c",
      "acceptanceTerms": {
        "admin": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
        "issuer": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
        "realizationMode": "ISSUER_REDEMPTION",
        "liquidityCommitment": "250000",
        "maxFixedRateBps": 1200
      },
      "enabled": true,
      "createdBy": "cmrz3a8q10000cghxf5w2n9k4",
      "updatedBy": "cmrz3a8q10000cghxf5w2n9k4",
      "createdAt": "2026-11-15T09:20:11.000Z",
      "updatedAt": "2026-11-15T09:20:11.000Z"
    }
  },
  "error": null,
  "metadata": {
    "timestamp": "2026-11-15T09:20:11.000Z",
    "requestId": "550e8400-e29b-41d4-a716-446655440000",
    "instanceId": "cmrz4d1v20000cghx8k6p3m7t"
  }
}
```

```json Error - Exists theme={null}
{
  "success": false,
  "data": null,
  "error": {
    "code": "STANDING_POLICY_EXISTS",
    "message": "A standing policy for this deployer already exists on this instance; edit it instead"
  },
  "metadata": {
    "timestamp": "2026-11-15T09:21:40.000Z",
    "requestId": "550e8400-e29b-41d4-a716-446655440001",
    "instanceId": "cmrz4d1v20000cghx8k6p3m7t"
  }
}
```

```json Error - Unknown Key theme={null}
{
  "success": false,
  "data": null,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": [
      { "field": "acceptanceTerms", "message": "Unrecognized key(s) in object: 'assetDataHash'" }
    ]
  },
  "metadata": {
    "timestamp": "2026-11-15T09:22:05.000Z",
    "requestId": "550e8400-e29b-41d4-a716-446655440002",
    "instanceId": "cmrz4d1v20000cghx8k6p3m7t"
  }
}
```

## Error Codes

| Code | HTTP | Cause |
| - | - | - |
| `VALIDATION_ERROR` | `400` | A field breaks its type, format or length rule, or `acceptanceTerms` carries a key not listed above |
| `INVALID_STANDING_POLICY` | `400` | `address` or an address in `acceptanceTerms` is the zero address |
| `STANDING_POLICY_SAVE_FAILED` | `400` | The policy 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` | `termsTemplateId` names no template of this instance |
| `STANDING_POLICY_EXISTS` | `409` | This instance already holds a policy of this `kind` for this `address`. Update that one instead |
| `TEMPLATE_ARCHIVED` | `409` | `termsTemplateId` names an archived template |
| `RATE_LIMIT_EXCEEDED` | `429` | More than 10 writes in the minute |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.