> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://docs.navalabs.ai/api/mcp` to find what you need.

# Nava Integrator API reference \[Developer Preview]

The HTTP API behind [Partner integration](/sdk/partner-integration). Your backend uses it to manage consented users' agents and wallets, read policy and verify transactions before they run. The [TypeScript SDK](/sdk/typescript#partner-management) wraps these calls. See the [interactive reference](/api/integrator) for full schemas.

## Authentication

Send both headers on every `/integrator/*` request and elevated login-context creation, from your server only:

```http
x-app-id: <NAVA_APP_ID>
x-api-key: <NAVA_INTEGRATION_KEY>
```

`x-app-id` is the integration's public app ID, not its internal integration ID. The key must belong to that active integration. Do not combine these headers with an `Authorization` credential.

## Endpoints

| Method | Path | What it does |
| --- | --- | --- |
| `POST` | `/embed/login-contexts` | Create a sign-in/consent context. |
| `GET` | `/integrator/agents?partnerUserRef=` | List the consented user's agents and wallets. |
| `POST` | `/integrator/agents` | Create an agent for that user. |
| `POST` | `/integrator/agents/{agentId}/wallets?partnerUserRef=` | Register an execution wallet. |
| `PATCH` | `/integrator/agents/{agentId}/wallets/{walletId}?partnerUserRef=` | Change only the wallet's address. |
| `DELETE` | `/integrator/agents/{agentId}/wallets/{walletId}?partnerUserRef=` | Remove a wallet. |
| `GET` | `/integrator/policies?walletAddress=&chainId=` | Read the wallet's current policy, optionally requiring chain eligibility. |
| `POST` | `/integrator/verifications` | Verify a proposed transaction. |
| `GET` | `/integrator/verifications/{id}` | Read a verification and its verdict. |
| `POST` | `/integrator/verifications/{id}/execution` | Report that an approved transaction executed. |
| `POST` | `/integrator/verifications/{id}/cancel` | Release a verification you will not execute. |

`{id}` is the verification `id` or its `requestHash`.

Cancelling releases the reserved spend for EVM transactions. A Hyperliquid order's spend hold clears only when Hyperliquid reports the order filled or finished.

## Partner management

`partnerUserRef` is your user identifier bound during consent, trimmed to 1 to 128 characters. Get it from your authenticated session and encode query values with `URLSearchParams` or your HTTP client's query options. Agent creation carries it in the JSON body; listing and wallet operations carry it in the query. Resource IDs are UUIDs and do not grant access by themselves.

| Operations | Required partner scope |
| --- | --- |
| List or create agents | `integrator:agents:write` |
| Register, update or remove wallets | `integrator:wallets:write` |

The integration's allowed scopes, API key scopes and active user grant must all cover the operation. Listing also requires the agents write scope. An inaccessible agent or wallet is not exposed to other users or integrations.

`GET /integrator/agents` returns `{ agents: [...] }`; creation returns an agent directly. Wallet registration and update return a wallet directly, and removal returns `{ deleted: true }`. The SDK returns the agent array and resolves deletion as `void`.

Registration starts pending. Omitted or `null` HTTP `chainId` means all chains; a supplied number must be a positive integer. In the SDK, omit the field rather than passing `null`. Address changes preserve chain/label and reset verification to pending with `verifiedAt: null`; sending the same address leaves verification unchanged. Registration does not create a policy or establish your signer's authority; [confirm an active policy](/sdk/partner-integration#check-the-user-has-a-policy) before verification.

### Login contexts

`POST /embed/login-contexts` always requires body `appId` and a registered `parentOrigin`. A basic browser context needs only that public configuration. For elevated partner consent, send both integration headers and include `partnerUserRef` together with nonempty, unique `requestedScopes`. The body app ID must match the authenticated integration. Requested scopes must be allowed by the integration and its key.

The SDK's `createLoginContext` always creates the elevated variant and supplies `appId` from its configuration. Its required fields do not make elevated fields mandatory for basic HTTP callers.

Creation returns `id`, single-use secret `state`, `appId`, `integrationName`, `parentOrigin`, `expiresAt`, editor `scopes`, `requestedScopes` and nullable `partnerUserRef`. Return only `{ id, state }` from your own authenticated backend endpoint to the [React consent callback](/sdk/partner-integration#partner-management-consent). Keep state out of caches and diagnostics. Creating a context is not consent.

## Verdicts

The verification response usually includes the verdict. Read `verdict.outcome`, not `status`: `status` can stay `PENDING` after Nava decides.

Every verification response also returns nullable `agentId`, `policyId`, and
`policyVersion`. These identify the wallet binding and policy evaluated at
admission and are frozen on the verification. Later wallet removal,
reassignment, or policy changes do not rewrite them.

| `verdict.outcome` | `canExecute` | Do this |
| --- | --- | --- |
| `approved` | `true` | Execute, then report execution. |
| `rejected` | `false` | Do not execute. `verdict.humanReason` explains why. |
| `pending`, or `verdict` is `null` | `false` | Poll `GET /integrator/verifications/{id}`. |

## Retries

For `POST /integrator/verifications`, `Idempotency-Key` is optional, but you need it to retry safely. Without it, a retry after a timeout creates a second verification that reserves spend again.

* Create one key per action, such as one trade, and store it before you send the request.
* Retry with the same key and the exact same body. Nava returns the original verification.
* Do not rebuild the body for a retry. A different body with the same key returns `409 idempotency_conflict`.
* Keys are 1 to 128 visible ASCII characters, with no spaces. Any other key returns `400`.

Management creation does not support this header. Agent names are not unique: serialize creation in your backend and persist IDs. After an uncertain agent/wallet create, read once to recover a committed result. An empty read cannot prove an in-flight write failed; keep it pending for reconciliation instead of automatically creating again. See [the SDK recovery example](/sdk/partner-integration#recover-access-and-uncertain-writes).

## Errors

Integrator errors carry a machine `code`. Embed login-context errors need not include one.

| Status | Meaning |
| --- | --- |
| `400` | Invalid body/query/UUID, unregistered parent origin or invalid requested scopes, duplicate wallet on the same agent or resource limit reached, invalid `Idempotency-Key`, or missing on-chain `txHash`. |
| `401` | Missing or invalid `x-app-id` or `x-api-key`. |
| `403` | `grant_revoked`: ask the user to consent again. Plain `forbidden`: the key lacks a required scope. Verification can also reject a wallet not registered for the transaction's chain. |
| `404` | No active grant covers the user/scope, the integration no longer allows that scope, or the requested resource is not accessible in this integration. |
| `409` | Conflicting wallet registration/address, or a verification is not executable/already settled. Also returned for `idempotency_conflict`. |
| `422` | `policy_not_active`: the verification wallet is bound to this integration, but its agent has no active policy. |
| `429` | Rate limited: 60 requests a minute, 120 for policy and agent-list reads. |

Only `listAgents` has no resource ID to be missing: its `404 not_found` can indicate missing/insufficient consent or disallowed integration scopes. Check allowed scopes if re-consent does not fix it. Do not turn every wallet-operation `404` into a consent prompt, or a plain `403` into repeated user consent.
