Use these endpoints to access tests and test runs in Grafana Cloud k6.
List load tests
GET /projects/:projectId/load_tests
Example URL with optional parameters:
GET /projects/:projectId/load_tests?$top=10&$skip=20&$count=true&$select=id,name,created&$orderby=created desc&$filter=contains(name,'heavy')
Parameters
All parameters are optional.
Parameter
Description
$select
Specifies a comma-separated list of properties to include in the response.
$orderby
Specifies the sorting order for the returned results. It accepts one or more comma-separated properties with an optional asc (ascending) or desc (descending) keyword.
$top
Limits the number of items to return in the response.
$skip
Specifies the number of items to skip in the result set before returning the remaining items. It is used for paging through a large result set.
$count
Includes a count of the total number of items in the result set in the response.
$filter
Filters the result set based on specified conditions.
Example request:
http
GET https://api.k6.io/cloud/v5/projects/5276/load_tests?$count=true
Accept:application/jsonAuthorization:Token 56c166885f9a7fc1e588a1b3cb66f6dd
GET /load_tests/:loadTestId/test_runs?$top=10&$skip=20&$count=true&$select=id,name,created&$orderby=created desc&$filter=run_status eq 5 and
Parameters
All parameters are optional.
Parameter
Description
$select
Specifies a comma-separated list of properties to include in the response.
$orderby
Specifies the sorting order for the returned results. It accepts one or more comma-separated properties with an optional asc (ascending) or desc (descending) keyword.
$top
Limits the number of items to return in the response.
$skip
Specifies the number of items to skip in the result set before returning the remaining items. It is used for paging through a large result set.
$count
Includes a count of the total number of items in the result set in the response.
$filter
Filters the result set based on specified conditions.
Example request:
http
GET https://api.k6.io/cloud/v5/load_tests/3535/test_runs?$top=10&$count=true&$orderby=created desc
Accept:application/jsonAuthorization:Token 56c166885f9a7fc1e588a1b3cb66f6dd
Example response
http
HTTP/1.1 200
Content-Type:application/json{"@count":"144","value":[{"config":{"agent_access_token":"eba569496f1d64f42333333320e4abaec0c74c6baf06d22f603f3aac7eb39c","archive":"4744e429260e47f8a504443d0f9f1bf1.tar",// cut for brevity},"created":"2023-05-18T08:46:01.157645Z","delete_status":0,"deleted":false,"duration":2550,"ended":"2023-05-18T08:55:25.000000Z","error_code":null,"error_detail":null,"id":152779,"is_baseline":false,"note":"","organization_id":499,"processing_status":2,"project_id":5276,"public_id":null,"result_status":0,"run_process":"UI-Script to Cloud","run_status":5,"script":"import { sleep, check } from 'k6 ...",// cut for brevity"started":"2023-05-18T08:48:31.000000Z","stopped_by_id":703,"test_id":3535,"user_id":703,"vus":3000},// cut for brevity]}
Get single test run by Id
GET /test_runs/:id
Parameters
Parameter
Description
$select
Optional: Specifies a comma-separated list of properties to include in the response.
Example Request:
http
GET https://api.k6.io/cloud/v5/test_runs/152779
Accept:application/jsonAuthorization:Token 56c166885f9a7fc1e588a1b3cb66f6dd
Example Response:
http
HTTP/1.1 200
Content-Type:application/json{"config":{"agent_access_token":"eba569496f1d64f42333333320e4abaec0c74c6baf06d22f603f3aac7eb39c","archive":"4744e429260e47f8a504443d0f9f1bf1.tar",// cut for brevity},"created":"2023-05-18T08:46:01.157645Z","delete_status":0,"deleted":false,"duration":2550,"ended":"2023-05-18T08:55:25.000000Z","error_code":null,"error_detail":null,"id":152779,"is_baseline":false,"note":"","organization_id":499,"processing_status":2,"project_id":5276,"public_id":null,"result_status":0,"run_process":"UI-Script to Cloud","run_status":5,"script":"import { sleep, check } from 'k6 ...",// cut for brevity"started":"2023-05-18T08:48:31.000000Z","stopped_by_id":703,"test_id":3535,"user_id":703,"vus":3000}