Skip to main content

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.

The Chat API enables programmatic interaction with QA.tech’s AI Chat Assistant. Create conversations, send messages, start change reviews, and poll for responses—all via REST API. This is ideal for integrating QA.tech’s AI capabilities into your automation workflows, project management systems, or custom tooling.
  • Base URL: https://api.qa.tech/v1
  • Authentication: Bearer token (project API token)
  • Content-Type: application/json

When to Use This API

  • Automated test creation – Send context from your system to create tests without opening the QA.tech UI
  • PR/Change reviews – Automatically trigger AI-powered change reviews from CI/CD pipelines
  • Custom integrations – Build buttons or workflows in your project management tools that interact with QA.tech Chat
  • AI-assisted QA workflows – Let your automation systems communicate with QA.tech’s AI assistant
For simpler chat interactions, consider using the CLI chat command which handles polling automatically: qatech chat "Create a login test"

Authentication

All Chat API endpoints require Bearer token authentication:
Authorization: Bearer YOUR_API_TOKEN
Find your API token in the QA.tech dashboard: Settings → Integrations → API.

Create Chat Conversation

Create a new chat conversation and send the first message. Processing is asynchronous—poll the Get Conversation endpoint until the assistant’s response is complete. Endpoint: POST /chat

Request Body

FieldTypeRequiredDescription
messagestringYesThe message text to send (min 1 character)
applicationOverridesarrayNoPer-application environment overrides for this conversation (see below)

Application Overrides

Each object in the applicationOverrides array:
FieldTypeRequiredDescription
applicationShortIdstringYesApplication short ID (e.g. app_gXeBl2)
devicePresetShortIdstringNoDevice preset short ID (e.g. preset_abc123)
environmentobjectYesEnvironment override (see below)
Environment override – use one of:
  • By URL: { "url": "https://...", "name": "Optional name" }
  • By short ID: { "shortId": "env_aB3xY9" }
  • By build: { "applicationBuildShortId": "build_abc123" } (for mobile apps)

Response (202 Accepted)

{
  "shortId": "chat_abc123",
  "url": "https://app.qa.tech/p/your-project/chat/chat_abc123",
  "title": null,
  "createdAt": "2026-05-04T10:30:00.000Z",
  "updatedAt": "2026-05-04T10:30:00.000Z",
  "source": "api",
  "messages": []
}
The response returns immediately with 202. The messages array is empty on creation. Poll Get Conversation to retrieve the assistant’s reply.

Example

curl -X POST https://api.qa.tech/v1/chat \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Generate a login flow test for our staging environment"
  }'

Example with Environment Override

curl -X POST https://api.qa.tech/v1/chat \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Create a test for the checkout flow",
    "applicationOverrides": [
      {
        "applicationShortId": "app_gXeBl2",
        "environment": {
          "url": "https://pr-123.preview.example.com",
          "name": "PR-123 Preview"
        }
      }
    ]
  }'

Start Change Review

Create a conversation that initiates an AI-powered change review. Supports two modes: reviewing a pull request URL or raw code changes. Endpoint: POST /chat/change-review

Request Body (PR Mode)

FieldTypeRequiredDescription
modestringYesMust be "pr"
prUrlstringYesPull request URL to review
vcsProviderIdstringYesVCS provider: "github" or "gitlab"
applicationOverridesarrayYesApplication environment overrides (see above)
contextstringNoAdditional context to help the AI understand the changes

Request Body (Raw Changes Mode)

FieldTypeRequiredDescription
modestringYesMust be "rawChanges"
changes.changeDescriptionstringYesDescription of the changes (min 1 character)
changes.diffstringYesGit diff content (min 1 character)
applicationOverridesarrayYesApplication environment overrides (see above)
contextstringNoAdditional context to help the AI understand the changes

Response (202 Accepted)

Same format as Create Chat Conversation.

Example: Review a Pull Request

curl -X POST https://api.qa.tech/v1/chat/change-review \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "pr",
    "prUrl": "https://github.com/your-org/your-repo/pull/123",
    "vcsProviderId": "github",
    "applicationOverrides": [
      {
        "applicationShortId": "app_gXeBl2",
        "environment": { "shortId": "env_aB3xY9" }
      }
    ],
    "context": "This PR updates the payment processing flow"
  }'

Example: Review Raw Changes

curl -X POST https://api.qa.tech/v1/chat/change-review \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "rawChanges",
    "changes": {
      "changeDescription": "Updated login validation to require email format",
      "diff": "diff --git a/src/auth.js b/src/auth.js\n..."
    },
    "applicationOverrides": [
      {
        "applicationShortId": "app_gXeBl2",
        "environment": { "shortId": "env_aB3xY9" }
      }
    ]
  }'

Send Message to Conversation

Send a follow-up message to an existing conversation. Returns 202 immediately—poll Get Conversation for the assistant’s reply. Endpoint: POST /chat/{chatConversationShortId}

Path Parameters

ParameterTypeRequiredDescription
chatConversationShortIdstringYesConversation short ID (e.g. chat_abc123)

Request Body

Same as Create Chat Conversation.

Response (202 Accepted)

Same format as Create Chat Conversation, with existing messages included.

Example

curl -X POST https://api.qa.tech/v1/chat/chat_abc123 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Can you also add a test for the forgot password flow?"
  }'

Get Conversation

Retrieve conversation metadata and messages. Use this to poll for the assistant’s response after sending a message. Endpoint: GET /chat/{chatConversationShortId}

Path Parameters

ParameterTypeRequiredDescription
chatConversationShortIdstringYesConversation short ID (e.g. chat_abc123)

Query Parameters

ParameterTypeDefaultDescription
limitinteger20Number of messages to return

Response (200 OK)

{
  "shortId": "chat_abc123",
  "url": "https://app.qa.tech/p/your-project/chat/chat_abc123",
  "title": "Login Flow Test",
  "createdAt": "2026-05-04T10:30:00.000Z",
  "updatedAt": "2026-05-04T10:35:00.000Z",
  "source": "api",
  "messages": [
    {
      "id": "msg_123",
      "role": "user",
      "createdAt": "2026-05-04T10:30:00.000Z",
      "text": "Generate a login flow test for our staging environment",
      "status": "COMPLETED",
      "isStreaming": false
    },
    {
      "id": "msg_456",
      "role": "assistant",
      "createdAt": "2026-05-04T10:30:05.000Z",
      "text": "I'll create a login flow test for your staging environment...",
      "status": "COMPLETED",
      "isStreaming": false
    }
  ]
}

Response Fields

FieldTypeDescription
shortIdstringConversation short ID (e.g. chat_abc123)
urlstringDashboard URL for the conversation
titlestringConversation title (may be null initially)
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp
sourcestringWhere the conversation originated: api, ui, github, gitlab, system
messagesarrayRecent messages, newest first

Message Fields

FieldTypeDescription
idstringMessage identifier
rolestring"user" or "assistant"
createdAtstringISO 8601 timestamp
textstringThe message content
statusstringINITIATED, PARTIAL, COMPLETED, CANCELLED, or FAILED
isStreamingbooleantrue while the assistant is still generating the response

Polling for Completion

To wait for the assistant’s response, poll until the most recent assistant message has status: "COMPLETED". We recommend polling every 2-5 seconds.
Assistant responses typically complete within 10-60 seconds depending on the complexity of the request. Test creation and execution may take several minutes.
while true; do
  RESPONSE=$(curl -s "https://api.qa.tech/v1/chat/chat_abc123" \
    -H "Authorization: Bearer YOUR_API_TOKEN")
  
  STATUS=$(echo "$RESPONSE" | jq -r '.messages[0].status')
  ROLE=$(echo "$RESPONSE" | jq -r '.messages[0].role')
  
  if [[ "$ROLE" == "assistant" && "$STATUS" == "COMPLETED" ]]; then
    echo "Response complete:"
    echo "$RESPONSE" | jq '.messages[0].text'
    break
  elif [[ "$STATUS" == "FAILED" || "$STATUS" == "CANCELLED" ]]; then
    echo "Response failed or cancelled"
    break
  fi
  
  sleep 3  # Poll every 3 seconds
done

Example

curl "https://api.qa.tech/v1/chat/chat_abc123?limit=50" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Error Responses

StatusDescription
400Validation error or malformed request body
401Missing or invalid API key
403Invalid token or organization suspended
404Conversation or project not found
500Server error
Error responses include a body: { "message": "Error description" }.