# HEVN

> HEVN fintech - balances, contacts, invoices, contracts, cards and money transfers via the HEVN API.

Lets an agent operate a [HEVN](https://hevn.finance) fintech account -
read balances and transactions, manage contacts, send invoices, run
contracts, issue and control cards, and move money.

## What it can do

| Area | Methods | What it does |
| --- | --- | --- |
| Account | `hevn_current_user`, `hevn_balance`, `hevn_update_profile`, `hevn_list_transactions` | Read who you are, balances and the transaction feed; update the profile. |
| KYC | `hevn_kyc_link`, `hevn_kyc_status`, `hevn_card_kyc_link` | Get a hosted KYC link and check verification status. |
| Contacts | `hevn_list_contacts`, `hevn_create_contact`, `hevn_update_contact`, `hevn_delete_contact`, `hevn_validate_bank` | Manage payees and validate their bank details. |
| Invoices | `hevn_list_invoices`, `hevn_get_invoice`, `hevn_create_invoice`, `hevn_create_uploaded_invoice`, `hevn_update_invoice`, `hevn_create_invoice_from_contract`, `hevn_batch_invoicing` | Create, upload, update and batch-send invoices. |
| Contracts | `hevn_list_contracts`, `hevn_get_contract`, `hevn_preview_contract`, `hevn_list_contract_templates`, `hevn_create_contract`, `hevn_update_contract`, `hevn_pause_contract`, `hevn_approve_contract`, `hevn_update_contract_payment_methods`, `hevn_delete_contract` | Draft, preview, approve, pause and manage recurring contracts. |
| Documents | `hevn_upload_document` | Attach supporting files. |
| Banks & pay-ins | `hevn_list_banks`, `hevn_activate_banks`, `hevn_payin_quote`, `hevn_bank_payin_quote`, `hevn_submit_bank_payin_quote`, `hevn_payout_quote` | Connect banks and quote/submit pay-ins and payouts. |
| Cards | `hevn_list_cards`, `hevn_create_card`, `hevn_get_card`, `hevn_update_card_label`, `hevn_update_card_limit`, `hevn_freeze_card`, `hevn_unfreeze_card`, `hevn_pre_approve_cards` | Issue and control virtual cards (label, limit, freeze). |
| Transfers | `hevn_app_me`, `hevn_mcp_balance`, `hevn_mcp_list_transfers`, `hevn_mcp_transfer` | Move money between accounts; fiat payout is two-step (`hevn_payout_quote` → `hevn_mcp_transfer` with the quoteId). |
| Public *(no auth)* | `hevn_rate`, `hevn_public_invoice` | FX rate lookup and reading a shared public invoice. |

> **Note: Card numbers**
>
> Reading full card PAN/CVV is intentionally not exposed - it requires a
> message-signing flow HEVN guards separately.

## How to get credentials

HEVN uses a single **API key**, not OAuth - one key authenticates everything,
including transfers (the server derives your app from the key).

1. Sign in at [app.gethevn.com](https://app.gethevn.com).
2. Open **Settings → API keys** (or run `hevn login` in the HEVN CLI).
3. Copy your **API key** - that is all you need.

## Fields to fill in FlyMyAI

| FlyMyAI field | Required | Where it comes from |
| --- | --- | --- |
| `HEVN_API_KEY` | yes | Settings → API keys (one key for everything, transfers included) |

## Troubleshooting

- **`401 / unauthorized`** - the `HEVN_API_KEY` is missing or wrong.
  Re-copy it from Settings → API keys.
- **Transfers fail with a permission error** - your `HEVN_API_KEY` lacks the
  transfer scope or spend limit; run `hevn_app_me` to inspect the key's scope
  and limits under Settings → API keys.
- **A fiat payout is rejected** - it's two-step: call `hevn_payout_quote`
  first, then `hevn_mcp_transfer` with the returned quoteId.

## Links

- [HEVN](https://hevn.finance)
- [HEVN app](https://app.gethevn.com)
