Easy to Use API
Integrate BitMitigate into your own applications and services programatically
Getting Started
BitMitigate's API is simple and easy to use. It is accessible via HTTPS and uses JSON to send and receive data. API keys can be instantly created and deleted from within the control panel. All of the API calls follow the same general architecture with slight changes in input data based on the action being performed.
All API calls are sent to the same URL: https://bitmitigate.com/user-panel/api.php
A post variable "apikey" must also be specified which contains an API for your account.
Additionally another POST parameter "data" must be sent which contains the action and associated input data. This parameter should be a stringified JSON value ex. { action: "get-websites"}
A post variable "apikey" must also be specified which contains an API for your account.
Additionally another POST parameter "data" must be sent which contains the action and associated input data. This parameter should be a stringified JSON value ex. { action: "get-websites"}
This an example API call in JavaScript for the "get-websites" action.
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
}
};
xhttp.open("POST", "https://bitmitigate.com/user-panel/api.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
var data = {};
data.action = "get-websites";
xhttp.send("apikey=xxxxxxxxxxxx&data=" + JSON.stringify(data));
Actions
Action:
Input Parameters:
Description: Returns a list of all the websites you have in the system.
get-websites
Input Parameters:
none
Description: Returns a list of all the websites you have in the system.
Action:
Input Parameters:
Description: Adds a website to the system
add-website
Input Parameters:
websites (sub components: website (sub component: origins (sub component: origin (sub component: address, port)))
Description: Adds a website to the system
Action:
Input Parameters:
Description: Removes a website from the system.
remove-website
Input Parameters:
wid (website ID)
Description: Removes a website from the system.
Action:
Input Parameters:
Description: Adds an API key to the system
add-api-key
Input Parameters:
name
Description: Adds an API key to the system
Action:
Input Parameters:
Description: Removes an API key from the system
add-api-key
Input Parameters:
kid (key ID)
Description: Removes an API key from the system
Action:
Input Parameters:
Description: Returns the data for a website
get-website-data
Input Parameters:
domain or wid
Description: Returns the data for a website
Action:
Input Parameters:
Description: Updates a website's settings
update-website-data
Input Parameters:
domain or wid, deferjavascript, hyperloader, minify, imageoptimizer, smartimages, progressiveimages, dnsprefetching, forcessl, brotli, forcehsts, defensemode, httpsrewriting, smartcaching, filecompression, developmentmode)
Description: Updates a website's settings
Action:
Input Parameters:
Description: Creates a page rule if it doesn't exist, updates it if it does exist.
update-page-rule
Input Parameters:
domain or wid, path, browserinspection, useragentprotection, sqlinjectionprotection, httpsrewriting, corsbypass, fileinjection, ipwhitelistblacklist['type'] (None, Whitelist, Blacklist), ipwhitelistblacklist['ips']
Description: Creates a page rule if it doesn't exist, updates it if it does exist.
Action:
Input Parameters:
Description: Gets a list of page rules for a domain.
get-locations
Input Parameters:
domain or wid
Description: Gets a list of page rules for a domain.
Action:
Input Parameters:
Description: Deletes a page rule
delete-location
Input Parameters:
domain or wid, path
Description: Deletes a page rule
Action:
Input Parameters:
Description: Creates a firewall rule.
add-firewall-rule
Input Parameters:
domain or wid, type (1 = Cookie, 2 = IP Address, 3 = Hostname, 4 = User Agent, 5 = Referrer), operator (1 = Equals, 2 = Does not Equal), Value
Description: Creates a firewall rule.
Action:
Input Parameters:
Description: Deletes a firewall rule.
delete-firewall-rule
Input Parameters:
domain or wid, fid
Description: Deletes a firewall rule.
Action:
Input Parameters:
Description: Gets a list of firewall rules.
delete-firewall-rule
Input Parameters:
domain or wid
Description: Gets a list of firewall rules.
Action:
Input Parameters:
Description: Returns your certificate and private key.
get-certificate
Input Parameters:
domain or wid
Description: Returns your certificate and private key.
Action:
Input Parameters:
Description: Updates your defense page contents
update-defense-page
Input Parameters:
domain or wid, customdefensepage
Description: Updates your defense page contents
Action:
Input Parameters:
Description: Uploads a custom SSL certificate
upload-custom-ssl-certificate
Input Parameters:
domain or wid, customsslcertificatepem, customsslkeypem
Description: Uploads a custom SSL certificate
Action:
Input Parameters:
Description: Creates a new non web service
add-nws
Input Parameters:
protectedip, protectedport, originip, originport
Description: Creates a new non web service
Action:
Input Parameters:
Description: Deletes a non web service
add-nws
Input Parameters:
sid
Description: Deletes a non web service
Action:
Input Parameters:
Description: Returns a list of non web services
get-nws
Input Parameters:
none
Description: Returns a list of non web services
Action:
Input Parameters:
Description: Returns a list of website views
get-website-views-raw
Input Parameters:
none
Description: Returns a list of website views
enterprise-grade prioritized Support
BitMitigate
Enterprise Plans
For companies requiring enterprise-grade security and performance, prioritized 24/7/365 phone, email, or chat support, and guaranteed uptime.
Learn More