Skip to main content
Every request to the FraudEG REST API must be authenticated with an API key passed as a Bearer token in the Authorization header. There are no cookies, no OAuth flows, and no session management to set up — just a single header added to every call. This page explains how to get your key, how to use it correctly, and how to keep it secure.

API Key Authentication Model

FraudEG uses static API keys as Bearer tokens. When you include your key in the Authorization header, FraudEG verifies the key, identifies your account and environment, checks the key’s permissions, and then processes your request — all before any fraud logic runs. The expected header format is:
There is no token expiry by default. Keys remain valid until you manually revoke them from the dashboard, which means keeping them secret is critical.

Getting Your API Keys

API keys are managed in the FraudEG dashboard:
  1. Log in to dashboard.fraudeg.com.
  2. Go to Settings → API Keys.
  3. Click Create new key.
  4. Enter a descriptive label (for example, production-backend or staging-payments-service).
  5. Select the environment: Live or Test.
  6. Click Generate. Your key is shown once — copy it immediately and store it in a secrets manager or environment variable.
Create separate API keys for each environment and each service. For example, use one key for your production payments service, another for your staging environment, and another for local development. This limits blast radius if a key is ever compromised, and makes it easy to rotate one key without disrupting others.

Live Keys vs. Test Keys

FraudEG issues two classes of API key, distinguished by their prefix: Always use a test key during development, integration testing, and CI pipelines. Use a live key only in your production environment, and only in server-side code.

Authenticating API Requests

Pass your API key in the Authorization header on every request. The examples below all call POST /v1/transactions/score, but the same header applies to every FraudEG endpoint.
Notice that all three examples read the key from an environment variable (process.env.FRAUDEG_API_KEY / os.environ["FRAUDEG_API_KEY"]) rather than embedding it as a string literal. This is the expected pattern in production code.

Security Best Practices

Follow these rules to keep your API keys secure: Use environment variables or a secrets manager. Never write an API key as a string literal in your source code. Use environment variables locally and a secrets manager (AWS Secrets Manager, HashiCorp Vault, GCP Secret Manager, etc.) in production. Keep keys server-side only. FraudEG API calls must be made from your backend. Your API key grants full access to your account — it must never appear in browser JavaScript, mobile app binaries, or any client-side code. Use one key per service. Scope each key to a single application or service. When you need to rotate or revoke a key, only that one service is affected. Rotate keys proactively. Rotate keys on a regular schedule (every 90 days is a reasonable baseline) and immediately if you suspect any exposure. Audit key usage. The FraudEG dashboard shows last-used timestamps and request counts per key. Review this regularly and revoke any keys that are no longer in use.
Never embed API keys in frontend code. If your API key appears in client-side JavaScript, a mobile app bundle, a public Git repository, or browser developer tools, treat it as compromised immediately. Go to Settings → API Keys in the dashboard, revoke the exposed key, and generate a new one. All FraudEG API calls must originate from your server.

Rotating and Revoking Keys

To rotate a key:
  1. Go to Settings → API Keys in the dashboard.
  2. Create a new key with the same label and environment as the one you are replacing.
  3. Update your environment variable or secrets manager entry with the new key.
  4. Deploy the updated configuration to your service.
  5. Once the new key is confirmed working, return to Settings → API Keys and click Revoke next to the old key.
To immediately invalidate a key (for example, after a suspected leak):
  1. Go to Settings → API Keys.
  2. Find the key and click Revoke.
  3. Confirm the revocation. The key stops working instantly — ongoing requests using it will immediately receive 401 Unauthorized responses.

Authentication Error Responses

FraudEG returns standard HTTP error codes for authentication and authorization failures:

401 Unauthorized

Returned when the Authorization header is missing, malformed, or contains an invalid or revoked key.
Common causes:
  • The Authorization header is not present in the request.
  • The key has been revoked from the dashboard.
  • The key string was truncated or corrupted (check for extra whitespace or missing characters).
  • You are using a test key against the production environment URL, or vice versa.

403 Forbidden

Returned when the API key is valid but does not have permission to access the requested resource. This can happen if the key was created with restricted scopes.
Common causes:
  • The key was created with a limited scope that excludes the endpoint you are calling.
  • You are attempting to access account-level resources (for example, key management endpoints) with a restricted key.
If you encounter a 403 you do not expect, go to Settings → API Keys, check the key’s assigned scopes, and create a new key with the appropriate permissions.