Service API: quotas
info
- We're assuming your API key is set in the environment variable
$KEYwith the necessary permissions. - The
quotasendpoint requires a key with quotas scope and read access, otherwise the API returns403 Forbidden.
A quota caps how many times your Organization can perform a given operation, such as creating blocklists or integrations, or querying the CTI. Limits depend on your plan; this endpoint is read-only and reports each limit together with its current usage.
Get Quotasโ
Get the quotas of your Organization and their current usage
cURL
Python
SH
curl -i -H "x-api-key: ${KEY}" -X GET -H "Content-Type: application/json" \
https://admin.api.crowdsec.net/v1/quotas
PY
import os
KEY = os.getenv('KEY')
from crowdsec_service_api import (
Quotas,
Server,
ApiKeyAuth,
)
from httpx import HTTPStatusError
auth = ApiKeyAuth(api_key=KEY)
client = Quotas(base_url=Server.production_server.value, auth=auth)
try:
response = client.get_quotas()
print(response.model_dump_json())
except HTTPStatusError as e:
print(f"An error occurred: {e.response.status_code} - {e.response.text}")
The response has two parts:
itemsholds one entry per operation, with itsusage, itslimitand whether it isunlimited. An unlimited quota has alimitof-1.ctisummarizes the CTI IP lookups of the current period:quota_typeisfree_quotaorpaid_quota, andlimitis absent when the quota is unlimited.
operation | Counts |
|---|---|
blocklists_create | blocklists created by your Organization |
allowlists_create | allowlists created by your Organization |
blocklists_subscriptions_free | subscriptions to free blocklists |
blocklists_subscriptions_premium | subscriptions to premium blocklists |
blocklists_subscriptions_platinum | subscriptions to platinum blocklists |
keys_create | API keys created |
integrations_create | integrations created |
cves_subscriptions | CVE subscriptions |
fingerprints_subscriptions | fingerprint subscriptions |
vendors_subscriptions | vendor subscriptions |
aia_ips_observed | IPs monitored by your Am I Attacking configurations |
cti_read_ip | CTI IP lookups in the current period |
answer on success
JSON
{
"items": [
{
"operation": "blocklists_create",
"usage": 0,
"limit": 0,
"unlimited": false
},
{
"operation": "cti_read_ip",
"usage": 0,
"limit": 0,
"unlimited": false
}
],
"cti": {
"quota_type": "free_quota",
"limit": 0,
"unlimited": false,
"usage": 0
}
}