Menu
Grafana Cloud

Projects REST API

List all projects

GET /cloud/v6/projects

List all available projects.

Request parameters

NameDescriptionInRequiredType
stackId

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:

  • created

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

200 response

OK.

Content type: application/json

ProjectListResponse 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[ProjectApiModel]

ProjectApiModel properties:

NameDescriptionRequiredType
createdThe date when the project was created.truestring , format: date-time
idProject ID.trueinteger
is_defaultUse this project as default for running tests when no explicit project ID is provided.trueboolean
nameProject name.truestring
updatedThe date when the project was last updated.truestring , format: date-time
OK example
{
  "@count": 123,
  "@nextLink": "https://api.k6.io/cloud/v6/projects?$skip=50\u0026$top=20",
  "value": [
    {
      "created": "2024-12-04T19:57:46.339Z",
      "id": 123,
      "is_default": false,
      "name": "My Project",
      "updated": "2024-12-04T19:57:46.339Z"
    }
  ]
}

400 response

401 response

403 response

500 response

Create a project

POST /cloud/v6/projects

Create a new project.

Request parameters

NameDescriptionInRequiredType
stackId

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 type: application/json

CreateProjectApiModel properties:

NameDescriptionRequiredType
nameProject name.truestring
Create example
{
  "name": "My Project"
}

201 response

OK.

Content type: application/json

ProjectApiModel properties:

NameDescriptionRequiredType
createdThe date when the project was created.truestring , format: date-time
idProject ID.trueinteger
is_defaultUse this project as default for running tests when no explicit project ID is provided.trueboolean
nameProject name.truestring
updatedThe date when the project was last updated.truestring , format: date-time
OK example
{
  "created": "2024-12-04T19:57:46.339Z",
  "id": 123,
  "is_default": false,
  "name": "My Project",
  "updated": "2024-12-04T19:57:46.339Z"
}

400 response

401 response

403 response

500 response

Delete a project

DELETE /cloud/v6/projects/{id}

Delete a project.

Request parameters

NameDescriptionInRequiredType
stackId

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

204 response

OK.

401 response

403 response

404 response

409 response

Cannot delete project with a running test.

Content type: 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

Get a project by ID

GET /cloud/v6/projects/{id}

Retrieve a single project.

Request parameters

NameDescriptionInRequiredType
stackId

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

200 response

OK.

Content type: application/json

ProjectApiModel properties:

NameDescriptionRequiredType
createdThe date when the project was created.truestring , format: date-time
idProject ID.trueinteger
is_defaultUse this project as default for running tests when no explicit project ID is provided.trueboolean
nameProject name.truestring
updatedThe date when the project was last updated.truestring , format: date-time
OK example
{
  "created": "2024-12-04T19:57:46.339Z",
  "id": 123,
  "is_default": false,
  "name": "My Project",
  "updated": "2024-12-04T19:57:46.339Z"
}

401 response

403 response

404 response

500 response

Update a project

PATCH /cloud/v6/projects/{id}

Update a project.

Request parameters

NameDescriptionInRequiredType
stackId

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

Request body

Content type: application/json

PatchProjectApiModel properties:

NameDescriptionRequiredType
nameProject name.truestring
Update example
{
  "name": "New Project Name"
}

204 response

OK.

400 response

401 response

403 response

404 response

500 response

Get project limits

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

Fetch limits for a project.

Request parameters

NameDescriptionInRequiredType
stackId

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

200 response

OK.

Content type: application/json

ProjectLimitsApiModel properties:

NameDescriptionRequiredType
duration_max_per_testMax duration of a test in seconds.trueinteger | null
project_idID of the related project.trueinteger
vu_browser_max_per_testMax number of concurrent browser virtual users (VUs) used in one test.trueinteger | null
vu_max_per_testMax number of concurrent virtual users (VUs) used in one test.trueinteger | null
vuh_max_per_monthMax amount of virtual user hours (VUH) used per one calendar month.trueinteger | null
OK example
{
  "duration_max_per_test": 600,
  "project_id": 123,
  "vu_browser_max_per_test": 5,
  "vu_max_per_test": null,
  "vuh_max_per_month": 50
}

401 response

403 response

404 response

500 response

Update project limits

PATCH /cloud/v6/projects/{id}/limits

Update limits for a project.

Set a limit to null to remove it.

Request parameters

NameDescriptionInRequiredType
stackId

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

Request body

Content type: application/json

PatchProjectLimitsRequest properties:

NameDescriptionRequiredType
duration_max_per_testMax duration of a test in seconds.falseinteger | null
vu_browser_max_per_testMax number of concurrent browser virtual users (VUs) used in one test.falseinteger | null
vu_max_per_testMax number of concurrent virtual users (VUs) used in one test.falseinteger | null
vuh_max_per_monthMax amount of virtual user hours (VUH) used per one calendar month.falseinteger | null
RemoveAll example
{
  "duration_max_per_test": null,
  "vu_browser_max_per_test": null,
  "vu_max_per_test": null,
  "vuh_max_per_month": null
}
RemoveSingle example
{
  "duration_max_per_test": null
}
UpdateAll example
{
  "duration_max_per_test": 600,
  "vu_browser_max_per_test": 5,
  "vu_max_per_test": 20,
  "vuh_max_per_month": 50
}
UpdateSingle example
{
  "vuh_max_per_month": 55
}

204 response

OK.

400 response

401 response

403 response

404 response

500 response