ISOERP docsAuthenticationAPI referenceMCPImport and exportVerificationGlossarySecurityChangelogFAQ

Authentication

Every API call carries Authorization: Bearer <token>. There are two kinds of token.

API keys (for integrations)

An API key is made in Settings → API keys by a signed-in person. It looks like nsk_AbCdEfGh_ followed by 43 more characters.

ScopeAllows
readevery read (GET) your role allows
writeevery read and change your role allows
read:<area>reads in one area only, for example read:documents
write:<area>reads and changes in one area only
mcpthe MCP endpoint; each tool it calls is checked again against the other scopes

The list of areas is returned by GET /api/api-keys/scopes. Areas are the groups of the API reference.

With a key you may leave out X-Company-Id; the key's company is used. Sending another company's id is refused with 403. Routes that span all of a person's companies (such as the list of your companies) are not available to keys.

curl -H "Authorization: Bearer $ISOERP_KEY" https://nrerp.khanwco.net/api/accounts

Sign-in tokens (for the screens)

The screens sign in with POST /api/auth/signin (or a code, a link, or Google) and receive an access token that lasts 15 minutes and a refresh token that rotates on every use. Calls that act in a company send X-Company-Id; the server checks it against your memberships and reads your role from there. Integrations should use API keys instead.

OAuth

OAuth sign-in for third-party apps and AI connectors is not available yet for this product. Use an API key with the mcp scope for the MCP endpoint.

Errors

Errors always have one shape: {"error": "a sentence a person can read"}. Business refusals are 422, permission 403, not found 404, duplicates 409, an invalid, expired or revoked token 401, too many calls 429.