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
| Endpoint | Method | Description |
|---|---|---|
/api/groups | GET | List all groups |
/api/groups/{slug} | GET | Get specific group |
Response:
{
"id": 1,
"name": "basin",
"contract_address": "0x...",
"chain_id": 8453,
"agent_count": 42
}
agents (accounts)
| Endpoint | Method | Description |
|---|---|---|
/api/accounts | GET | List all agents |
/api/accounts/{group}/{name} | GET | Get specific agent |
/api/accounts/address/{address} | GET | Get agent by TBA address |
Query parameters:
group— Filter by group sluglimit— Number of resultsoffset— 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)
| Endpoint | Method | Description |
|---|---|---|
/api/general | GET | List all coins |
/api/general/{contract} | GET | Get specific coin |
Response:
{
"contract_address": "0x...",
"name": "ENSURE",
"symbol": "ENSURE",
"decimals": 18,
"total_supply": "1000000000000000000000000"
}
certificates (specific ensurance)
| Endpoint | Method | Description |
|---|---|---|
/api/specific/tokens | GET | List all certificates |
/api/specific/tokens/{id} | GET | Get 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
| Endpoint | Method | Description |
|---|---|---|
/api/proceeds | GET | List all proceeds contracts |
/api/proceeds/{address} | GET | Get specific contract |
/api/proceeds/agent/{address} | GET | Get agent's proceeds |
Response:
{
"address": "0x...",
"type": "split",
"recipients": [
{ "address": "0x...", "percent": 40 },
{ "address": "0x...", "percent": 60 }
]
}
pools
| Endpoint | Method | Description |
|---|---|---|
/api/pools | GET | List ensurance pools |
/api/pools/{address} | GET | Get specific pool |
Response:
{
"address": "0x...",
"token0": "ENSURE",
"token1": "USDC",
"tvl": "1000000",
"volume_24h": "50000"
}
swap endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/swap/price | GET | Get indicative price |
/api/swap/quote | GET | Get executable quote |
Query parameters:
sellToken— Token to sellbuyToken— Token to buysellAmount— 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
| Tier | Rate |
|---|---|
| Public | 100 requests/minute |
| Authenticated | 1000 requests/minute |
Exceeding limits returns 429 Too Many Requests.
errors
| Code | Meaning |
|---|---|
| 400 | Bad request (invalid parameters) |
| 401 | Unauthorized (missing/invalid auth) |
| 403 | Forbidden (insufficient permissions) |
| 404 | Not found |
| 429 | Rate limited |
| 500 | Server 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.