InfraFenceInfraFence

Live Security Operations

Get started

Build on InfraFence with the API

Last updated:

The InfraFence API connects your own tools to the servers InfraFence protects. Read servers, events, incidents and bans. Ban and unban addresses, change the allow list, create install tokens. Get signed webhooks when something happens.

It is a JSON REST API over HTTPS, with an OpenAPI 3.1 description. It is included in the paid plans: Basic, Pro and AutoMode.

Not ready to install? The free server audit shows what InfraFence would find, without installing anything.Free server audit →

What you can build

  • Protection status in your hosting panel

    Show each customer whether their server is online, its security score and its recent incidents, inside the panel they already use. GET /servers and GET /incidents.

  • An "unblock my office" button

    A customer locked out after too many wrong passwords clicks a button in your portal. Your code finds the ban, lifts it and adds the office to the allow list. The same safety rules as the dashboard apply.

  • Attacks into your SIEM or ticketing system

    Pull events and incidents with filters by server, severity, category and time, or receive them as signed webhooks. Open a ticket for every critical incident.

  • Automatic install on new servers

    Your provisioning creates an install token and runs the install command on each new server, in Full protection or in Learning (detects everything, blocks nothing). The server then shows up in the dashboard and in GET /servers.

What the API covers

  • Servers: the list, their status (online, offline, not reporting), security score, protection mode (Full protection or Learning) and sites, and install tokens to add new servers.
  • Events and incidents: filtered by server, severity, category, type, source address and time range.
  • Bans: read them, ban an address on one server or on all of them, lift a ban. Private addresses, your allow list, InfraFence's never-block list and addresses with a recent SSH login are refused, as in the dashboard.
  • Allow list: read it, add an address or a range (at least a /16 or a /48), remove the entries you added through the API.
  • Webhooks: JSON signed with your secret, for alerts, servers going offline and online, bans created and removed.

Every endpoint, with a curl example and a sample answer, is in the API documentation.

A short example

The "unblock my office" button in two calls. First, look for the address in the bans:

curl "https://infrafence.com/api/v1/bans?ip=203.0.113.45" \
  -H "Authorization: Bearer $INFRAFENCE_API_KEY"

Lift each ban with DELETE /bans/{id}, then add the address to the allow list, so it is never banned again:

curl -X POST https://infrafence.com/api/v1/allowlist \
  -H "Authorization: Bearer $INFRAFENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ip": "203.0.113.45", "note": "Customer 1234 office"}'

And the list of servers, with their status and security score:

curl https://infrafence.com/api/v1/servers \
  -H "Authorization: Bearer $INFRAFENCE_API_KEY"

{
  "data": [
    {
      "id": 42,
      "name": "web-01",
      "hostname": "web-01.example.com",
      "ip": "203.0.113.10",
      "private_ip": null,
      "os": "Ubuntu",
      "os_version": "24.04",
      "agent_version": "1.0.35",
      "status": "online",
      "last_seen_at": "2026-11-13T09:14:52.000Z",
      "created_at": "2026-10-02T14:03:11.000Z",
      "security_score": { "score": 86, "grade": "B" },
      "mode": "protect",
      "domains": ["example.com", "shop.example.com"]
    }
  ],
  "next_cursor": null
}

Keys and limits

  • Owners and admins create keys under Settings › API in the dashboard. Each key belongs to the organization, with read only or read and write access. Up to 20 keys.
  • A key is shown once. Send it as Authorization: Bearer ifk_…. Revoke it at any time.
  • Live keys only: there is no test mode. Try writes on a test server first.
  • Up to 120 reads and 30 writes a minute per key, and 600 requests a minute for the whole organization. Every answer carries X-RateLimit-* headers.
  • Errors are JSON with a stable code. Lists use cursor pagination.

Webhooks

The API answers your requests; webhooks call you. Add a webhook channel under Settings › Alerts and choose what it receives: alert, server.offline, server.online, ban.created, ban.removed. A test delivery checks your endpoint.

With a signing secret, every delivery is signed. Failed deliveries are retried. The payload, the signature check in Node.js and PHP, and the retries are in Alerts › Webhooks.

Plans

The API is included in Basic (from $8.90 per server a month), Pro (from $18.90) and AutoMode (from $28.90). It is not available on the free Starter plan or during the 14-day free trial. Compare the plans.

Documentation