GetLimitInfo
Retrieves API call limit information for a Xero tenant. It helps you monitor and manage your API usage to ensure compliance with rate limits.
Procedure-Specific Information
This procedure reports information that the driver caches after each API request. If no requests have been made to a tenant on a connection than this procedure will report 0 rows. Otherwise, the LastModified field reports the last time the information in the row was updated.
If the last modified time is too long ago for your application to use, then this table may be refreshed by executing a query.
The query must read at least one row to ensure that an API request is triggered:
SELECT * FROM Organisation LIMIT 1
Result Set Columns
| Name | Type | Description |
| TenantId | String | The unique identifier of the tenant that the API usage limits apply to. This field contains a row for each tenant queried during the connection, though typically there will only be one row if a single tenant is queried. |
| AppRemaining | Integer | The number of remaining API calls available for the current OAuth app in the current minute, with a maximum limit of 10,000 calls. This limit is shared across all tenants accessed by the app, indicating the app's overall usage capacity. |
| MinuteRemaining | Integer | The number of remaining API calls available for the current OAuth app in the current minute, with a maximum limit of 60 calls. This limit is specific to the current tenant being queried, tracking the number of calls available for that particular tenant in the current minute. |
| DayRemaining | Integer | The number of remaining API calls available for the current OAuth app today, with a maximum limit of 5,000 calls. This limit is specific to the current tenant being queried and tracks the total number of calls available for that tenant throughout the day. |
| RetryAfter | Integer | The recommended time to wait before making another API call, provided when one of the above limits (for example, 'MinuteRemaining', 'DayRemaining') reaches zero during the most recent API call to the tenant. This is used to avoid hitting rate limits. |
| LastModified | Datetime | The timestamp of when the API usage limits information was last updated. This value is updated when performing API calls and may not reflect real-time data, as the values are only refreshed with each API interaction. |