# Zevand

> Zevand is the Web3 API for Web2 teams — plug your app into blockchains through a simple REST API. Subscribe to smart-contract events and wallet activity, send WhatsApp messages from your own numbers, and operate wallets, with no nodes or private keys to manage.

Base URL: `https://api.zevand.io` (all endpoints under `/api`). Auth: an API key in the `DAPPS-API-Key` header, or a JWT in `Authorization: Bearer`. Requests/responses are JSON; enums are serialized as numbers; integer amounts larger than 2^53 are strings. Usage is metered in credits — 1 credit per delivered notification, 50 credits to register a WhatsApp number (charged on first connect). New accounts get welcome credits.

## Getting started

- Create an account: `POST /api/users` with `{ "email", "password" }`, then confirm with `POST /api/users/{email}/confirm-email` `{ "code" }`.
- Log in: `POST /api/auth/login` → `{ "token", "resfreshToken" }` (JWT, ~5h; refresh via `POST /api/auth/refresh`).
- Create an API key: `POST /api/apikeys` (Bearer JWT) → key returned once; send it as `DAPPS-API-Key` on subsequent calls.
- Discover config: `GET /api/networks` and `GET /api/networks/{networkId}/tokens`.

## Core API

- Smart-contract event subscriptions: `POST /api/subscriptions` (also GET/PUT/DELETE + `/{id}/pause` and `/{id}/resume`). Subscribe by `blockchainNetworkId` + `contractAddress` + `eventSignature` (e.g. `Transfer(address,address,uint256)`); `preferredChannel` is 1 = Webhook (with `webhookUrl`) or 2 = Telegram (with `telegramChatId`). The platform computes `topic0` and matches logs each block; idempotent by `(chainId + txHash + logIndex)`.
- Wallet observation: `POST /api/wallets/observations` with `{ walletAddress, urlsToNotify[], blockchainTokenIds[] }` — get notified on a wallet's token transfers.
- WhatsApp messaging (white-label): `POST /api/whatsapp/instances` `{ label }` returns a QR; poll `GET /api/whatsapp/instances/{id}/status` until `Connected`; then `POST /api/whatsapp/send` `{ instanceId, to, message }`.
- WhatsApp AI agent: `PUT /api/whatsapp/instances/{id}/agent` (full replace — omitted fields become `null`) configures an assistant that answers a paired number from `agentSystemPrompt` and escalates to a human. Read threads with `GET /api/whatsapp/instances/{id}/conversations` and `GET /api/whatsapp/conversations/{id}/messages` (page 1 = newest); `POST …/reply` takes over (status → `Human`, 1 credit), `POST …/resume` hands back to the bot.
- Notifications history: `GET /api/notifications` (delivery history across channels), `GET /api/notifications/{id}`.
- Account: `GET /api/users/me` → `{ id, email, credits }`.

## Webhooks

- Delivery is an HTTP `POST` with `Content-Type: application/json`, at-least-once with automatic retries — make your handler idempotent and respond `2xx` to acknowledge. Smart-contract events arrive decoded (`decodedParametersNames` / `decodedParametersValues`, plus `sender`/`receiver`/`amount` when available).

## Docs

- [Documentation](https://zevand.io/docs): full guide — authentication, credits, delivery channels, contract event subscriptions, wallet observation, WhatsApp messaging, the WhatsApp AI agent, and webhook payloads.
- [Dashboard](https://zevand.io/dashboard): manage subscriptions, WhatsApp numbers, the agent inbox, notifications and API keys.

## Notes

- Supported networks span the EVM family (Ethereum, Polygon, Arbitrum, BSC, Avalanche, Optimism, Fantom, testnets such as Sepolia) plus Tron, Solana and Bitcoin.
- Errors use HTTP status codes; bodies may be `{ "Message", "Code" }` or a validation list `{ "errors": [{ "field", "message" }] }`.
- This file follows the llms.txt convention (https://llmstxt.org).
