Skip to main content

Authentication

The NetraOCR API authenticates every request with an API key + secret pair, sent using HTTP Basic authentication.

  • Username → your api_key (public identifier, looks like ak_…)
  • Password → your api_secret (secret, looks like sk_…)
Authorization: Basic base64(api_key:api_secret)

Most HTTP clients build this header for you when you supply a username and password — you rarely need to base64-encode it by hand.

Sending credentials

curl https://netraocr.shivicx.com/api/v1/templates \
-u "ak_live_xxxxxxxx:sk_live_xxxxxxxx"

IP allow-listing (required)

Every API key carries a mandatory IP allow-list of exact IPv4/IPv6 addresses (single IPs — CIDR ranges are not accepted). A request is rejected with 403 if:

  • the key has no allow-list, or
  • the caller's IP is not on the key's list.

This means a key only works from servers whose public IPs you've explicitly registered. To find the IP the API sees for your current host, call GET /api-keys/my-ip. Manage the list with PATCH /api-keys/{key_id}/ip-whitelist.

Keep keys server-side

Because credentials grant full access from allow-listed IPs, treat the api_secret like a password. Use it only from backend servers — never embed it in browsers, mobile apps, or public repositories.

Getting credentials

API keys are created in the console (Settings → API Keys) or via the API Keys API. The api_secret is shown only once, at creation time. If you lose it, revoke the key and create a new one.

Errors

StatusMeaning
401 UnauthorizedMissing or invalid credentials
403 ForbiddenCaller IP not on the key's allow-list (or no list set)

See Errors for the full list and response shape.

Rotating credentials

To rotate, create a new key + secret pair, deploy it, then revoke the old key. Key and secret stay bound together for traceability — you don't rotate the secret independently of its key.

Next: Managing API Keys.