The Calamari REST API uses the same username/password authentication method as the Calamari user interface.
At a high level, given an HTTP client that supports cookies, the process is:
For an example of how to authenticate with the API, please see the AuthenticatedHttpClient class defined in the Calamari test suite: https://github.com/ceph/calamari/blob/master/tests/http_client.py