Grafana Cloud

Tests REST API

Note

The documentation for this API is also available as an OpenAPI description.

List all tests

GET /cloud/v6/load_tests

List all available tests.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger
$countInclude collection length in the response object as @count.queryfalseboolean
$orderby

Comma-separated list of fields to use when ordering the results. Available fields:

  • id
  • project_id
  • name
  • created
  • updated

The default ascending order can be reversed by appending the desc specifier.

queryfalsestring
$skipThe initial index from which to return the results.queryfalseinteger
$topNumber of results to return per page.
Default: 1000
Maximum: 1000
queryfalseinteger
nameFilter results by load test name (exact match).queryfalsestring

200 response

OK.

Content types: application/json

LoadTestListResponse properties:

NameDescriptionRequiredType
@countObject count in the collection.falseinteger
@nextLinkA reference to the next page of results. The property is included until there are no more pages of results to retrieve.falsestring , format: uri
valueList of the resulting values.trueArray[LoadTestApiModel]

LoadTestApiModel properties:

NameDescriptionRequiredType
baseline_test_run_idID of a baseline test run used for results comparison. Deprecated: baselines are being replaced by the star/unstar test run APIs and this field is scheduled for removal on 2026-09-01.trueinteger | null , format: int64
createdThe date when the test was created.truestring , format: date-time
idID of the load test.trueinteger , format: int64
k6_versionIdentifier of the k6 version used to run the test.falseinteger | null
nameUnique name of the test within the project.truestring
project_idID of the parent project.trueinteger , format: int64
updatedThe date when the test was last updated.truestring , format: date-time
OK example
{
  "@count": 123,
  "@nextLink": "https://api.k6.io/cloud/v6/load_tests?$skip=50\u0026$top=20",
  "value": [
    {
      "baseline_test_run_id": null,
      "created": "2024-12-03T09:53:00.553",
      "id": 1234,
      "k6_version": null,
      "name": "Orders API Soak Test",
      "project_id": 312,
      "updated": "2024-12-03T09:53:00.553"
    }
  ]
}

400 response

Request validation error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

Get a load test by ID

GET /cloud/v6/load_tests/{id}

Fetch a single load test.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger
idID of the load test.pathtrueinteger , format: int64

200 response

OK.

Content types: application/json

LoadTestApiModel properties:

NameDescriptionRequiredType
baseline_test_run_idID of a baseline test run used for results comparison. Deprecated: baselines are being replaced by the star/unstar test run APIs and this field is scheduled for removal on 2026-09-01.trueinteger | null , format: int64
createdThe date when the test was created.truestring , format: date-time
idID of the load test.trueinteger , format: int64
k6_versionIdentifier of the k6 version used to run the test.falseinteger | null
nameUnique name of the test within the project.truestring
project_idID of the parent project.trueinteger , format: int64
updatedThe date when the test was last updated.truestring , format: date-time
OK example
{
  "baseline_test_run_id": null,
  "created": "2024-12-03T09:53:00.553",
  "id": 1234,
  "k6_version": null,
  "name": "Orders API Soak Test",
  "project_id": 312,
  "updated": "2024-12-03T09:53:00.553"
}

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

404 response

Resource not found.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

Delete a load test

DELETE /cloud/v6/load_tests/{id}

Delete a load test.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger
idID of the load test.pathtrueinteger , format: int64

204 response

OK.

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

404 response

Resource not found.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

409 response

Cannot delete test while it’s running.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

Update a load test

PATCH /cloud/v6/load_tests/{id}

Update a load test.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger
idID of the load test.pathtrueinteger , format: int64

Request body

Content types: application/json

PatchLoadTestApiModel properties:

NameDescriptionRequiredType
baseline_test_run_idID of a baseline test run used for results comparison. Deprecated: baselines are being replaced by the star/unstar test run APIs and this field is scheduled for removal on 2026-09-01.falseinteger | null , format: int64
k6_versionIdentifier of the k6 version used to run the test.falseinteger | null
nameUnique name of the test within the project.falsestring
Update example
{
  "baseline_test_run_id": 123,
  "name": "New Test Name"
}

204 response

OK.

400 response

Request validation error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

404 response

Resource not found.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

409 response

The name is already taken.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

Move a test to another project

PUT /cloud/v6/load_tests/{id}/move

Move a load test to a different project of the same organization. All respective test runs will be also moved to the new project.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger
idID of the load test.pathtrueinteger , format: int64

Request body

Content types: application/json

MoveLoadTestApiModel properties:

NameDescriptionRequiredType
project_idID of the destination project.trueinteger , format: int64
Move example
{
  "project_id": 123
}

204 response

OK.

400 response

Request validation error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

404 response

Resource not found.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

409 response

Test with the same name exists in the destination.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

Download the test script

GET /cloud/v6/load_tests/{id}/script

Download the test script.

The script can be either in the form of a single JavaScript file or a k6 .tar archive - the type is identified by the request content type.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger
idID of the load test.pathtrueinteger , format: int64

200 response

OK.

Content types: application/x-tar text/javascript
K6ArchiveScript example
(.tar data)
TextScript example
import http from 'k6/http';
import { sleep } from 'k6';

export const options = {
  vus: 10,
  duration: '30s',
  cloud: {
    // Project: Default project
    projectID: 3684621,
    // Test runs with the same name groups test runs together.
    name: 'Test (04/12/2024-20:28:06)'
  }
};

export default function() {
  http.get('https://test.k6.io');
  sleep(1);
}

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

404 response

Resource not found.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

406 response

The current script type can’t satisfy the request Accept header format.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

Upload the script for a test

PUT /cloud/v6/load_tests/{id}/script

Upload the script for a test.

The script can be either in the form of a single JavaScript text file or a k6 .tar archive - the type is auto-detected by the API. Any received payload that is not a .tar archive is assumed to be a JavaScript file.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger
idID of the load test.pathtrueinteger , format: int64

Request body

Content types: application/octet-stream
K6ArchiveScript example
(.tar data)
TextScript example
import http from 'k6/http';
import { sleep } from 'k6';

export const options = {
  vus: 10,
  duration: '30s',
  cloud: {
    // Project: Default project
    projectID: 3684621,
    // Test runs with the same name groups test runs together.
    name: 'Test (04/12/2024-20:28:06)'
  }
};

export default function() {
  http.get('https://test.k6.io');
  sleep(1);
}

204 response

OK.

400 response

Request validation error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

404 response

Resource not found.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

Start a test in Grafana Cloud

POST /cloud/v6/load_tests/{id}/start

Start a test in Grafana Cloud.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger
K6-Idempotency-KeyIdempotency key to prevent duplicate test starts when retrying requests. The key is valid for 10 minutes.headerfalsestring
idID of the load test.pathtrueinteger , format: int64

200 response

OK.

Content types: application/json

StartLoadTestResponse properties:

NameDescriptionRequiredType
cost

Test run cost details. The cost is available only after test run validation.

  • For test runs still in progress, the value is an estimate of the full cost that will be charged upon successful completion.
  • For finished test runs, the value is the real cost charged for the test run.
trueTestCostApiModel | null
createdDate and time when the test run was started.truestring , format: date-time
distributionList of the load zones configured for the test and the corresponding distribution percentages.truearray | null
endedDate and time when the test run ended. Unset if the test is still running.truestring | null , format: date-time
estimated_durationThe estimated duration of the test run in seconds.trueinteger | null
execution_durationThe real billable duration of the test run in seconds.trueinteger
idID of the test run.trueinteger , format: int64
is_starredWhether the test run is starred for quick access.trueboolean
k6_dependenciesThe requested version of k6 and extensions that was part of the script/archive.trueobject
k6_versionsThe computed version for k6 and extensions used to run the test.trueobject
max_browser_vusThe maximum number of browser VUs at any stage of the execution plan.trueinteger | null
max_vusThe maximum number of total VUs (browser and protocol) at any stage of the execution plan.trueinteger | null
noteUser-defined note for the test run.truestring
optionsThe original options object if available.trueobject | null
project_idID of the parent project.trueinteger , format: int64
resultTest run result. passed if there were no issues, failed if thresholds were breached, error if the execution was not completed.truestring | null
result_detailsAdditional information about the test run result.trueResultDetailsApiModel | null
retention_expiryTimestamp after which the test run results are deleted or null if the test run is saved.truestring | null , format: date-time
started_byEmail of the user who started the test if started with a user token.truestring | null , format: email
statusCurrent test run status.truestring
status_detailsDetails of the current test run status.trueStatusApiModel
status_historyList of test run status objects sorted by the status start time. The list represents the test run status history.trueArray[StatusApiModel]
test_idID of the parent test.trueinteger , format: int64
test_run_details_page_urlURL to the Grafana web app test run page.truestring

ResultDetailsApiModel properties:

NameDescriptionRequiredType
codeService-defined error code if applicable.falseinteger | null
messageHuman-readable description of why the test failed or the description of the error if applicable.falsestring | null
typeType of the result: passed, failed or error.truestring

Details of the test run status.

StatusApiModel properties:

NameDescriptionRequiredType
enteredDate and time when the test run entered the status.truestring , format: date-time
extraExtra information about the indicated status.falseStatusExtraApiModel | null
typeType of simple test run status: created, queued, initializing, running, processing_metrics, completed or aborted.truestring

StatusExtraApiModel properties:

NameDescriptionRequiredType
by_userEmail of the user that set the status if applicable.truestring | null , format: email
codeService-defined error code if applicable.trueinteger | null
messageHuman-readable string describing the error if applicable.truestring | null

TestCostApiModel properties:

NameDescriptionRequiredType
breakdowntrueCostBreakdownApiModel
total_vuhTotal number of billed VUH charged for the test run.true

Breakdown details of the test cost.

CostBreakdownApiModel properties:

NameDescriptionRequiredType
base_total_vuhVUH usage before applying the effective reduction.true
browser_vuhNumber of billed VUH charged for the browser part of the test run.true
protocol_vuhNumber of billed VUH charged for the protocol part of the test run.true
reduction_rateThe effective reduction rate after applying all individual reductions to the base VUH usage.true
reduction_rate_breakdownThe individual reduction rates applied to the base VUH usage.trueobject | null
Started example
{
  "cost": null,
  "created": "2024-06-01T19:00:00Z",
  "distribution": null,
  "ended": null,
  "estimated_duration": null,
  "execution_duration": 0,
  "id": 1234,
  "is_starred": false,
  "k6_dependencies": {
    "k6": "\u003e=v0.52",
    "k6/x/faker": "\u003e=0.4.0"
  },
  "k6_versions": {
    "k6": "v0.56.0",
    "k6/x/faker": "v0.4.1"
  },
  "max_browser_vus": null,
  "max_vus": null,
  "note": "",
  "options": null,
  "project_id": 12,
  "result": null,
  "result_details": null,
  "retention_expiry": "2024-06-07T19:00:00Z",
  "started_by": "user@example.com",
  "status": "created",
  "status_details": {
    "entered": "2024-06-01T19:00:00Z",
    "type": "created"
  },
  "status_history": [
    {
      "entered": "2024-06-01T19:00:00Z",
      "type": "created"
    }
  ],
  "test_id": 123,
  "test_run_details_page_url": "https://example.grafana.net/a/k6-app/runs/1234"
}

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

404 response

Resource not found.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

List load tests in a project

GET /cloud/v6/projects/{id}/load_tests

List load tests in a project.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger
$countInclude collection length in the response object as @count.queryfalseboolean
$orderby

Comma-separated list of fields to use when ordering the results. Available fields:

  • id
  • project_id
  • name
  • created
  • updated

The default ascending order can be reversed by appending the desc specifier.

queryfalsestring
$skipThe initial index from which to return the results.queryfalseinteger
$topNumber of results to return per page.
Default: 1000
Maximum: 1000
queryfalseinteger
idID of the project.pathtrueinteger , format: int64
nameFilter results by load test name (exact match).queryfalsestring

200 response

OK.

Content types: application/json

LoadTestListResponse properties:

NameDescriptionRequiredType
@countObject count in the collection.falseinteger
@nextLinkA reference to the next page of results. The property is included until there are no more pages of results to retrieve.falsestring , format: uri
valueList of the resulting values.trueArray[LoadTestApiModel]

LoadTestApiModel properties:

NameDescriptionRequiredType
baseline_test_run_idID of a baseline test run used for results comparison. Deprecated: baselines are being replaced by the star/unstar test run APIs and this field is scheduled for removal on 2026-09-01.trueinteger | null , format: int64
createdThe date when the test was created.truestring , format: date-time
idID of the load test.trueinteger , format: int64
k6_versionIdentifier of the k6 version used to run the test.falseinteger | null
nameUnique name of the test within the project.truestring
project_idID of the parent project.trueinteger , format: int64
updatedThe date when the test was last updated.truestring , format: date-time
OK example
{
  "@count": 123,
  "@nextLink": "https://api.k6.io/cloud/v6/projects/312/load_tests?$skip=50\u0026$top=20",
  "value": [
    {
      "baseline_test_run_id": null,
      "created": "2024-12-03T09:53:00.553",
      "id": 1234,
      "k6_version": null,
      "name": "Orders API Soak Test",
      "project_id": 312,
      "updated": "2024-12-03T09:53:00.553"
    }
  ]
}

400 response

Request validation error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

404 response

Resource not found.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

Create a new test

POST /cloud/v6/projects/{id}/load_tests

Create a new test in the project.

The script can be either in the form of a single JavaScript text file or a k6 .tar archive - the type is auto-detected by the API. Any received payload that is not a .tar archive is assumed to be a JavaScript file.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger
idID of the project.pathtrueinteger , format: int64

Request body

Content types: multipart/form-data

CreateLoadTestApiModel properties:

NameDescriptionRequiredType
k6_versionIdentifier of the k6 version used to run the test.falseinteger | null
nameUnique name of the test within the project.truestring
scriptTest script in the form of a UTF-8 encoded text or a k6 .tar archive.falsestring | null , format: binary

201 response

OK.

Content types: application/json

LoadTestApiModel properties:

NameDescriptionRequiredType
baseline_test_run_idID of a baseline test run used for results comparison. Deprecated: baselines are being replaced by the star/unstar test run APIs and this field is scheduled for removal on 2026-09-01.trueinteger | null , format: int64
createdThe date when the test was created.truestring , format: date-time
idID of the load test.trueinteger , format: int64
k6_versionIdentifier of the k6 version used to run the test.falseinteger | null
nameUnique name of the test within the project.truestring
project_idID of the parent project.trueinteger , format: int64
updatedThe date when the test was last updated.truestring , format: date-time
OK example
{
  "baseline_test_run_id": null,
  "created": "2024-12-03T09:53:00.553",
  "id": 1234,
  "k6_version": null,
  "name": "Orders API Soak Test",
  "project_id": 312,
  "updated": "2024-12-03T09:53:00.553"
}

400 response

Request validation error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

404 response

Resource not found.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

409 response

The name is already taken.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

Validate k6 script options

POST /cloud/v6/validate_options

Verify a test can be run in Grafana Cloud with the provided k6 script options.

Project ID can be specified in the root object as well as under options.cloud.

Request parameters

NameDescriptionInRequiredType
X-Stack-Id

Numeric ID of the Grafana stack representing the request scope.

  • If the API is called with a Personal API token, the user must be a member of the specified stack.
  • If the API is called with a Grafana Stack API token, the value must be the ID of the corresponding stack.
headertrueinteger

Request body

Content types: application/json

ValidateOptionsRequest properties:

NameDescriptionRequiredType
is_local_executionWhether the test is being executed locally.falseboolean
k6_dependenciesVersion of k6 and extensions to validate, as a map of dependency name to dependency version constraint.falseobject | null
k6_versionIdentifier of the k6 version used to run the test.falseinteger | null
optionsk6 script options object to validate.trueOptions
project_idID of a project where the test belongs.falseinteger | null , format: int64

Options properties:

NameDescriptionRequiredType
cloudCloud-specific k6 options.falseCloudOptions | null

CloudOptions properties:

NameDescriptionRequiredType
projectIDID of a project where the test belongs.falseinteger | null , format: int64
ProjectIdInOptionsExtensionsWithVersioning example
{
  "k6_dependencies": {
    "k6": "\u003e=v0.52",
    "k6/x/faker": "\u003e=0.4.0"
  },
  "options": {
    "cloud": {
      "distribution": {
        "amazon:us:ashburn": {
          "loadZone": "amazon:us:ashburn",
          "percent": 100
        }
      },
      "projectID": 123456
    },
    "stages": [
      {
        "duration": "1m",
        "target": 20
      },
      {
        "duration": "3m",
        "target": 20
      },
      {
        "duration": "30s",
        "target": 0
      }
    ]
  }
}
ProjectIdInOptionsExtensionsWithoutVersioning example
{
  "k6_dependencies": {
    "k6": "*",
    "k6/x/faker": "*"
  },
  "options": {
    "cloud": {
      "distribution": {
        "amazon:us:ashburn": {
          "loadZone": "amazon:us:ashburn",
          "percent": 100
        }
      },
      "projectID": 123456
    },
    "stages": [
      {
        "duration": "1m",
        "target": 20
      },
      {
        "duration": "3m",
        "target": 20
      },
      {
        "duration": "30s",
        "target": 0
      }
    ]
  }
}
ProjectIdInOptionsNoDependencies example
{
  "options": {
    "cloud": {
      "distribution": {
        "amazon:us:ashburn": {
          "loadZone": "amazon:us:ashburn",
          "percent": 100
        }
      },
      "projectID": 123456
    },
    "stages": [
      {
        "duration": "1m",
        "target": 20
      },
      {
        "duration": "3m",
        "target": 20
      },
      {
        "duration": "30s",
        "target": 0
      }
    ]
  }
}

200 response

OK.

Content types: application/json

ValidateOptionsResponse properties:

NameDescriptionRequiredType
breakdownBreakdown of the VUH usage.trueCostBreakdownApiModel
vuh_usageHow many VUH will be charged for the test.truenumber

Breakdown details of the test cost.

CostBreakdownApiModel properties:

NameDescriptionRequiredType
base_total_vuhVUH usage before applying the effective reduction.true
browser_vuhNumber of billed VUH charged for the browser part of the test run.true
protocol_vuhNumber of billed VUH charged for the protocol part of the test run.true
reduction_rateThe effective reduction rate after applying all individual reductions to the base VUH usage.true
reduction_rate_breakdownThe individual reduction rates applied to the base VUH usage.trueobject | null
OK example
{
  "breakdown": {
    "base_total_vuh": 10,
    "browser_vuh": 0,
    "protocol_vuh": 6.75,
    "reduction_rate": 32.5,
    "reduction_rate_breakdown": {
      "local_run": 25,
      "volume": 10
    }
  },
  "vuh_usage": 6.75
}

400 response

Request validation error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

401 response

Invalid token or authentication scheme.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

403 response

The user does not have permission to perform this action.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null

500 response

Unexpected error.

Content types: application/json

ErrorResponseApiModel properties:

NameDescriptionRequiredType
errortrueErrorApiModel

Details of the error.

ErrorApiModel properties:

NameDescriptionRequiredType
codeService-defined error code.truestring
detailsArray of objects with more specific error information when applicable.falsearray | null
messageHuman-readable string describing the error.truestring
targetA string indicating the target of the error. For example, the name of the property in error.falsestring | null