Developer
News and Updates
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Last updated Nov 24, 2026

Set limits for multiple accounts in one request

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).

What this tutorial covers

Use this tutorial to set limits for multiple accounts in one API request, review the result for each account, and verify each account’s limit and current usage.

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.

What this tutorial doesn’t cover

This tutorial does not cover:

  • Setting group-based limits.
  • Setting a limit for more than 50 accounts in one request.
  • Comparing the total of account limits with your organization’s limit.
  • Removing an existing limit. There’s a separate operation to DELETE.

Before you begin

To complete this tutorial, you need the following:

PlaceholderReplace it with
{orgId}Your organization ID
{meterId}The ID of a meter that supports limits (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)
{newLimit}A whole-number monthly limit in credits (25 or greater). The new limit replaces an account’s existing limit.

Authentication reminder

An API token is not an API key.

  • API key: send it in Authorization: Bearer <api_key>.
  • API token: used with basic authentication; it is not the credential used in this tutorial.

This tutorial uses an organization API key as a Bearer token.

Keep the API key out of source code and version control.

Step 1: Find the Rovo credits meter ID

Follow the steps in Find the Rovo credits meter ID if you haven’t already made a copy of your meter ID.

Step 2: Prepare the account limits batch

You can set limits for Rovo credits for multiple accounts in batches. Some useful information about how limits work:

  • An account’s limit stays the same from one usage cycle to the next unless you change it. Usage resets on the reset date, but the limit doesn’t.
  • If you set a new limit to be less than what the account has already used in the current usage cycle, the account can’t use features that consume Rovo credits for the remainder of the current usage cycle. Consumption can resume if the limit is raised above usage.

Rules for the batch

  • Create one row for each account.
  • Use the account’s Atlassian account ID in accountId.
  • Use a whole number (25 or greater) in limit.
  • An account can be a user or a service account.
  • Do not include the same account more than once in the batch.
  • If you have more than 50 rows, split them into separate requests. Each request must contain 1 to 50 rows.
  • The limits are absolute values: each row replaces the account’s current limit.
  • The API accepts rows even when their combined limits are greater than your organization’s limit. In that situation, the organization can reach its limit before an account reaches its individual limit.

Example request body:

1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "rows": [
    {
      "accountId": "5b10ac8d82e05b22cc7d4ef5",
      "limit": 1000
    },
    {
      "accountId": "712020:6f2e0a7b-3c1d-4e2f-9a8b-1c2d3e4f5a6b",
      "limit": 1000
    }
  ]
}
  1. Using the information and example above, create one row for each account. Each row must contain an accountId and an absolute limit in credits, as a whole number.
  2. If you have more than 50 rows, add the excess rows to a new batch.

Step 3: Send the batch request

Set limits for Rovo credits for multiple accounts with the operation: PUT /admin/v1/orgs/{orgId}/meters/{meterId}/limits

  1. Copy and paste the following batch request into a local plain-text editor.
1
2
3
4
5
6
7
curl --request PUT \
  --url "https://api.atlassian.com/admin/v1/orgs/{orgId}/meters/{meterId}/limits" \
  --header "Authorization: Bearer <api_key>" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '{"rows": [{"accountId": "{accountId}", "limit": {newLimit}}]}'
  1. Replace every placeholder in the URL and headers: {orgId}, {meterId}, and <api_key>.
  2. Replace the example rows array with all of the account-limit objects you prepared earlier.
  3. Import the updated curl command into your API client, or paste it in your terminal.
  4. Send the PUT request for the prepared batch.

Step 4: Interpret the top-level response status

Your API tool will return a response. Here’s an example of a response that contains a status of SUCCESS and a status of FAILURE:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "data": [
    {
      "accountId": "5b10ac8d82e05b22cc7d4ef5",
      "status": "SUCCESS",
      "result": {
        "limit": 1000
      }
    },
    {
      "accountId": "712020:6f2e0a7b-3c1d-4e2f-9a8b-1c2d3e4f5a6b",
      "status": "FAILURE",
      "error": {
        "type": "https://developer.atlassian.com/cloud/admin/organization/meters/problems/account-not-found",
        "title": "Account not found",
        "status": 404,
        "detail": "The account doesn't exist or isn't active."
      }
    }
  ]
}

Use the following table as a reference for the top-level response to your request.

ResponseMeaningWhat to do
207The API processed the rows, but one or more rows might have failed.Inspect the status of every row in the response. Continue to the next step.
400 with duplicate-accountAn account appears in two or more rows. No rows were written.Remove duplicate account IDs and send the request again.
400 with invalid-requestThe request body is invalid. No rows were written.Correct the request body syntax and send the request again.
400 with limits-not-supportedThe selected meter does not support limits. No rows were written.Use a meter that supports limits.
400 with too-many-rowsThe request contains more than 50 rows or contains no rows. No rows were written.Send between 1 and 50 rows.
404 with meter-not-foundThe meter is not one of the organization’s meters, or it’s deactivated.Check {meterId} and select an active organization meter.
429You sent too many requests for your organization. No rows were written.Wait, then send the same batch again. If the response has an X-Retry-After header, wait that long first.
500 with internal-errorSomething went wrong unexpectedly. Some rows might have been written.Wait a short time, then retry the entire request. Retrying is safe because every row sets an absolute limit.
503The request could not be completed. Some rows might still have been written.Wait a short time, then retry the entire request. Retrying is safe because every row sets an absolute limit.

Step 5: Check the result for every row

A 207 Multi-Status response contains a data array with one result object per account. You must still check each result separately. For each row in the response, read its status value.

  • If it is SUCCESS, result.limit contains the limit that was set.
  • If it is FAILURE, check error.status, error.type, and error.detail to understand the failure.

The field names below refer to each account’s result.

Row responseMeaningWhat to do
SUCCESSThe limit was created or replaced.Proceed to the next step to verify the limit.
400 with invalid-account or invalid-limitThe account ID or limit value is invalid.Correct that row and retry sending the request.
404 with account-not-foundThe account doesn’t exist or isn’t active.Check the account ID. If the account was deactivated or deleted, remove the row.
409 with limit-rejectedThe service rejected the limit.Read the error details and resolve the reported issue before trying again.
500 with internal-errorThe service encountered an internal error.Retry the row later. Contact support if the error continues.
503 with service-unavailableThe service was temporarily unavailable for that row.Retry the row later. Retrying is safe because the row sets an absolute limit.

Step 6: Prepare a request to verify account limits and usage

After your batch request has completed, you can verify account limits and current usage in one call with this read-only operation:
POST /admin/v1/orgs/{orgId}/meters/{meterId}/usage/search

You can include up to 100 account IDs in one verification request. Because it’s a read-only operation, there’s no risk of overwriting any account limits. The response can include these values for each account:

  • limit
  • usage
  • balance
  • usageState
  1. Copy and paste the following batch request into a local plain-text editor.
1
2
3
4
5
6
7
curl --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}"]}}'
  1. Replace every placeholder in the URL and headers: {orgId}, {meterId}, and <api_key>.
  2. Replace the example accountIds array with the account IDs you want to verify.
  3. Import the updated curl command into your API client, or paste it in your terminal.
  4. In your API tool, send the POST request for the prepared batch.

Step 7: Verify each account’s limit and usage

For every account ID you send in the request, the response returns an account record in the same order. Successful responses return a data array. For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "data": [
    {
      "accountId": "5b10ac8d82e05b22cc7d4ef5",
      "limit": 1000,
      "usage": 250,
      "balance": 750,
      "usageState": "WITHIN_LIMIT"
    },
    {
      "accountId": "712020:6f2e0a7b-3c1d-4e2f-9a8b-1c2d3e4f5a6b",
      "limit": null,
      "usage": 0,
      "balance": null,
      "usageState": "WITHIN_LIMIT"
    }
  ]
}

In the example response, the account starting with 712020 failed in Step 4 and had no previous limit, so its limit is null. For an account whose update returned FAILURE, a returned limit that differs from the one you sent is expected. For an account that returned SUCCESS, follow the numbered steps below.

The field names below refer to each account record. Each record includes the account’s limit, usage, and balance. Its usageState is either WITHIN_LIMIT or LIMIT_REACHED, indicating whether the account has reached its own limit.

Other field details to note:

  • An account with no limit displays limit: null and balance: null.
  • An account with no usage displays usage: 0.
  • A row that failed to update in the earlier batch request displays the account’s previous limit, or null if it had none.
  • A syntactically valid account ID with no recorded usage can return usage: 0. This does not confirm that the account exists.
  • 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.

To verify each account’s limit and usage, follow these steps.

  1. For every returned account, compare limit with the limit you sent.
  2. If an account’s limit update returned SUCCESS but its returned limit does not match the limit you sent, wait a few seconds, then send the verification request again. Limit changes can take a few seconds to appear in this response. If the limit still doesn’t match after a few tries, contact support.

For more examples and details, see the meters API documentation.

Rate this page: