> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/tech/en/api-integration/endpoint-behaviors/inbox-credit-quota-api.md).

# Conversation Platform Credits Quota API

Use the API to allocate inbox Credits quotas, adjust budgets, and toggle the quota requirement. Learn how inbox IDs differ from quota IDs and what happens when you deactivate a quota.

Integrated systems can allocate Credits spending limits to inboxes such as Web Chat and LINE, and control whether each inbox requires a quota to use AI. This provides budget control at the inbox level. For administration steps and the experience when a quota runs out, see [Inbox Credits Quota Management](https://docs.maiagent.ai/others/credits/inbox-credit-quota) in the user manual.

For example, a website provider creates a separate Web Chat for each campaign and wants to allocate campaign budgets through its own management system. The system first looks up the campaign's inbox ID, then creates a quota and retrieves it for verification. If the campaign is canceled, an administrator can deactivate the quota or turn off the quota requirement. These actions have different effects.

## Before You Call <a href="#prerequisites" id="prerequisites"></a>

* These APIs apply to organizations billed in Credits. The caller needs the organization's **Credit management permission**, including for read operations.
* Use the API Key authentication described in [API Conventions](https://docs.maiagent.ai/tech/en/api-integration/api-conventions.md#authentication). The member who owns the key must have the permission above.
* `inboxId` is the **inbox ID**, not the Agent ID. Different entry points for the same Agent may be separate inboxes. The quota controls on this page do not apply to MaiGPT inboxes.
* `quotaId` is the `id` returned when you create a quota, not the inbox ID.

## Choose an Endpoint <a href="#endpoints" id="endpoints"></a>

Append each path below to the platform URL, such as `https://api.maiagent.ai` for SaaS.

| Purpose                                             | Method and Path                                                                                      |
| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Query an organization's inboxes and quota summaries | `GET /api/v1/organizations/{organizationId}/credit-quota-inboxes/`                                   |
| List quota records for an inbox                     | `GET /api/v1/inboxes/{inboxId}/credit-quotas/`                                                       |
| Allocate a quota                                    | `POST /api/v1/inboxes/{inboxId}/credit-quotas/`                                                      |
| Retrieve a single quota                             | `GET /api/v1/inboxes/{inboxId}/credit-quotas/{quotaId}/`                                             |
| Update an active quota                              | `PATCH /api/v1/inboxes/{inboxId}/credit-quotas/{quotaId}/`                                           |
| Deactivate a quota                                  | `DELETE /api/v1/inboxes/{inboxId}/credit-quotas/{quotaId}/`                                          |
| Toggle the quota requirement                        | `PATCH /api/v1/organizations/{organizationId}/credit-quota-inboxes/{inboxId}/credit-quota-required/` |

The organization's inbox list excludes MaiGPT. Use `search` to search by inbox name, Agent name, or inbox ID. Follow the pagination information in the response to retrieve all the data you need.

{% hint style="info" %}
JSON fields use camelCase. Quota lists and details return fields such as `quotaLimit`, `consumedAmount`, `remaining`, and `isActive`. Do not treat consumed quota as the organization's wallet balance.
{% endhint %}

## Allocate a Quota <a href="#allocate-quota" id="allocate-quota"></a>

Send a `POST` request to the inbox's `credit-quotas/` path. The following is an example request body; replace the start time with your actual campaign time:

```json
{
  "quotaLimit": "500.000000",
  "validFrom": "2026-11-01T00:00:00+08:00",
  "validUntil": null,
  "resetPeriod": "none",
  "note": "Campaign customer service budget"
}
```

| Field         | Requirements When Creating a Quota                                                                                                                                                                                                       |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `quotaLimit`  | Required. The quota limit must be at least 0, with up to 18 digits in total, including up to 6 decimal places                                                                                                                            |
| `validFrom`   | Required. The start time; the example uses an ISO 8601 timestamp with a time zone                                                                                                                                                        |
| `validUntil`  | Optional. The expiration time; omit it or use `null` for no expiration. If provided, it must be later than the start time. If the organization has valid credited funds, it must not exceed the latest expiration date among those funds |
| `resetPeriod` | Optional. One of `none`, `daily`, `weekly`, or `monthly`; defaults to `none`. For reset behavior, see [Set a Reset Period](https://docs.maiagent.ai/others/credits/member-credit-quota#quota-reset-period)                               |
| `note`        | Optional. A note; defaults to an empty string                                                                                                                                                                                            |

A successful creation returns `201` and the quota data. Save the returned quota `id`, then retrieve the single quota with `GET` to verify it. Creating a quota also automatically turns on the quota requirement for that inbox.

An inbox cannot have two active quotas at the same time. If an active quota already exists, update it with `PATCH`, or deactivate the old quota before allocating a new one. Do not repeatedly resend creation requests.

## Adjust an Existing Quota <a href="#update-quota" id="update-quota"></a>

Send a `PATCH` request to the single-quota path, including only the fields you want to change, for example:

```json
{
  "quotaLimit": "800.000000",
  "note": "Campaign extended; budget increased"
}
```

You can adjust `quotaLimit`, `validUntil`, `note`, and `resetPeriod`. This endpoint cannot change the start time, and deactivated quotas cannot be updated. When lowering a quota, the limit must not fall below the amount already consumed.

## Deactivating a Quota vs. Removing the Requirement <a href="#deactivate-vs-remove-requirement" id="deactivate-vs-remove-requirement"></a>

A successful `DELETE` on a single quota returns `204`, indicating that the **quota is deactivated**. It does not delete the quota record or turn off the quota requirement. If the inbox still requires a quota, deactivation leaves it without a valid quota, which restricts AI replies.

To **remove the inbox quota requirement**, send the following to the `credit-quota-required/` path above:

```json
{
  "creditQuotaRequired": false
}
```

This turns off the quota requirement and also deactivates any existing active quota. Conversely, sending `true` only turns on the quota requirement; it does not automatically allocate a new quota. A successful toggle returns `200` and the updated inbox quota summary. Check `creditQuotaRequired`, then retrieve the single quota to confirm its status.

{% hint style="warning" %}
Removing the inbox quota requirement does not replenish the organization's wallet or remove other applicable quota limits. For the full hierarchy of controls, see [How the Three Quota Layers Work Together](https://docs.maiagent.ai/others/credits/inbox-credit-quota#quota-layers) in the user manual.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/tech/en/api-integration/endpoint-behaviors/inbox-credit-quota-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
