kasapi 1.0: one Go client for all-inkl.com, three tools on top
My domains and mailboxes live at all-inkl.com. The hosting is fine and the price is right, but everything is managed in KAS, their web panel. For a homelab that runs on GitOps, that is the one place where things still happen by clicking: a DNS record for a new service, a TXT record for a certificate, a mail forward.
KAS has an API. What it did not have was a client you would want to build on. So I wrote one: kasapi, a Go library and a small CLI. Three tools use it: a cert-manager webhook, a Terraform/OpenTofu provider and an external-dns webhook. Today kasapi, the provider and the cert-manager webhook are released as 1.0.0. This post explains why the library exists, how it works, and what the 1.0.0 means.
Why a library
It started with certificates. In October 2025 I needed wildcard certificates for services that are only reachable in my LAN, which means DNS-01, which means cert-manager has to write _acme-challenge TXT records at all-inkl. There was no webhook for that, so I wrote cert-manager-webhook-all-inkl. Its KAS code was copied from lego, the ACME library, which has an all-inkl provider for exactly this one job.
That worked for TXT records. Then I wanted DNS records and mailboxes in OpenTofu, next to everything else in my infrastructure code. Copying the lego code a second time and extending it was the obvious shortcut, and the wrong one: every tool would carry its own SOAP handling, its own session logic and its own idea of the rate limit, and every bug would be fixed one tool at a time.
So in June 2026 the KAS part moved into its own module, with three rules:
- Standard library only: The core package imports nothing else. Whoever uses it does not get a dependency tree with it.
- Typed services over one generic call:
Client.Execruns any KAS action with raw parameters.DNS,Mail,Domainsand the other services are thin wrappers over it, so an action without a wrapper is still one call away. - A fake server for tests:
kasapitestspeaks the KAS wire format in-process. Downstream projects test against it without credentials.
What makes KAS awkward
The KAS API is SOAP in name. There is one operation, and its single parameter is a JSON document that says what you actually want:
| |
The response, on the other hand, is real SOAP: PHP arrays serialized as SOAP-encoded maps of <item><key/><value/></item>. kasapi decodes them into plain map[string]any and []any once, and the typed services map those onto structs.
The bigger constraint is flood protection. Every response carries a KasFloodDelay, the time the next request has to wait. Call too early and you get a flood_protection fault instead of a result. A client that ignores this works fine in a quick test and fails as soon as two calls follow each other, which is exactly what a cert-manager Present followed by a CleanUp does. kasapi therefore serializes all calls of a client, waits out the reported delay before the next one, and retries the fault with bounded backoff. After a fault or a login, KAS reports no delay but still counts the call, so the client waits two seconds. A reported delay of zero is treated the same way.
The rest is the usual: sessions are created through a separate KasAuth endpoint and renewed when they expire, two-factor accounts get their one-time PIN through a callback, and kascli (kubectl-style, with contexts) is what I use to look at an account from the terminal:
| |
Three tools on top
flowchart LR
kas[(KAS API)]
lib[kasapi]
cm[cert-manager webhook<br/>DNS-01 TXT records]
tf[Terraform / OpenTofu provider<br/>DNS, mail, hosts, TLS, ...]
ed[external-dns webhook<br/>records from Ingress and Services]
cli[kascli]
lib --> kas
cm --> lib
tf --> lib
ed --> lib
cli --> libcert-manager webhook
cert-manager-webhook-all-inkl is the oldest of the three and moved onto kasapi in July. Since then it has become simpler with every kasapi release: Present uses DNS.Ensure, which returns an existing identical record instead of adding a duplicate, and the webhook keeps one client per KAS login so that all challenges of an account share the session and the flood-delay tracking.
For 1.0.0 it got stricter rather than bigger. The Issuer config is decoded strictly, so a misspelled field fails the challenge instead of being ignored silently. The Service is a fixed ClusterIP on 443, because the APIService dials 443 anyway. latest now means the newest release, not the last commit on main, and v1 and v1.0 follow their release line. Image and chart are signed with cosign, and the cert-manager DNS-01 conformance suite ran against a live zone before the tag.
Terraform and OpenTofu provider
terraform-provider-allinkl is the reason the library exists. It manages DNS records, mailboxes and forwards, subdomains, domain and host settings, TLS certificates, FTP users, databases, cronjobs and dynamic DNS users, plus data sources for most of them. The split is strict: the provider contains no SOAP and no session handling, and kasapi knows nothing about Terraform. Its acceptance tests run against an in-memory KAS account built on kasapitest, so CI never needs my credentials.
1.0.0 is when the schemas freeze, so the last schema changes went in now. Mail filters are objects ({ name = "spamc_move", action = "move", target = "Junk" }) instead of encoded strings. Forward targets, copy addresses and allowed hosts are sets, because order means nothing at KAS and a reordered list should not show as a diff. Every credential has a write-only _wo variant that never lands in the state. State upgraders convert existing state, so a rewritten configuration plans no change.
external-dns webhook
The newest one, external-dns-webhook-all-inkl, runs as a sidecar of the official external-dns chart and creates records for Ingresses and Services. external-dns thinks in endpoints (one name and type with a set of targets), while KAS stores one record per value, so the webhook groups records on read and diffs them on write. Flood protection shapes the design here too: each affected zone is read once per change set, and a value that replaces another becomes one update_dns_settings instead of a delete and an add. With a delay on every call, the number of calls is the one thing worth optimizing.
This one is not 1.0.0 yet, and deliberately so. It is three days old. It now requires a domain filter instead of managing every zone of the account, exposes Prometheus metrics, and has a live round-trip test that writes, reads back and deletes one record per type on a real zone. Next comes that live test on my zone, a 0.2.0 release, and two weeks of running in the homelab. Then it gets its 1.0.0.
What 1.0.0 means for kasapi
The 1.0.0 is a promise: no breaking change to the exported API of kasapi and kasapitest without a v2. Three things back it up.
The last breaking changes went in first. The Update methods for FTP users, databases, cronjobs and DDNS users used to send the whole object. Leaving a field at its zero value reset that setting at KAS, and every field added in a later release would have done the same to existing callers. They now take a change struct of pointers and send only what is set:
| |
Two-factor state became a TwoFactorMode instead of a bool. KAS reports inherited for subaccounts, and a bool read that as off. Creating a mailing list takes a struct, for a reason explained below.
A machine checks the promise. make check runs gorelease against the latest tag and fails on an incompatible API change, before a commit can be pushed and again in CI. The promise covers types, signatures and errors.Is/errors.As against the exported errors. Error text and the kascli command line are outside it.
The less-used actions ran against a real account. DNS, mail, domains, TLS, FTP, databases, cronjobs and DDNS have run in production through the provider and the webhook for months. For the rest, a script runs the read-only calls and a second run works on throwaway objects, both on a test account. That run confirmed the response fields for accounts, server information, storage, traffic, directory protection and Samba users. It also found a parameter the official documentation names wrong: add_sambauser takes samba_password, not samba_new_password.
One thing it could not settle. KAS refuses to create a mailing list with an undocumented fault, no_active_listen_owner_found, even with active mailboxes on the list’s domain. Mailing lists are the one service that never ran live. That is why their Create takes a MailingListCreate struct: if KAS turns out to need a parameter, it can arrive in a 1.x release as an optional field instead of a v2. Two-factor login is in the same spot. kasapi sends the PIN the way the documentation describes, but I have no account with 2FA enabled to check it against. If you have one, I’d like to hear whether it works.
If you host at all-inkl and automate anything there, the library is on GitHub and on pkg.go.dev, the provider is in the Terraform and OpenTofu registries, and the webhook chart is on GHCR. Reports from other accounts are especially welcome. Mailing lists and 2FA are the two places where they would help most.
All of this is an unofficial project, not affiliated with all-inkl.com.