List workspace rate limits
/v1/workspace/rate-limits// Workspace limits matter with several workspaces, or one that kept a limit after a deletion.
const { data } = await bird.workspace.rateLimits.list();
for (const policy of data) {
// Check usage.status first: workspace_remaining is also null when the
// workspace has no limit of its own or its usage is not measured yet.
console.log(policy.key, policy.limit, policy.usage.workspace_remaining);
}# Workspace limits matter with several workspaces, or one that kept a limit after a deletion.
limits = client.workspace.rate_limits.list()
for policy in limits.data:
# Check usage.status first: workspace_remaining is also None when the
# workspace has no limit of its own or its usage is not measured yet.
print(policy.key, policy.limit, policy.usage.workspace_remaining)// Workspace limits matter with several workspaces, or one that kept a limit after a deletion.
limits, err := client.Workspace.RateLimits.List(context.Background())
if err != nil {
log.Fatal(err)
}
for _, policy := range limits.Data {
fmt.Println(policy.Key, policy.Limit, policy.OrganizationLimit)
}// Workspace limits matter with several workspaces, or one that kept a limit after a deletion.
$limits = $bird->workspace->rateLimits->list();
foreach ($limits->getData() ?? [] as $policy) {
echo $policy->getKey() . ' ' . $policy->getLimit() . PHP_EOL;
}bird workspace rate-limits listcurl -X GET "https://us1.platform.bird.com/v1/workspace/rate-limits" \
-H "Authorization: Bearer $TOKEN"{
"data": [
{
"key": "email_send",
"workspace_limit": {
"status": "active"
},
"limit_source": "manual",
"attribution": {
"status": "unavailable"
},
"usage": {
"status": "available"
}
}
]
}
Only relevant to organizations with several workspaces, or one left with a workspace limit or enabled allocation after a deletion. When deleting workspaces leaves one, its manual limits apply until removed or expired, and enabled allocation continues. Without an active manual limit or allocation, one workspace uses the shared organization limit.
Returns every rate-limit policy as it applies to the current workspace: the organization limit shared by all workspaces, any manual or automatic workspace limit, and the remaining capacity observed in the current window.
A workspace limit is not reserved capacity. A request is refused when either the organization
limit or the workspace limit is reached. When usage cannot be read, usage.status is unavailable and
the remaining counts are null. usage.workspace_remaining is also null when neither a manual nor
an automatic limit applies, or attribution.status is not ready, so check usage.status before treating null
as a failed read.
Rate limits are served from the organization's home region. A request sent to another region returns 421 Misdirected Request; retry it on that region's host.
Carga de respuesta
dataRecursos relacionados
Continúa con la documentación, guías y ejemplos de este tema.