signal-cli provides a commandline, dbus and JSON-RPC interface
...For this use-case, it has a daemon mode with D-BUS interface (man page) and JSON-RPC interface (documentation). For the JSON-RPC interface, there's also a simple example client, written in Rust.