﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>> ## 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.

# Applications API

> Create and list applications, and create, list, update, and delete their environments

Create and retrieve applications and their environments in your project. Use these endpoints to set up a project from CI or an AI agent, and to discover application and environment short IDs for use with other API endpoints like [Start Run](https://docs.qa.tech/api-reference/runs/start-test-run.md) and [Chat](https://docs.qa.tech/api-reference/chat.md).

> [!TIP]
>
> You can also find Application and Environment Short IDs in the QA.tech
> dashboard: **Settings → Applications & Envs**. The short IDs (e.g.
> `app_gXeBl2`, `env_aB3xY9`) are displayed in the UI and can be copied using
> the three-dot menu (⋮).

## Endpoints

For full request, response, and error details, see the generated reference pages:

* [List Applications](https://docs.qa.tech/api-reference/applications/list-applications.md) – all applications in your project, including their kind (web or mobile)
* [Create Application](https://docs.qa.tech/api-reference/applications/create-application.md) – creates a web or API application and its default environment (requires a `write` key). If an application with the same name already exists in the project, it is returned unchanged with `created: false`, so repeating the request is safe
* [Update Application](https://docs.qa.tech/api-reference/applications/update-application.md) – `PATCH /v1/applications/{applicationShortId}` renames an application, changes its color, or changes its session state lifetime: how long cookies and storage saved by a login test stay valid for dependent tests (requires a `write` key). Only the fields you pass change
* [List Application Environments](https://docs.qa.tech/api-reference/applications/list-application-environments.md) – the environments configured for a specific application, including custom headers and basic auth domains and usernames (basic auth passwords are never returned), and for mobile environments the default `applicationBuildShortId`
* [Create Environment](https://docs.qa.tech/api-reference/applications/create-environment.md) – `POST /v1/applications/{applicationShortId}/environments` adds an environment, such as staging or production, to a web or API application (requires a `write` key). An environment with the same name on that application is returned unchanged with `created: false`
* [Update Environment](https://docs.qa.tech/api-reference/applications/update-environment.md) – `PATCH /v1/applications/{applicationShortId}/environments/{environmentShortId}` renames an environment, changes its URL or production flag, or makes an uploaded build a mobile environment's default (requires a `write` key). See [Keep the environment on the latest merged build](https://docs.qa.tech/pr-testing/agents/mobile.md#keep-the-environment-on-the-latest-merged-build)
* [Delete Environment](https://docs.qa.tech/api-reference/applications/delete-environment.md) – `DELETE /v1/applications/{applicationShortId}/environments/{environmentShortId}` deletes an environment, like Delete in **Settings → Applications & Envs** (requires a `write` key). The application's default environment cannot be deleted and returns `409`

> [!NOTE]
>
> For mobile applications, the iOS/Android platform is set per build when
> [uploading application builds](https://docs.qa.tech/api-reference/application-builds.md), not on the
> application itself.

## Authentication

All endpoints require Bearer token authentication. Create your API key in the QA.tech dashboard: **Organization Settings → API Keys**. The key is shown only once, at creation. See the [API Introduction](https://docs.qa.tech/api-reference/introduction.md#authentication) for details, including how organization-scoped keys pass `projectShortId`.

## Typical Workflow

A common pattern is to discover IDs dynamically instead of hardcoding them:

1. Call [List Applications](https://docs.qa.tech/api-reference/applications/list-applications.md) to find the application's `shortId`.
2. Call [List Application Environments](https://docs.qa.tech/api-reference/applications/list-application-environments.md) with that ID to find the environment you want to test against (for example, the first non-production environment, using the `isProduction` flag).
3. Pass the discovered IDs as application/environment overrides when [starting a run](https://docs.qa.tech/api-reference/runs/start-test-run.md) or [creating a chat conversation](https://docs.qa.tech/api-reference/chat.md). To persist auth or protection-bypass headers on that environment, include `customHeaders` on the environment override; for HTTP basic auth, include `basicAuth`. See [Environment custom headers](https://docs.qa.tech/core-concepts/applications-and-environments.md#custom-headers).

This is especially useful in CI/CD pipelines, where the target environment may vary per branch or deployment.

To set up a project from a script or an AI agent, call [Create Application](https://docs.qa.tech/api-reference/applications/create-application.md) and [Create Environment](https://docs.qa.tech/api-reference/applications/create-environment.md) instead of looking the IDs up. Both return the existing record when the name is already taken, so the same script can run on every deploy.

## Related documentation

* [Start Run API](https://docs.qa.tech/api-reference/runs/start-test-run.md) – Use application/environment IDs to run tests
* [Environment custom headers](https://docs.qa.tech/core-concepts/applications-and-environments.md#custom-headers) – Persist auth and protection-bypass headers from the Start Run API
* [Environment basic auth](https://docs.qa.tech/core-concepts/applications-and-environments.md#basic-auth) – Persist domain-scoped HTTP basic auth from the Start Run API
* [Chat API](https://docs.qa.tech/api-reference/chat.md) – Use application overrides in chat conversations
* [Applications and Environments](https://docs.qa.tech/core-concepts/applications-and-environments.md) – Learn about the application model
* [API Introduction](https://docs.qa.tech/api-reference/introduction.md) – Authentication and ID reference


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