Skip to main content
A remote transfer key lets a program send USDC from your HEVN account (a profile plus a Base smart wallet) with no approval step. Create the key in the app, then call GET /get_balance to confirm the key and its allowance.
A leaked key can spend up to its allowance. Grant the smallest allowance that covers the job. For everyday payments use the app or the HEVN assistant, which files transfer requests that you approve.

Model

Without an active spend permission, each transfer returns 403. The key does not use your wallet’s signing key, which stays in Privy. A key has no scopes. It can call every remote transfer route.

Create a key

  1. Open Settings → Remote Transfers in the app and click Create remote transfer key.
  2. Enter a name and a spending limit (an amount and a period).
  3. Confirm. HEVN issues the key, and your wallet signs a spend permission for the key’s spender wallet with the limit you set.
  4. Copy the key. HEVN cannot show it again.
Keep the key in a secret store on the machine that uses it, out of repositories and logs. HEVN notifies you when a key is created.

Change the limit

Open the key in the app and update its spend permission. Your wallet signs a new permission that replaces the old one.

Revoke a key

Delete the key in the app. The app revokes the spend permission onchain, then deletes the key. The deleted key stops authenticating at once. Keys do not expire. A deleted key cannot be restored, so create a new one. If a key leaks, delete it in the app and create a new key with a new allowance. Until the key is deleted, spending is bounded by the allowance left in the current period and by maxSpend if set.

Call the routes

Remote transfer routes take a remote transfer key in X-Api-Key and return camelCase JSON. Amounts are decimal USDC on Base. Paths are relative to HEVN_RT.
The prefix /api/v1/mcp serves the same routes and is deprecated.

Get balance

GET /get_balance returns your wallet’s USDC balance and the key’s allowance left in the current period, both read from the chain.
email is the key’s account and address is your Base smart wallet. remaining is 0 when the key has no active spend permission. An account with no smart wallet returns 404 Smart wallet not found.

Resolve address

GET /resolve_address?email= returns the Base smart wallet address for an email address.
If the email has no HEVN account, HEVN creates one and records its wallet address, which the email’s owner controls. See deterministic addresses.

Transfer

POST /transfer pays a contact, an invoice or a payout quote. Send one of contactId, invoiceId or quoteId. A request with none of the three ids returns 422. If several are sent, invoiceId takes precedence over quoteId, and quoteId over contactId. Idempotency-Key is optional. Send it on each contact transfer.
txHash is the onchain transaction. userCreated and emailSent are false on this route.

Transfer to email

POST /transfer_to_user pays an email address. If the email has no HEVN account, HEVN creates one, pays its wallet and emails an invitation to claim it. An existing account gets a payment email. amount (number, USDC), email and the Idempotency-Key header are required. Without the header the call returns 422. memo is accepted and not recorded.
userCreated is true when the transfer created the receiving account. emailSent is true when the invitation or payment email went out. Each new transfer saves the receiver as a contact.

A transfer runs at most once

Each transfer uses a nonce derived from a payment id, and the spender wallet accepts a nonce once. The payment id is <keyId>_<reference>. The reference is the first of these that the request has:
  1. invoiceId
  2. quoteId
  3. the Idempotency-Key header
The reference is scoped to the key, so paying the same invoice through two keys sends two transfers.
A contact transfer without Idempotency-Key gets a random reference and is not deduplicated. A retry pays the contact again. Send the header on each contact transfer.

List transfers

GET /transfers lists the account’s POST /transfer_to_user transfers, newest first. POST /transfer payments appear in the app’s transaction history.
receiverEmail contains the contact’s saved name. The name is the receiver’s full name if the account has one, and the email address otherwise.

Key routes

The key routes take your app session token in Authorization: Bearer in place of a remote transfer key. A key created with the API has no spend permission. Grant it in the app, as in Change the limit. DELETE /api_key/{key_id} leaves the spend permission onchain. The deleted key stops authenticating at once. Revoke the permission in the app as well, as in Revoke a key.

Limits

Set maxSpend and the IP allowlist (ipRestriction) with POST /api_key.

Errors

An error response has one field, detail. Branch on the status code and log detail.
Route-specific errors are listed under Transfer, and limit refusals under Limits.