Narro docs
Loading…
One pass through the integration with your sandbox key: two values in your .env, a first call, one client file from SETUP.md, the founder access request, the company profile, and Validate setup. The key is the only credential: no signing, and no key id, program id or cohort id.
narro_pk_test_ and is free. You have one. Its secret can be seen in the Hub at any time, so you cannot lose it. It reaches your sandbox cohort, which mirrors your cohort with synthetic founders."schema_version": "standard.v1". Narro finds your program and cohort from your key, so no id goes in a path, a body or your configuration. Where a path names a cohort, send current: the cohort your key belongs to. To create a module, use POST /cohorts/current/modules; the older POST /modules takes cohort_id as an optional field and fills in your key's cohort when you leave it out.The setup page shows your .env with the sandbox key filled in. It is exactly two names, and they are the same in the sandbox and live: NARRO_PROGRAMS_API_KEY and NARRO_PROGRAMS_API_BASE_URL, which is https://api.thenarro.com/programs/v1 for both. The key decides whether a call reaches the sandbox or live data.
# .env: the same two names in the sandbox and live. Going live is swapping the key value, nothing else.
# No key id, program id or cohort id: the key resolves them.
NARRO_PROGRAMS_API_KEY=narro_pk_test_<your-key>
NARRO_PROGRAMS_API_BASE_URL=https://api.thenarro.com/programs/v1Check the connection first. Any valid key may call it, with any scope, and it changes nothing:
curl -sS "$NARRO_PROGRAMS_API_BASE_URL/ping" \
-H "Authorization: Bearer $NARRO_PROGRAMS_API_KEY"{
"schema_version": "standard.v1",
"ok": true,
"key_id": "key_test_<your-key-id>",
"environment": "test",
"product": "programs",
"program": "prog_<partner-number>",
"cohort_id": "coh_<your-cohort-id>"
}The answer names the key and your cohort, for your information: your code never needs the key id. Read your cohort with current in place of a cohort id:
# current is the cohort your key belongs to: you never hold a cohort id.
curl -sS "$NARRO_PROGRAMS_API_BASE_URL/cohorts/current" \
-H "Authorization: Bearer $NARRO_PROGRAMS_API_KEY" \
-H "Accept: application/json"{
"schema_version": "standard.v1",
"id": "coh_<your-cohort-id>",
"name": "Example cohort",
"starts_at": "2026-01-12T00:00:00Z",
"ends_at": "2026-04-30T00:00:00Z",
"status": "running",
"member_count": 5,
"schedule": []
}A 200 with your cohort means the key, the address and your network scope work, and the Hub turns from waiting to connected within seconds. Any other answer carries a request_id. On https://api.thenarro.com errors are generic and name a category, not the cause. See Errors and retries.
The key is the only credential. Writes need an Idempotency-Key and no signature. The signing secret that comes with a key is needed only if Narro asks a key to sign after unusual use (see Authentication). A shell helper the rest of this page uses:
# narro_call METHOD PATH [BODY]. The key is the only credential: no signature. Writes carry an Idempotency-Key.
set -a && . ./.env && set +a
narro_call() {
method="$1"; path="$2"; body="$3"
curl -sS -X "$method" "$NARRO_PROGRAMS_API_BASE_URL$path" \
-H "Authorization: Bearer $NARRO_PROGRAMS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
--data-raw "$body"
}The same client in Node and in Python, which later steps reuse:
// narro-client.mjs. Server side only: the key never goes to a browser. Node 18 or newer, no packages.
import { randomUUID } from 'node:crypto';
// .env: NARRO_PROGRAMS_API_KEY and NARRO_PROGRAMS_API_BASE_URL, the same names in the sandbox and live.
// NARRO_PROGRAMS_API_BASE_URL is https://api.thenarro.com/programs/v1
// The key is the only credential. Writes carry an Idempotency-Key: pass the same one when you retry the same operation.
export async function narro(method, path, payload, { idempotencyKey } = {}) {
const url = process.env.NARRO_PROGRAMS_API_BASE_URL + path;
const headers = { Authorization: 'Bearer ' + process.env.NARRO_PROGRAMS_API_KEY, Accept: 'application/json' };
let body;
if (method !== 'GET') {
body = payload === undefined ? '' : JSON.stringify(payload);
headers['Content-Type'] = 'application/json';
headers['Idempotency-Key'] = idempotencyKey || randomUUID();
}
const response = await fetch(url, { method, headers, body: body || undefined, signal: AbortSignal.timeout(30000) });
const text = await response.text();
const json = text ? JSON.parse(text) : null;
if (!response.ok) {
const error = new Error('Narro request failed: ' + response.status + ' ' + (json && json.code));
error.problem = json;
error.status = response.status;
error.retryAfter = Number(response.headers.get('retry-after')) || null;
throw error;
}
return json;
}# narro_client.py. Server side only: the key never goes to a browser. Standard library only.
import json
import os
import uuid
from urllib.error import HTTPError
from urllib.request import Request, urlopen
# .env: NARRO_PROGRAMS_API_KEY and NARRO_PROGRAMS_API_BASE_URL, the same names in the sandbox and live.
# NARRO_PROGRAMS_API_BASE_URL is https://api.thenarro.com/programs/v1
def narro(method, path, payload=None, idempotency_key=None):
"""The key is the only credential. Writes carry an Idempotency-Key: pass the same one when you retry the same operation."""
url = os.environ["NARRO_PROGRAMS_API_BASE_URL"] + path
headers = {"Authorization": "Bearer " + os.environ["NARRO_PROGRAMS_API_KEY"], "Accept": "application/json"}
body = None
if method != "GET":
body = b"" if payload is None else json.dumps(payload, separators=(",", ":")).encode("utf-8")
headers["Content-Type"] = "application/json"
headers["Idempotency-Key"] = idempotency_key or str(uuid.uuid4())
request = Request(url, data=body, headers=headers, method=method)
try:
with urlopen(request, timeout=30) as response:
text = response.read().decode("utf-8")
return json.loads(text) if text else None
except HTTPError as error:
problem = json.loads(error.read().decode("utf-8") or "null")
raise RuntimeError("Narro request failed: %s %s (request_id %s)" % (error.code, problem and problem.get("code"), problem and problem.get("request_id"))) from errorimport { narro } from './narro-client.mjs';
const cohort = await narro('GET', '/cohorts/current'); // current: the cohort your key belongs to
console.log(cohort.name, cohort.status);
const modules = await narro('GET', '/modules?limit=25');
console.log(modules.data.length, modules.next_cursor); // next_cursor is null on the last pagefrom narro_client import narro
cohort = narro("GET", "/cohorts/current") # current: the cohort your key belongs to
print(cohort["name"], cohort["status"])
modules = narro("GET", "/modules?limit=25")
print(len(modules["data"]), modules["next_cursor"]) # next_cursor is null on the last pageThe setup page offers one file, SETUP.md, made for your key. It is a client spec, not a recipe: you, or an AI coding agent, add ONE file to your project, narro.ts, narro.js, narro.py or your stack's usual client location, with one function per endpoint, named after the operation, with arguments named exactly as the request fields. It reads only the two names in your .env, sends the key, handles JSON, typed errors, idempotency keys, paging, timeouts and retries, and fills in current for the cohort. Nothing else in your project changes: no sign-in, auth, routing or UI. You call the functions where you choose.
SETUP.md has the exact instructions for an agent, the .env, the client rules, a reference client in TypeScript, every endpoint, common flows as function calls, webhooks, founder emails, going live and every refusal code with its fix. For a sandbox key it holds the secret, so keep it out of version control. Using an AI agent? Give it the file and the prompt the Hub shows beside the download:
Here is my Narro Programs API setup file. Follow its "For AI agents" section: create one Narro client file in my project (narro.ts, narro.py or my stack's equivalent) with the functions it lists, add the two .env values (NARRO_PROGRAMS_API_KEY and NARRO_PROGRAMS_API_BASE_URL), run narroPing() to confirm it works, and don't change any existing code, sign-in or routes. Then tell me which functions I can call.The agent reports the file it created, the function list and the result of narroPing(). Then call, for example, createFounderToken when a founder signs in on your platform.
This is the call your platform makes most. When a founder is signed in on your platform, your server sends POST /founder-tokens and gets back a founder token that sees that founder's data and nothing else. Name the founder by their program email: it is the identifier. A member id is optional partner metadata, and sent with the email it must match the roster. The identity rules are being tightened, so do not rely on a member id alone.
What happens to an email that is not on the roster depends on the cohort policy unknown_founders, which your platform reads from identity_contract.unknown_founders in setup.json. With enroll, the default, the request adds that email to the roster, creates the founder's Narro account and answers with founder_state new. With refuse, the answer is founder_not_on_roster: add the founder to the roster first.
The founder must have accepted the Narro consents. By default your platform shows them the Narro consent text and relays their acceptance once, as consent with accepted: true and the text version you showed (narro-program-consent-text-2026-11-01 today; the Hub and the setup file name the current one). Without it the answer is consent_required. In the sandbox, make a test member in one click in the Cohorts and roster, or use the synthetic members, such as mem_test_0001.
# A founder is signed in on your platform. Name them by program email. member_id is optional and, if sent, must match the roster.
narro_call POST "/founder-tokens" '{
"schema_version": "standard.v1",
"program_email": "founder@example.com",
"consent": { "accepted": true, "text_version": "narro-program-consent-text-2026-11-01" }
}'{
"schema_version": "standard.v1",
"id": "fnt_<token-id>",
"token": "<founder-token>",
"founder_id": "fdr_<founder-ref>",
"scopes": ["portal.read", "intros.request"],
"expires_at": "2026-01-12T15:15:00Z",
"refresh_after": "2026-01-12T15:12:00Z",
"rotation_overlap_seconds": 120,
"founder_state": "new",
"missing_fields": [],
"dropped_fields": [],
"policy_version": 1
}founder_state is new the first time a founder is connected (in enroll mode, that includes the roster add), and known after that. Send the intake profile fields your intake policy asks for while it is new.missing_fields lists profile fields Narro still lacks, and dropped_fields the ones it did not store, with the reason.refresh_after, then ask for the next one. Do not hand it to the browser or the app: your backend proxies the founder's reads.import { narro } from './narro-client.mjs';
// Call this on your server when a founder is signed in on your platform. A founder token sees one founder's data and nothing else.
// It lasts 15 minutes. Keep it server-held: cache it on your server keyed by the founder session, program, cohort and environment,
// reuse it until refresh_after, then mint the next one. Proxy the founder's reads through your backend, never to the browser or app.
const minted = await narro('POST', '/founder-tokens', {
schema_version: 'standard.v1',
program_email: 'founder@example.com', // the identifier. member_id is optional; if you send it, it must match the roster
consent: { accepted: true, text_version: 'narro-program-consent-text-2026-11-01' }, // after your page showed the Narro consent text
});
console.log(minted.founder_state, minted.expires_at, minted.refresh_after);from narro_client import narro
# Call this on your server when a founder is signed in on your platform. Name them by program email.
# Keep the token server-held (never send it to the browser or app) and reuse it until refresh_after.
minted = narro("POST", "/founder-tokens", {
"schema_version": "standard.v1",
"program_email": "founder@example.com",
"consent": {"accepted": True, "text_version": "narro-program-consent-text-2026-11-01"},
})
print(minted["founder_state"], minted["expires_at"], minted["refresh_after"])A founder created with only an email has an empty company profile. Matches, the network, investor fit and intros need to know the company, so those calls answer 409 company_profile_incomplete until you send it. This is true in the sandbox as in live. Send it right after the founder access request, with a PUT on the founder's company route. company_name is required. industry and company_stage unlock most features, and city and country keep matches from coming back few or none. The founder_id is the fdr_ reference from step 4.
# Send the founder's company profile. company_name is required on PUT. current is the cohort your key belongs to.
# Option fields take the slug or the label, in any case. Values here are examples: send the founder's own.
curl -sS -X PUT "$NARRO_PROGRAMS_API_BASE_URL/cohorts/current/founders/fdr_<founder-ref>/company" \
-H "Authorization: Bearer $NARRO_PROGRAMS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"schema_version": "standard.v1",
"company_name": "Sample Company",
"industry": "fintech",
"company_stage": "seed",
"target_market": "Small businesses that invoice in more than one currency.",
"city": "Toronto",
"country": "Canada",
"summary": "Invoicing and payouts for small exporters.",
"website": "https://example.com",
"sub_categories": ["payments", "saas"],
"raise_amount": 1500000,
"raise_currency": "CAD"
}'The answer is a receipt with applied, kept and the requirements after the write. Read the requirements at any time with GET /cohorts/current/founders/{founder_id}/requirements. You can also put a company block on POST /founder-tokens and send everything in step 4. Every field, the values each one accepts and the errors are on Company profile and readiness.
Your sandbox cohort is seeded when it is made, so you do not have to reset it to start. A reset puts back five synthetic founders, three modules, materials, matches and deliverables, and gives you new test access codes. Only test keys can call it. See Sandbox.
narro_call POST "/sandbox:reset" ''An access code is how a roster founder starts signing in. There is one per founder per cohort. It is single use and expires in 14 days unless you set expiry_days, at most 30. In the sandbox you do not have to issue codes: a reset (step 6) gives each synthetic founder a test code. You can also load a sandbox roster with PUT /cohorts/current/roster and issue codes for it exactly as in live: your test key holds every partner scope (24), roster.write and codes.manage included. A live key carries the scopes it was made with.
For real founders, an Owner or Admin issues codes in the Hub, or your server issues them with a live key that holds codes.manage. founder_ids takes either the roster member id or the fdr_ founder id that the roster answer and POST /founder-tokens return; anything else is founder_not_on_roster. The delivery field decides who sends the code:
narro_email: Narro emails the code to the founder's program email.export_once: the plain code comes back once, in the response, for you to send. Narro keeps only a hash.narro_call POST "/cohorts/current/codes:issue" '{
"schema_version": "standard.v1",
"founder_ids": ["<roster-id>"],
"delivery": "export_once",
"expiry_days": 14
}'{
"schema_version": "standard.v1",
"data": [
{
"id": "cde_<code-record-id>",
"founder_id": "fdr_<founder-ref>",
"state": "outstanding",
"issued_at": "2026-01-05T15:00:00Z",
"expires_at": "2026-01-19T15:00:00Z",
"code": "<shown-once-with-export_once-only>"
}
],
"next_cursor": null
}Issuing and revoking codes is limited to the Owner and Admin roles on your Hub team. Roster founders are named by your member id. Revoke a code with POST /codes/{id}:revoke.
POST /widget-tokens answers 403 product_unavailable with your test key and with a live key, and so does every Events route. This step shows how widget tokens will work when Widgets opens. Skip it: nothing in your setup or go-live needs them.A widget runs on a short-lived token your server mints for one widget, one origin and one founder. The key never goes to the browser. The token lasts at most 10 minutes, and ttl_seconds can ask for less, from 30 to 600. The founder_id here is the fdr_ reference Narro returned for the founder, not the member id. A founder who has not signed in to Narro yet has no account, and the mint fails with account_unresolved. An anonymous enter_portal token needs no founder.
narro_call POST "/widget-tokens" '{
"schema_version": "standard.v1",
"widget": "my_cohort",
"origin": "https://<your-site-origin>",
"founder_id": "fdr_<founder-ref>"
}'In practice your own endpoint mints it for each page view and hands it to the loader. See Widgets.
// Your backend: the URL you put in data-token-url. Express shown; any framework works.
import express from 'express';
import { narro } from './narro-client.mjs';
const WIDGETS = ['enter_portal', 'my_cohort', 'module_materials', 'submit_deliverable', 'tier_a_this_week', 'ask', 'intro_request'];
const app = express();
app.get('/narro/widget-token/:widget', async (req, res) => {
const widget = req.params.widget;
if (!WIDGETS.includes(widget)) return res.status(404).end();
const founderRef = await founderRefFor(req); // your own session lookup: the fdr_ reference from your roster, or null when signed out
const body = { schema_version: 'standard.v1', widget, origin: 'https://<your-site-origin>' };
if (founderRef) body.founder_id = founderRef; // omit for an anonymous token (enter_portal only)
try {
const minted = await narro('POST', '/widget-tokens', body);
res.set('Cache-Control', 'no-store').json({ token: minted.token }); // valid for at most 10 minutes
} catch (error) {
res.status(502).json({ error: 'widget_unavailable' });
}
});
async function founderRefFor(req) {
return req.session && req.session.narroFounderRef ? req.session.narroFounderRef : null;
}
app.listen(3000);409 with signin_confirmation_required, and the page asks the person to type the program email the code was issued for (POST /auth/magic/{token}). A wrong email is the same generic failure as any other, and 5 wrong emails end the link.You do not build this form. Use the Enter portal widget or the Narro portal. Details of the credentials are on Authentication.
Webhooks are optional, for setup and for go-live. Register an HTTPS endpoint in the Webhooks or with the API. Narro then posts a signed verification request to it. Your endpoint must answer 2xx within 10 seconds and echo the challenge, as JSON { "challenge": "..." } or as the bare text. Only then does the endpoint turn on.
narro_call POST "/webhooks" '{
"schema_version": "standard.v1",
"url": "https://<your-site-origin>/narro/webhook",
"events": ["deliverable.status_changed", "intro.status_changed", "key.status_changed"]
}'The response carries the endpoint's own signing secret once. It is not your key and not the key's signing secret. Store it, then verify every delivery. A receiver in Node:
import express from 'express';
import { verifyWebhook } from './verify-webhook.mjs';
const app = express();
const seen = new Set(); // use a database in production: deduplicate on the event id
// The raw body is required: the signature covers the exact bytes Narro sent.
app.post('/narro/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const result = verifyWebhook({
secrets: [process.env.NARRO_WEBHOOK_SECRET],
headers: req.headers,
rawBody: req.body,
});
if (!result.ok) return res.status(400).end();
const event = JSON.parse(req.body.toString('utf8'));
if (event.type === 'endpoint.verification') {
return res.json({ challenge: event.challenge }); // the registration challenge
}
if (seen.has(event.id)) return res.status(200).end(); // a retry or a replay: already handled
seen.add(event.id);
// Hand the event to your own queue here, then answer fast.
res.status(200).end();
});
app.listen(3000);And in Python, with the verifier from Webhooks:
import json
import os
from flask import Flask, request
from verify_webhook import verify_webhook
app = Flask(__name__)
seen = set() # use a database in production: deduplicate on the event id
@app.post("/narro/webhook")
def narro_webhook():
raw = request.get_data() # the exact bytes, before any parsing
result = verify_webhook([os.environ["NARRO_WEBHOOK_SECRET"]], dict(request.headers), raw)
if not result["ok"]:
return "", 400
event = json.loads(raw)
if event.get("type") == "endpoint.verification":
return {"challenge": event["challenge"]} # the registration challenge
if event["id"] in seen:
return "", 200 # a retry or a replay: already handled
seen.add(event["id"])
# Hand the event to your own queue here, then answer fast.
return "", 200You can then send the signed test event from the Webhooks. To send founder emails yourself, choose You send them on the Founder emails page: see Webhooks.
Press Validate setup on the setup page. One call runs a checklist with your sandbox key and keeps the result: the key is active, the address is reachable, the key's scopes cover the Programs API, sandbox founders are available, a sandbox founder can sign in and their data can be read, and your platform has called the sandbox. A webhook, when you have one, gets a signed test event; that check is optional. Every failed check comes with one line that says what to fix. You do not have to ask Narro.
When your organization is set up (profile and billing), you have a cohort, your sandbox key made a successful call and Validate setup passed, an Owner or Admin presses Create live key. Founders, webhooks, widgets and a second factor are not needed. Put the live key in NARRO_PROGRAMS_API_KEY. Nothing else changes: the same base URL, the same functions, and current is now your live cohort. See Go live.
In the Cohorts and roster (one by one, or paste or upload a list), or with a live key that holds roster.write, load the cohort roster. Each founder has a first name, a last name, a company and an email. In the API send first_name and last_name beside display_name, which is the two joined. In the Hub, a CSV file has the header first_name,last_name,company,email,member_id; an older file with one name column still works. The member_id is optional: send your own, such as EX-1042, or leave it out and Narro makes a stable one, such as mem_k7m2q9x4ta. A founder whose email is already on the roster keeps their id. You can set your own id later in the Hub. The email is accepted on the way in and never returned. Up to 500 founders a call.
# member_id is optional. Send your own id, or leave it out and Narro makes one (mem_ and 10 characters).
# Each founder: first name, last name, company and email. display_name is the two names joined.
narro_call PUT "/cohorts/current/roster" '{
"schema_version": "standard.v1",
"founders": [
{
"member_id": "EX-1042",
"program_email": "founder@example.com",
"first_name": "Sample",
"last_name": "Founder",
"display_name": "Sample Founder",
"company_name": "Sample Company"
},
{
"program_email": "second.founder@example.com",
"first_name": "Second",
"last_name": "Founder",
"display_name": "Second Founder",
"company_name": "Second Company"
}
]
}'Do not load real founders into the sandbox cohort. A sandbox reset refuses to run when any founder on its roster is not synthetic. Next, read Go live for the go-live essentials and the review.