Skip to content
Narro
Narro AI
Pricing
Log inContact sales
Contact sales
Documentation
How it worksSupport

Get started

OverviewWorkspaceHow Narro works

Moxie

Moxie

The record

Company record

Prepare

Prepare

Fundraise

Fundraise
Add-ons

Network

Narro Network

Bring data in

IntegrationsGoogle DriveGmail

Share Narro out

Connect
MCP
PlatformsPermissionsCustom apps

Account

AccountBillingTeamMemory

Reference

SecurityFAQ

Developers

Which API do I need?
Data API
Getting started for partnersAuthentication and keysRate limitsEnvelope and errorsSandbox dataEndpointsWebhooksEvents APIOutcome write-backIntakeMCP for Claude and CursorJSON SchemasPricing and tiers
Programs API
Getting startedCompany profile and readinessAsk NarroAuthenticationKeysKey scopingRate limitsErrors and retriesSandboxEndpointsWebhooksEventsOutcomesIntake and documentsMCPJSON SchemasObjects and error codesWidgetsVersioningGo livePricing and billingData protection

Narro docs

Loading…

Docs/Developers/Programs API/Key scoping

Key scoping

A key works only from the places you registered for it. If it leaks, it is useless anywhere else.

Two kinds of scope

ScopeForChecked against
allowed_originsWidgets and browsers: the pages that embed a widget.The Origin of the request, or the origin of its Referer.
allowed_ip_rangesYour servers: the API and MCP.The address the request comes from.

A key can have either or both. You give the origins and the address ranges in the Programs setup, and a new live key starts with them. You can also set them on the key when you create it. A key holds at most 25 origins and 50 address ranges. Both are optional. A live key that is used for widgets must have at least one allowed origin.

Allowed origins

  • An origin is a scheme, a host and an optional port. No path, no query, no username or password.
  • Production origins use https. Plain http is accepted only for localhost and 127.0.0.1, and only on test keys.
  • Use a domain name, not an IP address.
  • Wildcards. One leading label can be a wildcard, as in https://*.example.com. It needs a real domain behind it, at least two labels. It matches subdomains and not the bare domain, so list https://example.com too if you need it. A wildcard cannot appear anywhere else, and there is no wildcard for the scheme or the port.
  • The origin you put in a widget token request must be one of these exactly. See Widgets.

Allowed IP ranges

  • Give single addresses or CIDR ranges, IPv4 or IPv6. Use the fixed outbound addresses of the servers that call Narro.
  • Very broad ranges are refused, because a range that wide is not a network scope: nothing wider than /8 for IPv4 or /16 for IPv6.
  • Narro reads the caller's address from the proxy chain in front of it and ignores anything a caller adds to the forwarding header. The address it uses is the one your request reaches api.thenarro.com from. Call from a server with a stable address, not through a shared proxy that changes it.

How a request is checked

Key hasA request must
IP ranges (a server key)Come from an address inside a range. If it also carries an Origin, that origin must match the allowed origins too. An Origin header is easy to forge outside a browser, so the address check is never skipped because an Origin is present.
Origins only (a browser key)Carry a matching Origin.
Neither (an unscoped key)A sandbox key is allowed. A live key with neither list is allowed for its 90 day life, cannot hold the widget scope, and never treats an empty list as every origin. A scoped key must name something, so a scoped key with neither list is refused.

The check runs before the request does anything else, and for MCP before any tool runs. Every refusal is also recorded on Narro's side as a flag on the key, which can lead to a closer look at it.

Browser calls (CORS)

A browser can call the API with a key or a token only from an origin that is allowed for it. Narro never answers with a wildcard and never allows credentials. Browsers call the public path, /public/standard/v1/..., because the preflight is answered only there. Servers use /programs/v1/....

  • A response carries Access-Control-Allow-Origin only when the request's Origin is the one origin of the widget token, or one of the allowed_origins of the partner key. Otherwise the browser blocks the response.
  • A preflight carries no credential. It is answered with 204 only for an origin that an active key lists, and with 403 for any other. The allowed methods are GET, POST, PUT, PATCH and OPTIONS. The allowed request headers are Authorization, Content-Type, Idempotency-Key, Narro-Timestamp, Narro-Nonce, Narro-Signature, Narro-Widget-SDK, Narro-Challenge and Narro-Link-Token. A preflight is cached for 600 seconds.
  • A script on a page can read X-Request-Id, RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, Retry-After, Deprecation, Sunset, Link and Idempotent-Replay.
  • A partner key does not belong in a browser. A key with only origins has no address check, and the Origin header is sent by the caller. Keep a browser key to what a page may do, such as minting widget tokens, and use IP ranges for every server key.

What you see when a check fails

EnvironmentAnswer
A detailed environment (staging)The status is 403 and the code names the cause: ip_not_allowed, origin_not_allowed or unscoped_key_not_allowed.
Production, including api.thenarro.comThe same 403 with one generic answer, request_not_permitted, for every cause. It never says whether it was the address, the origin or the scope.

The generic answer is on purpose: an error that names the rule helps someone with a stolen key find the rule to get around. Which form you get depends on the environment that serves the request, not on the key. The production host answers generically for test keys too. If you cannot tell which check failed, compare the address and the origin you registered with the ones your request really comes from, and quote the request_id when you ask Narro. See Errors and retries.

Unscoped keys

Origins and IP ranges are optional, so you can start without registering anything. A sandbox key can be unscoped. A live key created with no allowed origins and no IP ranges is unscoped: it lives 90 days, and it cannot hold the widget scope, because a live key used for widgets needs at least one allowed origin. An empty list never means every origin or address is permitted for a widget. Narro checks the key on every request, so it stops the moment it expires. For a live key that lives longer, give it origins or IP ranges when you create it.

Why scope a live keyA sandbox key reaches the synthetic data of your sandbox cohort only, so an unscoped one risks nothing. A live key reaches real founders. Binding it to your own origins and addresses means a copy of it, taken from a log or a repository, does not work for anyone else.

Changing a scope

  • Only a Narro administrator can change the origins, the IP ranges or the scope of a key. You cannot change them from the Hub or the API. Ask Narro, say which key and which values, and say why.
  • Update the origins and ranges in your profile as well, so the next key Narro issues for you starts from the right values.
  • A replacement key keeps the same scopes, uses, cohort, environment and network scope as the key it replaces. If you need a different scope on the new key, ask for it with the rotation request. See Authentication for rotation.
PreviousKeysNextRate limits

Home · Sign in

On this page

Two kinds of scopeAllowed originsAllowed IP rangesHow a request is checkedBrowser calls (CORS)What you see when a check failsUnscoped keysChanging a scope