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 usage and limits for multiple accounts, splitting lists larger than 100 into separate requests.
You’ll work with the Rovo credits meter in this tutorial.
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:
You need all of the following:
| Placeholder | Replace it with |
|---|---|
{orgId} | Your organization ID |
{meterId} | The ID of a meter (see Find the Rovo credits meter ID) |
<api_key> | Your organization API key |
{accountId} | An Atlassian account ID (for example, a user or a service account) |
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.
You can check usage and limits for multiple accounts in batches of up to 100 account IDs in one request. Each request can contain 1 to 100 account IDs. If your list contains more than 100 account IDs, split it into smaller batches.
filters object with an accountIds array.400 with too-many-rows.Example request body:
1 2 3 4 5 6 7 8 9 10{ "filters": { "accountIds": [ "5b10ac8d82e05b22cc7d4ef5", "5d3f9a1c7e24b60e8f1a2c97", "712020:6f2e0a7b-3c1d-4e2f-9a8b-1c2d3e4f5a6b" ] } }
You can send each batch to the usage search operation:
POST /admin/v1/orgs/{orgId}/meters/{meterId}/usage/search
1 2 3 4 5 6 7curl --request POST \ --url "https://api.atlassian.com/admin/v1/orgs/{orgId}/meters/{meterId}/usage/search" \ --header "Authorization: Bearer <api_key>" \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --data '{"filters": {"accountIds": ["{accountId}", "{accountId}"]}}'
{orgId}, {meterId}, and <api_key>.filters.accountIds array with the account IDs you prepared earlier.POST request for the prepared batch.A successful response returns one record per account, in the order you sent them, wrapped in a data array. For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26{ "data": [ { "accountId": "5b10ac8d82e05b22cc7d4ef5", "limit": 1000, "usage": 250, "balance": 750, "usageState": "WITHIN_LIMIT" }, { "accountId": "5d3f9a1c7e24b60e8f1a2c97", "limit": 500, "usage": 500, "balance": 0, "usageState": "LIMIT_REACHED" }, { "accountId": "712020:6f2e0a7b-3c1d-4e2f-9a8b-1c2d3e4f5a6b", "limit": null, "usage": 0, "balance": null, "usageState": "WITHIN_LIMIT" } ] }
Use the following table as a reference for the top-level response to your request. Successful responses return a data array containing account records. The field names below refer to each account record. Check each record for that account’s usage and limit.
| Response | Meaning | What to do |
|---|---|---|
200 | The batch was read. The response has one result for each account in the order you sent them. Each result includes accountId, usage, limit, balance, and usageState. | Continue to the next step. |
400 with invalid-account | One or more account IDs are empty or contain invalid characters, so the whole batch failed. The error names the first invalid account ID. IDs that pass this check are accepted even if the accounts don’t exist. | Fix or remove the account ID, then send the batch again. |
400 with invalid-request | The request body is invalid. Nothing was read. | Fix the request body and send the batch again. |
400 with too-many-rows | The batch has more than 100 account IDs, or none. Nothing was read. | Send between 1 and 100 account IDs. |
404 with meter-not-found | The meter isn't one of the organization's meters, or it's deactivated. | Check {meterId} and use an active meter for your organization. |
429 | You sent too many requests for your organization. Nothing was read. | Wait, then send the same batch again. If the response has an X-Retry-After header, wait that long first. |
500 with internal-error | Something went wrong unexpectedly. Nothing was returned. | Send the batch again later. If it keeps happening, contact support. |
503 | The batch couldn't be read. Nothing was returned. | Wait for a short time, then send the same batch again. Retrying is safe because this request only reads data. |
The batch request you just ran doesn't check whether accounts exist. A correctly formatted account ID that doesn't belong to an existing account still returns a result with usage: 0 and limit: null. An existing account with no usage or configured limit returns the same values, so a result does not confirm that the account exists.
Combine the results from all batch requests and compare the returned accountId values with your original list. For every returned account, use usage, limit, balance, and usageState to understand its current state.
Usage can lag behind actual consumption. A recently changed limit can take a few seconds to appear in the response.
For more examples and details, see the meters API documentation.
Rate this page: