Get monthly successful usage for the authenticated organization

GET
/api/usage

Returns the count of successfully processed pages and operations for a given month for the organization that owns the API key.

Behavior:

  • The organizationId is derived server-side from the authenticated API key. It cannot be passed as a query/body/header parameter.
  • When year and month are omitted, the current month is used. The year/month are computed in the server's runtime timezone to align with QuotaService, which writes counters using the same convention.
  • When the organization has no usage row for the requested month, the endpoint returns 0 for both counters.
  • This endpoint is not subject to quota enforcement. Calling it does not count as usage and is never blocked by 429/402.

Note on successful_conversions: this counter aggregates both conversions and identifications that completed successfully. The name mirrors the underlying OrganizationUsage.successfulConversions field.

Authorization

ApiKeyAuth
AuthorizationBearer <token>

Bearer token for API authentication

In: header

Query Parameters

year?integer

Year (must be sent together with month). Defaults to current year (server runtime timezone).

Range2020 <= value <= 2100
month?integer

Month 1–12 (must be sent together with year). Defaults to current month (server runtime timezone).

Range1 <= value <= 12

Response Body

application/json

application/json

application/json

curl -X GET "https://app.docutray.com/api/usage"
{
  "year": 2026,
  "month": 4,
  "successful_pages": 1234,
  "successful_conversions": 89
}
{
  "error": "Invalid month. Must be an integer between 1 and 12."
}
{
  "error": "Unauthorized"
}