> ## 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.

# Create a data partition

> Create a data partition.



## OpenAPI

````yaml /api-reference/datacatalog.yml put /catalog/v1/partitions/{partitionKey}
openapi: 3.0.1
info:
  title: Data Catalog 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: Partitions
    description: Management of data partitions.
  - name: Sources
    description: Management of data sources.
paths:
  /catalog/v1/partitions/{partitionKey}:
    put:
      tags:
        - Partitions
      summary: Create a data partition
      description: Create a data partition.
      operationId: CreateDataPartition
      parameters:
        - name: partitionKey
          in: path
          description: |
            Key of the data partition
            it must follow pattern: `^[a-zA-Z0-9-][\w-]{0,61}$`.
          required: true
          schema:
            type: string
        - name: stage
          in: query
          description: >
            If true, the partition will be created as a staged partition.

            Staged partitions are mutable and can be modified.


            If false, the partition will be created directly. This is the
            default behaviour and will

            make the data partition are immutable.


            As of now, staged partitions are not fully supported and it is
            recommended to directly create

            `ready` partitions.
          required: false
          schema:
            type: boolean
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1DataPartition'
      responses:
        '201':
          description: A successful response when the data partition was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1DataPartition'
        '400':
          description: Returned when the request is malformed or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Error'
        '404':
          description: Returned when a collection targeted by the request does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Error'
        '409':
          description: Returned when the data partition already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Error'
        '413':
          $ref: '#/components/responses/v1PayloadTooLargeError'
        '429':
          $ref: '#/components/responses/v1TooManyRequestError'
        '504':
          $ref: '#/components/responses/v1GatewayTimeoutError'
components:
  schemas:
    v1DataPartition:
      type: object
      required:
        - source
      properties:
        key:
          type: string
          readOnly: true
        source:
          $ref: '#/components/schemas/v1DataPartitionSourceConfig'
        status:
          $ref: '#/components/schemas/v1DataPartitionStatus'
          readOnly: true
      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
    v1DataPartitionSourceConfig:
      type: object
      required:
        - sources
        - collections
        - relationships
      properties:
        sources:
          type: array
          items:
            type: string
        collections:
          type: array
          items:
            $ref: '#/components/schemas/v1PartitionCollectionConnection'
          minItems: 1
        relationships:
          type: array
          items:
            $ref: '#/components/schemas/v1PartitionRelationshipConnection'
      additionalProperties: false
    v1DataPartitionStatus:
      type: string
      description: >
        The status of the data partition.

        - **STATUS_STAGE**: The data partition configuration is mutable. You can
        still query it as normal.

        - **STATUS_READY**: The data partition configuration is immutable.
      enum:
        - STATUS_READY
        - STATUS_STAGE
    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
    v1PartitionCollectionConnection:
      allOf:
        - $ref: '#/components/schemas/v1BasePartitionCollectionConnection'
        - type: object
          required:
            - key
          properties:
            key:
              type: string
              description: >
                The key of the mdm collection (analogous to its UnifiedProfile
                key).
    v1PartitionRelationshipConnection:
      type: object
      allOf:
        - $ref: '#/components/schemas/v1BasePartitionRelationshipConnection'
        - type: object
          required:
            - relationshipType
          properties:
            relationshipType:
              type: string
              description: The type of the mdm relationship.
    v1BasePartitionCollectionConnection:
      description: The definition of a collection in the mdm partition.
      type: object
      required:
        - properties
        - mappings
      properties:
        properties:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/v1PropertyDefinition'
          description: >
            The properties of the partition collection.

            The property key must follow the pattern:
            `^[a-zA-Z0-9-][\w-]{0,61}$`.
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/v1PartitionPropertiesMapping'
          description: >-
            The partition collection properties mappings from the mdm collection
            source profile's.
        reconciliationRules:
          $ref: '#/components/schemas/v1ReconciliationRules'
          description: The reconciliation rules for the partition collection properties.
        contained:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/v1PartitionContainedDefinition'
          description: The contained resources of the partition collection.
        traversedProperties:
          $ref: '#/components/schemas/v1BasePartitionTraversedProperties'
      additionalProperties: false
    v1BasePartitionRelationshipConnection:
      type: object
      required:
        - from
        - to
      properties:
        from:
          $ref: '#/components/schemas/v1RelationshipRefDefinition'
        to:
          $ref: '#/components/schemas/v1RelationshipRefDefinition'
        properties:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/v1PropertyDefinition'
          description: >
            The properties of the partition relationship.

            The property key must follow the pattern:
            `^[a-zA-Z0-9-][\w-]{0,61}$`.
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/v1PartitionPropertiesMapping'
          description: >-
            The partition relationship properties mappings from the source
            relationship profile's.
        reconciliationRules:
          $ref: '#/components/schemas/v1ReconciliationRules'
          description: >
            The reconciliation rules for the partition relationship

            If not specified, the default reconciliation rule is AGGREGATE for
            array properties and LATEST for non-array properties.
    v1PropertyDefinition:
      oneOf:
        - $ref: '#/components/schemas/v1AddressPropertyDefinition'
        - $ref: '#/components/schemas/v1ArrayPropertyDefinition'
        - $ref: '#/components/schemas/v1AttachmentPropertyDefinition'
        - $ref: '#/components/schemas/v1BooleanPropertyDefinition'
        - $ref: '#/components/schemas/v1CodePropertyDefinition'
        - $ref: '#/components/schemas/v1CodingPropertyDefinition'
        - $ref: '#/components/schemas/v1ContactPointPropertyDefinition'
        - $ref: '#/components/schemas/v1DatePropertyDefinition'
        - $ref: '#/components/schemas/v1DateTimePropertyDefinition'
        - $ref: '#/components/schemas/v1DecimalPropertyDefinition'
        - $ref: '#/components/schemas/v1GeoPointPropertyDefinition'
        - $ref: '#/components/schemas/v1HumanNamePropertyDefinition'
        - $ref: '#/components/schemas/v1IdentifierPropertyDefinition'
        - $ref: '#/components/schemas/v1InstantPropertyDefinition'
        - $ref: '#/components/schemas/v1IntegerPropertyDefinition'
        - $ref: '#/components/schemas/v1MarkdownPropertyDefinition'
        - $ref: '#/components/schemas/v1ObjectPropertyDefinition'
        - $ref: '#/components/schemas/v1PeriodPropertyDefinition'
        - $ref: '#/components/schemas/v1ReferencePropertyDefinition'
        - $ref: '#/components/schemas/v1SymbolPropertyDefinition'
        - $ref: '#/components/schemas/v1TimePropertyDefinition'
        - $ref: '#/components/schemas/v1UriPropertyDefinition'
        - $ref: '#/components/schemas/v1UrlPropertyDefinition'
        - $ref: '#/components/schemas/v1XhtmlPropertyDefinition'
      discriminator:
        propertyName: type
        mapping:
          address:
            $ref: '#/components/schemas/v1AddressPropertyDefinition'
          attachment:
            $ref: '#/components/schemas/v1AttachmentPropertyDefinition'
          boolean:
            $ref: '#/components/schemas/v1BooleanPropertyDefinition'
          code:
            $ref: '#/components/schemas/v1CodePropertyDefinition'
          coding:
            $ref: '#/components/schemas/v1CodingPropertyDefinition'
          contactpoint:
            $ref: '#/components/schemas/v1ContactPointPropertyDefinition'
          date:
            $ref: '#/components/schemas/v1DatePropertyDefinition'
          datetime:
            $ref: '#/components/schemas/v1DateTimePropertyDefinition'
          decimal:
            $ref: '#/components/schemas/v1DecimalPropertyDefinition'
          geopoint:
            $ref: '#/components/schemas/v1GeoPointPropertyDefinition'
          humanname:
            $ref: '#/components/schemas/v1HumanNamePropertyDefinition'
          identifier:
            $ref: '#/components/schemas/v1IdentifierPropertyDefinition'
          instant:
            $ref: '#/components/schemas/v1InstantPropertyDefinition'
          integer:
            $ref: '#/components/schemas/v1IntegerPropertyDefinition'
          markdown:
            $ref: '#/components/schemas/v1MarkdownPropertyDefinition'
          period:
            $ref: '#/components/schemas/v1PeriodPropertyDefinition'
          reference:
            $ref: '#/components/schemas/v1ReferencePropertyDefinition'
          symbol:
            $ref: '#/components/schemas/v1SymbolPropertyDefinition'
          time:
            $ref: '#/components/schemas/v1TimePropertyDefinition'
          uri:
            $ref: '#/components/schemas/v1UriPropertyDefinition'
          url:
            $ref: '#/components/schemas/v1UrlPropertyDefinition'
          xhtml:
            $ref: '#/components/schemas/v1XhtmlPropertyDefinition'
          array:
            $ref: '#/components/schemas/v1ArrayPropertyDefinition'
          object:
            $ref: '#/components/schemas/v1ObjectPropertyDefinition'
    v1PartitionPropertiesMapping:
      type: object
      required:
        - source
        - type
        - propertyMappings
      properties:
        source:
          type: string
          description: The source from which the properties are mapped.
        type:
          type: string
          description: >-
            The type of the resource (analogous to the profile key) from which
            the properties are mapped.
        propertyMappings:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/v1PartitionPropertyMapping'
          description: >
            This is used to map the partition collection properties from the
            source profile properties.

            The key is the partition property key and the value can be one of
            the following:

            - For a simple mapping between properties of a well-known datatype,
            the value is the source profile property key
              The value can be a simple property key or a nested property key
              ```
              {
                simple_partition_property: simple_source_property,
                other_simple_partition_property: source_object_property.sub-property
              }
              ```
            - For a mapping to a property of type 'OBJECT' in the partition, the
            value is an object with one of the following types:
              - OBJECT: To create a custom object in the partition from a single object or properties in the source profile
                ```
                {
                  partition_object_property: {
                    mappingType: OBJECT
                    propertyMappings: {
                      sub-property: simple_source_property
                      other_sub-property: source_object_property.sub-property
                    }
                  }
                }
                ```
              - OBJECT_ARRAY: To create an array of custom objects from an array of custom objects in the source profile
                The path to the source array must be specified in the 'fromSourceArray' property
                ```
                {
                  partition_object_array_property: {
                    mappingType: OBJECT_ARRAY
                    propertyMappings: {
                      fromSourceArray: source_object_array_property
                      propertyMappings: {
                        sub-property: source_object_array_property_sub-property
                        other_sub-property: source_object_array_property_object_sub-property.sub-property
                      }
                    }
                  }
                }
                ```.
      additionalProperties: false
    v1ReconciliationRules:
      oneOf:
        - $ref: '#/components/schemas/v1SystemReconciliationRules'
        - $ref: '#/components/schemas/v1PartitionCliniaFunctionReference'
      discriminator:
        propertyName: type
        mapping:
          SYSTEM:
            $ref: '#/components/schemas/v1SystemReconciliationRules'
          CLINIA_FUNCTION:
            $ref: '#/components/schemas/v1PartitionCliniaFunctionReference'
    v1PartitionContainedDefinition:
      type: object
      required:
        - properties
        - mappings
      properties:
        type:
          type: string
          description: >-
            The type of the contained resource. By default the contained key is
            used.
        properties:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/v1PropertyDefinition'
          description: >
            The properties of the partition contained resource.

            The property key must follow the pattern:
            `^[a-zA-Z0-9-][\w-]{0,61}$`.
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/v1PartitionContainedPropertiesMapping'
          description: >-
            The partition contained properties mappings from the source
            profile's.
      additionalProperties: false
    v1BasePartitionTraversedProperties:
      type: array
      items:
        type: string
      description: >
        The properties from the relationships or adjacent records that can be
        queried in the data partition with one of the following formats:

        - `@{includeKey}.{propertyKey}` (e.g. `@worksAt.startDate`).
            This allows to query on the property 'startDate' of the relationship 'worksAt'.
        - `@{includeKey}.@{resourcetype}.{propertyKey}` (e.g.
        `@worksAt.@clinic.name`).
            This allows to query on the property 'name' of the resource 'clinic' that is related to the record with the relationship 'worksAt'.
        - `@{includeKey}.@{resourcetype}.{containedKey}.{propertyKey}` (e.g.
        `@worksAt.@clinic.location.address`).
            This allows to query on the property 'address' of the contained resource 'location' of the resource 'clinic' that is related to the record with the relationship 'worksAt'
        Traversed Properties support only primitive and general-purpose complex
        Clinia Datatypes, nested properties of a custom datatype can be queried
        using the dot notation.
    v1RelationshipRefDefinition:
      type: object
      required:
        - profileKey
        - includeKey
      properties:
        profileKey:
          type: string
        includeKey:
          type: string
          description: Key must follow pattern `^[a-zA-Z0-9-][\w-]{0,61}$`.
    v1AddressPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BaseWellKnownObjectPropertyDefinition'
    v1ArrayPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
        - type: object
          required:
            - items
          properties:
            items:
              $ref: '#/components/schemas/v1PropertyDefinition'
    v1AttachmentPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BaseWellKnownObjectPropertyDefinition'
    v1BooleanPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1CodePropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1CodingPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BaseWellKnownObjectPropertyDefinition'
    v1ContactPointPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BaseWellKnownObjectPropertyDefinition'
    v1DatePropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1DateTimePropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1DecimalPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1GeoPointPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1HumanNamePropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BaseWellKnownObjectPropertyDefinition'
    v1IdentifierPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BaseWellKnownObjectPropertyDefinition'
    v1InstantPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1IntegerPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1MarkdownPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1ObjectPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
        - type: object
          required:
            - properties
          properties:
            properties:
              type: object
              additionalProperties:
                $ref: '#/components/schemas/v1PropertyDefinition'
          additionalProperties: false
    v1PeriodPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BaseWellKnownObjectPropertyDefinition'
    v1ReferencePropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BaseWellKnownObjectPropertyDefinition'
    v1SymbolPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1TimePropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1UriPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1UrlPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1XhtmlPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
    v1PartitionPropertyMapping:
      oneOf:
        - $ref: '#/components/schemas/v1PartitionSimplePropertyMapping'
        - $ref: '#/components/schemas/v1PartitionObjectPropertyMapping'
        - $ref: '#/components/schemas/v1PartitionObjectArrayPropertyMapping'
      discriminator:
        propertyName: mappingType
        mapping:
          VALUE:
            $ref: '#/components/schemas/v1PartitionSimplePropertyMapping'
          OBJECT:
            $ref: '#/components/schemas/v1PartitionObjectPropertyMapping'
          OBJECT_ARRAY:
            $ref: '#/components/schemas/v1PartitionObjectArrayPropertyMapping'
    v1SystemReconciliationRules:
      type: object
      required:
        - type
        - rules
      properties:
        type:
          $ref: '#/components/schemas/v1ReconciliationRulesType'
          description: Type is SYSTEM.
        rules:
          type: object
          description: For each property, the reconciliation rule to be applied.
          additionalProperties:
            $ref: '#/components/schemas/v1ReconciliationRule'
    v1PartitionCliniaFunctionReference:
      allOf:
        - $ref: '#/components/schemas/v1CliniaFunctionReference'
        - type: object
          required:
            - type
          properties:
            type:
              $ref: '#/components/schemas/v1ReconciliationRulesType'
              description: Type is CLINIA_FUNCTION.
    v1PartitionContainedPropertiesMapping:
      allOf:
        - $ref: '#/components/schemas/v1PartitionPropertiesMapping'
        - type: object
          required:
            - containedKey
          properties:
            containedKey:
              type: string
    v1BaseWellKnownObjectPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
        - type: object
          properties:
            properties:
              type: object
              additionalProperties:
                $ref: '#/components/schemas/v1WellKnownObjectPropertyDefinitionRule'
          additionalProperties: false
    v1BasePropertyDefinition:
      type: object
      required:
        - type
      properties:
        type:
          $ref: '#/components/schemas/v1DataType'
        readOnly:
          type: boolean
          default: false
          description: >-
            If set to true, the property cannot be set as required in the rules
            properties, and can only be set by the ingestion pipeline. Any value
            provided by the user will be ignored.
        description:
          type: string
          description: Description of the property.
        rules:
          type: array
          items:
            $ref: '#/components/schemas/v1PropertyRule'
        binding:
          $ref: '#/components/schemas/v1PropertyBinding'
        modelId:
          type: string
          readOnly: true
          description: >-
            ID of the model. Only used for enriched properties defined via
            pipelines.
        enrichedProperties:
          type: object
          readOnly: true
          additionalProperties:
            $ref: '#/components/schemas/v1EnrichedPropertyDefinition'
      additionalProperties: false
    v1PartitionSimplePropertyMapping:
      allOf:
        - $ref: '#/components/schemas/v1PartitionPropertyMappingBase'
        - type: object
          required:
            - value
          properties:
            value:
              type: string
    v1PartitionObjectPropertyMapping:
      allOf:
        - $ref: '#/components/schemas/v1PartitionCompositePropertyMappingBase'
    v1PartitionObjectArrayPropertyMapping:
      allOf:
        - $ref: '#/components/schemas/v1PartitionCompositePropertyMappingBase'
        - type: object
          required:
            - fromSourceArray
          properties:
            fromSourceArray:
              type: string
              description: The source profile property key. Must be an array of objects.
    v1ReconciliationRulesType:
      type: string
      enum:
        - SYSTEM
        - CLINIA_FUNCTION
    v1ReconciliationRule:
      type: string
      default: LATEST
      enum:
        - LATEST
        - EARLIEST
        - AGGREGATE
    v1CliniaFunctionReference:
      type: object
      required:
        - name
        - version
      properties:
        name:
          type: string
          description: The name of the function to be applied.
        version:
          $ref: '#/components/schemas/v1SemVer'
    v1WellKnownObjectPropertyDefinitionRule:
      type: object
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/v1PropertyRule'
        properties:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/v1WellKnownObjectPropertyDefinitionRule'
        items:
          $ref: '#/components/schemas/v1WellKnownObjectPropertyDefinitionRule'
        binding:
          $ref: '#/components/schemas/v1PropertyBinding'
      additionalProperties: false
    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
    v1PropertyRule:
      type: object
      properties:
        required:
          type: boolean
        pattern:
          type: string
        enum:
          description: >-
            List of possible values for the property: string and number types
            only.
          type: array
          items:
            oneOf:
              - type: string
              - type: number
          minItems: 1
        min:
          type: integer
          format: int
        max:
          type: integer
          format: int
        when:
          $ref: '#/components/schemas/v1Operator'
          description: >
            An operator that defines when the rule should be applicable.

            Whenever this operator evaluates to true, the rule will be checked;
            when it is evaluated to false, the rule is ignored entirely and none
            of its validation is applied.


            Supported operators are: 'eq', 'lt' and 'gt'.

            TODO: [ENG-4213] Add examples and document [current] and [*]..
      additionalProperties: false
    v1PropertyBinding:
      description: >
        Defines a subset of values the property can take.

        A binding can be defined for a code, a coding, a symbol or an URI
        property.

        In the case of a coding, the binding is applied to the code
        sub-attribute.
      type: object
      required:
        - vocabulary
      properties:
        vocabulary:
          $ref: '#/components/schemas/v1VocabularyBinding'
      additionalProperties: false
    v1EnrichedPropertyDefinition:
      oneOf:
        - $ref: '#/components/schemas/v1AddressPropertyDefinition'
        - $ref: '#/components/schemas/v1ArrayPropertyDefinition'
        - $ref: '#/components/schemas/v1AttachmentPropertyDefinition'
        - $ref: '#/components/schemas/v1BooleanPropertyDefinition'
        - $ref: '#/components/schemas/v1CodePropertyDefinition'
        - $ref: '#/components/schemas/v1CodingPropertyDefinition'
        - $ref: '#/components/schemas/v1ContactPointPropertyDefinition'
        - $ref: '#/components/schemas/v1DatePropertyDefinition'
        - $ref: '#/components/schemas/v1DateTimePropertyDefinition'
        - $ref: '#/components/schemas/v1DecimalPropertyDefinition'
        - $ref: '#/components/schemas/v1GeoPointPropertyDefinition'
        - $ref: '#/components/schemas/v1HumanNamePropertyDefinition'
        - $ref: '#/components/schemas/v1IdentifierPropertyDefinition'
        - $ref: '#/components/schemas/v1InstantPropertyDefinition'
        - $ref: '#/components/schemas/v1IntegerPropertyDefinition'
        - $ref: '#/components/schemas/v1MarkdownPropertyDefinition'
        - $ref: '#/components/schemas/v1ObjectPropertyDefinition'
        - $ref: '#/components/schemas/v1PeriodPropertyDefinition'
        - $ref: '#/components/schemas/v1ReferencePropertyDefinition'
        - $ref: '#/components/schemas/v1SymbolPropertyDefinition'
        - $ref: '#/components/schemas/v1TimePropertyDefinition'
        - $ref: '#/components/schemas/v1UriPropertyDefinition'
        - $ref: '#/components/schemas/v1UrlPropertyDefinition'
        - $ref: '#/components/schemas/v1XhtmlPropertyDefinition'
        - $ref: '#/components/schemas/v1DenseVectorPropertyDefinition'
      discriminator:
        propertyName: type
        mapping:
          address:
            $ref: '#/components/schemas/v1AddressPropertyDefinition'
          attachment:
            $ref: '#/components/schemas/v1AttachmentPropertyDefinition'
          boolean:
            $ref: '#/components/schemas/v1BooleanPropertyDefinition'
          code:
            $ref: '#/components/schemas/v1CodePropertyDefinition'
          coding:
            $ref: '#/components/schemas/v1CodingPropertyDefinition'
          contactpoint:
            $ref: '#/components/schemas/v1ContactPointPropertyDefinition'
          date:
            $ref: '#/components/schemas/v1DatePropertyDefinition'
          datetime:
            $ref: '#/components/schemas/v1DateTimePropertyDefinition'
          decimal:
            $ref: '#/components/schemas/v1DecimalPropertyDefinition'
          geopoint:
            $ref: '#/components/schemas/v1GeoPointPropertyDefinition'
          humanname:
            $ref: '#/components/schemas/v1HumanNamePropertyDefinition'
          identifier:
            $ref: '#/components/schemas/v1IdentifierPropertyDefinition'
          instant:
            $ref: '#/components/schemas/v1InstantPropertyDefinition'
          integer:
            $ref: '#/components/schemas/v1IntegerPropertyDefinition'
          markdown:
            $ref: '#/components/schemas/v1MarkdownPropertyDefinition'
          period:
            $ref: '#/components/schemas/v1PeriodPropertyDefinition'
          reference:
            $ref: '#/components/schemas/v1ReferencePropertyDefinition'
          symbol:
            $ref: '#/components/schemas/v1SymbolPropertyDefinition'
          time:
            $ref: '#/components/schemas/v1TimePropertyDefinition'
          uri:
            $ref: '#/components/schemas/v1UriPropertyDefinition'
          url:
            $ref: '#/components/schemas/v1UrlPropertyDefinition'
          xhtml:
            $ref: '#/components/schemas/v1XhtmlPropertyDefinition'
          array:
            $ref: '#/components/schemas/v1ArrayPropertyDefinition'
          object:
            $ref: '#/components/schemas/v1ObjectPropertyDefinition'
          densevector:
            $ref: '#/components/schemas/v1DenseVectorPropertyDefinition'
    v1PartitionPropertyMappingBase:
      type: object
      required:
        - mappingType
      properties:
        mappingType:
          $ref: '#/components/schemas/v1PartitionPropertyMappingType'
    v1PartitionCompositePropertyMappingBase:
      allOf:
        - $ref: '#/components/schemas/v1PartitionPropertyMappingBase'
        - type: object
          required:
            - propertyMappings
          properties:
            mappingType:
              $ref: '#/components/schemas/v1PartitionPropertyMappingType'
            propertyMappings:
              type: object
              additionalProperties:
                $ref: '#/components/schemas/v1PartitionPropertyMapping'
              description: >-
                The key is the object sub-property in the partition and the
                value is the source profile property key or the nested
                sub-property (object or object array).
    v1SemVer:
      type: string
      description: Version of the clinia function. Should be a valid semver.
    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'
    v1VocabularyBinding:
      type: object
      required:
        - key
        - strength
      properties:
        key:
          type: string
        strength:
          $ref: '#/components/schemas/v1BindingStrength'
      additionalProperties: false
    v1DenseVectorPropertyDefinition:
      allOf:
        - $ref: '#/components/schemas/v1BasePropertyDefinition'
        - type: object
          required:
            - modelId
          properties:
            modelId:
              type: string
              readOnly: true
              description: ID of the model used to generate the dense embedding.
          additionalProperties: false
    v1PartitionPropertyMappingType:
      type: string
      enum:
        - VALUE
        - OBJECT
        - OBJECT_ARRAY
    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'
    v1BindingStrength:
      type: string
      description: |
        The strength with which the binding is asserted.
         - required: To be conformant, the concept in this element shall be from the specified value set.
         - preferred: Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant.
      enum:
        - required
        - preferred
    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
    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:
    v1PayloadTooLargeError:
      description: Returned when the payload exceeds the max content size (100kB).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
    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

````