# Welcome

Get started with Firewalla MSP API. (For complete examples, please visit https://github.com/firewalla/msp-api-examples)

# Create your personal access token

Go to Account Settings (1), then click Create New Token (2) and give your token a name (3). You may want to create different tokens for different purposes so that you can disable a token if needed without affecting other uses of the token.

Your token will appear. Keep in mind that you can't see this token again, so keep it safe. You can always generate more tokens though. And, very important, you can invalidate a token if you ever think it has been compromised by deleting the token.

Now let's go through a few examples of what you can do with the Firewalla MSP API.

# Examples

# List Boxes

The first thing you may want to do is confirm that the boxes you have in your MSP inventory are there. This is also a great place to start using the API as you may need some of the data that you get from this call for other API calls. Let's see what information is available. For the purpose of this guide, we will use curl to make our API calls and jq to format and filter the results because they are available for nearly every platform.

# Sample Request - Get list of boxes
// https://github.com/axios/axios
const axios = require("axios");

// Change these variables to what you have
const msp_domain = process.env.msp_domain || "mydomain.firewalla.net";
const token = process.env.token || "your_personal_access_token";

axios({
    method: 'get',
    url: `https://${msp_domain}/v2/boxes`,
    headers: {
        Authorization: `Token ${token}`
    }
}).then(res => {
    console.log(res.data);
})
curl --request GET  \
--url "https://${msp_domain}/v2/boxes" \
--header "Authorization: Token ${your_personal_access_token}"
# Sample Response
[
  {
    "gid": "00000000-0000-0000-0000-000000000000",
    "model": "gold",
    "name": "My Firewalla",
    "mode": "router",
    "online": true,
    "version": "1.975",
    "license": "00000000-1111-1111-1111-000000000000",
    "publicIP": "1.1.1.1",
    "location": "Los Angeles, US",
    "lastSeen": 1648632679.193,
    "group": null,
    "deviceCount": 11,
    "ruleCount": 34,
    "alarmCount": 89
  }
]

This site was created to document the Firewalla MSP APIs that are open to the public and make them usable to MSP users. However, since Firewalla MSP is still evolving rapidly, this document might be outdated or incorrect. If you find anything confusing or misleading, you are welcome to tell us in an email to help@firewalla.com.