TIL that ActivityPub has a client-to-server part to it, but that Mastodon doesn't implement it. Mastodon has its own API which clients use.
Some discussion on it here: https://github.com/tootsuite/mastodon/issues/1557
Micropub is a client-to-server protocol used mostly in #indieweb.