Use this tutorial to delete a limit for an account, and confirm that the account’s existing usage still counts.
You’ll work with the Rovo credits meter in this tutorial.
Deleting an active account’s limit removes its individual limit. It does not block the account, deactivate it, or remove access. An account that still has access can continue consuming credits, subject to the organization’s limit, if one is set, and Atlassian system limits.
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 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 |
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 delete a limit for an account with the operation:
DELETE /admin/v1/orgs/{orgId}/meters/{meterId}/limits/{accountId}
The API doesn’t identify which accounts have left your organization. Start with a trusted account ID, such as one from your offboarding list.
1 2 3 4 5curl --request DELETE \ --url "https://api.atlassian.com/admin/v1/orgs/{orgId}/meters/{meterId}/limits/{accountId}" \ --header "Authorization: Bearer <api_key>" \ --header "Accept: application/json"
{orgId}, {meterId}, {accountId}, and <api_key>.DELETE request.Use this table to interpret the response to your DELETE request.
| Response | Meaning | What to do |
|---|---|---|
204 | The limit was deleted. The response has no body. | Continue to Step 4 to confirm the account’s usage. |
400 with invalid-account | The account ID is malformed. | Check {accountId} and send the request again. |
400 with limits-not-supported | This meter does not support limits. | Check {meterId} and use a meter that supports limits. |
404 with limit-not-found | The account has no limit. A previous delete request might have succeeded, and this might be a safe retry. Either way, no limit remains. | Continue to Step 4 to confirm the account’s usage. |
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. The deletion might still have succeeded. | Wait a short time before retrying. A 404 with limit-not-found on retry means no limit remains. |
You can read the account’s usage 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.The response contains a data object. For example:
1 2 3 4 5 6 7 8 9 10{ "data": { "accountId": "5b10ac8d82e05b22cc7d4ef5", "limit": null, "usage": 250, "balance": null, "usageState": "WITHIN_LIMIT" } }
Check that limit and balance are null. If the previous limit still appears, wait a few seconds and send the GET request again. The successful DELETE response confirms the deletion.
The GET request you just ran doesn't check whether the account exists. A correctly formatted account ID that doesn't belong to an existing account still returns usage: 0, limit: null, and balance: null. These values alone do not confirm that the account exists or that a limit was deleted.
Any usage from the current cycle still appears because it counts against the organization’s allowance and billing.
For more examples and details, see the meters API documentation.
Rate this page: