Use this tutorial to find the ID of a meter and check that it supports limits before you set any.
You’ll work with the Rovo credits meter in this tutorial. You’ll use the meter’s key to find its ID, check whether it supports limits, and check its pay-as-you-go settings. Each meter has a key and an ID. For the Rovo credits meter, the meter key is rovo-credits for all organizations. Each organization has its own unique meter ID; for example: 7c0e5f3a-9b2d-4e61-8a47-1d3c6b9e2f80.
By the end of this tutorial, you'll have your organization’s meter ID and confirmation that limits.supported is true.
For more details on meters and usage, see What is Platform usage?
For full technical details of available operations, see the meters API.
To complete this tutorial, you need the following:
An API token is not an API key.
Authorization: Bearer <api_key>.This tutorial uses an organization API key as a Bearer token.
Keep the API key out of source code and version control.
Replace these placeholders before sending a request (see Get started with the meters API to find them):
| Placeholder | Replace it with |
|---|---|
{orgId} | Your organization ID |
<api_key> | Your organization API key |
You can find the Rovo credits meter ID with the operation:
GET /admin/v1/orgs/{orgId}/meters?key=rovo-credits
You’ll need the meter ID for other API operations for Rovo credits. A meter’s ID doesn’t change, so you can reuse it for this organization. If you administer more than one organization, the meter ID is different in each organization.
To find the ID for the Rovo credits meter:
1 2 3 4 5curl --request GET \ --url "https://api.atlassian.com/admin/v1/orgs/{orgId}/meters?key=rovo-credits" \ --header "Authorization: Bearer <api_key>" \ --header "Accept: application/json"
{orgId} and <api_key>.GET request.A successful response returns the Rovo credits meter information. For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22{ "data": [ { "id": "7c0e5f3a-9b2d-4e61-8a47-1d3c6b9e2f80", "key": "rovo-credits", "name": "Rovo credits", "unit": "credits", "limits": { "supported": true, "dimensions": [ { "key": "accountId", "type": "string" } ] }, "resetDate": "2027-01-04T00:00:00Z", "payAsYouGo": { "enabled": false, "limit": null } } ], "links": { "self": "/v1/orgs/{orgId}/meters?key=rovo-credits" } }
To see every meter for your organization as they become available through the API, send the same request without ?key=rovo-credits. Rovo credits is the first and only meter currently available.
Use this table to interpret the response to your GET request and what to do next.
| Response | Meaning | What to do |
|---|---|---|
200 with populated list | The request worked. The list has the meter. | Copy the meter ID and continue to Step 3. |
200 with empty list | The meter either isn’t provisioned or is deactivated for your organization. | Do not continue. Instead, contact support. |
400 with invalid-parameter | The request has an unknown query parameter or a value the operation doesn’t support. | Check that the only query parameter is ?key=rovo-credits and send the request again. |
401 | Authentication failed. | Check the organization ID and the API key, then send the request again. |
403 | The API key doesn’t have access to the organization ID that you sent in the request. | Check the organization ID and the API key, then send the request again. |
429 | The organization has sent too many requests. | Wait before retrying. If the response includes X-Retry-After, wait that long. |
500 with internal-error | An unexpected error occurred. | Retry later. If it keeps happening, contact support. |
503 with service-unavailable | The request couldn’t be served right now. | Wait for a short time before retrying. |
The fields and values returned in your request response provide details of the meter configuration for your organization. Use this information to determine if any additional configuration is needed. Successful responses return a data array containing meter objects. The field names below refer to the Rovo credits meter’s object. Check the fields within the Rovo credits meter’s entry.
Pay-as-you-go settings are changed in Atlassian Administration, not through this API.
| Field | Value | What it means |
|---|---|---|
limits.supported | true | The meter supports limits. |
limits.supported | false | The meter doesn’t support limits. Setting a limit returns a limits-not-supported error. |
resetDate | A timestamp, such as 2027-01-04T00:00:00Z | The date and time that usage resets for every account. |
resetDate | null | The reset date isn’t available yet. |
payAsYouGo | enabled: false | Pay as you go is disabled. Usage stops at the organization’s allowance. |
payAsYouGo | enabled: true and a positive limit | Pay as you go is enabled. The specified pay-as-you-go limit applies to usage beyond the organization’s total allowance. |
payAsYouGo | enabled: true and limit: null | Pay as you go is enabled with no pay-as-you-go limit set. |
payAsYouGo | enabled: true and limit: 0 | Works like pay as you go being disabled. Usage stops at the organization’s total allowance. |
Visit the meters API for more examples and information.
Rate this page: