---
title: "Browse accross resource or relationship collections in the data partition"
method: POST
path: "/partitions/{partitionKey}/v1/browse"
tags: ["Browse"]
---

# Browse accross resource or relationship collections in the data partition

`POST /partitions/{partitionKey}/v1/browse`

## Request

- Base URL: `https://.clinia.cloud`
- URL: `https://.clinia.cloud/partitions/{partitionKey}/v1/browse`
- Auth: API key in header `X-Clinia-API-Key`

Browse across resource or relationship collections in the data partition.
This endpoint only accept federated search paths, which means that when using an operator it expects the collection type and collection key to be specified in the path.
For example, `resources.<collectionKey>.<propertyKey>`.

In order to initiate a browse session, you can specifiy in the body the `v1BrowseParameters` object with the following properties:
- `filter`: A filter to apply to the browse session. Can contain any valid search operators (all except KNN).
- `perPage`: The number of results to return per batch. Defaults to 100.

Once the browse session is initiated, you can use the `cursor` returned in the response to continue browsing through the results.
The `cursor` is a string that keeps track of the current position in the browse session and can be used to fetch the next batch of results.

A browse session lives for 5 minutes, after which it will be automatically closed and a 404 error will be returned if you try to continue browsing.
The session is a rolling session, meanining that each new request will extend the session by 5 minutes from the time of the request.

A browse response contains the following properties:
- `hits`: An array of results that match the browse session.
- `meta`: An object containing metadata about the browse session, including the `cursor` and the total number of results available in the browse session.

You should use the `hits` length to check if there are more results to browse.
If `hits > 0` is true, you can use the `meta.cursor` to fetch the next batch of results.
If `hits > 0` is false, it means that you have reached the end of the browse session and there are no more results to browse.

## Path parameters

- `partitionKey` string, required

## Request body

- V1BrowseRequest
  - `collectionKeys` string[], required: The collection keys to which the browse session applies.
  - `params` V1BrowseParameters, required: Parameters to initiate a browse session. This object can contain a filter, a sort, and the number of results to return per page. The `perPage` property specifies the number of results to return per page, with a default value of 100 and a maximum of 1000.
    - `cursor` string: The cursor to continue browsing from. If not provided, the browse session will start from the beginning by applying the params.
    - `filter` union
      - object
        - `id` string
        - `and` V1Operator[], required
      - object
        - `id` string
        - `or` V1Operator[], required
      - object
        - `id` string
        - `all` object, required
      - object
        - `id` string
        - `any` object, required
      - object
        - `id` string
        - `composite` object, required
      - object
        - `id` string
        - `eq` object, required
      - object
        - `id` string
        - `knn` object, required
      - object
        - `id` string
        - `geoDistance` object, required
      - object
        - `id` string
        - `gt` object, required
      - object
        - `id` string
        - `lt` object, required
      - object
        - `id` string
        - `match` object, required
      - object
        - `id` string
        - `not` V1Operator, required (recursive)
    - `properties` V1PropertiesSelector: Properties selector allows to specify which properties should be included or excluded in the search response. System properties are always included and cannot be excluded.
      - `include` string[]: The properties to include in the search response. System properties are included by default.
      - `exclude` string[]: The properties to exclude from the search response. System properties are not allowed to be excluded.
    - `perPage` integer: The number of results to return per page. Defaults to 100.

## Response `200`

A successful response containting the first batch of results and a cursor to continue browsing.
5 minutes after the request, the cursor will expire and a 404 error will be returned if you try to continue browsing.

- V1BrowseResponse
  - `hits` V1Hit[], required
    - `hitType` 'RESOURCE' | 'RELATIONSHIP' | 'OBJECT' | 'CONCEPT' | 'PIPELINE_EXECUTION' | 'RESOLUTION_QUEUED_ITEM', required
    - `score` number, double, required: The score of the hit in the search results, indicating its relevance.
    - `resource` object, required
    - `traversedProperties` unknown
    - `highlighting` unknown
  - `meta` V1BrowseResponseMeta, required: Metadata about the browse session, including the cursor, the number of results per batch, whether there are more results to browse, and the total number of results available in the browse session.
    - `cursor` string, required: The cursor to continue browsing from.
    - `total` integer, required: The total number of results available in the browse session.

## Other responses

- `400`: Returned when the request is malformed or invalid.
- `404`: Returned when the cursor is invalid or the browse session has expired.

---

[API](https://skmtc.dev/clinia/apis/data-partition-api.md) - [All operations](https://skmtc.dev/clinia/apis/data-partition-api/llms.txt) - [OpenAPI document](https://skmtc.dev/clinia/apis/data-partition-api/revisions/d95b0e95e86c?raw)
