> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clinia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Browse accross resource or relationship collections in the registry

> Browse across resource or relationship collections in the registry.
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.




## OpenAPI

````yaml /api-reference/registry.yml post /sources/{sourceKey}/v1/browse
openapi: 3.0.1
info:
  title: Registry API
  version: 1.0.0
servers:
  - url: https://api.{workspaceId}.clinia.cloud
    variables:
      workspaceId:
        default: ''
        description: The workspace id.
security:
  - apiKey: []
  - basicHttpAuth: []
  - bearerHttpAuth: []
tags:
  - name: Collections
    description: Management of collections in a registry.
  - name: Relationships
    description: Management of relationships in a registry.
  - name: Resources
    description: Management of resources in a registry.
paths:
  /sources/{sourceKey}/v1/browse:
    post:
      tags:
        - Browse
      summary: Browse accross resource or relationship collections in the registry
      description: >
        Browse across resource or relationship collections in the registry.

        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.
      operationId: RegistryBrowse
      parameters:
        - name: sourceKey
          in: path
          description: The source from which to execute the query.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1BrowseRequest'
        required: true
      responses:
        '200':
          description: >
            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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1BrowseResponse'
        '400':
          description: Returned when the request is malformed or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Error'
        '404':
          description: >-
            Returned when the cursor is invalid or the browse session has
            expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1RegistryError'
        '429':
          $ref: '#/components/responses/v1TooManyRequestError'
        '504':
          $ref: '#/components/responses/v1GatewayTimeoutError'
components:
  schemas:
    v1BrowseRequest:
      type: object
      properties:
        collectionKeys:
          type: array
          items:
            type: string
          minLength: 1
          description: The collection keys to which the browse session applies.
        params:
          $ref: '#/components/schemas/v1BrowseParameters'
      required:
        - collectionKeys
        - params
      additionalProperties: false
    v1BrowseResponse:
      required:
        - hits
        - meta
      type: object
      properties:
        hits:
          type: array
          items:
            $ref: '#/components/schemas/v1Hit'
        meta:
          $ref: '#/components/schemas/v1BrowseResponseMeta'
      additionalProperties: false
    v1Error:
      type: object
      required:
        - code
        - message
        - type
      properties:
        code:
          $ref: '#/components/schemas/v1ErrorCode'
        message:
          type: string
        type:
          $ref: '#/components/schemas/v1ErrorType'
        details:
          description: list of errors that occurred if applicable.
          type: array
          items:
            $ref: '#/components/schemas/v1Error'
        additionalContext:
          type: object
          additionalProperties: true
    v1RegistryError:
      allOf:
        - $ref: '#/components/schemas/v1Error'
        - type: object
          properties:
            code:
              $ref: '#/components/schemas/v1ErrorCode'
            applicationErrorCode:
              type: string
              enum:
                - REGISTRY_DUPLICATE_IDENTIFIER
                - REGISTRY_INVALID_COLLECTION_TYPE
                - REGISTRY_INVALID_CONTENT_TYPE
                - REGISTRY_INVALID_PIPELINE_STEP_DEFINITION
                - REGISTRY_INVALID_REQUEST_BODY
                - REGISTRY_INVALID_REVISION_ID
                - REGISTRY_PAYLOAD_PARSE_ERROR
                - REGISTRY_REQUIRED_FIELD_MISSING
                - REGISTRY_RESOURCE_TYPE_NOT_FOUND
                - REGISTRY_UNAVAILABLE_UPSTREAM_SERVICE
                - REGISTRY_BROWSE_SESSION_EXPIRED
                - REGISTRY_BULK_OPERATION_NOT_FOUND
                - REGISTRY_COLLECTION_NOT_FOUND
                - REGISTRY_CONTAINED_DEFINITION_NOT_FOUND
                - REGISTRY_PIPELINE_EXECUTION_NOT_FOUND
                - REGISTRY_PROFILE_NOT_FOUND
                - REGISTRY_PURGE_NOT_FOUND
                - REGISTRY_RELATIONSHIP_COLLECTION_NOT_FOUND
                - REGISTRY_RELATIONSHIP_DEFINITION_NOT_FOUND
                - REGISTRY_RELATIONSHIP_NOT_FOUND
                - REGISTRY_RESOURCE_NOT_FOUND
                - REGISTRY_RESOURCE_COLLECTION_NOT_FOUND
                - REGISTRY_SOURCE_NOT_FOUND
                - REGISTRY_TASK_NOT_FOUND
                - REGISTRY_VERSION_HISTORY_ITEM_NOT_FOUND
                - REGISTRY_REQUEST_CANCELLED
                - REGISTRY_REQUEST_TIMEOUT
                - REGISTRY_COLLECTION_ALREADY_EXISTS
                - REGISTRY_DUPLICATE_OPERATION_IN_BUNDLE
                - REGISTRY_IDENTIFIER_ALREADY_EXISTS
                - REGISTRY_RELATIONSHIP_ALREADY_EXISTS
                - REGISTRY_RELATIONSHIP_FROM_REF_ALREADY_EXISTS
                - REGISTRY_RELATIONSHIP_TO_REF_ALREADY_EXISTS
                - REGISTRY_RESOURCE_ALREADY_EXISTS
    v1BrowseParameters:
      type: object
      description: >
        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.
      properties:
        cursor:
          type: string
          description: >-
            The cursor to continue browsing from. If not provided, the browse
            session will start from the beginning by applying the params.
        filter:
          $ref: '#/components/schemas/v1Operator'
        properties:
          $ref: '#/components/schemas/v1PropertiesSelector'
        perPage:
          type: integer
          format: int32
          description: The number of results to return per page. Defaults to 100.
          maximum: 1000
      additionalProperties: false
    v1Hit:
      type: object
      required:
        - hitType
        - resource
        - score
      properties:
        hitType:
          $ref: '#/components/schemas/v1HitType'
        score:
          type: number
          format: double
          description: >-
            The score of the hit in the search results, indicating its
            relevance.
        resource:
          type: object
          x-is-generic: true
        traversedProperties:
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/v1TraversedProperty'
        highlighting:
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/v1HighlightingHit'
    v1BrowseResponseMeta:
      type: object
      required:
        - cursor
        - total
      description: >
        Metadata about the browse session, including the cursor and the total
        number of results available in the browse session.
      properties:
        cursor:
          type: string
          description: The cursor to continue browsing from.
        total:
          type: integer
          format: int64
          description: The total number of results available in the browse session.
      additionalProperties: false
    v1ErrorCode:
      type: integer
      format: int32
      enum:
        - 400
        - 401
        - 403
        - 404
        - 408
        - 409
        - 413
        - 429
        - 500
        - 501
        - 504
    v1ErrorType:
      type: string
      enum:
        - ALREADY_EXISTS
        - FAILED_PRECONDITION
        - INTERNAL
        - INVALID_ARGUMENT
        - NOT_FOUND
        - OUT_OF_RANGE
        - UNIMPLEMENTED
        - PERMISSION_DENIED
        - UNAUTHENTICATED
        - CONTENT_TOO_LARGE
        - REQUEST_TIMEOUT
        - TOO_MANY_REQUEST
        - GATEWAY_TIMEOUT
    v1Operator:
      description: >
        Logical (`and`, `or`, `not`, `all`, `any`),

        composite (`composite`),

        comparisons (`eq`, `gt`, `lt`),

        text match (`match` with types `phrase`, `phrasePrefix`, `word`,
        `wordPrefix` and optional `fuzziness` up to 3),

        geo (`geoDistance`), and vector (`knn`).
      oneOf:
        - $ref: '#/components/schemas/v1AndOperator'
        - $ref: '#/components/schemas/v1OrOperator'
        - $ref: '#/components/schemas/v1AllOperator'
        - $ref: '#/components/schemas/v1AnyOperator'
        - $ref: '#/components/schemas/v1CompositeOperator'
        - $ref: '#/components/schemas/v1EqOperator'
        - $ref: '#/components/schemas/V1KNNOperator'
        - $ref: '#/components/schemas/v1GeoDistanceOperator'
        - $ref: '#/components/schemas/v1GreaterThanOperator'
        - $ref: '#/components/schemas/v1LessThanOperator'
        - $ref: '#/components/schemas/v1MatchOperator'
        - $ref: '#/components/schemas/v1NotOperator'
    v1PropertiesSelector:
      type: object
      description: >
        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.

        Exclude properties has precedence over include properties.
      properties:
        include:
          type: array
          items:
            type: string
          description: |
            The properties to include in the search response.
            System properties are included by default.
        exclude:
          type: array
          items:
            type: string
          description: |
            The properties to exclude from the search response.
            System properties are not allowed to be excluded.
      additionalProperties: false
    v1HitType:
      type: string
      enum:
        - RESOURCE
        - RELATIONSHIP
        - CONCEPT
        - PIPELINE_EXECUTION
        - RESOLUTION_QUEUED_ITEM
    v1TraversedProperty:
      required:
        - value
        - type
      type: object
      properties:
        type:
          $ref: '#/components/schemas/v1DataType'
        value:
          type: object
          x-is-generic: true
        relationshipId:
          type: string
        relationshipType:
          type: string
        recordId:
          type: string
        recordType:
          type: string
    v1HighlightingHit:
      type: object
      oneOf:
        - $ref: '#/components/schemas/v1HighlightingHitTextual'
        - $ref: '#/components/schemas/v1HighlightingHitVector'
      discriminator:
        propertyName: type
        mapping:
          textual:
            $ref: '#/components/schemas/v1HighlightingHitTextual'
          vector:
            $ref: '#/components/schemas/v1HighlightingHitVector'
    v1AndOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - and
          properties:
            and:
              type: array
              items:
                $ref: '#/components/schemas/v1Operator'
    v1OrOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - or
          properties:
            or:
              type: array
              items:
                $ref: '#/components/schemas/v1Operator'
    v1AllOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - all
          properties:
            all:
              type: object
              minProperties: 1
              maxProperties: 1
              additionalProperties:
                $ref: '#/components/schemas/v1SupportedPrimitiveArrays'
    v1AnyOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - any
          properties:
            any:
              type: object
              minProperties: 1
              maxProperties: 1
              additionalProperties:
                $ref: '#/components/schemas/v1SupportedPrimitiveArrays'
    v1CompositeOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - composite
          properties:
            composite:
              type: object
              minProperties: 1
              maxProperties: 1
              additionalProperties:
                type: array
                items:
                  $ref: '#/components/schemas/v1Operator'
    v1EqOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - eq
          properties:
            eq:
              type: object
              minProperties: 1
              maxProperties: 1
              additionalProperties:
                $ref: '#/components/schemas/v1EqCondition'
    V1KNNOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - knn
          properties:
            knn:
              type: object
              minProperties: 1
              maxProperties: 1
              additionalProperties:
                $ref: '#/components/schemas/v1KNNCondition'
    v1GeoDistanceOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - geoDistance
          properties:
            geoDistance:
              type: object
              minProperties: 1
              maxProperties: 1
              additionalProperties:
                $ref: '#/components/schemas/v1GeoDistanceCondition'
    v1GreaterThanOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - gt
          properties:
            gt:
              type: object
              minProperties: 1
              maxProperties: 1
              additionalProperties:
                $ref: '#/components/schemas/v1SupportedComparablePrimitives'
    v1LessThanOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - lt
          properties:
            lt:
              type: object
              minProperties: 1
              maxProperties: 1
              additionalProperties:
                $ref: '#/components/schemas/v1SupportedComparablePrimitives'
    v1MatchOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - match
          properties:
            match:
              type: object
              minProperties: 1
              maxProperties: 1
              additionalProperties:
                $ref: '#/components/schemas/v1MatchCondition'
    v1NotOperator:
      allOf:
        - $ref: '#/components/schemas/V1OperatorBase'
        - type: object
          required:
            - not
          properties:
            not:
              $ref: '#/components/schemas/v1Operator'
    v1DataType:
      type: string
      enum:
        - address
        - attachment
        - boolean
        - code
        - coding
        - contactpoint
        - date
        - datetime
        - decimal
        - geopoint
        - humanname
        - identifier
        - instant
        - integer
        - markdown
        - period
        - reference
        - symbol
        - time
        - uri
        - url
        - xhtml
        - array
        - object
        - densevector
    v1HighlightingHitTextual:
      type: object
      required:
        - type
        - highlight
      properties:
        type:
          $ref: '#/components/schemas/v1HighlightingHitType'
        highlight:
          type: string
    v1HighlightingHitVector:
      type: object
      required:
        - type
        - score
        - path
        - data
      properties:
        type:
          $ref: '#/components/schemas/v1HighlightingHitType'
        score:
          type: number
        path:
          type: string
        data:
          type: string
    V1OperatorBase:
      type: object
      properties:
        id:
          type: string
    v1SupportedPrimitiveArrays:
      oneOf:
        - $ref: '#/components/schemas/v1ArrayOfStrings'
        - $ref: '#/components/schemas/v1ArrayOfIntegers'
        - $ref: '#/components/schemas/v1ArrayOfDoubles'
    v1EqCondition:
      oneOf:
        - $ref: '#/components/schemas/v1SupportedPrimitives'
        - $ref: '#/components/schemas/v1EqObject'
    v1KNNCondition:
      type: object
      additionalProperties: false
      required:
        - value
      properties:
        value:
          type: string
    v1GeoDistanceCondition:
      type: object
      required:
        - coordinates
        - radius
      properties:
        coordinates:
          $ref: '#/components/schemas/v1GeoDistanceConditionCoordinates'
        radius:
          type: integer
          format: int32
      additionalProperties: false
    v1SupportedComparablePrimitives:
      oneOf:
        - $ref: '#/components/schemas/v1String'
        - $ref: '#/components/schemas/v1Integer'
        - $ref: '#/components/schemas/v1Double'
    v1MatchCondition:
      type: object
      description: The match condition is used to match a string field with a given value.
      additionalProperties: false
      required:
        - value
        - type
      properties:
        value:
          type: string
        type:
          $ref: '#/components/schemas/v1MatchOperatorType'
        fuzziness:
          type: integer
          format: int32
          maximum: 3
    v1HighlightingHitType:
      type: string
      enum:
        - textual
        - vector
    v1ArrayOfStrings:
      type: array
      items:
        type: string
    v1ArrayOfIntegers:
      type: array
      items:
        type: integer
        format: int32
    v1ArrayOfDoubles:
      type: array
      items:
        type: number
        format: double
    v1SupportedPrimitives:
      oneOf:
        - $ref: '#/components/schemas/v1String'
        - $ref: '#/components/schemas/v1Integer'
        - $ref: '#/components/schemas/v1Double'
        - $ref: '#/components/schemas/v1Bool'
    v1EqObject:
      type: object
      description: >
        The eq operator condition with an additional normalized field to support
        queries that require case-insensitive equality.

        Normalized equality is only supported for string values.
      additionalProperties: false
      required:
        - value
      properties:
        value:
          $ref: '#/components/schemas/v1SupportedPrimitives'
        normalized:
          type: boolean
    v1GeoDistanceConditionCoordinates:
      oneOf:
        - $ref: '#/components/schemas/v1GeoPoint'
        - $ref: '#/components/schemas/v1String'
    v1String:
      type: string
    v1Integer:
      pattern: ^[0]|[-+]?[1-9][0-9]*$
      type: integer
      description: A whole number.
      format: int32
    v1Double:
      type: number
      format: double
    v1MatchOperatorType:
      type: string
      enum:
        - phrase
        - phrasePrefix
        - word
        - wordPrefix
    v1Bool:
      type: boolean
    v1GeoPoint:
      type: object
      properties:
        latitude:
          $ref: '#/components/schemas/v1Decimal'
        longitude:
          $ref: '#/components/schemas/v1Decimal'
      additionalProperties: false
      required:
        - latitude
        - longitude
    v1Decimal:
      pattern: ^-?(0|[1-9][0-9]{0,17})(\.[0-9]{1,17})?([eE][+-]?[0-9]{1,9}})?$
      type: number
      format: double
      description: A rational number with implicit precision.
  responses:
    v1TooManyRequestError:
      description: Returned when the server starts throttling the requests.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
    v1GatewayTimeoutError:
      description: Returned when the request exceeds the server timeout window.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Clinia-API-Key
    basicHttpAuth:
      description: Basic HTTP authentication.
      type: http
      scheme: basic
    bearerHttpAuth:
      description: JWT Bearer authentication.
      type: http
      scheme: Bearer
      bearerFormat: JWT

````