> For the complete documentation index, see [llms.txt](https://docs.creditcoop.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.creditcoop.xyz/developer-api-docs/models.md).

# Models

## The ErrorResponse object

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"components":{"schemas":{"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer"}}}}}}
```

## The Organization object

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"components":{"schemas":{"Organization":{"type":"object","required":["id","name","slug"],"properties":{"id":{"type":"string","format":"uuid","description":"Organization unique identifier"},"name":{"type":"string","maxLength":255,"description":"Organization display name"},"slug":{"type":"string","maxLength":100,"description":"URL-friendly identifier"},"header":{"type":"string","nullable":true,"description":"Short tagline or headline for the organization profile"},"description":{"type":"string","nullable":true,"description":"Brief summary of the organization"},"overview":{"type":"string","nullable":true,"description":"Long-form organization description (may contain Markdown)"},"links":{"type":"array","description":"Organization links and image assets. Labels starting with \"#\" are image assets (e.g. \"#logo\", \"#header\"); all others are external links (e.g. \"Twitter\", \"Website\").","items":{"type":"object","required":["id","label","url"],"properties":{"id":{"type":"string","format":"uuid","description":"Link unique identifier"},"label":{"type":"string","description":"Link type. \"#logo\" and \"#header\" denote image assets; other values (e.g. \"Twitter\", \"Website\") denote external links."},"linkText":{"type":"string","nullable":true,"description":"Display text for external links (e.g. \"@raincards\", \"rain.xyz\")"},"iconUrl":{"type":"string","nullable":true,"description":"Icon image URL for external links"},"url":{"type":"string","description":"Target URL (image URL for asset links, destination URL for external links)"}}}}}}}}}
```

## The Pagination object

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"components":{"schemas":{"Pagination":{"type":"object","required":["total","limit","offset"],"properties":{"total":{"type":"integer","description":"Total number of records matching the query"},"limit":{"type":"integer","description":"Maximum number of records returned per page"},"offset":{"type":"integer","description":"Number of records skipped from the start"}}}}}}
```

## The Token object

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"components":{"schemas":{"Token":{"type":"object","required":["id","address","networkId","symbol","decimals"],"properties":{"id":{"type":"string","format":"uuid","description":"Token unique identifier"},"address":{"type":"string","description":"Token contract address"},"networkId":{"type":"string","description":"CAIP-2 network identifier"},"symbol":{"type":"string","description":"Token ticker symbol (e.g. \"USDC\", \"WETH\")"},"name":{"type":"string","nullable":true,"description":"Full token name"},"decimals":{"type":"integer","minimum":0,"maximum":255,"description":"Number of decimal places for the token"},"wraps":{"type":"string","nullable":true,"description":"Underlying asset this token represents (e.g. \"USD\" for USDC, \"ETH\" for WETH)"},"iconUrl":{"type":"string","nullable":true,"description":"URL of the token icon image"},"coingeckoId":{"type":"string","nullable":true,"description":"CoinGecko API identifier for price lookups"}}}}}}
```

## The Network object

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"components":{"schemas":{"Network":{"type":"object","required":["networkId","displayName"],"properties":{"networkId":{"type":"string","description":"CAIP-2 network identifier"},"displayName":{"type":"string","description":"Human-readable network name (e.g. \"Ethereum Mainnet\")"},"explorerUrl":{"type":"string","nullable":true,"description":"Block explorer base URL"},"rpcUrl":{"type":"string","nullable":true,"description":"RPC endpoint URL"},"iconUrl":{"type":"string","nullable":true,"description":"URL of the network icon image"},"nativeCurrencySymbol":{"type":"string","nullable":true,"description":"Native currency ticker (e.g. \"ETH\")"},"nativeCurrencyDecimals":{"type":"integer","nullable":true,"description":"Native currency decimal places"}}}}}}
```

## The Vault object

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"components":{"schemas":{"Vault":{"type":"object","required":["id","address","networkId","protocolVersion","label","organizationId","deployedAt"],"properties":{"id":{"type":"string","format":"uuid","description":"Vault unique identifier"},"address":{"type":"string","description":"Vault contract address"},"networkId":{"type":"string","description":"CAIP-2 network identifier"},"protocolVersion":{"type":"string","nullable":true,"description":"Credit Coop protocol/contract generation (e.g. \"v1\", \"v2\"). Null when not classified."},"label":{"type":"string","nullable":true,"description":"Display label for the vault. Always present; null if not configured."},"organizationId":{"type":"string","format":"uuid","nullable":true,"description":"Vault curator organization ID"},"deployedAt":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp when the vault contract was deployed"},"organization":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Organization"}],"description":"Organization details with links. Only included when expand includes \"organization\"."},"relatedAddresses":{"type":"object","nullable":true,"description":"On-chain related addresses. Only included when expand includes \"related-addresses\".","properties":{"creditStrategy":{"type":"string","nullable":true,"description":"CreditStrategy contract address. Manages credit allocation from vault funds to credit facilities."},"liquidStrategy":{"type":"string","nullable":true,"description":"LiquidStrategy contract address. Manages liquid asset reserves in the vault."},"vaultCurator":{"type":"string","nullable":true,"description":"Vault curator (manager) address of the CreditStrategy contract. Retrieved by calling manager() on the creditStrategy."}}},"assets":{"type":"object","nullable":true,"description":"Asset information. Only included when expand includes \"assets\".","properties":{"assetToken":{"type":"string","nullable":true,"description":"Asset token address"},"shareToken":{"type":"string","nullable":true,"description":"Share token address"},"decimals":{"type":"integer","nullable":true,"description":"Asset token decimals"},"totalAssets":{"type":"string","nullable":true,"description":"Total assets in the vault (raw uint256 — divide by 10^decimals to get human-readable value)"},"totalLiquidAssets":{"type":"string","nullable":true,"description":"Total liquid assets. Vault's balance - total pending deposits - claimable redeem assets + liquid strategy total assets + uninvested credit strategy assets (raw uint256 — divide by 10^decimals to get human-readable value)"},"totalSupply":{"type":"string","nullable":true,"description":"Total supply of vault shares (raw uint256 — divide by 10^decimals to get human-readable value)"},"sharePrice":{"type":"string","nullable":true,"description":"Share price of the vault (raw uint256 — divide by 10^decimals to get human-readable value)"},"baseUnit":{"type":"string","nullable":true,"description":"Minimum accounting unit used by the CreditStrategy for scaling interest calculations (raw uint256). Equal to 10^decimals."},"totalActiveCredit":{"type":"string","nullable":true,"description":"Total active credit from CreditStrategy. Deposits plus accrued and repaid interest for all credit lines (raw uint256 — divide by 10^decimals to get human-readable value)"},"uninvestedCreditAssets":{"type":"string","nullable":true,"description":"Uninvested credit assets. Asset token balance held by CreditStrategy (raw uint256 — divide by 10^decimals to get human-readable value)"}}},"apy":{"type":"object","nullable":true,"description":"APY data from historical sharePrice snapshots. Only included when expand includes \"apy\".","properties":{"apyPct30D":{"type":"number","nullable":true,"description":"30-day APY in percent (e.g. 5.0 = 5%). Null if insufficient snapshot data."}}},"fees":{"type":"object","nullable":true,"description":"Credit strategy fees in basis points. Only included when expand includes \"fees\".","properties":{"managementFee":{"type":"integer","description":"Management fee in basis points (e.g. 200 = 2%)"},"performanceFee":{"type":"integer","description":"Performance fee in basis points (e.g. 1000 = 10%)"}}}}},"Organization":{"type":"object","required":["id","name","slug"],"properties":{"id":{"type":"string","format":"uuid","description":"Organization unique identifier"},"name":{"type":"string","maxLength":255,"description":"Organization display name"},"slug":{"type":"string","maxLength":100,"description":"URL-friendly identifier"},"header":{"type":"string","nullable":true,"description":"Short tagline or headline for the organization profile"},"description":{"type":"string","nullable":true,"description":"Brief summary of the organization"},"overview":{"type":"string","nullable":true,"description":"Long-form organization description (may contain Markdown)"},"links":{"type":"array","description":"Organization links and image assets. Labels starting with \"#\" are image assets (e.g. \"#logo\", \"#header\"); all others are external links (e.g. \"Twitter\", \"Website\").","items":{"type":"object","required":["id","label","url"],"properties":{"id":{"type":"string","format":"uuid","description":"Link unique identifier"},"label":{"type":"string","description":"Link type. \"#logo\" and \"#header\" denote image assets; other values (e.g. \"Twitter\", \"Website\") denote external links."},"linkText":{"type":"string","nullable":true,"description":"Display text for external links (e.g. \"@raincards\", \"rain.xyz\")"},"iconUrl":{"type":"string","nullable":true,"description":"Icon image URL for external links"},"url":{"type":"string","description":"Target URL (image URL for asset links, destination URL for external links)"}}}}}}}}}
```

## The CreditFacility object

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"components":{"schemas":{"CreditFacility":{"type":"object","required":["id","address","networkId","protocolVersion","label","organizationId"],"properties":{"id":{"type":"string","format":"uuid","description":"Credit facility unique identifier"},"address":{"type":"string","description":"SecuredLine contract address"},"networkId":{"type":"string","description":"CAIP-2 network identifier"},"protocolVersion":{"type":"string","nullable":true,"description":"Credit Coop protocol/contract generation (e.g. \"v1\", \"v2\"). Null when not classified."},"label":{"type":"string","nullable":true,"description":"Display label for the credit facility. Always present; null if not configured."},"organizationId":{"type":"string","format":"uuid","nullable":true,"description":"Borrower organization ID"},"organization":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Organization"}],"description":"Organization details with links. Only included when expand includes \"organization\"."},"relatedAddresses":{"type":"object","nullable":true,"description":"On-chain related addresses. Only included when expand includes \"related-addresses\".","properties":{"spigot":{"type":"string","nullable":true,"description":"Spigot contract address. Captures and routes borrower revenue to debt repayment."},"borrower":{"type":"string","nullable":true,"description":"Address authorized to borrow, repay, and close credit lines"},"admin":{"type":"string","nullable":true,"description":"Credit facility administrator address"},"spigotOperator":{"type":"string","nullable":true,"description":"Address authorized to execute revenue claims on the Spigot"},"escrow":{"type":"string","nullable":true,"description":"Escrow contract address. Holds collateral posted by the borrower and enforces the minimum collateral ratio."}}},"fees":{"type":"object","nullable":true,"description":"Fee configuration for the Credit Facility. Only included when expand includes \"fees\".","required":["originationFee","swapFee","servicingFee"],"properties":{"originationFee":{"type":"string","description":"Origination fee (basis points)"},"swapFee":{"type":"string","description":"Swap fee (basis points)"},"servicingFee":{"type":"string","description":"Servicing fee (basis points)"}}},"counts":{"type":"object","nullable":true,"description":"Active credit lines and open proposals counts. Only included when expand includes \"counts\".","required":["activeCreditLines","openProposals"],"properties":{"activeCreditLines":{"type":"integer","description":"Number of active credit lines"},"openProposals":{"type":"integer","description":"Number of open mutual consent proposals"}}},"status":{"type":"object","nullable":true,"description":"On-chain contract status. Only included when expand includes \"status\".","required":["code","label"],"properties":{"code":{"type":"integer","description":"Numeric status code (0: UNINITIALIZED, 1: ACTIVE, 2: LIQUIDATABLE, 3: REPAID, 4: INSOLVENT, 5: ABORTED)"},"label":{"type":"string","enum":["UNINITIALIZED","ACTIVE","LIQUIDATABLE","REPAID","INSOLVENT","ABORTED","UNKNOWN"],"description":"Human-readable status label. UNKNOWN is returned when the on-chain status code is outside the known range (e.g., a new status added by a future contract version)."}}},"collateral":{"type":"object","nullable":true,"description":"On-chain collateral state from the Escrow contract. Only included when expand includes \"collateral\". Null when the facility has no escrow, RPC is unavailable, or the facility predates the Escrow architecture.","required":["maxLtvBps","totalOutstandingDebt","collateralValue","ltvBps","targetLtvBps","collateralTokens"],"properties":{"maxLtvBps":{"type":"string","nullable":true,"description":"Maximum loan-to-value ratio allowed for this facility, in basis points (10000 = 100%). Computed server-side as 10000² / minimumCollateralRatio (integer floor). Null when the facility does not enforce a collateral requirement."},"totalOutstandingDebt":{"type":"string","nullable":true,"description":"Total outstanding debt in USD as a formatted decimal string with trailing zeros trimmed (e.g. \"1234.56\"). The debt token's decimals are read from the first active credit position and applied server-side. \"0\" when there are no active positions. Null when the facility does not enforce a collateral requirement."},"collateralValue":{"type":"string","nullable":true,"description":"Collateral value in USD as a formatted decimal string with trailing zeros trimmed (e.g. \"2000\" or \"1999.99\"). Formatted server-side. Null when the facility does not enforce a collateral requirement."},"ltvBps":{"type":"string","nullable":true,"description":"Current loan-to-value ratio in basis points: (totalOutstandingDebt × 10000) / collateralValue, computed server-side from raw on-chain values (decimals normalized before division). \"0\" when there is no outstanding debt. \"999999999\" (sentinel) when debt is positive but on-chain collateral value is 0 — the facility is effectively infinitely undercollateralized. Null when the facility does not enforce a collateral requirement, or when debt decimals could not be resolved."},"targetLtvBps":{"type":"string","nullable":true,"description":"Target LTV in basis points. Defines the minimum collateral value required to back the facility's credit limit (min collateral ≈ creditLimit × 10000 / targetLtvBps). Null when no target is configured for this facility."},"collateralTokens":{"type":"array","description":"Every token ever enabled as collateral on the Escrow, with its current on-chain amount and USD value. May be empty if EnableCollateral events have not been ingested for this Escrow.","items":{"type":"object","required":["address","amount","decimals","usdValue"],"properties":{"address":{"type":"string","description":"Collateral token address (ERC-20)."},"amount":{"type":"string","nullable":true,"description":"Current on-chain collateral amount (raw uint256; divide by `decimals` to get human-readable value). Null if the on-chain `getCollateralData` read failed."},"decimals":{"type":"integer","nullable":true,"description":"Decimals of the collateral token itself (for rendering `amount`). Null if ERC-20 metadata could not be fetched."},"usdValue":{"type":"string","nullable":true,"description":"USD value of the current collateral amount as a human-readable decimal string (e.g. \"1234.56\"), up to 6 decimal places with trailing zeros trimmed. Null if amount, price, or decimals is unavailable."}}}}}}}},"Organization":{"type":"object","required":["id","name","slug"],"properties":{"id":{"type":"string","format":"uuid","description":"Organization unique identifier"},"name":{"type":"string","maxLength":255,"description":"Organization display name"},"slug":{"type":"string","maxLength":100,"description":"URL-friendly identifier"},"header":{"type":"string","nullable":true,"description":"Short tagline or headline for the organization profile"},"description":{"type":"string","nullable":true,"description":"Brief summary of the organization"},"overview":{"type":"string","nullable":true,"description":"Long-form organization description (may contain Markdown)"},"links":{"type":"array","description":"Organization links and image assets. Labels starting with \"#\" are image assets (e.g. \"#logo\", \"#header\"); all others are external links (e.g. \"Twitter\", \"Website\").","items":{"type":"object","required":["id","label","url"],"properties":{"id":{"type":"string","format":"uuid","description":"Link unique identifier"},"label":{"type":"string","description":"Link type. \"#logo\" and \"#header\" denote image assets; other values (e.g. \"Twitter\", \"Website\") denote external links."},"linkText":{"type":"string","nullable":true,"description":"Display text for external links (e.g. \"@raincards\", \"rain.xyz\")"},"iconUrl":{"type":"string","nullable":true,"description":"Icon image URL for external links"},"url":{"type":"string","description":"Target URL (image URL for asset links, destination URL for external links)"}}}}}}}}}
```

## The CreditLine object

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"components":{"schemas":{"CreditLine":{"type":"object","required":["lineTokenId"],"properties":{"lineTokenId":{"type":"string","description":"Credit line token ID"},"deposit":{"type":"string","nullable":true,"description":"Deposit amount (raw uint256 — divide by 10^decimals to get human-readable value)"},"creditLimit":{"type":"string","nullable":true,"description":"Credit limit (raw uint256 — divide by 10^decimals to get human-readable value). For open lines: equals current deposit. For closed lines: deposit from the most recent AddCredit or IncreaseCredit event."},"principal":{"type":"string","nullable":true,"description":"Principal amount borrowed (raw uint256 — divide by 10^decimals to get human-readable value)"},"interestBalance":{"type":"string","nullable":true,"description":"Total interest balance (raw uint256 — divide by 10^decimals to get human-readable value). Open lines: interestAccrued + interestRepaid. Closed lines: interestRepaid."},"interestAccrued":{"type":"string","nullable":true,"description":"Interest accrued (raw uint256 — divide by 10^decimals to get human-readable value)"},"interestRepaid":{"type":"string","nullable":true,"description":"Interest repaid (raw uint256 — divide by 10^decimals to get human-readable value)"},"token":{"type":"string","nullable":true,"description":"Token address for this credit line"},"decimals":{"type":"integer","nullable":true,"description":"Token decimals"},"isOpen":{"type":"boolean","nullable":true,"description":"Whether the credit line is open"},"isRestricted":{"type":"boolean","nullable":true,"description":"Whether the credit line is restricted"},"earlyWithdrawalFee":{"type":"string","nullable":true,"description":"Early withdrawal fee in basis points"},"deadline":{"type":"string","format":"date-time","nullable":true,"description":"Credit line deadline"},"drawRate":{"type":"string","nullable":true,"description":"Draw rate in basis points (interest rate on borrowed principal)"},"facilityRate":{"type":"string","nullable":true,"description":"Facility rate in basis points (interest rate on unused deposit)"},"apyPct":{"type":"number","nullable":true,"description":"Computed APY as a percentage (e.g. 5.0 = 5.0%). Weighted average of drawRate on principal and facilityRate on unused deposit."},"createdTxHash":{"type":"string","nullable":true,"description":"Transaction hash of the AddCredit event that created this line"},"createdBlockNumber":{"type":"integer","nullable":true,"description":"Block number when this credit line was created"},"createdAt":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp when this credit line was created"},"fees":{"type":"object","nullable":true,"description":"Only included when expand=fees is specified. Null if fetching failed.","required":["originationFees"],"properties":{"originationFees":{"type":"string","description":"Total origination fees paid for this credit line (raw uint256 — divide by 10^decimals to get human-readable value)"}}},"error":{"type":"string","nullable":true,"description":"Error message if fetching this credit line failed. Other fields will be null."}}}}}}
```

## The VaultCreditLineRelatedAddresses object

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"components":{"schemas":{"VaultCreditLineRelatedAddresses":{"type":"object","required":["facility","facilityOrganizationId"],"properties":{"facility":{"type":"string","nullable":true,"description":"SecuredLine contract address for this credit line"},"facilityOrganizationId":{"type":"string","format":"uuid","nullable":true,"description":"Organization ID of the borrower associated with the facility address. Null if the facility address is not registered."}}}}}}
```

## The FacilityCreditLineRelatedAddresses object

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"components":{"schemas":{"FacilityCreditLineRelatedAddresses":{"type":"object","required":["lender"],"properties":{"lender":{"type":"string","description":"Lender address (owner of the credit line NFT)"},"vault":{"type":"string","nullable":true,"description":"Lending vault address associated with the lender"},"vaultCurator":{"type":"string","nullable":true,"description":"Vault curator address for the lender"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.creditcoop.xyz/developer-api-docs/models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
