Admin API

Overview

The Admin API is a REST-like HTTP interface for programmatically administering the WebAdmin platform. It enables users to automate administrative tasks and manage system configurations through API calls rather than the graphical user interface. This API follows modern REST principles and uses JSON for request and response data.

WebAdmin Configuration

Creating an API Key

To access the Admin API, you must first generate an API key from within the WebAdmin interface:

  1. Log in to WebAdmin with your administrator account
  2. Navigate to APIsAdmin API
  3. Click Create New API Key
  4. Enter a descriptive name for the key (e.g., the name of the service or integration that will use it)
  5. Select an expiration date for the key
  6. Click Generate
  7. Copy and save the generated key immediately—it will not be accessible again after this step

Using the API Key

Include the API key in every request to the Admin API by adding an Authorization header with the following format:

Authorization: ApiKey <your-api-key>

Replace <your-api-key> with the actual API key generated in the WebAdmin interface.

API Documentation

For detailed information about available endpoints, request/response formats, and interactive API exploration, refer to Admin API Reference.

API Helper Scripts

upload_cert.sh

Download: upload_cert.sh

Uploads a TLS certificate to WebAdmin and assigns it to one or more interfaces. Intended as a deploy hook for certbot or acme.sh to automate certificate renewal. The certificate is uploaded once and can be assigned to multiple interfaces in a single run, each with its own FQDN. The API key must be provided via the WEBADMIN_API_KEY environment variable.

export WEBADMIN_API_KEY=<your-api-key>
./upload_cert.sh <cert-file.crt> <key-file.key> <ca-file.ca> <webadmin-host> <interface:fqdn> [<interface:fqdn> ...]

Example — wildcard certificate assigned to both interfaces:

export WEBADMIN_API_KEY=myapikey123
./upload_cert.sh portal.crt portal.key ca.crt 192.168.1.100 \
    surflan:guest.your-location.net \
    officelan:iacbox.your-company.com