usage

Licence-enforced consumption for an account

Changed on

Units an account consumed over a window: the number its licence allowance is enforced against, summed over every workspace of the account.

Authenticate with an API key of any workspace in the account, or a bearer token of a member with permission to read the account's billing information. Any other account answers 403.

Counted in whole UTC days. Days before the counter began (counted_from) count as zero. A window that ends after today answers 503 rather than a smaller number, and so does any failure to read the count: a 200 is never a stand-in for a count that could not be read.

breakdown=day adds days, the quantity for every UTC day in the window (at most 366 days), for charting; weeks and months roll up from it.

split=strategy adds strategies: the pages by processing strategy (fast, hi_res, vlm), with other for every other kind of page and unattributed for pages counted before the split began (strategies_counted_from) or asserted as an opening balance. The five always sum to the quantity they split. The split is informational: the licence counts every page as one, whatever its strategy.

Call this endpoint at most 15 times per minute for each authenticated identity.

get/api/v1/accounts/{account_id}/consumed

Request

  • Base URL
    https://platform.unstructuredapp.io
  • URL
    https://platform.unstructuredapp.io/api/v1/accounts/{account_id}/consumed
  • Auth
    none declared

Path parameters

account_idinteger required

Query parameters

unitstring required

Unit to count. Today only pages.

startstring date-time required

Start of the window, RFC 3339. Counted in whole UTC days: the day containing start counts in full.

endstring date-time required

End of the window, RFC 3339. Counted in whole UTC days: the day containing end counts in full, unless end is exactly midnight UTC, which ends the window with the previous day.

breakdown'day' nullable

day adds days: the quantity for every UTC day in the window, at most 366 days.

split'strategy' nullable

strategy adds strategies to the total, and to each of days: pages by processing strategy (fast, hi_res, vlm, other, unattributed), summing to the quantity they split. Informational: every page counts as one against the licence.

Headers

unstructured-api-keystring nullable

Response

Successful Response

account_idinteger required

The account the quantity was counted for.

unitstring required

Unit of quantity. Today only pages.

quantityinteger required

Units consumed by every workspace of the account over the requested window, counted in whole UTC days as the start and end parameters describe.

counted_fromstring date-time required

When the counter began counting. Days before it count as zero: a rack's counter starts with its fresh database.

counted_throughstring date-time required

When the counter last recorded usage. Informational.

sourcestring required

Which counter produced the quantity.

strategies_counted_fromstring date-time nullable

Only with split=strategy: from here on every counted page is in the split; pages before it may be unattributed. Left out if the split never started.

Changes

    • info

      added the new optional query request parameter split

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      endpoint added