Skip to main content

List all objects

Learn how to list all personal data objects

You can obtain a list of all objects in a collection, returning all or a subset of their values. You can also request transformations of values, where available.

You can use the unsafe option to get all the values of the objects (which is not recommended). Using unsafe can be combined with the show_builtins option to include the built-in properties.

Whether your request for all objects succeeds depends on the permissions you've been granted as part of the Vault’s identity and access management settings.

Get some properties of all objects in a collection

Overview

To get a list of all object from a collection you:

  1. Determine which object property values you want returned.
  2. Use the CLI list all objects command or the REST API get objects operation passing the property or properties and the collection name.

Step-by-step

You want to retrieve name and email for all the buyers in the buyers collection you created in Create a collection.

You list the objects using the CLI like this:

pvault object list --props first_name,email --collection buyers

You get a response similar to this:

Displaying 10 results.
+-----------------------------+------------+
| email | first_name |
+-----------------------------+------------+
| Ranom_Davis@gmail.com | Ranom |
| Kiana.Strosinll98@yahoo.com | Kiana |
| Jeffry_Wehner9756@yahoo.com | Jeffry |
| Ardith.Reichel9@gmail.com | Ardith |
| Lincoln9@yahoo.com | Lincoln |
| Destiney65@hotmail.com | Destiney |
| Quentin_Ferry@hotmail.com | Moni |
| Erica_Jerde@gmail.com | Erica |
| Arvid_Pagac20@hotmail.com | Arvid |
| john1234@gmail.com | John |
+-----------------------------+------------+

The response is paginated. See CLI pagination for more information about working with paginated responses.

Or using the REST API like this:

curl -s -X GET \
--url 'http://localhost:8123/api/pvlt/1.0/data/collections/buyers/objects?props=first_name,email&reason=AppFunctionality' \
-H 'Authorization: Bearer pvaultauth' \
-H 'Content-Type: application/json'

You get a response similar to this:

{
"results": [
{
"email": "Ranom_Davis@gmail.com",
"first_name": "Ranom"
},
{
"email": "Kiana.Strosinll98@yahoo.com",
"first_name": "Kiana"
},
{
"email": "Jeffry_Wehner9756@yahoo.com",
"first_name": "Jeffry"
},
{
"email": "Ardith.Reichel9@gmail.com",
"first_name": "Ardith"
},
{
"email": "Lincoln9@yahoo.com",
"first_name": "Lincoln"
},
{
"email": "Destiney65@hotmail.com",
"first_name": "Destiney"
},
{
"email": "Quentin_Ferry@hotmail.com",
"first_name": "Moni"
},
{
"email": "Erica_Jerde@gmail.com",
"first_name": "Erica"
},
{
"email": "Arvid_Pagac20@hotmail.com",
"first_name": "Arvid"
},
{
"email": "john1234@gmail.com",
"first_name": "John"
}
],
"paging": {
"size": 10,
"remaining_count": 0,
"cursor": ""
}
}

The response is paginated. See API pagination for more information about working with paginated responses.

Get transformed properties for all objects in a collection

Overview

Data types can have transformations. Several built-in translations are provided with Vault. For example, there is a transformation for the email data type that returns a masked email address similar to this ‘j**********@gmail.com’.

To get transformed values for all the objects in a collection you:

  1. Determine which transformed property values you want from each object.
  2. Use the CLI list all objects command or the REST API get objects operation passing the IDs of the objects, the transformed properties, and collection name.

Step-by-step

You want to retrieve the name and transformed email of all buyers in the buyers collection you created in Create a collection.

First, you determine the name of the transformation for email values.

Once you've determined the transformation name for the object property you want to retrieve, define the transformed property by appending the mask name to the property name using dot annotation. For example, for your transformed email address, you use email.mask.

You now retrieve the values and transformed values using the CLI like this:

pvault object list --props first_name,email.mask --collection buyers

You get a response similar to this:

Displaying 10 results.
+-----------------------------+------------+
| email.mask | first_name |
+-----------------------------+------------+
| R**********@gmail.com | Ranom |
| K****************@yahoo.com | Kiana |
| J****************@yahoo.com | Jeffry |
| A**************@gmail.com | Ardith |
| L*******@yahoo.com | Lincoln |
| D*********@hotmail.com | Destiney |
| Q************@hotmail.com | Moni |
| E**********@gmail.com | Erica |
| A************@hotmail.com | Arvid |
| j*******@gmail.com | John |
+-----------------------------+------------+

The response is paginated. See CLI pagination for more information about working with paginated responses.

Or using the REST API like this:

curl -s -X GET \
--url 'http://localhost:8123/api/pvlt/1.0/data/collections/buyers/objects?props=first_name,email.mask&reason=AppFunctionality' \
-H 'Authorization: Bearer pvaultauth' \
-H 'Content-Type: application/json'

You get a response similar to this:

{
"results": [
{
"email.mask": "R**********@gmail.com",
"first_name": "Ranom"
},
{
"email.mask": "K****************@yahoo.com",
"first_name": "Kiana"
},
{
"email.mask": "J****************@yahoo.com",
"first_name": "Jeffry"
},
{
"email.mask": "A**************@gmail.com",
"first_name": "Ardith"
},
{
"email.mask": "L*******@yahoo.com",
"first_name": "Lincoln"
},
{
"email.mask": "D*********@hotmail.com",
"first_name": "Destiney"
},
{
"email.mask": "Q************@hotmail.com",
"first_name": "Moni"
},
{
"email.mask": "E**********@gmail.com",
"first_name": "Erica"
},
{
"email.mask": "A************@hotmail.com",
"first_name": "Arvid"
},
{
"email.mask": "j*******@gmail.com",
"first_name": "John"
}
],
"paging": {
"size": 10,
"remaining_count": 0,
"cursor": ""
}
}

The response is paginated. See API pagination for more information about working with paginated responses.