fegura.ai

Authentication

The Fegura API uses API keys for authentication. Include your API key in theAuthorization header of every request using the Bearer token format.

API Keys

API keys are created from your API Keys settings page. Each key has a specific scope that determines what operations it can perform.

Key Formats

Fegura API keys follow these formats:

  • feg_live_* - Production keys with full access
  • feg_test_* - Test keys for development
Important: Keep your API keys secure. Never expose them in client-side code, public repositories, or logs.

Making Authenticated Requests

Include your API key in the Authorization header:

curl https://api.fegura.ai/api/accounts \
  -H "Authorization: Bearer feg_live_your_api_key" \
  -H "Fegura-Version: 2026-02-01"

Request Headers

ParameterTypeDescription
AuthorizationrequiredstringBearer token with your API key (e.g., Bearer feg_live_xxx)
Fegura-VersionstringAPI version date. Defaults to the version your key was created with.Default: 2026-02-01
Content-TypestringRequired for POST/PATCH requests with a bodyDefault: application/json

Scopes

API keys can be created with different scopes to limit their permissions. Choose the most restrictive scope that meets your needs.

ScopePermissionsUse Case
readRead accounts, scans, and diagramsDashboards, reporting, integrations
writeCreate scans and trigger operationsCI/CD pipelines, automation scripts

Authentication Errors

When authentication fails, the API returns a 401 Unauthorized response:

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}

Common Authentication Errors

ErrorCauseSolution
Missing API keyNo Authorization header providedAdd Authorization: Bearer your_key
Invalid API keyKey doesn't exist or was revokedCheck key in settings, create new if needed
Insufficient scopeKey scope doesn't allow the operationUse a key with the required scope

Security Best Practices

  • Use environment variables - Store API keys in environment variables, never hardcode them in source code.
  • Rotate keys regularly - Create new keys periodically and revoke old ones.
  • Use minimal scopes - Create keys with only the permissions they need.
  • Monitor usage - Review API key activity in your dashboard for unusual patterns.
  • Never expose keys - Don't include keys in URLs, logs, or client-side code.