Before you startPlease contact our support for the latest changes in xorlab API setup before you start configuring the API.
Enable the API
- First, activate the API as the source for receiving emails by xorlab. Open the
activeguard/core/active_guard.ymlfile in Expert Editor and add the following line toscanSources: - Add these two lines and set their values to the same value as
mainWorkerCount. IfmainWorkerCountis not set, use the default value of20: - Now, configure the Email Scanning API in Expert Editor by navigating to the
abby/abby/abby.ymlfile. When you open it, the following content appears: - Under
hosts, adjust the addresses of the xorlab MTAs such that they match your deployment: - Under
staticApiTokens, enter the name of your bearer authentication token and its value. For SaaS instances, the token will be preconfigured and provided by xorlab; for on-prem instances, we recommend using theopenssl rand -hex 32command to generate the token (32 bytes or 64 hex digits). Unlike the Rule List API, this API does not use API keys created in the web interface. The token must still be configured statically inabby.yml. The value below is a placeholder showing the expected shape — always use one you generated yourself: - Click Publish, then restart all MTAs. The
scanSourcesand processing settings inactiveguard/core/active_guard.ymlrequire an MTA restart; see How to Activate the Configuration.
API reference
Request
Requests are served by two endpoints:/v1/messageQueue/submitEmail/v1/admin/status
The
parameters argument accepts only one parameter, borderMtaData, which includes the following key:value pairs:
Maximum payloadThe maximum accepted payload size is 50 MiB. Payloads above this will result in a 413 error code.
Response
In response to your API request, you will receive either a message analysis result or an error. In the former case, the response will contain the following parameters:Examples
cURL
This is a sample cURL command for sending an email to xorlab for analysis:<path to your eml file>is the path to the .eml file you wish to send, e.g.,fileName.eml<auth token>is the bearer auth token (see step #5 in the Enable the API section above)<your xorlab instance>is the domain of your xorlab instance, e.g., forxyz.activeguard.cloud, the full link would readhttps://xyz.activeguard.cloud:9081/v1/messageQueue/submitEmail
Python
The following Python script makes use of the cURL command described above:<auth token> and <your xorlab instance>—are the same as for the cURL example.