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

# API Key

> Connect Parable to TestRail using an API key

export const platform_1 = "TestRail"

export const limit_0 = "varies by plan; typically 200 requests/minute"

export const platform_0 = "TestRail"

export const role_0 = undefined

export const tokenName_0 = "API key"

<Tabs>
  <Tab title="Setup">
    <Card title="What You'll Need" icon="key">
      | Credential    | What it is                                                      |
      | ------------- | --------------------------------------------------------------- |
      | **Email**     | Your TestRail email                                             |
      | **API Token** | Generated from user settings                                    |
      | **Base URL**  | TestRail instance URL (e.g., `https://yourcompany.testrail.io`) |
    </Card>

    ## Overview

    Connect Parable to TestRail for test case management and quality metrics.

    <CardGroup cols={2}>
      <Card title="Test Cases" icon="list-check">
        Cases, sections, suites
      </Card>

      <Card title="Results" icon="chart-line">
        Runs, results, statistics
      </Card>
    </CardGroup>

    ## Prerequisites

    <Info>
      **Setup access in {platform_0}.** These steps require **{role_0}**, or a colleague with equivalent permissions who can create credentials for you.

      If that is not you, ask your {platform_0} administrator.
    </Info>

    * TestRail user account with API access enabled
    * Admin access for full data visibility

    ## Setup Guide

    <Steps>
      <Step title="Access User Settings">
        1. Log in to TestRail
        2. Click your name in the top right → **My Settings**
      </Step>

      <Step title="Enable API Key">
        1. Go to the **API Keys** section
        2. Check **Enable API** if not already enabled
        3. Click **Add Key** or **Generate Key**
        4. Name: `Parable Integration`

        <Warning>
          **Copy your {tokenName_0} now!**

          This is the only time it will be displayed. Store it in a secure password manager before closing this page.
        </Warning>
      </Step>

      <Step title="Note Instance URL">
        Your TestRail URL format:

        ```
        https://yourcompany.testrail.io
        ```
      </Step>

      <Step title="Enter values in the form">
        1. Enter your TestRail **URL**, **Email**, and **API Key** in the connector form.
        2. Click **Save & test connection**.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Reference">
    ## Verify Your Setup

    <CodeGroup>
      ```bash Test Authentication theme={null}
      curl -u "your-email:YOUR_API_KEY" \
        "https://yourcompany.testrail.io/index.php?/api/v2/get_user_by_email&email=your-email"
      ```

      ```bash List Projects theme={null}
      curl -u "your-email:YOUR_API_KEY" \
        "https://yourcompany.testrail.io/index.php?/api/v2/get_projects"
      ```
    </CodeGroup>

    <Check>
      **Success!** If you received a `200 OK` response with valid data, your credentials are configured correctly. You can now proceed to configure this connector in Parable.
    </Check>

    <Tip>
      **Rate Limits:** {platform_1} enforces rate limits of **{limit_0}**.

      Parable handles rate limiting automatically with exponential backoff, but initial syncs of large datasets may take longer due to these limits.
    </Tip>

    ## Troubleshooting

    | Error              | Meaning             | Solution                    |
    | ------------------ | ------------------- | --------------------------- |
    | `401 Unauthorized` | Invalid credentials | Verify email and API key    |
    | `403 Forbidden`    | API not enabled     | Enable API in user settings |
    | `404 Not Found`    | Wrong endpoint      | Check URL and API version   |

    ## Additional Resources

    <CardGroup cols={2}>
      <Card title="TestRail API" icon="book" href="https://support.testrail.com/hc/en-us/articles/7077083596436-Introduction-to-the-TestRail-API">
        Official API documentation
      </Card>
    </CardGroup>
  </Tab>
</Tabs>
