> ## Documentation Index
> Fetch the complete documentation index at: https://nango.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TestRail - How do I link my account?

## 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](https://secure.testrail.com/customers/testrail/trial/?type=signup).
* 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](https://mintcdn.com/nango/L8mNNwuDDmV-XvGM/api-integrations/testrail/enable_api_site_settings.png?fit=max\&auto=format\&n=L8mNNwuDDmV-XvGM\&q=85\&s=c3ae8a666da1ebf0ed77c2aa2ad65dc8)

### 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](https://mintcdn.com/nango/L8mNNwuDDmV-XvGM/api-integrations/testrail/api_keys_tab.png?fit=max\&auto=format\&n=L8mNNwuDDmV-XvGM\&q=85\&s=4e1c73e8298480ea3f2277b4f6e174dc)

3. 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](https://mintcdn.com/nango/L8mNNwuDDmV-XvGM/api-integrations/testrail/add_api_key_dialog.png?fit=max\&auto=format\&n=L8mNNwuDDmV-XvGM\&q=85\&s=a9effab58ec1da81d53e9641e112d391)

4. 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](https://mintcdn.com/nango/L8mNNwuDDmV-XvGM/api-integrations/testrail/api_key_created.png?fit=max\&auto=format\&n=L8mNNwuDDmV-XvGM\&q=85\&s=cfc3efe270734885172d85b5b798d1c9)

> [!TIP]
>
> 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](https://mintcdn.com/nango/L8mNNwuDDmV-XvGM/api-integrations/testrail/form.png?fit=max\&auto=format\&n=L8mNNwuDDmV-XvGM\&q=85\&s=48a33f0113adb9cba0cb040371fb400d)

You are now connected to TestRail.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.