usage.rate_limit
The usage.rate_limit command is used to get API rate limit statistics for a thing, user, or org.
The statistics consist of the API rate limit in calls per second as well as the number of calls in the latest one second period if a session id is passed to the command.
Passing in an orgId requires Super Ops rights.
Usage can be requested either with no parameters, or one by specifying one of the following:
-
A sessionId for a user or thing, or
-
An orgId
TR50 Request
// No parameters
{
"cmd": {
"command": "usage.rate_limit"
}
}
// Query by session Id
{
"cmd": {
"command": "usage.rate_limit",
"params": {
"sessionId": "56f2db4d486b344870306443"
}
}
}
// Query by org Id
{
"cmd": {
"command": "usage.rate_limit",
"params": {
"orgId": "534c36e53100460721000051"
}
}
}
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
sessionId |
String |
|
The Id of the session (its org or org profile) to acquire API rate limit info for. |
orgId |
String |
|
The Id of the org to acquire API rate limit info for. |
TR50 Response
If the command is sent successfully a success message and the statistics are returned. Otherwise, an error and error message will be returned.
{
"1": {
"success": true,
"params": {
"apiRateLimit": 99,
"commandCounterValue": 1
}
}
}
Response Parameters
Name |
Type |
Description |
---|---|---|
apiRateLimit |
Integer |
If set, the API rate limit in calls per second for the appropriate org. If not set, the org's org profile is checked for its API rate limit. |
commandCounterValue |
Integer |
Only returned if a session id is passed to the command and represents the number of API calls in the last one second time period. |