Skip to main content

Get token count

get
/api/pvlt/1.0/data/collections/{collection}/count/tokens

Gets the number of tokens in a collection.

The role performing this operation must have at least one allowing policy and no denying policies for the stats operation.

See identity and access management for more information about how Vault uses policies to control access to data.

Request

Path parameters

  • collection - string required*

    The name of the collection containing the tokens.

Query parameters

  • adhoc_reason - string

    An ad-hoc reason for accessing the Vault data. Required when reason is set to Other.

  • reason - string required*

    Details of the reason for requesting the property. The default is set when no access reason is provided and PVAULT_SERVICE_FORCE_ACCESS_REASON is false.

  • custom_audit - string

    Custom audit information to be included in the audit log.

  • reload_cache - boolean

    Reloads the cache before the action.

Possible responses

The request is successful.

object required*
  • active - integer required*

    Number of active items.

  • archived - integer required*

    Number of archived items.

  • total - integer required*

    Number of total items.

Example
{
"active": 10,
"archived": 15,
"total": 25
}
Example
{
"active": 10,
"archived": 15,
"total": 25
}

Try the API

Authorization

Path parameters

Query parameters

Navigate to the docs of your local Vault installation to try the API directly from there.

Code examples

Example