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

# Visual Tests

> Manage and run cross-device visual regression tests.

Manage and run visual tests across desktop, laptop, iPad, and mobile viewports. Dispatch the desired operation with the `action` field in the request body.

## Actions

| Action     | Description                                  |
| ---------- | -------------------------------------------- |
| `list`     | List visual routes with their latest result. |
| `add`      | Register a new URL for visual monitoring.    |
| `delete`   | Remove a visual route.                       |
| `results`  | Retrieve stored visual results.              |
| `run`      | Trigger a visual test immediately.           |
| `schedule` | Schedule a visual run.                       |

## Headers

<ParamField header="x-transaction-id" type="string">
  Optional caller-provided transaction identifier for tracing.
</ParamField>

## Request body

<ParamField body="action" type="string" required>
  One of `list`, `add`, `delete`, `results`, `run`, or `schedule`.
</ParamField>

<ParamField body="data" type="object">
  Payload for the selected action.

  <Expandable title="data fields">
    <ParamField body="url" type="string">
      Fully qualified URL to capture. Required for `add`.
    </ParamField>

    <ParamField body="name" type="string">
      Human-readable name (1–80 characters). Required for `add`.
    </ParamField>

    <ParamField body="routeId" type="string">
      Identifier of the visual route. Required for `delete`, `run`, and `schedule`.
    </ParamField>

    <ParamField body="when" type="string">
      Schedule mode: `at`, `every`, or `now`. Required for `schedule`.
    </ParamField>

    <ParamField body="time" type="string">
      Time expression paired with `when`. Required for `schedule`.
    </ParamField>

    <ParamField body="engine" type="string">
      Rendering engine for `run` and `schedule`: `self` or `api`.
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="routes" type="array">
  Returned by `list`. Each entry includes `id`, `url`, `name`, `createdAt`, `running`, and `latest` (a VisualLatestResult with `status`, `takenAt`, `workflowId`, and per-device `imageUrl`/`analysis`).
</ResponseField>

<ResponseField name="route" type="object">
  Returned by `add`.
</ResponseField>

<ResponseField name="transaction_id" type="string">
  Returned by `run` and `schedule` — the async job identifier.
</ResponseField>

<Info>
  Every successful response includes the `X-Credits-Remaining` header.
</Info>
