Back to top

Vilfo API reference

Overview

Getting started

Welcome to Vilfo’s API reference!

This document describes all API requests that are available for Vilfo. You may use the left column to quickly jump to various sections.

Authorization

You’ll need an Access Token if you want to use the API. All API requests except for the browser extension requires the Access Token. Browser extension API requests do not require an Access Token since they only affect the device that sent the API request.

The Access Token is available on http://admin.vilfo.com/settings/general

Using Access Tokens

To use your Access Token simply provide it as part of the authorization header when you make a request. Access Tokens use the bearer authorization header when you make a request. This just means you need to specify the bearer type in the header.

Authorization

  • Request

    Authorization: Bearer <access_token>

Groups

Groups

List Groups
GET/groups

Example URI

GET http://admin.vilfo.com/api/v1/groups
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "id": 1,
      "name": "First group",
      "vpn": {
        "should": true
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    }
  }
}

Create Group
POST/groups

Notice

Unsorted devices is a reserved phrase and can not be used as group name

Example URI

POST http://admin.vilfo.com/api/v1/groups
Request
HideShow
Body
{
  "name": "First group"
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    }
  },
  "required": [
    "name"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "name": "First group",
    "vpn": {
      "should": true
    }
  },
  "message": "Group has been created"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "name": {
          "type": "string",
          "description": "Group name"
        },
        "vpn": {
          "type": "object",
          "properties": {
            "should": {
              "type": "boolean",
              "description": "Shows whether or not group is connected to VPN"
            }
          }
        }
      },
      "required": [
        "id"
      ]
    },
    "message": {
      "type": "string"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": {
    "attribute": [
      "First validation message",
      "Second validation message"
    ]
  },
  "message": "The given data was invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "array"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}

Group

Update Group
PUT/groups/{id}

Notice

Unsorted devices is a reserved phrase and can not be used as group name

Example URI

PUT http://admin.vilfo.com/api/v1/groups/1
URI Parameters
HideShow
id
number (required) Example: 1
Request
HideShow
Body
{
  "name": "Updated name"
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    }
  },
  "required": [
    "name"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": 1,
    "name": "First group",
    "vpn": {
      "should": true
    }
  },
  "message": "Group has been updated"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number"
        },
        "name": {
          "type": "string",
          "description": "Group name"
        },
        "vpn": {
          "type": "object",
          "properties": {
            "should": {
              "type": "boolean",
              "description": "Shows whether or not group is connected to VPN"
            }
          }
        }
      },
      "required": [
        "id"
      ]
    },
    "message": {
      "type": "string"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": {
    "attribute": [
      "First validation message",
      "Second validation message"
    ]
  },
  "message": "The given data was invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "array"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}

Delete Group
DELETE/groups/{id}

Delete group and release all devices from it.

Example URI

DELETE http://admin.vilfo.com/api/v1/groups/1
URI Parameters
HideShow
id
number (required) Example: 1
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Group has been deleted"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Connect group to VPN

Show information

Show information
GET/group-vpn/1

Return general information about VPN connection

Example URI

GET http://admin.vilfo.com/api/v1/group-vpn/1
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "ip": {
      "internal": "10.129.173.99"
    },
    "openvpn": {
      "running": true,
      "uptime": "2017-09-20T12:42:58+00:00"
    },
    "provider": {
      "id": "2",
      "name": "OVPN"
    },
    "region": {
      "id": 1,
      "location": "Stockholm, SE"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "ip": {
          "type": "object",
          "properties": {
            "internal": {
              "type": "string"
            }
          }
        },
        "openvpn": {
          "type": "object",
          "properties": {
            "running": {
              "type": "boolean",
              "description": "Whether or not VPN connection is active"
            },
            "uptime": {
              "type": "string",
              "description": "Datetime since when group has been connected to VPN"
            }
          }
        },
        "provider": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          }
        },
        "region": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "location": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Connect group

Connect group
POST/group-vpn

Example URI

POST http://admin.vilfo.com/api/v1/group-vpn
Request
HideShow
Body
{
  "group": 2,
  "region": 1
}
Schema
{
  "type": "object",
  "properties": {
    "group": {
      "type": "number",
      "description": "Id of the group that will be connected"
    },
    "region": {
      "type": "number",
      "description": "Id of region to connect to"
    }
  },
  "required": [
    "group",
    "region"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "ip": {
      "internal": "10.129.173.99"
    },
    "openvpn": {
      "running": true,
      "uptime": "2017-09-20T12:42:58+00:00"
    },
    "provider": {
      "id": "2",
      "name": "OVPN"
    },
    "region": {
      "id": 1,
      "location": "Stockholm, SE"
    }
  },
  "message": "Group has been successfully connected to OVPN"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "ip": {
          "type": "object",
          "properties": {
            "internal": {
              "type": "string"
            }
          }
        },
        "openvpn": {
          "type": "object",
          "properties": {
            "running": {
              "type": "boolean",
              "description": "Whether or not VPN connection is active"
            },
            "uptime": {
              "type": "string",
              "description": "Datetime since when group has been connected to VPN"
            }
          }
        },
        "provider": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          }
        },
        "region": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number"
            },
            "location": {
              "type": "string"
            }
          }
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Unable to connect"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Disconnect group

Disconnect group
DELETE/group-vpn/{id}

Example URI

DELETE http://admin.vilfo.com/api/v1/group-vpn/2
URI Parameters
HideShow
id
number (required) Example: 2

Group id

Request
HideShow
Body
{
  "region": 1
}
Schema
{
  "type": "object",
  "properties": {
    "region": {
      "type": "number",
      "description": "Id of region to connect to"
    }
  },
  "required": [
    "region"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Group has been successfully disconnected from OVPN"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Unable to disconnect"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Show OpenVPN history

Show OpenVPN history
GET/group-vpn/{id}/history

Return a summary of current VPN status as well a history of events during connection. status.connected is either boolean or null. It will be null until the connection attempt either was successful or it failed.

Example URI

GET http://admin.vilfo.com/api/v1/group-vpn/2/history
URI Parameters
HideShow
id
number (required) Example: 2

Group id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "date": "2017-09-22T08:22:46+00:00",
    "connected": true,
    "message": "Connection to VPN server established"
  },
  "events": [
    {
      "date": "2017-09-22T08:22:46+00:00",
      "category": "info|connected|disconnected|error",
      "message": "Cipher: aes-256-gcm"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string"
        },
        "connected": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "events": {
      "type": "array"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Show OpenVPN log

Show OpenVPN log
GET/group-vpn/{id}/log

Return the OpenVPN generated log file.

Example URI

GET http://admin.vilfo.com/api/v1/group-vpn/2/log
URI Parameters
HideShow
id
number (required) Example: 2

Group id

Response  200
HideShow
Headers
Content-Type: text/plain
Body
Fri Sep 22 08:22:33 2017 OpenVPN 2.4.3 x86_64-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD]
Fri Sep 22 08:22:33 2017 library versions: OpenSSL 1.0.2k  26 Jan 2017, LZO 2.09
Fri Sep 22 08:22:33 2017 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Devices

Devices

List Devices
GET/devices

Information about device’s online status is not included in the response.

Example URI

GET http://admin.vilfo.com/api/v1/devices
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "blocked": false,
      "hostname": "box-7",
      "displayName": "Box 7",
      "ipv4": "192.168.0.7",
      "mac_address": "08:00:27:8e:ac:31",
      "vendor": "PCS Systemtechnik GmbH",
      "vilfo_group": 1,
      "bandwidth": {
        "download": 0.5,
        "upload": 0.2,
        "total": 0.7
      },
      "bypass": true,
      "first_seen_at": "2017-09-20T12:42:58+00:00"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    }
  }
}

Devices

Show Device
GET/devices/{mac_address}

Example URI

GET http://admin.vilfo.com/api/v1/devices/08:00:27:8e:ac:31
URI Parameters
HideShow
mac_address
string (required) Example: 08:00:27:8e:ac:31
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "blocked": false,
    "hostname": "box-7",
    "displayName": "Box 7",
    "ipv4": "192.168.0.7",
    "mac_address": "08:00:27:8e:ac:31",
    "vendor": "PCS Systemtechnik GmbH",
    "vilfo_group": 1,
    "bandwidth": {
      "download": 0.5,
      "upload": 0.2,
      "total": 0.7
    },
    "bypass": true,
    "first_seen_at": "2017-09-20T12:42:58+00:00",
    "status": {
      "online": true,
      "online_from": "2017-09-20T12:42:58+00:00"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "blocked": {
          "type": "boolean",
          "description": "Shows if device has been blocked"
        },
        "hostname": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "ipv4": {
          "type": "string"
        },
        "mac_address": {
          "type": "string"
        },
        "vendor": {
          "type": "string"
        },
        "vilfo_group": {
          "type": "number",
          "description": "Group id"
        },
        "bandwidth": {
          "type": "object",
          "properties": {
            "download": {
              "type": "number"
            },
            "upload": {
              "type": "number"
            },
            "total": {
              "type": "number"
            }
          },
          "description": "Information about bandwidth in gigabytes."
        },
        "bypass": {
          "type": "boolean",
          "description": "If device is not connected to VPN tunnel this value will be `null`"
        },
        "first_seen_at": {
          "type": "string",
          "description": "Datetime string of when device has connected for the first time"
        },
        "status": {
          "type": "object",
          "properties": {
            "online": {
              "type": "boolean",
              "description": "Shows whether or not device is online"
            },
            "online_from": {
              "type": "string",
              "description": "Datetime string or null if device is offline"
            }
          },
          "description": "Information about online status"
        }
      }
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Update Device
PUT/devices/{mac_address}

Example URI

PUT http://admin.vilfo.com/api/v1/devices/08:00:27:8e:ac:31
URI Parameters
HideShow
mac_address
string (required) Example: 08:00:27:8e:ac:31
Request
HideShow
Body
{
  "hostname": "Updated box name",
  "ipv4": "192.168.0.10"
}
Schema
{
  "type": "object",
  "properties": {
    "hostname": {
      "type": "string"
    },
    "ipv4": {
      "type": "string"
    }
  },
  "required": [
    "hostname",
    "ipv4"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "blocked": false,
    "hostname": "box-7",
    "displayName": "Box 7",
    "ipv4": "192.168.0.7",
    "mac_address": "08:00:27:8e:ac:31",
    "vendor": "PCS Systemtechnik GmbH",
    "vilfo_group": 1,
    "bandwidth": {
      "download": 0.5,
      "upload": 0.2,
      "total": 0.7
    },
    "bypass": true,
    "first_seen_at": "2017-09-20T12:42:58+00:00",
    "status": {
      "online": true,
      "online_from": "2017-09-20T12:42:58+00:00"
    }
  },
  "message": "Device has been updated"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "blocked": {
          "type": "boolean",
          "description": "Shows if device has been blocked"
        },
        "hostname": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "ipv4": {
          "type": "string"
        },
        "mac_address": {
          "type": "string"
        },
        "vendor": {
          "type": "string"
        },
        "vilfo_group": {
          "type": "number",
          "description": "Group id"
        },
        "bandwidth": {
          "type": "object",
          "properties": {
            "download": {
              "type": "number"
            },
            "upload": {
              "type": "number"
            },
            "total": {
              "type": "number"
            }
          },
          "description": "Information about bandwidth in gigabytes."
        },
        "bypass": {
          "type": "boolean",
          "description": "If device is not connected to VPN tunnel this value will be `null`"
        },
        "first_seen_at": {
          "type": "string",
          "description": "Datetime string of when device has connected for the first time"
        },
        "status": {
          "type": "object",
          "properties": {
            "online": {
              "type": "boolean",
              "description": "Shows whether or not device is online"
            },
            "online_from": {
              "type": "string",
              "description": "Datetime string or null if device is offline"
            }
          },
          "description": "Information about online status"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow

If provided IP address is already being used by another device or it is not valid

Headers
Content-Type: application/json
Body
{
  "error": "Specified IP is not valid"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "Specified IP is not valid",
        "Specified IP is already in use"
      ]
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": {
    "attribute": [
      "First validation message",
      "Second validation message"
    ]
  },
  "message": "The given data was invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "array"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}

Device history
GET/history/{mac_address}{?page}

Example URI

GET http://admin.vilfo.com/api/v1/history/08:00:27:8e:ac:31?page=2
URI Parameters
HideShow
mac_address
string (required) Example: 08:00:27:8e:ac:31
page
number (optional) Example: 2
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "links": {
    "first": "<url>|null",
    "last": "<url>|null",
    "next": "<url>|null",
    "prev": "<url>|null"
  },
  "meta": {
    "current_page": 1,
    "last_page": 3,
    "per_page": 5,
    "from": 1,
    "to": 5,
    "total": 14
  },
  "data": [
    {
      "id": 1,
      "created_at": "2017-09-20T12:42:58+00:00",
      "message": "Device is once again protected"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "links": {
      "type": "object",
      "properties": {
        "first": {
          "type": "string"
        },
        "last": {
          "type": "string"
        },
        "next": {
          "type": "string"
        },
        "prev": {
          "type": "string"
        }
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "current_page": {
          "type": "number"
        },
        "last_page": {
          "type": "number"
        },
        "per_page": {
          "type": "number"
        },
        "from": {
          "type": "number"
        },
        "to": {
          "type": "number"
        },
        "total": {
          "type": "number"
        }
      }
    },
    "data": {
      "type": "array"
    }
  }
}

Add Device to Group
POST/group-devices

Example URI

POST http://admin.vilfo.com/api/v1/group-devices
Request
HideShow
Body
{
  "group": 2,
  "mac_address": "08:00:27:8e:ac:31"
}
Schema
{
  "type": "object",
  "properties": {
    "group": {
      "type": "number",
      "description": "Group id"
    },
    "mac_address": {
      "type": "string",
      "description": "MAC address of the device that will be added to the given group"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Device has been added to <group-name>"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Device has not been added to <group-name>"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}

Remove Device from Group
DELETE/group-devices/{mac_address}

Example URI

DELETE http://admin.vilfo.com/api/v1/group-devices/08:00:27:8e:ac:31
URI Parameters
HideShow
mac_address
string (required) Example: 08:00:27:8e:ac:31
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Device has been removed from the group"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Unable to remove device from the group"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}

Parental control rules
GET/devices/{mac_address}/parental-control

Example URI

GET http://admin.vilfo.com/api/v1/devices/08:00:27:8e:ac:31/parental-control
URI Parameters
HideShow
mac_address
string (required) Example: 08:00:27:8e:ac:31
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "active": false,
      "mac_address": "08:00:27:8e:ac:31",
      "name": "vilfo-parentcontrol-rule-8Ylzg9hp80MlbB2z",
      "schedule": "Weekends",
      "start_time": "12:00:00",
      "stop_time": "14:00:00",
      "device": {
        "blocked": false,
        "hostname": "box-7",
        "displayName": "Box 7",
        "ipv4": "192.168.0.7",
        "mac_address": "08:00:27:8e:ac:31",
        "vendor": "PCS Systemtechnik GmbH",
        "vilfo_group": 1,
        "bandwidth": {
          "download": 0.5,
          "upload": 0.2,
          "total": 0.7
        },
        "bypass": true,
        "first_seen_at": "2017-09-20T12:42:58+00:00"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    }
  }
}

Traffic statistics
GET/devices/{mac_address}/traffic/{period}

Show traffic statistics (upload, download) for a given device and time period

Example URI

GET http://admin.vilfo.com/api/v1/devices/08:00:27:8e:ac:31/traffic/week
URI Parameters
HideShow
mac_address
string (required) Example: 08:00:27:8e:ac:31
period
string (required) Example: week

Returns results for a given period of time

Choices: week month

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "labels": [
      "2017-10-02 13:15"
    ],
    "download": [
      "127"
    ],
    "upload": [
      "252"
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "labels": {
          "type": "array"
        },
        "download": {
          "type": "array"
        },
        "upload": {
          "type": "array"
        }
      }
    }
  }
}

Blocked devices

Block device

Block device
POST/blocked-devices

Example URI

POST http://admin.vilfo.com/api/v1/blocked-devices
Request
HideShow
Body
{
  "mac_address": "08:00:27:8e:ac:31",
  "ipv4": "192.168.0.7"
}
Schema
{
  "type": "object",
  "properties": {
    "mac_address": {
      "type": "string"
    },
    "ipv4": {
      "type": "string"
    }
  },
  "required": [
    "mac_address",
    "ipv4"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Device has been blocked"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": {
    "attribute": [
      "First validation message",
      "Second validation message"
    ]
  },
  "message": "The given data was invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "array"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}

Unblock device

Unblock device
DELETE/blocked-devices/{mac_address}

Example URI

DELETE http://admin.vilfo.com/api/v1/blocked-devices/08:00:27:8e:ac:31
URI Parameters
HideShow
mac_address
string (required) Example: 08:00:27:8e:ac:31
Request
HideShow
Body
{
  "ipv4": "192.168.0.7"
}
Schema
{
  "type": "object",
  "properties": {
    "ipv4": {
      "type": "string"
    }
  },
  "required": [
    "ipv4"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Device has been unblocked"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": {
    "attribute": [
      "First validation message",
      "Second validation message"
    ]
  },
  "message": "The given data was invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "array"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}

Bypass VPN connection

Bypass VPN connection

Bypass VPN connection
POST/bypass-devices

Example URI

POST http://admin.vilfo.com/api/v1/bypass-devices
Request
HideShow
Body
{
  "mac_address": "08:00:27:8e:ac:31"
}
Schema
{
  "type": "object",
  "properties": {
    "mac_address": {
      "type": "string"
    }
  },
  "required": [
    "mac_address"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Box 7 is now using ordinary connection"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Bypass was not enabled"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Protect device with VPN

Protect device with VPN
DELETE/bypass-devices/{mac_address}

Example URI

DELETE http://admin.vilfo.com/api/v1/bypass-devices/08:00:27:8e:ac:31
URI Parameters
HideShow
mac_address
string (required) Example: 08:00:27:8e:ac:31
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Box 7 is once again protected"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Bypass was not disabled"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No query results for model..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

VPN Providers

List Providers

List Providers
GET/providers

Return list of all enabled providers

Example URI

GET http://admin.vilfo.com/api/v1/providers
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "id": "2",
      "name": "OVPN",
      "regions": [
        {
          "id": 1,
          "location": "Stockholm, SE"
        }
      ]
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    }
  }
}

System

Power off

Power off
POST/system/poweroff

Example URI

POST http://admin.vilfo.com/api/v1/system/poweroff
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Shutting down Vilfo"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Reboot

Reboot
POST/system/reboot

Example URI

POST http://admin.vilfo.com/api/v1/system/reboot
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Rebooting Vilfo"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Ping

Ping
GET/system/ping

Notice

This API call can be used to check so Vilfo is back up and running after a reboot. No actual external ping is made anywhere.

Example URI

GET http://admin.vilfo.com/api/v1/system/ping
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Online"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Not online"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}

Port forwards

Rules

Get rules
GET/ports

Example URI

GET http://admin.vilfo.com/api/v1/ports
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "mac_address": "08:00:27:a8:ac:aa",
      "src": "90-95",
      "dest": "105",
      "protocol": "tcp"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    }
  }
}

Add rules
POST/ports

Example URI

POST http://admin.vilfo.com/api/v1/ports
Request
HideShow
Body
{
  "mac_address": "08:00:27:a8:ac:aa",
  "src_port": "20",
  "dest_port": "40",
  "protocol": "tcp"
}
Schema
{
  "type": "object",
  "properties": {
    "mac_address": {
      "type": "string"
    },
    "src_port": {
      "type": "string",
      "description": "Number or range of numbers"
    },
    "dest_port": {
      "type": "string",
      "description": "Number or range of numbers"
    },
    "protocol": {
      "enum": [
        "tcp",
        "udp",
        "tcp udp",
        "udp tcp"
      ],
      "description": "Rule protocol"
    }
  },
  "required": [
    "mac_address",
    "src_port",
    "dest_port",
    "protocol"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Please specify both internal and external ports"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "Please specify both internal and external ports",
        "Port range is not correct",
        "Number of ports should be the same",
        "Ports should not overlap",
        "Specified ports are already occupied"
      ]
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": {
    "attribute": [
      "First validation message",
      "Second validation message"
    ]
  },
  "message": "The given data was invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "array"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}

Rule

Remove rule
DELETE/ports/{mac_address}

Example URI

DELETE http://admin.vilfo.com/api/v1/ports/08:00:27:a8:ac:aa
URI Parameters
HideShow
mac_address
string (required) Example: 08:00:27:a8:ac:aa
Request
HideShow
Body
{
  "src_port": "20"
}
Schema
{
  "type": "object",
  "properties": {
    "src_port": {
      "type": "string"
    }
  },
  "required": [
    "src_port"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[]
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Unable to delete forwarding rule"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}

Settings

Parental control

Get rules
GET/settings/parents

Example URI

GET http://admin.vilfo.com/api/v1/settings/parents
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "active": false,
      "mac_address": "08:00:27:8e:ac:31",
      "name": "vilfo-parentcontrol-rule-8Ylzg9hp80MlbB2z",
      "schedule": "Weekends",
      "start_time": "12:00:00",
      "stop_time": "14:00:00",
      "device": {
        "blocked": false,
        "hostname": "box-7",
        "displayName": "Box 7",
        "ipv4": "192.168.0.7",
        "mac_address": "08:00:27:8e:ac:31",
        "vendor": "PCS Systemtechnik GmbH",
        "vilfo_group": 1,
        "bandwidth": {
          "download": 0.5,
          "upload": 0.2,
          "total": 0.7
        },
        "bypass": true,
        "first_seen_at": "2017-09-20T12:42:58+00:00"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array"
    }
  }
}

Schedule device
POST/settings/parents

Example URI

POST http://admin.vilfo.com/api/v1/settings/parents
Request
HideShow
Body
{
  "mac_address": "08:00:27:8e:ac:31",
  "days": [
    "Mon",
    "Tue",
    "Wed",
    "Thu",
    "Fri",
    "Sat",
    "Sun"
  ],
  "whole_day": true,
  "schedule_start: `12:00` (string, optional) - Time in `HH:mm` format. Required if `whole_day` is not present in the request": "Hello, world!",
  "schedule_end: `14:00` (string, optional) - Time in `HH:mm` format. Required if `whole_day` is not present in the request": "Hello, world!"
}
Schema
{
  "type": "object",
  "properties": {
    "mac_address": {
      "type": "string"
    },
    "days": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Array of days in `date('D')` format."
    },
    "whole_day": {
      "type": "boolean",
      "description": "Set to `true` if you need to apply rule to the whole day"
    },
    "schedule_start: `12:00` (string, optional) - Time in `HH:mm` format. Required if `whole_day` is not present in the request": {
      "type": "string"
    },
    "schedule_end: `14:00` (string, optional) - Time in `HH:mm` format. Required if `whole_day` is not present in the request": {
      "type": "string"
    }
  },
  "required": [
    "mac_address",
    "days"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "active": false,
    "mac_address": "08:00:27:8e:ac:31",
    "name": "vilfo-parentcontrol-rule-8Ylzg9hp80MlbB2z",
    "schedule": "Weekends",
    "start_time": "12:00:00",
    "stop_time": "14:00:00",
    "device": {
      "blocked": false,
      "hostname": "box-7",
      "displayName": "Box 7",
      "ipv4": "192.168.0.7",
      "mac_address": "08:00:27:8e:ac:31",
      "vendor": "PCS Systemtechnik GmbH",
      "vilfo_group": 1,
      "bandwidth": {
        "download": 0.5,
        "upload": 0.2,
        "total": 0.7
      },
      "bypass": true,
      "first_seen_at": "2017-09-20T12:42:58+00:00"
    }
  },
  "message": "Rule has been added"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "active": {
          "type": "boolean",
          "description": "Indicates if rules is active at current moment"
        },
        "mac_address": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "schedule": {
          "type": "string",
          "description": "List of days or user-friendly string"
        },
        "start_time": {
          "type": "string"
        },
        "stop_time": {
          "type": "string"
        },
        "device": {
          "type": "object",
          "properties": {
            "blocked": {
              "type": "boolean",
              "description": "Shows if device has been blocked"
            },
            "hostname": {
              "type": "string"
            },
            "displayName": {
              "type": "string"
            },
            "ipv4": {
              "type": "string"
            },
            "mac_address": {
              "type": "string"
            },
            "vendor": {
              "type": "string"
            },
            "vilfo_group": {
              "type": "number",
              "description": "Group id"
            },
            "bandwidth": {
              "type": "object",
              "properties": {
                "download": {
                  "type": "number"
                },
                "upload": {
                  "type": "number"
                },
                "total": {
                  "type": "number"
                }
              },
              "description": "Information about bandwidth in gigabytes."
            },
            "bypass": {
              "type": "boolean",
              "description": "If device is not connected to VPN tunnel this value will be `null`"
            },
            "first_seen_at": {
              "type": "string",
              "description": "Datetime string of when device has connected for the first time"
            }
          }
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Rule has not been added"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": {
    "attribute": [
      "First validation message",
      "Second validation message"
    ]
  },
  "message": "The given data was invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "array"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}

Remove rule
DELETE/settings/parents/{name}

Example URI

DELETE http://admin.vilfo.com/api/v1/settings/parents/vilfo-parentcontrol-rule-8Ylzg9hp80MlbB2z
URI Parameters
HideShow
name
string (required) Example: vilfo-parentcontrol-rule-8Ylzg9hp80MlbB2z

Rule name

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Rule has been removed"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Unable to remove rule"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Dashboard

Device vendors

Device vendors
GET/dashboard/vendors

Return list of vendors

Example URI

GET http://admin.vilfo.com/api/v1/dashboard/vendors
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "vendor": "PCS Systemtechnik GmbH",
    "count": "4"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Bandwidth

Bandwidth
GET/dashboard/bandwidth

Return bandwidth information of all devices sorted descending by total traffic

Example URI

GET http://admin.vilfo.com/api/v1/dashboard/bandwidth
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "total": 0.2,
    "displayName": "Box 7"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Bandwidth distribution

Bandwidth distribution
GET/dashboard/bandwidth/distribution

Return how much bandwidth in Gigabytes that have been sent via VPN and via ordinary WAN connection

Example URI

GET http://admin.vilfo.com/api/v1/dashboard/bandwidth/distribution
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "wan": 0.1,
  "vpn": 0.4
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "wan": {
      "type": "number",
      "description": "Total bandwidth sent via WAN in gigabtyes"
    },
    "vpn": {
      "type": "number",
      "description": "Total bandwidth sent via VPN in gigabtyes"
    }
  }
}

Gateways

Gateways
GET/dashboard/gateways

Return timeseries information about gateways for recent 3 hours

Example URI

GET http://admin.vilfo.com/api/v1/dashboard/gateways
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "gateways": [
    {
      "name": "Gateway 1",
      "latencies": [
        0.077,
        0.066
      ]
    }
  ],
  "labels": [
    "2017-09-21 07:07",
    "2017-09-21 07:12"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "gateways": {
      "type": "array",
      "description": "Every gateway will represent a single series of data in the chart"
    },
    "labels": {
      "type": "array",
      "description": "Datetime labels"
    }
  }
}

Utilization

Utilization
GET/dashboard/utilization

Return timeseries information about utilization for recent 3 hours

Example URI

GET http://admin.vilfo.com/api/v1/dashboard/utilization
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "labels": [
    "2017-09-21 07:07",
    "2017-09-21 07:12"
  ],
  "utilization": [
    78.65,
    18.02
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "labels": {
      "type": "array",
      "description": "Datetime labels"
    },
    "utilization": {
      "type": "array",
      "description": "Array of load in percents"
    }
  }
}

Online devices

Online devices
GET/dashboard/online-devices

Return information about online vs. offline devices

Example URI

GET http://admin.vilfo.com/api/v1/dashboard/online-devices
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Offline": 0,
  "Online": 4
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "Offline": {
      "type": "number",
      "description": "Number of offline devices"
    },
    "Online": {
      "type": "number",
      "description": "Number of online devices"
    }
  }
}

Check online device

Check online device
GET/dashboard/online-devices/{mac_address}

Check if a single device is online

Example URI

GET http://admin.vilfo.com/api/v1/dashboard/online-devices/08:00:27:8e:ac:31
URI Parameters
HideShow
mac_address
string (required) Example: 08:00:27:8e:ac:31

Device mac address

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "online": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "online": {
      "type": "boolean",
      "description": "Whether or not device is online"
    }
  }
}

Board information

Board information
GET/dashboard/board

Return information about system

Example URI

GET http://admin.vilfo.com/api/v1/dashboard/board
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "bootTime": "2017-09-20T12:42:58+00:00",
  "load": 65,
  "version": "v1.0-beta"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "bootTime": {
      "type": "string",
      "description": "Datetime sting since Vilfo has been booted"
    },
    "load": {
      "type": "number",
      "description": "Current load in percents"
    },
    "version": {
      "type": "string",
      "description": "Version number"
    }
  }
}

Setup

Notice

Please ignore Example URI for this section. Because we are using session storage for Setup flow, we should use default base url for following requests (without /api/v1/ prefix)

Check Internet connection

Check Internet connection
GET/setup/check

Example URI

GET http://admin.vilfo.com/api/v1/setup/check
Response  200
HideShow
Headers
Content-Type: application/json
Body
[]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Ensure that you have an internet cable attached to the WAN port of Vilfo"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}

Submit step

Submit step
PUT/setup

Each request should include all fields that are present in the current step

Example URI

PUT http://admin.vilfo.com/api/v1/setup
Request
HideShow
Body
{
  "step": "license",
  "action": "continue"
}
Schema
{
  "type": "object",
  "properties": {
    "step": {
      "type": "string"
    },
    "action": {
      "type": "string",
      "description": "Could be `skip` to skip current step"
    }
  },
  "required": [
    "step"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "next": "credentials",
  "attributes": {
    "key": "vilfo-1631"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "next": {
      "type": "string",
      "description": "Show what is the next step should be. Could be `null` there are no steps left"
    },
    "attributes": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        }
      },
      "description": "Contains all input that has been passed in current step. Used to save it in storage."
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Unknown setup step"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": {
    "attribute": [
      "First validation message",
      "Second validation message"
    ]
  },
  "message": "The given data was invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "array"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}

Browser Extension

Bypass

Enable bypass
POST/extension/bypass

You can either enable bypass globally for a current device or provide domain and ip addresses of the website that should be bypassed.

If domain is not specified rules will be applied for device globally.

Example URI

POST http://admin.vilfo.com/api/v1/extension/bypass
Request
HideShow
Body
{
  "ip_addresses": [
    "192.168.10.20"
  ],
  "domain": "domain.com"
}
Schema
{
  "type": "object",
  "properties": {
    "ip_addresses": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Required if domain is present"
    },
    "domain": {
      "type": "string",
      "description": "Specify domain that should be bypassed"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "domain.com is bypassed"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": {
    "attribute": [
      "First validation message",
      "Second validation message"
    ]
  },
  "message": "The given data was invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "array"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}

Disable bypass
DELETE/extension/bypass

You can either disable bypass globally for a current device or provide domain of the website that should be protected.

Example URI

DELETE http://admin.vilfo.com/api/v1/extension/bypass
Request
HideShow
Body
{
  "domain": "domain.com"
}
Schema
{
  "type": "object",
  "properties": {
    "domain": {
      "type": "string",
      "description": "Specify domain that should be protected"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "domain.com is protected"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "errors": {
    "attribute": [
      "First validation message",
      "Second validation message"
    ]
  },
  "message": "The given data was invalid."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "array"
        }
      }
    },
    "message": {
      "type": "string"
    }
  }
}