If your billing cycle started before November 5, you may see only partial account-level usage data through the APIs for the current cycle, depending on your monthly billing reset date. This is a one-time limitation in API visibility — your data is still there, and the APIs will show complete data for your next monthly billing cycle. Your complete usage data is available through CSV export or data share (for Cloud Enterprise customers).
Use this tutorial to check one account's usage and limit, find out whether its own limit is blocking it, and raise that limit if needed.
You’ll work with the Rovo credits meter in this tutorial. You might want to raise a Rovo credits limit for a user who has run out of credits partway through the month.
For more details on meters and usage, see What is Platform usage?
For full technical details of available operations, see the meters API.
This tutorial does not cover:
To complete this tutorial, you need the following:
| Placeholder | Replace it with |
|---|---|
{orgId} | Your organization ID |
{meterId} | The ID of a meter that supports limits (see Find the Rovo credits meter ID) |
{accountId} | An Atlassian account ID (for example, a user or a service account) |
<api_key> | Your organization API key |
{newLimit} | The new total monthly limit in credits, as a whole number of 25 or greater. |
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.
Follow the steps in Find the Rovo credits meter ID if you haven’t already made a copy of your meter ID. Do not continue if the meter does not support limits.
You can read an account's usage and limit with the operation:
GET /admin/v1/orgs/{orgId}/meters/{meterId}/usage/{accountId}
1 2 3 4 5curl --request GET \ --url "https://api.atlassian.com/admin/v1/orgs/{orgId}/meters/{meterId}/usage/{accountId}" \ --header "Authorization: Bearer <api_key>" \ --header "Accept: application/json"
{orgId}, {meterId}, {accountId}, and <api_key>.GET request.A successful response includes the account's limit, usage, balance, and usage state. These are all wrapped in a data object. For example:
1 2 3 4 5 6 7 8 9 10{ "data": { "accountId": "5b10ac8d82e05b22cc7d4ef5", "limit": 1000, "usage": 1000, "balance": 0, "usageState": "LIMIT_REACHED" } }
Use this table to interpret the response to your GET request. Successful responses wrap their content in a data object, and the field names below are relative to it.
| Response | Meaning | What to do |
|---|---|---|
200 with usageState of LIMIT_REACHED | The account's own limit is blocking it. usage is equal to or above limit, and balance is 0. | Continue to the next step to raise the limit. If you don't want to raise it, tell the user they've reached their monthly limit. |
200 with usageState of WITHIN_LIMIT | The account's own limit isn't stopping it from consuming Rovo credits, so raising the limit won't help. The organization might have reached its limit. | If the account is blocked, use the summary endpoint to check the organization's total usage. Compare usage.total with the organization's limit, which comes from allowance.total and the meter's payAsYouGo settings. See Check your organization's allowance and usage. |
200 with limit and balance of null | The account has no limit. | Set a limit if the account is using too many credits. If you don't want to set one, change the organization limit instead, or do nothing. |
200 with usage of 0, and limit and balance of null. | No usage or limit exists for this account ID. The GET request doesn't check whether the account exists. | If you think the account ID is mistyped, check {accountId} and send the request again. |
400 with invalid-account | The account ID is empty or contains invalid characters. IDs that pass this check are accepted even if the account doesn’t exist. | Check {accountId} and send the request again. |
404 with meter-not-found | The meter is not provisioned for the organization or has been deactivated. | Check {meterId} and use an active meter for your organization. |
429 | The organization has sent too many requests. | Wait before retrying. If the response includes X-Retry-After, wait that long first. |
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 trying again. |
You can set a limit for an account with the operation:
PUT /admin/v1/orgs/{orgId}/meters/{meterId}/limits/{accountId}
To remove the account’s own limit as a blocker, set the new total limit above its current usage. The value replaces the existing limit; it isn’t an additional allocation.
The new limit stays in place until you or another admin changes it. You can raise or lower the limit at any time.
1 2 3 4 5 6 7curl --request PUT \ --url "https://api.atlassian.com/admin/v1/orgs/{orgId}/meters/{meterId}/limits/{accountId}" \ --header "Authorization: Bearer <api_key>" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{"limit": {newLimit}}'
{orgId}, {meterId}, {accountId}, and <api_key>. Replace {newLimit} with the new limit.PUT request.A successful result looks like this example:
1 2 3 4 5 6 7{ "data": { "accountId": "5b10ac8d82e05b22cc7d4ef5", "limit": 2000 } }
Use this table to interpret the response to your PUT request. Successful responses wrap their content in a data object, and the field names below are relative to it.
| Response | Meaning | What to do |
|---|---|---|
200 | The limit was created or replaced. The response shows data.limit as the new limit. | Continue to the next step. |
400 with invalid-account | The account ID is missing or malformed. | Check {accountId} and send the request again. |
400 with invalid-limit | The limit is missing, below 25, not a whole number, or not a number. | Set limit to a whole number of 25 or more and send the request again. |
400 with invalid-request | The request body isn't valid JSON or doesn't have the expected shape. Nothing was written. | Check that the body is {"limit": {newLimit}} and send the request again. |
400 with limits-not-supported | The meter doesn't support limits. | Check {meterId} and send the request again. |
404 with account-not-found | The account doesn't exist or isn't active. | Check the account ID. To set a limit, use the ID of an active Atlassian account. |
404 with meter-not-found | The meter is not provisioned for the organization or has been deactivated. | Check {meterId} and use an active meter for your organization. |
409 with limit-rejected | The limit was refused. | Read detail in the response to find out why. |
429 | The organization has sent too many requests. | Wait before retrying. If the response includes X-Retry-After, wait that long. Retrying is safe because the request sets an absolute limit. |
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. |
To verify the updated limit, you can rerun the earlier GET request. A usageState of WITHIN_LIMIT means the account's own limit isn't blocking it. If the organization has reached its limit, the account will still be blocked even if it shows WITHIN_LIMIT.
GET request from Step 2 again.usageState is WITHIN_LIMIT and that balance equals the new limit minus usage.If the response still shows LIMIT_REACHED, the change may not have appeared yet. Check it again shortly.
For more examples and details, see the meters API documentation.
Rate this page: