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 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
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. The member who owns the key must have the permission above.
inboxIdis 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.quotaIdis theidreturned when you create a quota, not the inbox ID.
Choose an Endpoint
Append each path below to the platform URL, such as https://api.maiagent.ai for SaaS.
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.
Allocate a Quota
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:
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
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
Send a PATCH request to the single-quota path, including only the fields you want to change, for example:
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 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:
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.
Last updated
Was this helpful?