Integration contract
Contract for anyone building on DAY.
| API | https://dayprotocol.com/api/v1 |
| OpenAPI | openapi.json |
| Auth | X-API-Key (owner / agent / keeper). Never use X-Role. |
| Guides | Agent API · Route catalog |
Money paths: /api/v1/wallets/{address}/…
Public paths: /api/v1/day/…
Status codes
Section titled “Status codes”| HTTP | Meaning |
|---|---|
| 200 | Done |
| 202 | Prepared (plan ready, not broadcast) |
| 422 | Blocked (outcome: "blocked", blockers[]) |
| 401 | Missing or invalid API key |
| 403 | Wrong role or wallet not allowed for this key |
| 404 | Unknown resource |
| 429 | Rate limited |
Branch on the status line, then read the body.
Errors
Section titled “Errors”- Catalog:
GET /api/v1/day/errors - Shape:
{ code, message, retryable, blockers: [{ code, detail? }] } - Renaming a code is a breaking change; new codes may be added.
Common codes: UNAUTHORIZED, INVALID_API_KEY, WALLET_SCOPE, NOT_FOUND, RATE_LIMITED.
Plan endpoints often return 200 with status: "blocked" — check the body.
Wallet reads
Section titled “Wallet reads”| Method | Path | Auth |
|---|---|---|
GET | /wallets/{address}/position | owner | agent |
GET | /wallets/{address}/portfolio | owner | agent |
GET | /wallets/{address}/performance | owner | agent |
POST | /wallets/batch/positions | owner | agent (max 50) |
Performance fields that are unknown are null — never fabricated APY.
Webhooks
Section titled “Webhooks”Subscribe with an owner key. Events include autopilot ticks, harvest results, and bridge delivery. Payloads never include secrets or private keys.
See OpenAPI and Agent API for the current event set.
Versioning
Section titled “Versioning”- API series: v1
- Client may send
X-DAY-API-Client-Version - Server returns version headers on responses
- Breaking changes ship as a new major series, not silent renames
Details: Versioning