API Key Authentication
All API requests require authentication via an API key passed in theAuthorization header using the Bearer scheme.
Getting an API Key
API keys are generated by your Inspecto administrator through the admin panel. Each key is:- Company-scoped: Only accesses data for your company
- Permission-based: Has specific scopes (read/write permissions)
- Environment-specific: Separate keys for sandbox and production
Security Best Practices
Store Keys Securely
Store Keys Securely
- Use environment variables or secret management systems
- Never commit keys to version control
- Don’t expose keys in client-side code
- Use
.envfiles with.gitignore
Rotate Keys Regularly
Rotate Keys Regularly
- Rotate keys every 90 days
- Use the rotation endpoint to create new keys
- Old keys are automatically revoked after rotation
Use Minimum Scopes
Use Minimum Scopes
- Request only the scopes your integration needs
- Separate keys for read-only vs write operations
- Use different keys for different services
Revoke Compromised Keys
Revoke Compromised Keys
- Immediately revoke any compromised keys
- Monitor key usage in the admin panel
- Set up alerts for unusual activity
API Key Format
API keys follow a specific format for security and identification:Keys are hashed using SHA-256 before storage. Only the fingerprint (first 8 characters) is stored in logs for auditing.
Making Authenticated Requests
Authentication Errors
401 Unauthorized
Returned when the API key is invalid, missing, or expired.- Missing
Authorizationheader - Invalid key format
- Expired or revoked key
- Incorrect Bearer scheme