--- title: "Public API Overview" slug: "public-api-overview" description: "Narmi Public API guide: register apps, authenticate with OAuth 2.0 PKCE, request data, initiate transfers, and handle scopes, pagination, and errors." tags: ["API Authentication"] status: "new" updated: 2026-12-01T17:26:42Z published: 2026-12-01T17:26:42Z canonical: "help.narmi.com/public-api-overview" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.narmi.com/llms.txt > Use this file to discover all available pages before exploring further. # Public API Overview The Narmi Public API allows third-party applications to access banking data and initiate actions on behalf of users who have granted consent. Access is granted through the OAuth 2.0 Authorization Code flow with PKCE. This article covers how to register your application, authenticate users, and make API requests. Refer to the endpoint reference for details on specific resources. ## Capabilities All endpoints follow the pattern `https://api.sandbox.narmi.dev/v1/{resource}/`. For production, your Narmi Relationship Manager will provide your institution-specific base URL. The API is organized around resources. The most commonly used include: | Resource | Description | | --- | --- | | `accounts` | Deposit, loan, and external accounts the user can access, including balances. | | `transactions` | Posted and pending transactions for the user's accounts. | | `transfers` | Internal and external (ACH) movements of funds between accounts. | | `recipients` | Saved external accounts and recipients used as transfer destinations. | | `deposits` | Remote (mobile) check deposits. | | `documents` | Statements and other user documents. | | `payees` / `payments` | Bill pay payees and payments. | | `me` | The authenticated user's profile information. | The set of endpoints visible to your application depends on the scopes you are granted and the features enabled for the institution. The interactive reference reflects the resources available to you. The trailing slash on each path is significant. Requests without it are redirected, which can drop the request body on non-`GET` methods. ## Authentication The Public API is a standards-compliant OAuth 2.0 authorization server using the **Authorization Code flow with PKCE**. Your application redirects the user to Narmi to authenticate and grant consent, then receives an access token to make API calls on their behalf. To get started, contact your Narmi Relationship Manager to register your application and receive a `client_id` and `client_secret`. PKCE (Proof Key for Code Exchange) is **required** for the authorization code flow. Generate a `code_verifier` and its `code_challenge` per [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636); both `S256` and `plain` challenge methods are supported (`S256` is strongly recommended). When a confidential client uses PKCE, the `client_secret` may be omitted at the token endpoint. ### Choosing an Authorization Server: /v2/oauth/ vs. /v1/tokens/ Narmi exposes two token-issuing surfaces. **New and third-party integrations should always use the standards-compliant `/v2/oauth/` server.** | | /v2/oauth/ **(recommended)** | /v1/tokens/ (legacy) | | --- | --- | --- | | Standard | OAuth 2.0 + OpenID Connect, advertised via discovery documents | Narmi-proprietary | | Authorize endpoint | `/v2/oauth/authorize/` | `/v1/apps/authorize/` | | Token endpoint | `/v2/oauth/token/` | `/v1/tokens/` | | Token response | Standard OAuth payload (`access_token`, `token_type`, `expires_in`, `refresh_token`, `scope`) | Simplified `{ "token": "...", "secret": "..." }`, with an embedded `user` profile on password/refresh grants | | OIDC / discovery / dynamic registration | Yes | No | | Documented in schema | Yes | No (excluded) | | Intended use | All third-party and new integrations | Backwards compatibility for existing integrations and Narmi's first-party apps | Both surfaces complete the same Authorization Code (+ PKCE) exchange and ultimately issue an access token that is used identically — as an `Authorization: Bearer <token>` header against `/v1/{resource}/` endpoints. The `/v1/tokens/` endpoint additionally supports the `password` grant used by Narmi's own mobile apps and returns a non-standard response shape; prefer `/v2/oauth/` so your integration benefits from discovery metadata, OIDC, and refresh-token rotation. The remainder of this guide assumes the `/v2/oauth/` server. ### OAuth & OpenID Endpoints | URL | Purpose | | --- | --- | | `/v2/oauth/authorize/` | Authorization endpoint — redirect the user here to obtain consent and an authorization code. | | `/v2/oauth/token/` | Token endpoint — exchange an authorization code (or refresh token) for an access token. | | `/v2/oauth/userinfo/` | Authenticated user info (OIDC). | | `/v2/oauth/register/` | Dynamic Client Registration ([RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591)). | | `/v2/oauth/revoke_token/` | Revoke an access or refresh token. | | `/v2/oauth/.well-known/openid-configuration/` | OpenID Connect discovery. | | `/v2/oauth/.well-known/oauth-authorization-server/` | OAuth 2.0 server metadata. | | `/v2/oauth/.well-known/oauth-protected-resource/` | Protected resource metadata. | | `/v2/oauth/.well-known/jwks.json` | JSON Web Key Set. | Prefer reading endpoint URLs, supported grant types, and challenge methods dynamically from the discovery documents rather than hardcoding them. - **Supported grant types:** `authorization_code`, `refresh_token` - **Supported response types:** `code`, `id_token` - **Token endpoint auth methods:** `none` (public clients using PKCE), `client_secret_post` ### Scopes Request the narrowest set of scopes your application needs. Resource scopes are preferred over the broad `read` / `write` scopes. The consent screen shows the user exactly what they are granting. | Scope | Grants | | --- | --- | | `banking:accounts:read` | Read account information. | | `banking:accounts:write` | Update account information. | | `banking:transactions:read` | Read transaction information. | | `banking:transactions:write` | Update transaction information. | | `banking:scheduled_transfers:read` | Read scheduled transfer information. | | `banking:scheduled_transfers:write` | Create and update scheduled transfers. | | `banking:users:read` | Read user profile information. | | `banking:products:read` | Read product information. | | `banking:documents:read` | Read user statements and documents. | | `offline_access` | Issue a long-lived refresh token alongside the access token. | | `openid` | Enable OpenID Connect; required to call `/userinfo/`. | | `profile`, `email` | Standard OIDC claims for extended user information. | ### Token Lifetime Defaults | Token | Lifetime | | --- | --- | | Access Token | 1 hour | | Refresh Token | Until revoked or 365 days of inactivity | | Authorization Code | 10 minutes | Refresh tokens are only issued when the `offline_access` scope is granted. A brief grace period (60 seconds) allows a rotated refresh token to be retried in case the token response is lost in transit. ## Make an API Request Pass the access token as a Bearer token in the `Authorization` header of each request: ``` Authorization: Bearer ``` Example — retrieving accounts for the authenticated user: ``` curl --request GET \ --url https://api.sandbox.narmi.dev/v1/accounts/ \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' ``` Example — creating an internal transfer of **$100.00**. Note that `amount` is expressed in **minor units** (cents), so$100.00 is sent as `10000`: ``` curl --request POST \ --url https://api.sandbox.narmi.dev/v1/transfers/ \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: f3ff7758-3a6c-4897-aa62-6af927339f24' \ --data '{ "from_account": "76f62a58-5404-486d-9afc-07bded328704", "to_account": "a1b2c3d4-5678-9012-3456-789abcdef012", "amount": 10000, "memo": "Savings contribution" }' ``` ## Conventions These conventions apply across the API and are easy to miss when reading individual endpoint schemas. ### Monetary Amounts All monetary values are represented as **integers in the currency's smallest unit** (e.g., cents for USD) — never as decimals. For example, `$10.00` is `1000` and `$100.00` is `10000`. This applies to both request bodies and responses. Sending a decimal value such as `100.00` will be misinterpreted. ### Identifiers Resources are identified by a UUID exposed as the `id` field. Internal numeric database identifiers are never exposed. Use the `id` value from a resource when constructing paths or referencing it in request bodies (e.g., `from_account`, `to_account`). ### Timestamps Date and time values are ISO 8601 strings (e.g., `2026-06-15T14:03:00Z`). Date-only fields use `YYYY-MM-DD`. ### Versioning The API is versioned via an optional `API-Version` request header containing an integer version (e.g., `API-Version: 20`). Omitting the header always resolves to the latest version. Pin a version in production so that additive, backward-incompatible response changes do not affect your integration. A non-integer value returns `400`. ### Pagination List endpoints return a paginated envelope. The most common shape is: ``` { "links": { "next": "https://api.sandbox.narmi.dev/v1/transactions/?page=2", "previous": null }, "meta": { "total": 240 }, "transactions": [] } ``` - The data array is named after the resource (e.g., `transactions`, `transfers`, `accounts`); some endpoints use the generic `results`. - Page through results by following `links.next` until it is `null`. - Page-based endpoints accept `page` and `per_page`; offset-based endpoints accept `limit` and `offset`. The maximum page size is capped server-side. ### Sudo Elevation (step-up authentication) Sensitive write operations — such as creating an external transfer — require a recent second-factor (2FA) re-verification, referred to as **sudo**. If sudo has expired, the request is rejected and you must elevate the session: 1. `GET /v1/sudo/` returns `200` if the user currently has sudo, or `404` if elevation is required. 2. `POST /v1/sudo/` with a `device_id` dispatches a one-time password to the user's 2FA device. 3. `POST /v1/sudo/` with `device_id` and `one_time_password` validates the code and grants sudo. A `403` with the `two_factor_authentication_required` error indicates the operation needs elevation (or that the user has no registered 2FA device). ## Idempotency Mutating requests (`POST`, `PUT`, `PATCH`, `DELETE`) may safely be retried by supplying an `Idempotency-Key` header. This guards against creating duplicate resources when a network error leaves you unsure whether a request succeeded. ``` Idempotency-Key: f3ff7758-3a6c-4897-aa62-6af927339f24 ``` Behavior: - The key **must be a version-4 UUID**. A malformed key returns `422` with error ID `idempotency_key_invalid`. - While the original request is still being processed, a concurrent retry returns `409` with a `Retry-After` header indicating how long to wait before retrying. - After a request completes successfully, replaying the same key returns `409` with error ID `idempotency_key_used`. Keys are remembered for **1 hour**. - Idempotency is ignored for safe methods (`GET`, `HEAD`, `OPTIONS`) and for unauthenticated or unverified users. > The idempotency layer prevents duplicate side effects; it does **not** replay and return the original response body. Treat a `409 idempotency_key_used` as confirmation that the first request was already accepted, then fetch the resource to obtain its current state. ## Error Responses All errors follow a consistent format: ``` { "id": "", "message": "" } ``` | HTTP Status | Error ID | Meaning | | --- | --- | --- | | 400 | `bad_request_error` | Malformed request. | | 401 | `authentication_failed` | Invalid or expired token. | | 403 | `two_factor_authentication_required` | The operation requires sudo / 2FA elevation. | | 403 | `user_disabled` | The user's account is disabled. | | 404 | `not_found_error` | Resource not found. | | 409 | `idempotency_key_used` | The idempotency key was already used by a completed request. | | 422 | `invalid_request_error` | Validation error. | | 422 | `idempotency_key_invalid` | The idempotency key is not a valid UUIDv4. | | 429 | `rate_limit_error` | Too many requests. | | 503 | `core_down_error` | Core banking system temporarily unavailable. | | 503 | `service_failure_error` | An upstream service was unavailable; retry shortly. | Validation errors (`invalid_request_error`) may return a `message` that is either a string or a structured object/array keyed by field name. Error messages are localized; do not match on `message` text — branch on `id` instead. ## Rate Limiting API endpoints are rate-limited per client and per IP. Limits vary by endpoint, with sensitive operations (such as authentication) limited more strictly than read endpoints. When a limit is exceeded, the API returns HTTP 429 with error ID `rate_limit_error`. Back off and retry after a short delay, and design integrations to avoid bursty traffic. ## Related - [Open Banking API Overview](/open-banking-api-overview.md) - [Admin API Overview](/admin-api-overview.md) - [API Overview](/api-overview.md)