Technical answers for developers integrating SpamJammer. Can't find what you need? Check the API docs or contact us.
SpamJammer is API-first, so integration is a single HTTP call before you persist or deliver user-generated content. Install one of our official SDKs or call the REST API directly.
The basic flow is:
1. User submits content to your app.
2. Your backend sends the content to POST /v1/check.
3. SpamJammer returns a verdict in <50ms.
4. You decide what to do based on the response.
import { SpamJammer } from '@spamjammer/sdk'; const sj = new SpamJammer(process.env.SJ_API_KEY); // Express middleware export const spamCheck = async (req, res, next) => { const result = await sj.check({ content: req.body.message, type: 'form' }); if (result.spam) { return res.status(422).json({ error: 'Message flagged as spam', score: result.score }); } next(); };
Integration typically takes under 15 minutes. The SDK handles authentication, retries, and error handling automatically.
SpamJammer supports five content channels, each optimized with channel-specific detection models:
Email — Full email analysis including subject, body, headers, and attachments. Pass "type": "email" in your API call.
Form submissions — Contact forms, sign-up forms, any user input. Pass "type": "form".
Blog comments — Comment spam detection with link analysis and user reputation scoring. Pass "type": "comment".
Chat messages — Real-time chat moderation for community platforms. Pass "type": "chat". (Professional+)
SMS — Text message spam detection with phone number reputation. Pass "type": "sms". (Enterprise)
Each channel uses the same POST /v1/check endpoint. The type parameter tells SpamJammer which detection model and scoring profile to use.
SpamJammer uses a custom 125M-parameter transformer model (sj-v3-turbo) trained on 2.4 billion labeled messages. The model is retrained hourly on live data from our global network, which means it adapts to new spam patterns within minutes of emergence.
The detection pipeline has multiple stages:
1. Pre-processing — Content normalization, language detection, encoding standardization.
2. Feature extraction — Content features, structural features, metadata features, link analysis.
3. ML inference — Primary transformer model produces a base score.
4. Rule evaluation — Custom rules (if configured) modify the score.
5. Ensemble scoring — Final score computed from ML + rules + sender reputation.
The 99.9% figure is measured as the true positive rate on our holdout test set (updated weekly). The false positive rate is 0.01%, meaning only 1 in 10,000 legitimate messages is incorrectly flagged.
SpamJammer runs on multi-region infrastructure with 99.99% uptime on Enterprise plans. However, you should always design your integration to handle API failures gracefully.
Our SDKs include built-in resilience features:
const sj = new SpamJammer({ apiKey: 'sj_live_...', timeout: 3000, // 3s timeout retries: 2, // 2 automatic retries fallback: 'allow', // allow messages if API is down circuitBreaker: { threshold: 5, // open after 5 failures resetTimeout: 30000 // try again after 30s } });
The fallback option determines behavior when the API is unreachable: "allow" passes all messages through (fail-open), "block" rejects all messages (fail-closed), or "queue" queues messages for later processing. Most teams use "allow" to avoid blocking legitimate users during outages.
Yes. SpamJammer's <50ms latency makes it ideal for serverless and edge environments. Our SDK has zero native dependencies and works in any JavaScript runtime including Node.js, Deno, Bun, Cloudflare Workers, and Vercel Edge Functions.
import { SpamJammer } from '@spamjammer/sdk'; export default { async fetch(request, env) { const sj = new SpamJammer(env.SJ_API_KEY); const body = await request.json(); const result = await sj.check({ content: body.message, type: 'form' }); if (result.spam) { return new Response('Blocked', { status: 422 }); } return new Response('OK'); } };
The SDK package is under 15KB gzipped, so it won't impact cold start times. Connection pooling is handled automatically.
SpamJammer provides a feedback API for reporting false positives and false negatives. Reports are used to improve the global model and can be used to train custom models on Enterprise plans.
To report a false positive, call POST /v1/report with the original message ID and the correction. The report is processed within the next model training cycle (hourly on the global model).
For immediate relief, you can use the Custom Rules DSL to create allowlists for specific senders, domains, or content patterns. Allowlist rules are evaluated before the ML model, ensuring zero false positives for trusted sources.
We recommend implementing a "quarantine" flow rather than hard blocking: store flagged messages in a review queue and let your team approve or reject them. The analytics dashboard shows false positive trends over time.
Yes. SpamJammer is SOC 2 Type II certified and GDPR compliant. We offer a Data Processing Agreement (DPA) for all paid plans.
Data processing regions: US-East (Virginia), EU-West (Frankfurt), and APAC (Singapore). Enterprise customers can pin their data to a specific region via the X-SJ-Region header or account settings.
Data retention: Message content is processed in-memory and never persisted to disk. Only metadata (scores, categories, timestamps) is stored for analytics. Metadata retention is configurable from 30 days to 2 years. You can also opt out of metadata storage entirely.
Encryption: TLS 1.3 in transit, AES-256 at rest. API keys are hashed with bcrypt. Webhook secrets are encrypted with per-customer keys.
Rate limits depend on your plan:
Starter: 100 requests/minute, 10,000 messages/month.
Professional: 1,000 requests/minute, 100,000 messages/month.
Enterprise: Custom rate limits, unlimited messages.
When you exceed your monthly message quota, overage is billed at the end of the billing cycle: $0.005/message on Starter, $0.002/message on Professional. Enterprise plans have custom overage pricing.
Rate limit headers are included in every API response:
X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 847 X-RateLimit-Reset: 1708185600 X-Monthly-Quota: 100000 X-Monthly-Used: 42857
You can set up budget alerts in the dashboard or via the POST /v1/alerts API to get notified at specific usage thresholds (e.g., 80%, 90%, 100% of quota).
Our support team is made up of engineers who build with SpamJammer daily.