---
title: "Sample random tests with prioritization"
method: GET
path: "/test/journeys/sample"
tags: ["Test"]
---

# Sample random tests with prioritization

`GET /test/journeys/sample`

Returns a random sample of test variant IDs, prioritizing tests with recent passing runs,
then tests with any recent runs, then all other tests in the workspace. For tests with
runs, returns the latest variant that has passing runs, or else latest with any runs.
Tests are associated with applications via their test run history.

## Query parameters

- `organization_id` string, required
- `application_id` string
- `sample_size` integer

## Response `200`

Array of sampled test variant IDs

- TestSampleResult — Result envelope for test sampling endpoint
  - `test_ids` string[] — Array of sampled test IDs, prioritized by recent test run results

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
