Validates whether the account can use the AI chat right now: whether the plan is active and whether it has tokens available in the current billing period. Intended to check the status before invoking POST /chat or POST /chat/stream, for example to disable the chat input in your UI when allowed is false.
This query does not consume AI tokens.
| Resource information | |
|---|---|
| Authentication | Required (API Token, Bearer) |
| Scope | mapaprop-chat-ai |
| HTTP Method | GET |
| Response | JSON |
| Version | 1 |
Resource URL
https://mapaprop.app/api/action/mapaprop-chat-ai-v1/validate
Parameters
No parameters. customerId is derived from the authentication token.
Sample code
GET /api/action/mapaprop-chat-ai-v1/validate HTTP/1.1
Host: mapaprop.app
Authorization: Bearer {access_token}
Response
| Object | Field | Type | Required | Description |
|---|---|---|---|---|
| Response | allowed | boolean | yes | true if a message can be sent to the chat right now (active plan and tokens available). |
| enabled | boolean | yes | true if the customer has AI chat active/subscribed, regardless of whether tokens remain. | |
| tokensUsed | int | yes | Tokens consumed in the current billing period. | |
| tokenLimit | int | yes | Token cap for the current period. | |
| tokensRemaining | int | yes | Tokens remaining (never negative). | |
| resetDate | string or null | no | Date on which the period's token counter resets. null if not applicable. | |
| message | string | no | Only present when there's no active AI subscription on the account (enabled: false). |
If the customer has their own AI API key configured ("Bring Your Own Key" / BYO) and that setting is active, allowed can be true even if tokensRemaining is 0 — in that case consumption doesn't come out of the Mapaprop token pool.
Sample response
{
"allowed": true,
"enabled": true,
"tokensUsed": 12450,
"tokenLimit": 100000,
"tokensRemaining": 87550,
"resetDate": "2026-09-01"
}
Example when there's no active AI subscription:
{
"allowed": false,
"enabled": false,
"tokensUsed": 0,
"tokenLimit": 0,
"tokensRemaining": 0,
"resetDate": null,
"message": "No active AI subscription"
}