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

# API Introduction

> Learn how to interact with QA.tech programmatically using our REST API

The QA.tech REST API allows you to programmatically control test runs, create test cases, check results, and integrate QA.tech into your CI/CD pipelines and automation workflows.

## What Can You Do?

* **Start test runs** programmatically from CI/CD pipelines or scripts
* **Create and list test cases** via API for importing tests or generating them dynamically
* **Check run status** and retrieve test results
* **Rerun tests** (all or a subset) from a previous run
* **Chat with AI assistant** to create tests and review changes via API
* **List applications and environments** for dynamic test configuration
* **Create remote tunnels** to test local environments
* **Upload mobile app builds** for iOS and Android testing
* **Get outbound IPs** for firewall allowlisting

## Quick Start

Here's a complete example to start a test run:

```bash theme={null}
curl -X POST https://api.qa.tech/v1/run \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"testPlanShortId": "pln_abc123"}'
```

**What you need:**

1. **API Token** - Found in Settings → Integrations → API (project-specific)
2. **Test Plan Short ID** - Prefixed ID from your test plan (e.g. `pln_abc123`)
3. **Other short IDs** as needed - Application, Environment, Config, Device Preset, Scenario (see table below)

## Authentication

All API endpoints (except [Get Outbound IPs](/api-reference/outbound-ips)) require Bearer token authentication. Include your API token in the `Authorization` header:

```bash theme={null}
Authorization: Bearer YOUR_API_TOKEN
```

**Where to find your API token:**

1. Navigate to **Settings → Integrations → API** in your project dashboard
2. Your API token is displayed on the API integration page
3. Copy the token and use it in the `Authorization` header

<Note>
  Your API token is project-specific. The project is inferred from the token, so
  you do not pass a project ID in the URL or body.
</Note>

## Understanding Different IDs

QA.tech uses **prefixed short IDs** for most API resources. The prefix indicates the resource type. Some fields (e.g., dependency test case IDs in Create Test Case and Rerun endpoints) still use UUIDs and are documented on their respective pages:

| ID Type                    | Format                     | Where to Find                          | Used In API                                 | Example           |
| -------------------------- | -------------------------- | -------------------------------------- | ------------------------------------------- | ----------------- |
| **Test Plan Short ID**     | `pln_` + alphanumeric      | Test plan URLs, Settings               | `testPlanShortId` in request body           | `pln_abc123`      |
| **Application Short ID**   | `app_` + alphanumeric      | Settings → Applications                | `applicationShortId` in applications array  | `app_gXeBl2`      |
| **Environment Short ID**   | `env_` + alphanumeric      | Settings → Applications → Environments | `environment.shortId` in applications array | `env_aB3xY9`      |
| **Config Short ID**        | `cfg_` + alphanumeric      | Settings → Configs                     | `configShortIds` array                      | `cfg_xyz789`      |
| **Device Preset Short ID** | `preset_` + alphanumeric   | Settings → Device Presets              | `devicePresetShortId` in applications array | `preset_abc123`   |
| **Scenario Short ID**      | `scenario_` + alphanumeric | Scenarios                              | `scenarioShortId` in test-cases body        | `scenario_abc123` |
| **Chat Conversation ID**   | `chat_` + alphanumeric     | Chat API response                      | `chatConversationShortId` in chat endpoints | `chat_abc123`     |
| **Application Build ID**   | `build_` + alphanumeric    | Build API response                     | `applicationBuildShortId` in environment    | `build_abc123`    |

### Finding Application and Environment Short IDs

Application and Environment Short IDs are shown in the UI with their `app_` and `env_` prefixes.

<Steps>
  <Step title="Go to Applications">
    Navigate to **Settings → Applications** in your project
  </Step>

  <Step title="Find Short ID">
    The Application Short ID (e.g. `app_gXeBl2`) appears in the applications
    table. Use the three-dot menu (⋮) to **Copy Short ID**
  </Step>

  <Step title="Find Environment Short ID">
    Under **Settings → Applications → \[Select Application]**, the Environment
    Short ID (e.g. `env_aB3xY9`) appears in the **Environments** section. Use
    the copy action to copy it
  </Step>
</Steps>

## Next Steps

* **[Start a Run](/api-reference/start-run)** - Trigger test runs programmatically
* **[Get Run Status](/api-reference/run-status)** - Wait for test completion in CI/CD pipelines
* **[Rerun Tests](/api-reference/rerun)** - Rerun all or failed tests from a previous run
* **[Create Test Cases](/api-reference/test-cases)** - Create tests via API
* **[List Test Cases](/api-reference/list-test-cases)** - Retrieve test cases from your project
* **[Chat API](/api-reference/chat)** - Interact with the AI assistant programmatically
* **[Applications API](/api-reference/applications)** - List applications and environments
* **[Remote Tunnels API](/api-reference/remote-tunnels)** - Create tunnels to test local environments
* **[Application Builds API](/api-reference/application-builds)** - Upload mobile app builds
* **[Get Outbound IPs](/api-reference/outbound-ips)** - Retrieve IPs for firewall allowlisting
* **[View OpenAPI Spec](/api-reference/api.json)** - Complete API reference with all endpoints

## Base URL

All API requests are made to:

```
https://api.qa.tech/v1
```

## Migration from Legacy API

If you used the legacy API format:

* **Old:** `https://app.qa.tech/api/projects/{projectUuid}/runs`
* **New:** `https://api.qa.tech/v1/run` (project is inferred from your API key)

The old format may still work temporarily but is **deprecated**. Key changes in the current API:

* No `projectUuid` in the path; the project is determined by your API token
* All IDs use **prefixed short IDs** (e.g. `pln_abc123`, `app_gXeBl2`) instead of UUIDs where applicable
* Base URL is `https://api.qa.tech/v1`

Migrate to the new base URL and request format when possible.
