Skip to main content

Overview

To authenticate with TestRail, you need:
  1. TestRail Hostname — the host of your TestRail instance.
  2. Email — the email address you log in to TestRail with.
  3. API Key — an API key generated in your TestRail settings.
This guide will show you how to enable the API, generate an API key and find your hostname.

Prerequisites

  • A TestRail account. You can start a free trial.
  • A role that allows generating API keys.

Step 1: Enable the API

The TestRail API is enabled by an administrator. If you are not an administrator, ask one to do this step.
  1. Log in to TestRail and select Admin in the top right.
  2. Open Site Settings, then the API tab.
  3. Tick Enable API, then select Save settings.
TestRail Site Settings, API tab, with the Enable API checkbox ticked and the Save settings button

Step 2: Generate an API key

  1. Open the user menu in the top right and select My Settings.
  2. Open the API Keys tab and select Add API Key.
TestRail My Settings, API Keys tab, with the Add API Key button
  1. Enter a name that describes where the key is used (for example, nango), then select Generate API Key.
TestRail Add API Key dialog with a key name entered and the Generate API Key button
  1. Copy the generated key, then select Add API Key to save it. Enter the key in the API Key field.
TestRail Add API Key dialog showing the generated key with a copy button and the Add API Key button
TestRail only shows the key once. Store it securely before you close the dialog.

Step 3: Find your hostname and email

  1. Copy the host from your browser’s address bar when you are logged in to TestRail, without https:// or any path. For example, if you open TestRail at https://example.testrail.io, enter example.testrail.io in the TestRail Hostname field. If you host TestRail on your own server, enter the host of your installation.
  2. Enter the email address you log in to TestRail with in the Email field.

Step 4: Enter your credentials in the Connect UI

  1. Open the form where you need to authenticate with TestRail.
  2. Enter your TestRail Hostname, Email and API Key in the designated fields.
  3. Submit the form, and you should be successfully authenticated.
TestRail connection form in the Nango Connect UI You are now connected to TestRail.