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

# API Reference

> Programmatically create, run, and manage your Docket tests and modules

The Docket API lets you integrate Docket into your workflows by creating tests, triggering runs, and managing reusable modules programmatically.

**Base URL:**

```
https://api.docketqa.com
```

## Authentication

All API requests require an `X-API-KEY` header. You can find your API key in your [Docket account CI/CD tab](https://app.docketqa.com/).

```bash theme={null}
curl -X GET https://api.docketqa.com/test_blueprint/list \
  -H "X-API-KEY: your-api-key"
```

<Warning>
  Keep your API key secret. Do not expose it in client-side code or public repositories.
</Warning>

## Key concepts

### Blueprint types

Docket organizes tests using **blueprint types**:

| Type                 | Value           | Description                                                                                                                        |
| -------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **Integration**      | `"integration"` | A standard end-to-end test with a sequence of steps.                                                                               |
| **Account (Module)** | `"module"`      | A login/account module with stored credentials and a starting URL.                                                                 |
| **Module**           | `"step_module"` | A reusable set of steps that can be embedded in other tests. Created via the [Modules API](/api-reference/endpoint/create-module). |

### Step types

Steps define the actions your test performs. Each step has a `type` that determines its behavior:

| Type                | Description                                            |
| ------------------- | ------------------------------------------------------ |
| `"act"`             | AI-driven browser action (click, type, navigate, etc.) |
| `"assert"`          | AI-driven assertion that verifies page state           |
| `"step_module"`     | Execute a reusable module inline                       |
| `"api"`             | Make an HTTP request (GET, POST, PUT, DELETE)          |
| `"trigger_run"`     | Trigger another test blueprint as a sub-run            |
| `"key"`             | Press a keyboard key (recorded step)                   |
| `"type"`            | Type text into the focused element (recorded step)     |
| `"mouse_move"`      | Move mouse to coordinates (recorded step)              |
| `"left_click"`      | Left click at coordinates (recorded step)              |
| `"right_click"`     | Right click at coordinates (recorded step)             |
| `"double_click"`    | Double click at coordinates (recorded step)            |
| `"triple_click"`    | Triple click at coordinates (recorded step)            |
| `"left_click_drag"` | Click and drag (recorded step)                         |
| `"scroll"`          | Scroll the page (recorded step)                        |
| `"wait"`            | Wait for a duration (recorded step)                    |
| `"deeplink"`        | Open a deep link URL (mobile only)                     |

### Device types

Tests can target different device types:

| Device              | Value       | Description                                 |
| ------------------- | ----------- | ------------------------------------------- |
| **Desktop browser** | `"browser"` | Default. Runs in a remote Chromium browser. |
| **Android**         | `"android"` | Runs on an Android device/emulator.         |
| **iOS**             | `"ios"`     | Runs on an iOS device/simulator.            |

Modules are device-agnostic — a single module can be referenced from a browser test at one viewport and from a mobile test on a phone. The runtime selects the right internal cache per execution config, so each combination of device / viewport / zoom stays sharp on its own.

## Endpoints

<CardGroup cols={2}>
  <Card title="Create Test" icon="plus" href="/api-reference/endpoint/create-test">
    Create a new test blueprint with steps
  </Card>

  <Card title="Run Test" icon="play" href="/api-reference/endpoint/run-test">
    Trigger a test run for one or more tests
  </Card>

  <Card title="Get Test Run" icon="magnifying-glass" href="/api-reference/endpoint/get-test-run">
    Retrieve results for a specific test run
  </Card>

  <Card title="List Tests" icon="list" href="/api-reference/endpoint/list-tests">
    List all test blueprints in your account
  </Card>

  <Card title="Create Module" icon="cube-plus" href="/api-reference/endpoint/create-module">
    Create a reusable module
  </Card>

  <Card title="Get Module" icon="cube" href="/api-reference/endpoint/get-module">
    Retrieve a specific module by ID
  </Card>

  <Card title="List Modules" icon="cubes" href="/api-reference/endpoint/list-modules">
    List modules with optional filtering
  </Card>

  <Card title="Update Module" icon="pen-to-square" href="/api-reference/endpoint/update-module">
    Update an existing module
  </Card>
</CardGroup>
