Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

How to use api key?



I would like to use api key instead of password.
I could generate API Key from my user setting and use in authorization request

the problem is everytime i use username/apikey i get Authentication failed while using username/password i could access test rail API


Hi there,

Thank you for your post. With API keys you would simply use your username and the API key instead of your password. You may have already looked at our documentation for this but if not you can find more information here:

I would recommend trying a simple CURL request using API keys if you have not yet to test this.


Should that be in the format username:APIkey in the request? I’m trying that and it doesn’t work; I am only able to get it to work with username:password (where username is my email address).


Hi Alex,

Thanks for your reply! Yes, you can use your username:APIkey when accessing the API, and you would just need to be sure that the API key was saved to your profile after adding this, otherwise it wouldn’t provide access to the API. So after generating and adding the key, be sure to also click “Save Settings” at the bottom of the page so that the API key can be saved to your profile.

Hope this helps!



One very important distinction to make: If you’re using LDAP to authenticate users to your TestRail website, you would use the LDAP username:password in the API, but to use an API key for that same user, you apparently need to use the email address instead.