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 (insp_live_…) 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://backend.inspow.com.co/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://backend.inspow.com.co/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://backend.inspow.com.co/api/v1/access-control/auth/user/me \
-H "Authorization: Bearer <YOUR_TOKEN>"

For server-to-server integrations, don’t use a User’s token: create an API key in Developers and use it against the public API (https://backend.inspow.com.co/api/public/v1) with Authorization: Bearer insp_live_…. Legacy ak_ keys keep working on /api/v1 until you revoke them.