API Reference
Authentication
The Cleori API uses Bearer token authentication. Each asset has its own unique token for telemetry and activation endpoints, while administrative operations require user authentication tokens.
Token Types
Asset Tokens
Purpose: Asset-specific operations
- Send telemetry data
- Receive activations
- Confirm activation execution
Scope: Limited to single asset
User Tokens
Purpose: Administrative operations
- Manage organizations
- Configure assets
- View reports and analytics
Scope: Organization-wide
Using Asset Tokens
Each asset receives a unique Bearer token during registration. Use this token for all asset-specific operations.
Sending Telemetry
Getting Activations
Using User Tokens
User tokens are required for administrative endpoints like managing assets, viewing organization data, and configuring settings.
Getting Your Access Token
Access tokens for system/machine requests are available in the Settings page of your dashboard. These tokens do not expire and are intended for programmatic API access.
Note: Store your access token securely. If compromised, you can regenerate a new token from the Settings page.
Administrative Operations
Token Security
Important: Never expose tokens in client-side code, logs, or version control systems.
Best Practices
- Store securely: Use environment variables or secure key management
- Use HTTPS: Always communicate over encrypted connections
- Rotate user tokens: Refresh user tokens daily
- Monitor usage: Track API calls for suspicious activity
- Limit scope: Use asset tokens only for asset operations
Example: Secure Token Storage
Error Handling
Common Authentication Errors
| Status | Error | Solution |
|---|---|---|
| 401 | Missing token | Include Authorization header |
| 401 | Invalid token | Check token is correct |
| 401 | Invalid token | Check token is correct |
| 403 | Wrong token type | Use asset token for asset endpoints, user token for admin |
| 403 | Insufficient permissions | Check user role permissions |
Example Error Response
Token Management
Getting Your Asset Token
Asset tokens are provided when you register an asset through the platform:
- Register asset via Cleori dashboard or API
- Receive unique asset token
- Store securely in your integration
- Use for all asset operations
Token Management
Asset Tokens
- No expiration
- No refresh needed
- Revoke and regenerate if compromised
User Tokens
- Available in Settings page
- No expiration for machine access
- Regenerate if compromised