My current DNS provider (Contabo) doesn’t expose a standard API for manipulating DNS records, but it has its own API.
I do have a couple of bash scripts that take care of this (which I already use as manual DNS auth hooks for certbot).
I think it would be beneficial to have a custom DNS provider where a .sh file is given, and this script file is called by the stalwart binary whenever a DNS update is needed. The information about the DNS record (delete/create/update, type, key, value, TTL, etc.) can be passed as arguments, and the exit code of the script notifies whether the request was successful, the type of record is unsupported (e.g., TLSA records are not supported by every DNS), or it failed for some other reason.
I’ve updated yesterday to v0.16.6 and I didn’t see this feature yet, so apologies if I missed it.