Search objects
Returns a paginated list of objects, with property values, from a collection that satisfies a query.
You can read more about full-match searches in the Search pbjects guide and about substring searches in the Substring search objects guide.
The role performing this operation must have all the following:
- The
CapDataSearcher
capability. - Policies:
- At least one allowing policy and no denying policies for the
read
operation for each of the collection properties specified in theprops
query parameter. - At least one allowing policy and no denying policies for the
search
operation for each of the collection properties specified in thequery
body parameter.
- At least one allowing policy and no denying policies for the
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.
Warning: Use of the unsafe
option, to include all object property values, may expose more private information than is required, use with caution..
Request
Header parameters
X-Trans-Param
- stringExtra parameter to pass on to the transformers.
X-Tenant-Id
- array of stringsList of tenant IDs to enforce on the request.
Path parameters
collection
- string required*The name of a collection.
Query parameters
adhoc_reason
- stringAn ad-hoc reason for accessing the Vault data. Required when
reason
is set toOther
.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
- stringCustom audit information to be included in the audit log.
reload_cache
- booleanReloads the cache before the action.
page_size
- integerThe maximum number of items to return in this request. If not specified, the default value is used. The default value is specified in the
PVAULT_SERVICE_DEFAULT_PAGE_SIZE
environment variable. Must not exceed the value specified in thePVAULT_SERVICE_MAX_PAGE_SIZE
environment variable.cursor
- stringThe cursor represents the state of consecutive queries for the same request parameters. In the first call, the cursor may be omitted or specified as an empty string. In consecutive calls, it should be set to the value of the cursor field of the objectFieldsPage returned by the previous call. Note: when the
id
is specified, paging is not supported. In this case, if the number ofid
values specified exceeds the maximum page size, the method returns 400 (BAD REQUEST).options
- array of stringsOptions for the operation. Options include:
archived
– whether to search only archived objects. If not specified, search only active objects.show_builtins
– show built-in properties, can only be specified withunsafe
.unsafe
– fetch all the properties, cannot be specified withprops
.
props
- array of stringsThe list of property names and transformations. To include multiple names and transformations, provide a comma-separated list. For example,
Each string:props=first_name,last_name,email.mask
.The name of a property or a transformation in the format
<property-name>.<transformer-name>
.
Request body
This is a JSON object consisting of maps in which the keys are property names.
The in
map maps a property name to an array of possible values for that property.
The match
map maps a property name to the required value for that property.
The like
map maps a property name to a search pattern that the property value should match.
An object matches the query if the object meets the requirements of both maps.
For example:
{
"in": {
"email": ["john@work.com", "john@home.com"],
},
"match": {
"first_name": "John",
"last_name": "Doe"
}
}
is equivalent to:
WHERE first_name = 'John' AND last_name='Doe' AND email IN ('john@work.com', 'john@home.com')
Another example:
{
"like": {
"email": "*john*",
},
"match": {
"region": "US"
}
}
is equivalent to:
WHERE email LIKE '%john%' AND region = 'US'
- application/json
A query is a map of operators to match against the properties of an object.
Multiple operators can be combined in a single query.
in
- objectThe
in
query operator allows you to match a property value against a list of values.Each key in the map is a property name, and the value is a list of values to match.
The SQL equivalent of this query is:
Values of additional properties are arrays of any typeSELECT * FROM objects WHERE property1 IN (value1, value2) AND property2 IN (value1, value2);
Each item:A value to match. Must be of the same type as the property.
match
- objectThe
match
query operator allows you to match a property value against a specific value.Each key in the map is a property name, and the value is the value to match.
The SQL equivalent of this query is:
Values of additional properties are any typeSELECT * FROM objects WHERE property1 = value1 AND property2 = value2;
A value to match. Must be of the same type as the property.
like
- objectThe
like
query operator allows you to match a property value against a search pattern.Each key in the map is a property name, and the value is the pattern to match.
The SQL equivalent of this query is:
Values of additional properties are any typeSELECT * FROM objects WHERE property1 LIKE pattern1 AND property2 LIKE pattern2;
A pattern to match. Must be of the same type as the property.
{
"in": {
"first_name": [
"Pat"
]
},
"match": {
"date_of_birth": "1993-02-22"
}
}
Possible responses
- 200
- 400
- 401
- 403
- 404
- 405
- 409
- 410
- 500
- 503
The request is successful.
- application/json
results
- array of objects required*A page of objects.
Each object:A list of maps of object properties and their values.
Example{
"date_of_birth": "1993-02-22",
"email": "patfar@example.com",
"first_name": "Pat",
"last_name": "Far",
"phone_number": "+11011010101"
}paging
- object required*Pagination information.
size
- integer required*Number of results in the current page.
remaining_count
- integer required*The remaining number of objects that can be read in ensuing calls to this method.
cursor
- string required*An opaque string you should provide to get the next page.
{
"results": [
{
"date_of_birth": "1993-02-22",
"email": "patfar@example.com",
"first_name": "Pat",
"last_name": "Far",
"phone_number": "+11011010101"
}
],
"paging": {
"size": 0,
"remaining_count": 0,
"cursor": "string"
}
}
The request is invalid.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1001",
"message": "The access reason is missing.",
"context": {
"reason": null
}
}
Authentication credentials are incorrect or missing.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1005",
"message": "The request is unauthorized.",
"context": {}
}
The caller doesn't have the required access rights.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1007",
"message": "The operation is forbidden due to missing capabilities.",
"context": {
"username": "WebServer"
}
}
The collection or properties is not found.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"context": {
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
},
"error_code": "PVxxxx",
"message": "The object is not found.",
"error_url": "https://docs.piiano.com/api/error-codes#PV1005"
}
The operation is not allowed.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1026",
"message": "The operation is not allowed in in-memory mode.",
"context": {}
}
A conflict occurs.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV3218",
"message": "Concurrent conflicting updates to the same object.",
"context": {}
}
Access to a resource that is no longer available occurs.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1033",
"message": "The resource is gone.",
"context": {}
}
An error occurs on the server.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1000",
"message": "Something went wrong",
"context": {}
}
The service is unavailable.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1009",
"message": "The operation timed out on the server.",
"context": {}
}
Path parameters
Query parameters
Headers
Request body
Code examples