Skip to content

Guides

Authentication

How to authenticate against the Inspow API with a JWT Bearer token or an API Key.

The Inspow API accepts two credentials:

  • A User’s JWT token (Bearer scheme), obtained with their email and password.
  • An API Key from your Organization, for server-to-server integrations (see API Keys).

Send the credentials to the login endpoint. If the email exists in several organizations, specify which one with tenantSlug:

Ventana de terminal
curl -X POST https://api.inspow.tech/api/v1/access-control/auth/login \
-H "Content-Type: application/json" \
-d '{ "email": "you@example.com", "password": "••••••••", "tenantSlug": "my-organization" }'

Like every API response, it comes wrapped in { "data": …, "meta": … }. The token is in data.token (together with the User’s details in data.user).

If the account has 2FA enabled, the login does not return token, but requires2fa: true and a tempToken (valid for about 5 minutes). Complete it with the code from the authenticator app:

Ventana de terminal
curl -X POST https://api.inspow.tech/api/v1/access-control/auth/2fa/verify \
-H "Content-Type: application/json" \
-d '{ "tempToken": "<TEMP_TOKEN>", "code": "123456" }'

To use a backup code, also send "isBackupCode": true. For automated integrations, use an API Key instead.

Include the token in the Authorization header of every protected request:

Ventana de terminal
curl https://api.inspow.tech/api/v1/access-control/auth/user/me \
-H "Authorization: Bearer <YOUR_TOKEN>"

For server-to-server integrations, use an API Key from your Organization, with a limited scope, instead of a User’s token. It is sent in X-API-Key: ak_… or in Authorization: Bearer ak_… / Authorization: ApiKey ak_…. See API Keys.