Skip to content

API Authentication

The NEURO API uses Bearer token authentication. This guide explains how to obtain and use API tokens.

TypeUse CaseExpiration
Personal TokenIndividual user accessConfigurable
Service TokenApplication integrationsLong-lived
  1. Log into NEURO
  2. Go to SettingsAPI Access
  3. Click + Create Token
  4. Configure token:
    • Name: Descriptive name
    • Expiration: Never, 30 days, 90 days, 1 year
    • Scopes: Select permissions
  5. Click Create
  6. Copy the token immediately - it won’t be shown again

For application integrations:

  1. Go to SettingsIntegrationsAPI Tokens
  2. Click + Create Service Token
  3. Configure token settings
  4. Assign to a service account

Include the token in the Authorization header:

Terminal window
curl -X GET "https://{tenant}.nforged.com/api/v1/projects" \
-H "Authorization: Bearer nf_live_abc123..."
Terminal window
# List projects
curl -X GET "https://{tenant}.nforged.com/api/v1/projects" \
-H "Authorization: Bearer YOUR_TOKEN"
# Create finding
curl -X POST "https://{tenant}.nforged.com/api/v1/findings" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"project_id": "proj_123", "title": "SQL Injection"}'
import requests
API_TOKEN = "nf_live_abc123..."
BASE_URL = "https://{tenant}.nforged.com/api/v1" # Replace {tenant} with your subdomain
headers = {
"Authorization": f"Bearer {API_TOKEN}",
"Content-Type": "application/json"
}
# List projects
response = requests.get(f"{BASE_URL}/projects", headers=headers)
projects = response.json()["data"]
const API_TOKEN = 'nf_live_abc123...';
const BASE_URL = 'https://{tenant}.nforged.com/api/v1'; // Replace {tenant} with your subdomain
const response = await fetch(`${BASE_URL}/projects`, {
headers: {
'Authorization': `Bearer ${API_TOKEN}`,
'Content-Type': 'application/json'
}
});
const { data: projects } = await response.json();

Limit token permissions with scopes:

ScopeAccess
projects:readView projects
projects:writeCreate/edit projects
findings:readView findings
findings:writeCreate/edit findings
reports:readView/download reports
reports:writeGenerate reports
assets:readView assets
assets:writeCreate/edit assets
adminAdministrative access

Read-only integration:

projects:read, findings:read, assets:read

CI/CD automation:

findings:write, assets:write

Full access:

admin
    • Use minimal scopes needed
    • Set expiration dates
    • Use environment variables
    • Rotate tokens periodically
    • Monitor token usage
    • Commit tokens to source control
    • Share tokens between users
    • Use admin scope unnecessarily
    • Ignore token expiration

Store tokens securely:

Terminal window
# .env file (never commit)
NFORGED_API_TOKEN=nf_live_abc123...
import os
token = os.environ.get('NFORGED_API_TOKEN')
  1. Go to SettingsAPI Access
  2. See list of your tokens
  3. View last used date
  1. Find token in list
  2. Click Revoke
  3. Confirm revocation

Token is immediately invalidated.

  1. Create new token with same scopes
  2. Update your applications
  3. Revoke old token
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing authentication token"
}
}

Causes:

  • Missing Authorization header
  • Invalid token
  • Expired token
  • Revoked token
{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "Token does not have required scope"
}
}

Causes:

  • Token lacks required scope
  • Resource access not permitted

Future support for OAuth 2.0 flows:

  • Authorization Code
  • Client Credentials
  • Refresh Tokens

Next: Learn about the Projects API