Appearance
API Key Authentication
Netra API utilizes API keys for secure authentication. Each API key is associated with a specific team and user, providing granular control over API access.
Generating Your API Key
- Log in to your Netra application.
- Navigate to the Agent interface (either single-entity or multi-entity view).
- Click the Settings icon (gear symbol) in the bottom toolbar.
- In the left-hand menu of the settings panel, select API Keys under the Account section.
- Provide a descriptive name for your API key.
- Select an expiration period for your key (7 days, 30 days, 90 days, or No Expiration). For long-term integrations, "No Expiration" might be suitable, but consider rotating keys regularly.
- Click Create.
- Immediately copy the generated API key. This is the only time you will be able to see the full key. Store it in a secure location.
Important Security Note:
Treat your API key like a password. Do not share it publicly or commit it to version control. If your API key is compromised, delete it immediately from your Netra account and generate a new one.
Authenticating API Requests
To authenticate your API requests, include your API key in the Authorization header of your HTTP requests, using the Bearer token scheme.
Example (using cURL):
bash
curl -X GET https://api.netra.technology/v1/entities \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY"
Replace YOUR_API_KEY with the actual API key you generated.
API Key Security Best Practices
- Keep Keys Confidential: Never expose your API keys in client-side code, public repositories, or unsecured environments.
- Use Environment Variables: Store API keys as environment variables in your application or CI/CD pipelines.
- Regular Rotation: Periodically rotate your API keys, especially for long-lived integrations.
- Least Privilege: If Netra API introduces permissions in the future, grant API keys only the minimum necessary permissions.
- Monitor Usage: Regularly monitor the usage of your API keys for any unusual activity.