What a rule would have queued
const url = 'https://example.com/v1/projects/example/queue-rules/preview';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/v1/projects/example/queue-rules/preview \ --header 'Authorization: Bearer <token>'Among the project’s last last top-level runs (not replays), how many a rule with these fields (and its sample) would have queued. The rule editor’s “would have added N of the last 100”. Lists are comma-separated. Needs read on the project.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ProjectId — opaque branded string.
Query Parameters
Section titled “Query Parameters”Comma-separated.
Comma-separated.
Comma-separated; pinned for the pinned version.
Comma-separated: completed, failed, cancelled.
true to count dry runs.
0 < sample ≤ 1. Default 1.
How many recent runs to look at, 1 to 500. Default 100.
An existing rule’s id, to sample as that rule does: matched is then exactly the runs it would take. Without it, matched is an estimate.
Responses
Section titled “Responses”The preview.
object
The recent runs looked at.
Those the rule would have queued, with its sample (maxOpen isn’t applied).
Examplegenerated
{ "considered": 1, "matched": 1}A malformed field (bad-input).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No project with that id (project-not-found).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The database was too busy to answer in time (database-busy); Retry-After (whole seconds) says when to try again.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}See also
GET /v1/projects/{projectId}: Fetch a project by idPATCH /v1/projects/{projectId}: Partially update a projectDELETE /v1/projects/{projectId}: Delete a project (idempotent)GET /v1/projects/{projectId}/queue-rules: List a project's queue rules- Error code
bad-input - Error code
database-busy - Error code
project-not-found - Every error code