Self-hosted Bitcoin wallet for Linux with API?
did you look at bitcoind?
It does everything you are looking for.

-port=           Listen for connections on  (default: 8333 or testnet: 18333)

-walletnotify=    Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)

-alertnotify=     Execute command when a relevant alert is received (%s in cmd is replaced by message)

http://paste.ee/p/IBU79

And all of your transactions you do via rpc  https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

enjoy!