Accessing the API Console
Navigate to Settings > API in the Wazuh Dashboard to access the API console interface.1
Navigate to Settings
Click on the Wazuh icon and select Settings from the menu
2
Select API Tab
Click on the API tab to view configured API connections
3
Open Console
Select an API host and open the console interface
Making API Requests
The console supports all standard HTTP methods used by the Wazuh API:GET Requests
Retrieve information from the Wazuh API:POST Requests
Create resources or perform actions:PUT Requests
Update existing resources:DELETE Requests
Remove resources:Request Format
Requests in the console follow this format:string
required
HTTP method: GET, POST, PUT, DELETE, PATCH
string
required
API endpoint path, starting with
/. Query parameters can be included.object
JSON request body for POST, PUT, and PATCH requests
Response Format
The console displays responses in a formatted JSON view:object
The main response data containing affected items and metadata
string
Human-readable description of the response
number
Error code (0 indicates success)
Common Endpoints
Here are some frequently used endpoints you can test in the console:Agent Management
Manager Information
Rules and Decoders
Security Configuration Assessment
Features
Auto-completion
The console provides intelligent auto-completion for:- API endpoint paths
- HTTP methods
- Common query parameters
- Request body schemas
Request History
Access previously executed requests from the history panel:1
View History
Click the history icon to view recent requests
2
Reuse Request
Click on a previous request to load it into the console
3
Clear History
Use the clear button to remove all history entries
Multi-host Support
Switch between different configured API hosts:- Select the API host from the dropdown
- The console automatically uses the selected host’s credentials
- All requests are sent to the selected host
Error Handling
The console displays detailed error information when requests fail:Common Error Codes
error
Wazuh API internal error
error
Wazuh API error (invalid request)
error
Permission denied
error
Wazuh daemon error
Programmatic Usage
While the console is designed for interactive use, you can also make programmatic API requests:Client-Side (Public Plugin)
Server-Side (Server Plugin)
Best Practices
Use Query Parameters for Filtering
Use Query Parameters for Filtering
Instead of fetching all data and filtering client-side, use query parameters:
Handle Pagination
Handle Pagination
For large datasets, use offset and limit:
Check Permissions First
Check Permissions First
Verify user permissions before attempting operations:
Use Specific Queries
Use Specific Queries
Query specific resources instead of retrieving all:
Related Resources
Wazuh API Reference
Official Wazuh API documentation
Server Routes
Dashboard plugin API endpoints
Authentication
API authentication methods
RBAC
Role-based access control