Saltar al contingut principal
GET

Consultar ús de l'API (token d'automatització)

Scope:developers:usage.read
https://api.holded.com/api/v2/usage

Retorna l'ús de l'API del mes en curs per al tipus automation_token.

Petició

python
import requests

url = "https://api.holded.com/api/v2/usage"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

response = requests.get(url, headers=headers)
print(response.json())

Respostes

Resposta

json
{
  "type": "automation_token",
  "period": "2026-04",
  "usage": 12450,
  "limit": 25000,
  "count": 1,
  "secondary_usages": "{\"api_sales_invoices_list\": 150}",
  "user_usages": "{\"abc123\": 1500}",
  "next_plan": "company_basic",
  "next_limit": 300000
}

Respostes exitoses

200Ús de l'API del mes en cursapplication/json
object
typestringrequired

Usage type identifier

periodstringrequired

Period in YYYY-MM format

usageintegerrequired

Total API calls in this period

limitintegerrequired

Maximum allowed calls for this period

countintegerrequired

Number of usage records aggregated

secondary_usagesobjectrequired

Breakdown by API endpoint type

user_usagesobjectrequired

Token usage aggregated by user id

next_planstring | nullrequired

Next plan with a higher limit, null if already at the top tier

next_limitinteger | nullrequired

Base plan limit for next_plan, null when next_plan is null

Respostes d'error

401API key no vàlida o no proporcionadaapplication/json
403Permisos insuficientsapplication/json
429Límit de sol·licituds exceditapplication/json