Skip to main content

Delete objects (bulk)

delete
/api/pvlt/1.0/data/collections/{collection}/bulk/objects

Deletes objects from a collection. This operation is irreversible.

If any object delete fails, the operation fails and no objects are deleted.

The maximum number of objects that can be deleted in one operation is determined by the PVAULT_SERVICE_MAX_PAGE_SIZE environment variable.

The role performing this operation must have both of the following:

  • The CapDataWriter capability.
  • At least one allowing policy and no denying policies for the delete operation for each of the properties defined for the collection specified in the call.

See identity and access management for more information about how capabilities are used to control access to operations and policies are used to control access to data.

Request

Header parameters

  • X-Tenant-Id - array of strings

    List of tenant IDs to enforce on the request.

Path parameters

  • collection - string required*

    The name of a collection.

Query parameters

  • options - array of strings

    Options for the operation. Options include:

    • archived – whether to delete only archived objects. If not specified, deletes only active objects.
    Each string:
  • 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.

Request body

List of objects to delete. The order of the objects in the array is preserved in the response.

array of objects required*

List of objects to delete.

Each object:
  • id - string required*
Example
[
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
},
{
"id": "69861845-8405-430c-b8ef-7e646d153149"
}
]
Example
[
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
},
{
"id": "69861845-8405-430c-b8ef-7e646d153149"
}
]

Possible responses

The bulk operation is successful. This status doesn't indicate that the operation is successful for all objects. Check the response body for details of the status of each object.

object required*
  • ok - boolean required*

    Indicates whether the operation was completed successfully for all objects in the bulk operation. If the operation failed for one or more of the provided objects, this property will be set to false.

  • results - array of objects required*

    An array of objects representing the processing result of each item in the bulk operation. The order of the objects in the array will match the order of the objects in the request.

    Each object:

    A result object representing the processing result of a single object in the bulk operation. Each result object includes the following fields:

    • ok field is a boolean that indicates whether the operation completed successfully for the object.
    • id field is the unique identifier for the processed object. This field might be omitted if the operation failed before an id was assigned to the object.
    • error field is present when ok is false and provides more information about the error that occurred. The error field follows the same structure as the error objects returned in single object operations.
    • id - string

      The unique identifier for the object.

    • ok - boolean required*

      Indicates whether the operation was completed successfully for this object. If true, the operation completed successfully. If false, the operation failed and the error field will contain more information.

    • error - object
      • context - object required*

        The error context.

        Values of additional properties are strings
        Example
        {
        "objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
        }
      • error_code - string required*

        The error code.

      • message - string required*

        The error message.

Example
{
"ok": false,
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"ok": false,
"error": {
"context": {
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
},
"error_code": "PVxxxx",
"message": "The object is not found."
}
}
]
}

Try the API

Authorization

Path parameters

Query parameters

Headers

Request body

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

Code examples

Example