APIs power modern applications but also attract bots, scrapers, and automated abuse. The OWASP API Security Top 10 highlights broken object-level authorization, broken authentication, unrestricted resource consumption, and unrestricted access to sensitive business flows. This guide covers core API security practices for 2026 and how to add abuse and bot protection so your APIs stay available and your business logic is not exploited.
Core API security practices
- Authentication and authorization – Use strong auth (e.g. OAuth 2.0, API keys, or tokens) and enforce authorization on every request. Validate object-level and function-level access (OWASP API1, API2, API5).
- Rate limiting and quotas – Limit requests per client, per key, or per IP to prevent unrestricted resource consumption (API4:2023). Protect expensive or state-changing operations with stricter limits.
- Input validation – Validate and sanitise all inputs; reject malformed or unexpected payloads. Use allowlists where possible.
- Logging and monitoring – Log authentication failures, authorization failures, rate-limit hits, and anomalies. Monitor for abuse patterns and automate alerts.
- Secure configuration – Avoid default credentials; use HTTPS; restrict CORS and exposure of internal endpoints. Address security misconfiguration (API8).
Abuse and bot protection for APIs
APIs are prime targets for OWASP Automated Threats: scraping (OAT-011), credential stuffing, account enumeration, and abuse of signup, trial, or payment flows (e.g. API6:2023 – Unrestricted Access to Sensitive Business Flows). Adding bot and abuse protection at the API layer reduces resource consumption (API4) and stops automated abuse before it hits your business logic.
Practical approach: For each API request (or for sensitive endpoints only), call a check-request or API-abuse service with client IP, path, user/session identifier if present, and request metadata. Get back allow, challenge, or block. Use a short timeout and fail open so legitimate users and partners are not locked out on provider downtime. Then:
- Allow – Process the request.
- Challenge – Return 401/429 with a challenge or require a token/cookie from a prior browser challenge (e.g. proof-of-work or CAPTCHA).
- Block – Return 403 or 429 and optionally log for analysis.
This complements rate limiting: rate limiting caps volume; bot protection identifies automated or abusive clients and blocks or challenges them before they consume resources or abuse business flows.
Protecting your API with bot protection (Trusted Accounts)
You can protect API endpoints with the same request-level check you use for web pages. Bot Protection exposes a check-request API: from your API gateway, backend, or middleware you send the client IP, request path, and optional headers; you receive allow, challenge, or block in under ~50 ms. Use it for:
- Sensitive API routes – Signup, login, checkout, trial signup, webhooks, or any endpoint that is scraped or abused. Call the check before executing the business logic; block or challenge bad traffic and allow good clients.
- Resource-heavy or expensive operations – Reduce API4:2023 Unrestricted Resource Consumption by stopping bots before they hit expensive queries or external calls.
- Unrestricted access to sensitive business flows (API6) – Protect signup, payment, and trial flows from automation; combine with auth and rate limiting for defence in depth.
Integration: Call POST /api/v1/check-request from your server or API gateway with your secret key; pass client IP, path, and optional context (e.g. user ID if authenticated). On allow, process the request; on challenge, return 401/429 and optionally direct the client to a challenge (e.g. taCAPTCHA for browser-based clients); on block, return 403. Set a short timeout (e.g. 100 ms) and fail open so availability is not tied to the provider. If your API is called from a web app, you can also load the Bot Detection SDK on the page and send a session or request identifier so the check has behaviour and device signals for better accuracy.
Result: Bots and scrapers are filtered or challenged at the edge; legitimate API clients and partners get through. Your API stays available, and sensitive business flows are protected from automation.
OWASP API Security Top 10 – quick reference
- API1:2023 Broken Object Level Authorization – Validate that the caller is allowed to access the requested object.
- API2:2023 Broken Authentication – Implement robust authentication and session handling.
- API3:2023 Broken Object Property Level Authorization – Validate exposure of properties (mass assignment, excessive data exposure).
- API4:2023 Unrestricted Resource Consumption – Rate limit, quota, and cost controls; bot protection reduces abusive consumption.
- API5:2023 Broken Function Level Authorization – Enforce role/function access control.
- API6:2023 Unrestricted Access to Sensitive Business Flows – Protect signup, checkout, trial, and payment from automation; use bot/abuse checks.
- API7:2023 Server Side Request Forgery – Validate and restrict user-supplied URLs and outbound requests.
- API8:2023 Security Misconfiguration – Harden config, secrets, and deployment.
- API9:2023 Improper Inventory Management – Document and secure all API endpoints.
- API10:2023 Unsafe Consumption of APIs – Validate and limit trust in third-party API responses.
For a full walkthrough, see OWASP API Security: What you should know. For website and API protection in one place, see Application Security: Protect your Website and APIs from Modern Attacks.
Summary
Combine strong auth, rate limiting, input validation, and logging with bot and abuse protection for APIs. That addresses resource consumption and automated abuse (OWASP API4, API6, and Automated Threats) and keeps your APIs available and your business logic protected. Use a check-request API from your server or API gateway: send client IP, path, and context; get allow/challenge/block in under ~50 ms; fail open on timeout. Trusted Accounts Bot Protection fits this model: call it for web and API traffic, protect sensitive endpoints and business flows, and optionally combine with Bot Detection and taCAPTCHA when the client is browser-based.
Try Trusted Accounts – bot protection for your website and APIs; EU-based, data in the EU.


