senapati
Documentation index

Authentication

One credential: the API key. Keys are long-lived, meant for servers and scripts, and managed from the dashboard. Every product endpoint takes one.

API keys

Keys start with snpt_. Send one on every product call as the X-API-Key header:

curl -X POST "https://api.senapati.io/api/check-ip" \
  -H "X-API-Key: $SENAPATI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ip":"1.1.1.1"}'
  • The full key is shown once, when it is created. Afterwards the dashboard shows only its prefix.
  • Your plan sets how many active keys you can hold: 2 on Free, up to 25 on Enterprise.
  • Revoking a key takes effect immediately; in-flight requests with it fail with 401 UNAUTHORIZED.
  • Keys inherit the account's credits and rate allowance; there are no per-key quotas.

Managing keys

Create, name and revoke keys in the dashboard under API keys. Name each key after the integration that will use it, so you can rotate or revoke one without touching the others. Your plan and balance are readable from code with GET /api/account/subscription; see Credits & rate limits.

Good practice

  • One key per integration, named after it, so revocation is surgical.
  • Read the key from the environment; never commit it or ship it to a browser.
  • Rotate: create the replacement first, deploy it, then revoke the old key.
  • Treat 401 as a configuration error and 402 as a billing signal: retrying either does nothing. See Errors.