MOR API IP access

From Kolmisoft Wiki
Jump to navigationJump to search

IP access status (API v2)

Read-only check whether an IPv4 address appears in MOR Monitorings block/whitelist lists.

Authentication

  • MOR API v2 JWT (`Authorization: Bearer …`) — obtain token via POST /billing/api/v2/authentication/login.
  • Accountant users need Monitorings → Manage read permission (monitorings_manage).
  • API permission group must grant Check IP blacklist/whitelist status (v2_ip_access_status, Read).

Request

GET /billing/api/v2/ip_access/status

Parameter Required Description
ip yes IPv4 address to check (validated with IPAddr; malformed or missing → 400).
server_id no Restrict results to one MOR server. Unknown id → 404.

Response (200)

Field Meaning
ip Normalized query IPv4 string.
blacklisted_on_servers Server IDs with active block (unblock=0).
whitelisted_on_servers Server IDs with active whitelist (unblock=3).
blacklisted_pending_on_servers Pending block side (unblock 1 or 2).
whitelisted_pending_on_servers Pending whitelist side (unblock 4 or 5).
meta.server_id_filter null when all servers; otherwise the server_id query value.

Precedence (per server): active whitelist excludes that server from blacklisted_on_servers; pending whitelist excludes that server from blacklisted_pending_on_servers. Active and pending states are independent — a server may appear in both an active and a pending array.

Matching is CIDR-aware (stored host or prefix rows in blocked_ips).

Errors

HTTP Body
400 {"errors":"IP is invalid or missing"}
401 JWT invalid, API disabled, missing monitorings_manage, or v2_ip_access_status denied
404 {"errors":"Server not found"} (invalid server_id)

Example

curl -s -H "Authorization: Bearer $TOKEN" \
  "https://example.com/billing/api/v2/ip_access/status?ip=203.0.113.10"

See also