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

Difficulty to access TestRail via its API (error 401)


hello Tobias
I’ve complexity on reaching out TestRail via its API.

I’ve read and followed properly the official doc (as you can figure out, I use Python) & even an interesting previous thread (here) but it remains unclear how I can solve the error 401 that I have once intenting a GET.

I have then 2 questions regarding the info to provide in my scripts:
. is the URL in:
admin dashboard / site settings / application / Web Address (already picked)

. is the user name in:
my settings / user / full name (already picked)
admin dashboard / site settings / application / installation name

thks in advance!


Hi Guillaume,

You would need to use the username & password you use to log in to TestRail (usually your email address and a password):

You can also use your username and API keys you added on the My Settings page.

I hope this helps!



¨hey Tobias

thanks for your link posted.
That works! I can logged to any test case.

Then, what I understood is that:
client.password = 'mysuperpassword123’
client.user = ‘yourEmailAddressThatYouUseForLogging’

My mistake was that I figured out that my variable had to include ‘’ instead ‘client.user’.

ps: I sould recommend such a little note in your Python doc, 'hoping that could help somebody else.
Thks again!


Hi Guillaume,

Great to hear that it works now :slight_smile: The properties to use are already documented in the example but we will make sure to highlight this again: