Skip to main content

Delete objects and tokens


Deletes objects and tokens that have been archived for longer than the retention period and token transaction IDs with no associated tokens.


This operation deletes a maximum of 10,000 items. To delete all items, repeat calls until the count of deleted items reaches zero. Using the prune job, rather than calling the API, is recommended.

For ad-hoc deletion of archived records, use the Delete objects and tokens CLI command, which deletes all relevant items.

See Object life cycle for more information on how objects and tokens are archived and how deletion is affected by the retention period.


Query parameters

  • filter - string

    Whether to delete objects, tokens, or token transaction IDs with no associated tokens. Options are:

    • objects_only – delete only objects.
    • tokens_only – delete only tokens.
    • transaction_ids_only – delete only token transaction IDs with no associated tokens.
  • dry_run - boolean

    Whether to respond with how many objects and tokens are available for deletion, without deleting them.

  • 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.

  • reload_cache - boolean

    Reloads the cache before the action.

Possible responses

The request is successful.

array of objects required*
Each object:
  • collection_name - string required*

    The name of the collection containing the objects or tokens to delete.

  • collection_type - string required*

    The type of the collection.

  • count - integer required*

    The number of items deleted.

"collection_name": "Tokens",
"collection_type": "TOKENS",
"count": 634

Try the API


Query parameters

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

Code examples