Skip to content
On this page

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

  1. Log in to your Netra application.
  2. Navigate to the Agent interface (either single-entity or multi-entity view).
  3. Click the Settings icon (gear symbol) in the bottom toolbar.
  4. In the left-hand menu of the settings panel, select API Keys under the Account section.
  5. Provide a descriptive name for your API key.
  6. 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.
  7. Click Create.
  8. 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.

Powered by VitePress