Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Search Objects

POST/api/v2/ontologies/{ontology}/objects/{objectType}/search

Search for objects in the specified ontology and object type. The request body is used to filter objects based on the specified query. The supported queries are:

Query typeDescriptionSupported Types
ltThe provided property is less than the provided value.number, string, date, timestamp
gtThe provided property is greater than the provided value.number, string, date, timestamp
lteThe provided property is less than or equal to the provided value.number, string, date, timestamp
gteThe provided property is greater than or equal to the provided value.number, string, date, timestamp
eqThe provided property is exactly equal to the provided value.number, string, date, timestamp
isNullThe provided property is (or is not) null.all
containsThe provided property contains the provided value.array
notThe sub-query does not match.N/A (applied on a query)
andAll the sub-queries match.N/A (applied on queries)
orAt least one of the sub-queries match.N/A (applied on queries)
containsAllTermsInOrderPrefixLastTermThe provided property contains all the terms provided in order. The last term can be a partial prefix match.string
containsAllTermsInOrderThe provided property contains the provided term as a substring.string
containsAnyTermThe provided property contains at least one of the terms separated by whitespace.string
containsAllTermsThe provided property contains all the terms separated by whitespace.string
startsWithDeprecated alias for containsAllTermsInOrderPrefixLastTerm.string

Queries can be at most three levels deep. By default, terms are separated by whitespace or punctuation (?!,:;-[](){}'"~). Periods (.) on their own are ignored. Partial terms are not matched by terms filters except where explicitly noted.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:ontologies-read.

Path parameters

ontology
string

The API name of the ontology. To find the API name, use the List ontologies endpoint or check the Ontology Manager.

objectType
string

The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.

Query parameters

sdkPackageRid
string
optional

The package rid of the generated SDK.

sdkVersion
string
optional

The version of the generated SDK.

branch
string
optional

The Foundry branch to search objects from. If not specified, the default branch will be used.

Request body

SearchObjectsRequestV2
object
Hide child attributes

Hide child attributes

where
union
optional
Show child attributes

Show child attributes

orderBy
object
optional

Specifies the ordering of search results by a field and an ordering direction or by relevance if scores are required in a nearestNeighbors query. By default orderType is set to fields.

Show child attributes

Show child attributes

pageSize
integer
optional

The page size to use for the endpoint.

pageToken
string
optional

The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the nextPageToken field of the previous response and use it to populate the pageToken field of the next request.

select
list<PropertyApiName>
optional

The API names of the object type properties to include in the response.

Show child attributes

Show child attributes

excludeRid
boolean
optional

A flag to exclude the retrieval of the __rid property. Setting this to true may improve performance of this endpoint for object types in OSV2.

snapshot
boolean
optional

A flag to use snapshot consistency when paging. Setting this to true will give you a consistent view from before you start paging through the results, ensuring you do not get duplicate or missing items. Setting this to false will let new results enter as you page, but you may encounter duplicate or missing items. This defaults to false if not specified, which means you will always get the latest results.

Response body

SearchObjectsResponseV2
object

Success response.

Hide child attributes

Hide child attributes

data
list<OntologyObjectV2>
optional
Show child attributes

Show child attributes

nextPageToken
string
optional

The page token indicates where to start paging. This should be omitted from the first page's request. To fetch the next page, clients should take the value from the nextPageToken field of the previous response and use it to populate the pageToken field of the next request.

totalCount
string

The total number of items across all pages.

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ -H "Content-type: application/json" \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/ontologies/palantir/objects/employee/search?branch=ri.branch..branch.d827184f-ee0e-4351-8b70-efbe51e07252" \ -d '{"where":{"type":"eq","field":"age","value":21}}'

Response

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 { "data": [ { "__rid": "ri.phonograph2-objects.main.object.5b5dbc28-7f05-4e83-a33a-1e5b851ababb", "__primaryKey": 1000, "__apiName": "Employee", "employeeId": 1000, "lastName": "smith", "firstName": "john", "age": 21 } ] }