SecureNow API Documentation
The SecureNow API provides AI-powered threat intelligence, IP reputation scoring, and security automation for your applications. Public endpoints require no authentication.
Free Public API
No API key needed. Query IP intelligence instantly.
AI-Powered
Threat verdicts, bot detection, and attack classification.
Real-Time
Sub-second responses with 24h intelligent caching.
Authentication
Public API — No Auth Required
All endpoints under /api/public/* are free and require no authentication. Just send a request and get results.
Authenticated API — Bearer Token
Platform endpoints require a Bearer token. Obtain one by signing into the SecureNow dashboard or by using the CLI.
# CLI login (generates a session token) npx securenow login # Use the token in requests curl -H "Authorization: Bearer YOUR_TOKEN" \ https://api.securenow.ai/api/applications
Runtime SDK - API Key
The SDK uses a per-app snk_live_... runtime API key to authenticate telemetry ingestion and firewall sync. npx securenow login (or npx securenow app connect) writes it to .securenow/runtime.json; admin login is separate. There is no client object to construct: the preload reads the file at startup. Rotate the key with npx securenow api-key create or npx securenow api-key set snk_live_....
// .securenow/runtime.json (secret: never commit or print it)
{
"apiKey": "snk_live_...",
"app": { "key": "<app-uuid>", "name": "my-api" },
"config": { "runtime": { "deploymentEnvironment": "local" } }
}Base URLs
| Environment | URL | Use |
|---|---|---|
| Production API | https://api.securenow.ai | All API requests |
| Dashboard | https://app.securenow.ai | User login, settings |
| OTLP Endpoint | https://ingest.securenow.ai | Trace ingestion (OpenTelemetry) |
Rate Limits
Rate limits are applied per client IP address. Exceeding the limit returns a 429 status with a retryAfter field indicating seconds to wait.
| Endpoint | Limit | Cache |
|---|---|---|
/api/public/ip-intel/:ip | 10 req/min | 1 hour (public), 24h (server) |
/api/public/ip-intel/recent-ips | 2 req/min | 24 hours |
/api/public/ip/:ip | 10 req/min | 1 hour |
| Authenticated endpoints | Varies by plan | — |
Error Handling
All errors return a JSON body with an error field. HTTP status codes follow standard conventions.
| Status | Meaning | Example |
|---|---|---|
| 400 | Bad Request | { "error": "Only IPv4 addresses are currently supported" } |
| 401 | Unauthorized | { "error": "Authentication required" } |
| 404 | Not Found | { "error": "Resource not found" } |
| 429 | Rate Limited | { "error": "Rate limit exceeded. Max 10 requests per minute.", "retryAfter": 60 } |
| 500 | Server Error | { "error": "Failed to fetch IP intelligence" } |
SDKs & Collections
npm Package
CLI + SDK for Node.js, Next.js, Nuxt, and Express.
npm install securenow@latest
Postman Collection
Import into Postman or Insomnia. All endpoints pre-configured.
SDK Setup
Install the npm package and integrate with your framework. See also: CLI Reference | Download SKILL.md files
Installation
The securenow package includes the SDK (tracing, logging, body capture, firewall), CLI binary, MCP server, and framework integrations. Install the latest package, then connect with the credentials-first login flow.
Project dependency
npm install securenow@latestGlobal CLI
npm install -g securenow@latestConnect
npx securenow loginnpx securenow login picks or creates the app and writes runtime app config plus the runtime API key to .securenow/runtime.json; the firewall runs as soon as that key is present. Admin/control-plane auth lives separately in .securenow/admin.json. Both files are secrets: login and init gitignore them without ignoring the whole .securenow/ folder. Then npx securenow init detects the framework and fills the defaults. Environment variables are not required for SDK runtime setup.node_modules/securenow/SKILL-API.md (integration) and SKILL-CLI.md (CLI). Every CLI command documents itself offline: npx securenow help <command>.Framework Integration
Pick your framework below. Most need zero code changes — just a preload flag or one config line.
Express / Node
0 lines changed# Express 4/5, Fastify, NestJS, Koa, Hapi, Hono (@hono/node-server),
# Polka, Feathers, h3, raw http. ESM and TypeScript (tsx) use the same flag.
# Connect once. This writes .securenow/runtime.json.
npx securenow login
# Then add the preload flag — zero code changes.
node -r securenow/register src/index.js
# TypeScript: SecureNow first, then your loader
node -r securenow/register --import tsx src/index.ts
# Can't change the command? Use NODE_OPTIONS
NODE_OPTIONS="-r securenow/register" npm start
# Or use the CLI
npx securenow run src/index.js
# Bun 1.3, apps served through node:http (Bun.serve is not covered)
bun --preload securenow/register app.js
# PM2 ecosystem.config.cjs: fork or cluster mode, no env vars needed.
# Use an absolute path: in cluster mode a bare -r is resolved from the
# PM2 daemon's folder, so workers crash if it was started elsewhere.
module.exports = {
apps: [{
script: './app.js',
instances: 'max',
node_args: ['-r', require.resolve('securenow/register')],
}],
};Runtime Configuration
SecureNow boots from .securenow/runtime.json locally, then legacy/generated runtime credential files. Production should mount the tokenless runtime export as .securenow/credentials.json or .securenow/credentials.<env>.json. Every setting below is a key in that file.
The SDK reads only two environment variables: SECURENOW_CREDENTIALS, for hosts that cannot mount a file, and SECURENOW_DISABLED. Older variables such as SECURENOW_APPID, SECURENOW_INSTANCE or SECURENOW_NO_UUID are ignored.
| Setting | Default | Description |
|---|---|---|
| .securenow/runtime.json | local SDK runtime | Generated by `npx securenow login` or `npx securenow app connect`. Stores app identity, runtime API key, ingest routing, and SDK defaults. |
| .securenow/admin.json | admin CLI/MCP | Generated by `npx securenow admin login` or the friendly login flow. Stores admin/control-plane auth only. |
| .securenow/credentials.json | legacy/prod mount | Legacy combined credentials are still read. Production should mount the tokenless runtime export here when needed. |
| .securenow/credentials.<env>.json | production export | Generated by `npx securenow credentials runtime --env production`; accepted directly when credentials.json is absent. |
Deployment
Production uses a tokenless runtime export: npx securenow credentials runtime --env production writes .securenow/credentials.production.json (app key, runtime API key and config, never the admin token). Ship it as <app-root>/.securenow/credentials.json, or on hosts without file mounts store the output of --format env as the secret SECURENOW_CREDENTIALS. Keep the preload on the command that really starts the server.
# Writes .securenow/credentials.production.json (app key, runtime API key, config; no admin token) npx securenow credentials runtime --env production # Ship it as <app-root>/.securenow/credentials.json (secret file or mount) # Hosts without file mounts: one secret environment variable npx securenow credentials runtime --env production --format env # prints SECURENOW_CREDENTIALS=<base64>; it wins over every credentials file # .dockerignore: keep local secrets out of images .securenow/admin.json .securenow/runtime.json .securenow/credentials*.json
Verify
- Start the app and read its startup line:
[securenow] pid=... appId="<app-uuid>" ... apiKey=set credentials=<path or env:SECURENOW_CREDENTIALS> → service.name=<app-uuid>(Next.js:[securenow] Next.js App -> service.name=<app-uuid> apiKey=set ...), thenFirewall: ENABLEDandFirewall: synced <n> global blocked IPs. apiKey=missingmeans telemetry and firewall sync are rejected: runnpx securenow app connect. No[securenow]line at all means the preload is not on the command that starts the server.initwritesdeploymentEnvironment: "local"while the CLI and dashboard default toproduction: pass--env localwhen checking a local run.- Keep test runs out of the real app with
SECURENOW_DISABLED=1 npm test.
npx securenow version # 8.24.0+ (8.25.0+ for the marked items) npx securenow whoami # admin auth and the runtime app both present npx securenow env # service name = app key, environment, firewall enabled npx securenow doctor # All checks passed. npx securenow test-span # Span accepted (HTTP 200) # start the app, send one real request, then: npx securenow traces --env local --limit 5 npx securenow status npx securenow today npx securenow firewall test-ip 203.0.113.7 --env production
Tested On & Limits
- Tested end to end (traces, client IP, body capture with redaction, 403 block, 429 rate limit, challenge, errors, logs) on Node 24.22 with Express 4.22 and 5.3, Fastify 5.12, NestJS 11.2, Koa 3.3, Hapi 21.4, Hono 4, Polka 0.5, Feathers 5.0, h3 1.15, Next.js 14.2 (8.25.0+), 15.5 and 16.4 (Turbopack and webpack,
next startand standalone), Nuxt 3.21 and 4.6, Bun 1.3 and PM2 5.4 (fork and cluster). Older majors are expected to work but are not tested. - Not supported: Edge runtimes (Cloudflare Workers, Vercel Edge, Next.js Edge middleware and routes), Deno,
Bun.serve, browser telemetry. - Not tested: Vercel (the firewall is unverified on its serverless functions), AWS Lambda and other serverless platforms.
- Cloud WAF (layer 4): AWS WAF tested against real IP sets (8.25.2+); Cloudflare and GCP tested on the request format only, not against real accounts.
- IPv6: the blocklist, allowlist, trusted IPs, rate limits, challenges and API-key IP limits take IPv6 addresses and CIDR ranges; layer 1 and trusted proxies match them from 8.25.0 (older SDKs match exact IPv6 addresses but ignore IPv6 ranges).
SDK Features
What the SDK does once it is wired, and how to use each feature from the CLI, MCP or your code. Items marked 8.25.0+ need that version (npx securenow version).
What Is Automatic
Once the runtime is wired, none of this needs code:
- Traces: one server span per request with method, status, client IP and route (
http.routefor Express, Fastify, NestJS, Koa with@koa/router, Hapi and Nuxt; Next.js, Hono, h3, Feathers and Polka from 8.25.0), plus database (Postgres, MySQL, MongoDB, Redis...) and outgoing HTTP spans. - Header and body capture with redaction: JSON, form and GraphQL bodies up to
capture.maxBodySize, multipart field values and file metadata (never file content). Passwords, tokens, OTP codes, cards, emails and other sensitive fields are redacted in the app, by name and by value shape. - Logs:
console.*lines become log records linked to the active trace. From 8.25.0 they are redacted before export (config.logging.redact, default true); attributes passed togetLogger().emit()are exported as set. Redaction goes by field names and value shapes, so don't log secrets in free text. - Crash capture: uncaught exceptions and unhandled rejections become FATAL logs with the stack; logs and finished spans are flushed before the process exits.
- Firewall: blocklist and allowlist (403), rate limits (429 with
Retry-After) and proof-of-work challenges, synced from the dashboard, CLI and MCP.
npx securenow redact '{"email":"a@b.co","password":"x","otpCode":"123456"}'
npx securenow traces --env production --limit 5
npx securenow logs errors --since 1h
npx securenow logs --level fatal --since 1hClient IP & Trusted Proxies
The client IP is the connection's address unless the connection comes from a trusted proxy; then it is the right-most untrusted X-Forwarded-For address (or CF-Connecting-IP, True-Client-IP, X-Real-IP). Private, loopback and (8.25.0+) Unix-socket connections are trusted by default, so a client cannot pick its IP through X-Forwarded-For. The firewall, rate limits, session detection and traces all use this IP.
- Behind Cloudflare, a CDN or a load balancer with a public address, list it in
config.networking.trustedProxies: exact IPs, IPv4 or IPv6 CIDRs (IPv6 ranges 8.25.0+), or"cloudflare"for Cloudflare's edge ranges. Make the proxy forward the client (X-Forwarded-For). - Check it: in
npx securenow traces show <traceId>,http.client_ipis the visitor andhttp.client_ip.sourceisx-forwarded-for, notsocket. Starter protection refuses block mode while more than 20% of the app's traffic comes through a proxy it doesn't trust.
{ "config": { "networking": { "trustedProxies": ["cloudflare", "203.0.113.10", "198.51.100.0/24"] } } }Firewall Layers
- Layer 1, HTTP 403: always on once the runtime API key is present; works behind proxies. It enforces the blocklist (SecureNow's known-bad IP feed, refreshed hourly, plus your entries), the allowlist, scoped blocks, challenges and rate limits. Version check every 10 seconds, full resync hourly, fail-open by default (
failMode). - Layer 2, TCP drop (
tcp: true): destroys the socket before HTTP parsing. Layer 3, OS firewall (iptables: true): kernel DROP rules; Linux, root orCAP_NET_ADMIN(in Docker:--cap-add NET_ADMINand theiptablespackage). Layers 2 and 3 see only the connection's source IP, so they help only when clients connect directly. - Layer 4, Cloud WAF (
cloud: "cloudflare" | "aws" | "gcp"): pushes the global blocklist to the edge; on Cloudflare your own WAF rule must reference thesecurenow-blocklistlist.cloudDryRun: truelogs the pushes only. AWS tested against real IP sets (8.25.2+); Cloudflare and GCP request format tested only. - Layers 2 to 4 carry global IP/CIDR blocks only; turn them on with 8.25.0+. Turn the whole firewall on or off per app and environment in the dashboard or with
npx securenow firewall enable|disable(config.firewall.enabledis ignored).
{
"config": {
"firewall": {
"failMode": "open",
"tcp": true,
"iptables": true,
"cloud": "cloudflare",
"cloudflare": { "apiToken": "<secret>", "accountId": "<account-id>" }
}
}
}npx securenow firewall status npx securenow firewall test-ip 203.0.113.7 --path /admin --env production npx securenow firewall hits --since 1h npx securenow firewall disable --app <key> --env local
Blocklist, Allowlist & Trusted IPs
- Blocklist: an IP address or CIDR range, IPv4 or IPv6 (IPv6 ranges need securenow 8.25.0+), everywhere or on one route and method, optionally expiring. Unblocking keeps the history. Blocks reach running apps in about 10 seconds.
- Allowlist (dangerous): deny-by-default. Once one entry is active for an app and environment, only listed IPs get through. Use it only to lock an app to known IPs.
- Trusted IPs: uptime monitors, office VPN, your own servers. Alerts on them are suppressed; nobody is restricted.
npx securenow blocklist add 203.0.113.42 --env production --duration 24h --reason "credential stuffing" npx securenow blocklist add 203.0.113.42 --route /admin --mode prefix --method ALL --reason "admin probing" npx securenow blocklist unblock <id> --reason "false alarm" npx securenow trusted add 198.51.100.20 --label "Uptime monitor" npx securenow allowlist add 198.51.100.7 --app <key> --env production --label "Office" --reason "lock the admin app"
Rate Limits & Redis
Rules live in SecureNow, not in your code, and running apps apply them within about 10 seconds. A rule matches a route (exact, prefix or regex) and method, optionally an IP or CIDR, and counts per IP, globally, per request-header value (API key, tenant) or per cookie value (session). Over the limit: HTTP 429 with Retry-After.
- Counters live in each process: with PM2 cluster or several servers, share them through Redis with
config.firewall.rateLimitStore(redis://orrediss://). If Redis is unreachable, counting falls back to in-process. - Rules are per environment and the CLI defaults to
production: create one with--env localto try it on a local run.
npx securenow ratelimit add --route /api/login --method POST --limit 5 --window 1m --env production --reason "login brute force" npx securenow ratelimit add --route /api/ --limit 100 --window 1m --header x-api-key --env production npx securenow ratelimit from-text "5 per minute per IP on POST /api/login for 2h" --yes npx securenow ratelimit test 203.0.113.42 --path /api/login --method POST --env production
{ "config": { "firewall": { "rateLimitStore": "redis://your-redis:6379" } } }Challenges (Proof of Work)
A softer step than a block. Browsers get an invisible proof-of-work page (14 bits by default, about a second) and a pass cookie valid 30 minutes. Clients that don't accept HTML get a 403 JSON challenge_required, so don't challenge API routes that non-browser clients call. A challenge can escalate to a block after repeated failures.
npx securenow challenge add --route /login --clearance 30m --env production npx securenow challenge add 203.0.113.0/24 --route /signup --difficulty 16 --escalate-to-block --fail-threshold 10 --block-ttl-hours 24 npx securenow challenge test 203.0.113.9 --path /login --method GET --env production
Security Events: track()
Your app reports what only it knows: sign-ins, OTPs, password resets, MFA. Events feed brute-force, credential-stuffing and account-takeover detection, and alert rules can query them. track() is fire-and-forget: batched in the background, never throws, and uses the runtime credentials (call await flush() before a script exits).
- Recommended events:
auth.login.failure,auth.login.success,auth.otp.send.requested,auth.otp.send.result,auth.otp.verify.failure,auth.otp.verify.success,auth.password_reset.requested,auth.password_reset.completed,auth.mfa.challenge.failure,auth.mfa.challenge.success,auth.session.revoked. - Properties:
userId,sessionId,ip,userAgent,severity(trace to fatal),ts, and your own fields underattributes(strings, numbers, booleans). - From a shell, CI or a non-JS service:
npx securenow event send auth.login.failure --user u_test --ip 203.0.113.10 --attrs reason=test. See what arrived:npx securenow telemetry fields --since 1h --json.
const { track } = require('securenow/events'); // ESM: import { track } from 'securenow/events';
const { resolveClientIp } = require('securenow/resolve-ip'); // the firewall's trusted-proxy rules
app.post('/api/login', async (req, res) => {
const ip = resolveClientIp(req);
const user = await findUserByEmail(req.body.email);
if (!user || !(await verifyPassword(user, req.body.password))) {
track('auth.login.failure', {
userId: user ? user.id : undefined, // your internal id, never the password
ip, userAgent: req.get('user-agent'), severity: 'warn',
attributes: { reason: user ? 'bad_password' : 'unknown_user' },
});
return res.status(401).json({ error: 'Invalid email or password' });
}
track('auth.login.success', { userId: user.id, ip, attributes: { method: 'password' } });
res.json({ ok: true });
});Session Revocation
Revoke a stolen session or every session of a user from the CLI, the dashboard or automation. The SDK pulls active revocations every 30 seconds and rejects matching requests locally (fail-open). The session id is the SHA-256 of the Bearer token or of the session cookie (your sessions.cookieNames (8.25.0+), then __Secure-next-auth.session-token, __Host-next-auth.session-token, next-auth.session-token, connect.sid, session, sid); the user id is the JWT sub.
- Zero code, every framework (8.25.0+):
sessions.guardanswers a revoked session or user with 401 and clears the session cookies;sessions.capturesendssession.seen(deduplicated per session and IP every 5 minutes) for session-theft detection. Works with-r securenow/register, Next.js, Nuxt and firewall-only. - Express-style apps (Express, Connect, Polka, NestJS on the Express adapter, Feathers with Express):
app.use(sessions.guard()), optionally with your owngetSessionId(req)andgetUserId(req). - Anything else (8.25.0+):
sessions.check(req)takes a Node request or a WebRequestand returns{ revoked, sessionId, userId }; answer 401 yourself. Fastifyrequest.raw, Koactx.req, Honoc.req.raw, h3event.node.req, a Next.js route handler'srequest. Lower level:sessions.isRevoked({ sessionId, userId }).
npx securenow revoke session <session-id> --reason "impossible travel" --duration 24h npx securenow revoke user <user-id> --reason "account takeover" # default expiry 7d npx securenow revoke list npx securenow revoke restore <id> --reason "verified with the user"
{ "config": { "sessions": { "guard": true, "capture": true, "cookieNames": ["my_app_session"] } } }const sessions = require('securenow/sessions');
// Express, Connect, Polka, NestJS (Express adapter), Feathers (Express)
app.use(sessions.guard());
// Fastify (8.25.0+): the same check works in Koa, Hono, h3 and Next.js route handlers
fastify.addHook('onRequest', async (request, reply) => {
if (sessions.check(request.raw).revoked) return reply.code(401).send({ error: 'session_revoked' });
});Detection & Alert Rules
- Starter protection: every app gets about 20 rules (SQL injection, XSS, traversal, command and template injection, Log4Shell, SSRF,
.env/.gitprobes, attack tools, failed sign-ins, 404 scanning...) in monitor mode on first traffic: they alert and block nothing. Only a signed-in person can turn blocking on. - Alert rules from English or SQL start in test mode: they alert and nothing acts on them until a person promotes them. Agents ask with
alerts rules request-promotion. - AI investigations prepare a verdict and a proposed action for each alerting IP; decisions wait in Requires Human (
npx securenow human), rules that fired too wide in Alert Review (npx securenow review).
npx securenow protect status npx securenow alerts rules from-text "one IP failing 10 sign-ins in 5 minutes" --app <key> --draft-only npx securenow alerts rules test <rule-id> --wait npx securenow alerts rules runs <rule-id> --since 1h npx securenow alerts rules promote <rule-id> --yes npx securenow today npx securenow attacker 203.0.113.42
MCP for Coding Agents
- Local stdio server after
npx securenow login, or the hosted serverhttps://api.securenow.ai/mcpwith OAuth sign-in (an API key asAuthorization: Bearer <key>also works). - 125 tools (62 read-only, 63 write). Every write tool refuses to run without
confirm: trueand a non-emptyreason.npx securenow mcp --profile investigator|detection|responderserves fewer tools.
claude mcp add securenow -- npx securenow mcp
codex mcp add securenow -- npx securenow mcp
claude mcp add --transport http securenow https://api.securenow.ai/mcp # hosted, OAuth
# Cursor: .cursor/mcp.json
{ "mcpServers": { "securenow": { "command": "npx", "args": ["securenow", "mcp"] } } }Public API Reference
Free endpoints — no authentication required.
Get IP Intelligence
Returns a comprehensive AI-powered threat report for any IPv4 address. Combines SecureNow's proprietary scoring, AI analysis, bot detection, attack classification, and SecureNow AI IPDB community data into a single response.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ip | string | REQUIRED | IPv4 address to analyze (e.g. "185.220.101.1") |
Response Fields
| Field | Type | Description |
|---|---|---|
| ip | string | The queried IP address |
| securenowScore | integer | Composite threat score (0 = clean, 100 = highly malicious) |
| verdict | string | AI-generated threat verdict (e.g. "Malicious - Automated Scanner", "Clean") |
| isMalicious | boolean | Whether the IP is classified as malicious |
| isBot | boolean | null | Whether traffic is bot/automated (null if unknown) |
| activityType | string | Type of activity observed (e.g. "Automated Scanning") |
| attackTypes | string[] | Array of attack categories (Port Scan, Brute Force, etc.) |
| summary | string | Human-readable AI analysis summary |
| riskFactors | string[] | List of risk factors contributing to the score |
| botVsHumanAnalysis | string | Detailed bot vs human classification reasoning |
| securenowIpdb | object | SecureNow AI IPDB data: confidenceScore, countryCode, isp, domain, totalReports, recentReports |
| sources | string[] | Data sources used (SecureNow AI IPDB, securenow-internal, securenow-ai) |
| lastUpdatedAt | string (ISO 8601) | Timestamp of last data refresh |
Code Examples
curl -s "https://api.securenow.ai/api/public/ip-intel/185.220.101.1" | jq .
Example Response
{
"ip": "185.220.101.1",
"securenowScore": 87,
"verdict": "Malicious - Automated Scanner",
"isMalicious": true,
"isBot": true,
"activityType": "Automated Scanning",
"attackTypes": ["Port Scan", "Brute Force", "Web Application Attack"],
"summary": "This IP has been widely reported for automated scanning and brute force attacks...",
"riskFactors": [
"High SecureNow AI IPDB confidence score (95%)",
"Known Tor exit node",
"Over 500 community abuse reports"
],
"botVsHumanAnalysis": "Traffic patterns are consistent with automated scanning tools...",
"securenowIpdb": {
"abuseConfidenceScore": 95,
"countryCode": "DE",
"countryName": "Germany",
"domain": "torproject.org",
"isp": "Tor Exit Node",
"usageType": "Hosting/Transit/CDN",
"totalReports": 543,
"lastReportedAt": "2026-03-13T10:30:00Z",
"recentReports": [
{
"reportedAt": "2026-03-13T10:30:00Z",
"categories": [14, 15],
"comment": "Port scan and SSH brute force attempts"
}
]
},
"sources": ["securenow-ipdb", "securenow-internal", "securenow-ai"],
"lastUpdatedAt": "2026-03-13T12:00:00Z"
}Get Recent IPs
Returns a list of recently analyzed IP addresses. Useful for building sitemaps or discovering trending threat IPs. Heavily cached (24 hours) and more strictly rate-limited.
Example Response
{
"ips": [
"185.220.101.1",
"45.33.32.156",
"103.152.220.44",
"192.42.116.16"
]
}curl -s "https://api.securenow.ai/api/public/ip-intel/recent-ips" | jq .
Get IP Data (Legacy)
/api/public/ip-intel/{ip} instead for the full AI-powered analysis.Returns basic IP reputation data in a simplified format compatible with older integrations.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ip | string | REQUIRED | IPv4 address to look up |
Example Response
{
"ip": "185.220.101.1",
"abuseConfidenceScore": 95,
"countryCode": "DE",
"isp": "Tor Exit Node",
"domain": "torproject.org",
"totalReports": 543,
"lastReportedAt": "2026-03-13T10:30:00Z"
}Authenticated API Reference
These endpoints require a Bearer token. Obtain one through the dashboard or via npx securenow login.
Applications
Manage your monitored applications. Create, update, delete applications and retrieve their API keys for integration.
| Method | Path | Description |
|---|---|---|
| GET | /api/applications | List all applications |
| POST | /api/applications | Create a new application |
| GET | /api/applications/:id | Get application by ID |
| PUT | /api/applications/:id | Update an application |
| DELETE | /api/applications/:id | Delete an application |
| POST | /api/applications/bulk | Bulk operations on applications |
| GET | /api/applications/:id/ips | List IPs hitting this application |
| POST | /api/applications/:id/detect-tech | Detect application tech stack |
Traces
Access HTTP request traces collected by the SecureNow SDK. View individual traces, analyze suspicious requests with AI, and investigate incidents.
| Method | Path | Description |
|---|---|---|
| GET | /api/traces | List traces (supports filtering & pagination) |
| GET | /api/traces/:traceId | Get a single trace by ID |
| POST | /api/analyze-trace | Start AI analysis on a trace |
| GET | /api/analyze-trace/:analysisId | Get analysis results |
Analytics
Retrieve aggregated security analytics for your applications. Response codes, error rates, and traffic patterns broken down by status category.
| Method | Path | Description |
|---|---|---|
| GET | /api/analytics/2xx-responses | Successful responses over time |
| GET | /api/analytics/3xx-responses | Redirect responses over time |
| GET | /api/analytics/4xx-responses | Client error responses |
| GET | /api/analytics/5xx-responses | Server error responses |
| GET | /api/analytics/500-errors | Detailed 500-level errors |
Forensics
AI-powered security forensics. Ask questions in natural language and get structured results from your trace data. Supports chat-based investigations and saved query libraries.
| Method | Path | Description |
|---|---|---|
| POST | /api/forensics/query | Execute a natural language query |
| GET | /api/forensics/query/status/:jobId | Check query execution status |
| POST | /api/forensics/chat | Start or continue a chat investigation |
| GET | /api/forensics/chat/status/:id | Get chat response status |
| POST | /api/forensics/chat/confirm/:id | Confirm a suggested action |
| GET | /api/forensics/conversations | List saved conversations |
| GET | /api/forensics/conversations/:id | Get conversation history |
| GET | /api/forensics/query-library | List saved query templates |
| POST | /api/forensics/query-library/execute | Execute a saved query |
Example: Natural Language Query
curl -X POST https://api.securenow.ai/api/forensics/query \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "Show me all suspicious IPs from the last 24 hours"}'Alert Rules & Channels
Configure security alert rules, notification channels (Slack, email, webhooks), and review alert history.
| Method | Path | Description |
|---|---|---|
| GET | /api/alert-rules | List alert rules |
| POST | /api/alert-rules | Create an alert rule |
| PUT | /api/alert-rules/:id | Update an alert rule |
| DELETE | /api/alert-rules/:id | Delete an alert rule |
| GET | /api/alert-channels | List notification channels |
| POST | /api/alert-channels | Create a notification channel |
| GET | /api/alert-history | List alert history |
| GET | /api/alert-history/:id | Get alert details |
| GET | /api/notifications | List notifications |
| POST | /api/notifications/read-all | Mark all notifications read |
Blocklist & Allowlist
Manage IP blocklists and allowlists for your applications. Block known threats automatically or whitelist trusted IPs and services.
| Method | Path | Description |
|---|---|---|
| GET | /api/blocklist | List blocked IPs |
| POST | /api/blocklist | Add IP to blocklist |
| GET | /api/allowlist | List allowed IPs |
| POST | /api/allowlist | Add IP to allowlist |
| GET | /api/trusted-ips | List trusted IPs |
| POST | /api/trusted-ips | Add a trusted IP |
Firewall
Real-time firewall integration endpoints. Used by the SecureNow SDK to sync blocklists and allowlists with your application's firewall middleware.
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/firewall/status | Get firewall status |
| GET | /api/v1/firewall/check/:ip | Check if an IP is blocked |
| GET | /api/v1/firewall/blocklist | Get full blocklist |
| GET | /api/v1/firewall/allowlist | Get full allowlist |
| GET | /api/v1/firewall/blocklist/version | Get blocklist version (for sync) |
| GET | /api/v1/firewall/allowlist/version | Get allowlist version (for sync) |
SDK Integration
No code calls these endpoints: the preload syncs the lists itself with the runtime API key (version check every 10 seconds) and enforces them in the app. Wire it once, then check what it would do from the CLI. See Firewall Layers.
# Express, Fastify, NestJS, Koa, Hapi, Hono... (Next.js and Nuxt: npx securenow init) node -r securenow/register src/index.js # Would this IP be blocked on this route? npx securenow firewall test-ip 203.0.113.7 --path /admin --env production npx securenow firewall status
Need Help?
Join our community, check out the blog, or contact us for enterprise support and custom integrations.