HAPI Reference: Unleash ShieldAI Programmatically đŠâđģđ¨âđģ
HAPI Reference: Command ShieldAI via Code! đšī¸
Welcome, developers, to the ShieldAI Application Programming Interface (API) Reference!
This section is your gateway to interacting with the ShieldAI platform directly through code. Whether you need to automate policy updates, integrate security events into your SIEM, or build custom dashboards, the API empowers you to extend and customize your ShieldAI experience. đ
đ Getting Started with the API
Before you make your first API call, here are the essential concepts you need to grasp:
Base URL: All ShieldAI API endpoints are relative to the base URL
Note: Always use HTTPS for secure communication. The API version (`v1`) is included in the path.
Authentication: đ Every API request must be authenticated. We primarily use API Keys passed via HTTP headers. Head over to the Authentication page for detailed instructions on generating keys and formatting your requests. Unauthenticated requests will result in a
401 Unauthorized
error.Content Type: The ShieldAI API expects request bodies (for POST, PUT, PATCH) to be in JSON format and returns responses in JSON. Ensure your requests include the header:
Content-Type: application/json
Rate Limiting: đĻ To ensure service stability for all users, API requests are rate-limited. If you exceed the limit, you'll receive a
429 Too Many Requests
error. Check the response headers (e.g., `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`) for details. Plan your integrations accordingly!Error Handling: đĨ Things don't always go as planned! The API uses standard HTTP status codes to indicate success or failure. Consult the Error Handling page (you'll need to create this!) for a list of common status codes and error response formats. Well-structured error responses will include a machine-readable error code and a descriptive message.
Versioning: As the API evolves, we may introduce new versions. Versioning is handled via the URL path (`/v1/`). We strive to maintain backward compatibility within a version but will announce any breaking changes well in advance.
đ Exploring the API Endpoints
The API is organized into logical resource categories. Dive into the specifics for each area:
Policies API: đ Programmatically create, read, update, delete (CRUD), and list your security policies. Define rules, actions, and detection settings.
Events API: đ Fetch security event logs generated by ShieldAI. Filter by time range, threat type, action taken, etc. Ideal for feeding into monitoring or SIEM systems.
Rules API: đ§ Manage custom detection rules (e.g., specific keywords, regex patterns) that feed into your policies.
Protected Models API: đ¤ List and manage the AI model endpoints registered with ShieldAI.
Analytics API: đ Retrieve aggregated statistics and insights about threat trends, policy effectiveness, and model traffic patterns.
Account Management API: đ¤ Manage users, API keys, and basic account settings (permissions permitting).
đ ī¸ SDKs: Your Integration Accelerators
While the REST API offers maximum flexibility, our official Software Development Kits (SDKs) can significantly simplify integration by handling authentication, request formatting, and response parsing for you:
đ Python SDK
Node.js SDK
Java SDK
We highly recommend using an SDK if one is available for your language!
Now you're equipped with the basics! Choose an endpoint category to explore or head straight to Authentication to get your keys ready. Happy coding! đ
Last updated