Skip to main content

Delete objects and tokens

post
/api/pvlt/1.0/system/admin/lifecycle/gc

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

note

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.

Request

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

    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.

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.

Example
[
{
"collection_name": "Tokens",
"collection_type": "TOKENS",
"count": 634
}
]

Try the API

Authorization

Query parameters

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

Code examples

Example