manual/REFERENCE

api

integration endpoints

The ensurance API provides programmatic access to protocol data, enabling integrations, dashboards, and automated systems.

base url

https://ensurance.app/api

All endpoints return JSON. Most are public read-only. Write operations require authentication.

core endpoints

groups

EndpointMethodDescription
/api/groupsGETList all groups
/api/groups/{slug}GETGet specific group

Response:

{
  "id": 1,
  "name": "basin",
  "contract_address": "0x...",
  "chain_id": 8453,
  "agent_count": 42
}

agents (accounts)

EndpointMethodDescription
/api/accountsGETList all agents
/api/accounts/{group}/{name}GETGet specific agent
/api/accounts/address/{address}GETGet agent by TBA address

Query parameters:

  • group — Filter by group slug
  • limit — Number of results
  • offset — Pagination offset

Response:

{
  "token_id": 1,
  "name": "klamath",
  "group": "basin",
  "tba_address": "0x...",
  "owner_address": "0x...",
  "bio": "Klamath watershed steward",
  "mandate": "Protect watershed ecosystem services"
}

coins (general ensurance)

EndpointMethodDescription
/api/generalGETList all coins
/api/general/{contract}GETGet specific coin

Response:

{
  "contract_address": "0x...",
  "name": "ENSURE",
  "symbol": "ENSURE",
  "decimals": 18,
  "total_supply": "1000000000000000000000000"
}

certificates (specific ensurance)

EndpointMethodDescription
/api/specific/tokensGETList all certificates
/api/specific/tokens/{id}GETGet specific certificate

Query parameters:

  • type — Filter by type (policy, line)
  • group — Filter by group

Response:

{
  "token_id": 1,
  "name": "Klamath Wetlands Policy",
  "type": "policy",
  "par_value": "100000",
  "natural_asset_id": 42
}

proceeds

EndpointMethodDescription
/api/proceedsGETList all proceeds contracts
/api/proceeds/{address}GETGet specific contract
/api/proceeds/agent/{address}GETGet agent's proceeds

Response:

{
  "address": "0x...",
  "type": "split",
  "recipients": [
    { "address": "0x...", "percent": 40 },
    { "address": "0x...", "percent": 60 }
  ]
}

pools

EndpointMethodDescription
/api/poolsGETList ensurance pools
/api/pools/{address}GETGet specific pool

Response:

{
  "address": "0x...",
  "token0": "ENSURE",
  "token1": "USDC",
  "tvl": "1000000",
  "volume_24h": "50000"
}

swap endpoints

EndpointMethodDescription
/api/swap/priceGETGet indicative price
/api/swap/quoteGETGet executable quote

Query parameters:

  • sellToken — Token to sell
  • buyToken — Token to buy
  • sellAmount — Amount to sell (in wei)
  • takerAddress — Address executing swap

Response:

{
  "price": "1.05",
  "buyAmount": "1050000",
  "sources": [{ "name": "Aerodrome", "proportion": "1" }]
}

authentication

Public endpoints require no authentication.

Write operations require:

  • Privy authentication token
  • Appropriate permissions

Headers:

Authorization: Bearer {privy_token}
Content-Type: application/json

rate limits

TierRate
Public100 requests/minute
Authenticated1000 requests/minute

Exceeding limits returns 429 Too Many Requests.

errors

CodeMeaning
400Bad request (invalid parameters)
401Unauthorized (missing/invalid auth)
403Forbidden (insufficient permissions)
404Not found
429Rate limited
500Server error

Error response:

{
  "error": "Invalid token address",
  "code": "INVALID_PARAM"
}

for agents and llms

See /api/llms.txt for AI-optimized documentation and /manual/llm for agent integration patterns.

  • agents — Agent API patterns
  • coins — Coin contract details
  • proceeds — Proceeds contract types