API Authentication
Testmo uses simple Bearer tokens to authenticate against the API. When calling the API, you just need to submit the token as part of an Authorization HTTP header like this:
1
Authorization: Bearer $TOKEN
Copied!
You can generate and use multiple API tokens for each user account and delete API tokens when not in use anymore. It is recommended to generate a separate API token for each application, service or host you use so you can easily revoke individual API keys without affecting other services.
Here is a full example on how to authenticate against and call the Testmo API to retrieve basic information about the authenticated user:
1
$ TESTMO_TOKEN=********
2
$ curl -H "Authorization: Bearer $TESTMO_TOKEN" \
3
https://<testmo-name>.testmo.net/api/v1/user
Copied!

Generating API keys

To generate API keys in Testmo, simply visit your User Profile page (from the avatar image in the top right corner). Then click the change link next to the API access section to add one or more API keys. The API key is only displayed once when you generate the key, so make sure to store the key.
You can create multiple API keys and assign a name to each API key so you can remember where it's used and revoke keys once they are no longer in use.
Using API users and host/service accounts
You can use Testmo's API with any edition and subscription by creating API keys for individual users (see above). If you are using a Business or Enterprise subscription, you have the additional option to create separate API users under Admin > Users & roles.
API users are not counted towards the subscription user limit and are a great option to create separate users for certain hosts, services or integrations and assign custom roles and permissions. Once you create API users in the admin area, you can also manage the API keys for the users there.
Last modified 1mo ago
Copy link