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

# Bulk store (upsert) metadata

> Create or update multiple metadata entities. Items are sorted by FQN depth so ancestors are processed first.



## OpenAPI

````yaml /openapi/em-runtime-utils-v2.yaml post /utils/metadata/store
openapi: 3.1.0
info:
  title: em_runtime_utils
  version: 5.27.0
servers: []
security: []
paths:
  /utils/metadata/store:
    post:
      tags:
        - metadata
      summary: Bulk store (upsert) metadata
      description: >-
        Create or update multiple metadata entities. Items are sorted by FQN
        depth so ancestors are processed first.
      operationId: bulk_store_metadata
      parameters:
        - name: X-Project-ID
          in: header
          required: true
          schema:
            type: string
            title: X-Project-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkStoreMetadataRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkStoreMetadataResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    BulkStoreMetadataRequest:
      properties:
        items:
          items:
            $ref: '#/components/schemas/BulkStoreMetadataItem'
          type: array
          maxItems: 100
          minItems: 1
          title: Items
      type: object
      required:
        - items
      title: BulkStoreMetadataRequest
      description: Request body for bulk store metadata.
    BulkStoreMetadataResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/BulkStoreMetadataItemResult'
          type: array
          title: Items
        errors:
          items:
            $ref: '#/components/schemas/MetadataItemError'
          type: array
          title: Errors
      type: object
      required:
        - items
        - errors
      title: BulkStoreMetadataResponse
      description: Response for bulk store metadata.
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - error
      title: ErrorResponse
      description: Standard error response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BulkStoreMetadataItem:
      properties:
        resource_uri:
          type: string
          minLength: 1
          title: Resource Uri
        metadata:
          oneOf:
            - $ref: '#/components/schemas/ColumnMetadata'
            - $ref: '#/components/schemas/TableMetadata'
            - $ref: '#/components/schemas/SchemaMetadata'
            - $ref: '#/components/schemas/DatabaseMetadata'
          title: Metadata
          discriminator:
            propertyName: type
            mapping:
              column:
                $ref: '#/components/schemas/ColumnMetadata'
              database:
                $ref: '#/components/schemas/DatabaseMetadata'
              database_schema:
                $ref: '#/components/schemas/SchemaMetadata'
              table:
                $ref: '#/components/schemas/TableMetadata'
      type: object
      required:
        - resource_uri
        - metadata
      title: BulkStoreMetadataItem
      description: Single item in a bulk store request.
    BulkStoreMetadataItemResult:
      properties:
        fqn:
          type: string
          title: Fqn
        type:
          $ref: '#/components/schemas/AssetType'
        message:
          type: string
          title: Message
        version:
          type: string
          title: Version
        children:
          anyOf:
            - additionalProperties:
                additionalProperties:
                  type: integer
                type: object
              type: object
            - type: 'null'
          title: Children
      type: object
      required:
        - fqn
        - type
        - message
        - version
      title: BulkStoreMetadataItemResult
      description: Per-item result in bulk store response.
    MetadataItemError:
      properties:
        fqn:
          type: string
          title: Fqn
        error_code:
          $ref: '#/components/schemas/MetadataErrorCode'
        detail:
          type: string
          title: Detail
      type: object
      required:
        - fqn
        - error_code
        - detail
      title: MetadataItemError
      description: Per-item error in bulk operation responses.
    ErrorBody:
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          title: Message
        details:
          additionalProperties: true
          type: object
          title: Details
        request_id:
          type: string
          title: Request Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
      type: object
      required:
        - code
        - message
        - request_id
        - timestamp
      title: ErrorBody
      description: Error body with structured details.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ColumnMetadata:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        fully_qualified_name:
          type: string
          maxLength: 512
          minLength: 1
          title: Fully Qualified Name
        display_name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Display Name
        description:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Description
        summary_text:
          anyOf:
            - type: string
              maxLength: 8000
            - type: 'null'
          title: Summary Text
          description: >-
            Human-readable summary used as the source text for semantic search
            embedding. Should be a rich contextual description (~1000 tokens)
            for best results. When omitted, the entity is excluded from semantic
            search but remains discoverable via structured queries.
        type:
          type: string
          const: column
          title: Type
          default: column
        data_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Type
        data_type_display:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Type Display
        ordinal_position:
          anyOf:
            - type: integer
            - type: 'null'
          title: Ordinal Position
        nullable:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Nullable
        constraint:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Constraint
        column_relationships:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Column Relationships
        precision:
          anyOf:
            - type: integer
            - type: 'null'
          title: Precision
        scale:
          anyOf:
            - type: integer
            - type: 'null'
          title: Scale
        data_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Data Length
        business_definition:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Business Definition
        business_rules:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Business Rules
        owners:
          anyOf:
            - items:
                $ref: '#/components/schemas/OwnerSchema'
              type: array
            - type: 'null'
          title: Owners
        extension:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extension
        is_dq_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Dq Tagged
        is_pii_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Pii Tagged
        is_sensitivity_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Sensitivity Tagged
        version:
          anyOf:
            - type: string
              pattern: ^\d+\.\d+$
            - type: 'null'
          title: Version
          description: For optimistic locking (e.g., '0.1', '0.10')
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Tag FQNs to associate (e.g., ['PII.Email'])
      type: object
      required:
        - name
        - fully_qualified_name
      title: ColumnMetadata
      description: Column metadata for store requests.
    TableMetadata:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        fully_qualified_name:
          type: string
          maxLength: 512
          minLength: 1
          title: Fully Qualified Name
        display_name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Display Name
        description:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Description
        summary_text:
          anyOf:
            - type: string
              maxLength: 8000
            - type: 'null'
          title: Summary Text
          description: >-
            Human-readable summary used as the source text for semantic search
            embedding. Should be a rich contextual description (~1000 tokens)
            for best results. When omitted, the entity is excluded from semantic
            search but remains discoverable via structured queries.
        type:
          type: string
          const: table
          title: Type
          default: table
        table_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Table Type
        row_count:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Row Count
          description: Number of rows in this table
        column_count:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Column Count
          description: Number of columns in this table
        owners:
          anyOf:
            - items:
                $ref: '#/components/schemas/OwnerSchema'
              type: array
            - type: 'null'
          title: Owners
        extension:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extension
        schema_definition:
          anyOf:
            - type: string
            - type: 'null'
          title: Schema Definition
          description: DDL statement (e.g., CREATE TABLE/VIEW)
        is_dq_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Dq Tagged
        is_pii_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Pii Tagged
        is_sensitivity_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Sensitivity Tagged
        version:
          anyOf:
            - type: string
              pattern: ^\d+\.\d+$
            - type: 'null'
          title: Version
          description: For optimistic locking (e.g., '0.1', '0.10')
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Tag FQNs to associate (e.g., ['PII.Email'])
        columns:
          anyOf:
            - items:
                $ref: '#/components/schemas/ColumnMetadata'
              type: array
            - type: 'null'
          title: Columns
      type: object
      required:
        - name
        - fully_qualified_name
      title: TableMetadata
      description: Table metadata for store requests.
    SchemaMetadata:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        fully_qualified_name:
          type: string
          maxLength: 512
          minLength: 1
          title: Fully Qualified Name
        display_name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Display Name
        description:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Description
        summary_text:
          anyOf:
            - type: string
              maxLength: 8000
            - type: 'null'
          title: Summary Text
          description: >-
            Human-readable summary used as the source text for semantic search
            embedding. Should be a rich contextual description (~1000 tokens)
            for best results. When omitted, the entity is excluded from semantic
            search but remains discoverable via structured queries.
        type:
          type: string
          const: database_schema
          title: Type
          default: database_schema
        table_count:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Table Count
          description: Number of tables in this schema
        owners:
          anyOf:
            - items:
                $ref: '#/components/schemas/OwnerSchema'
              type: array
            - type: 'null'
          title: Owners
        extension:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extension
        schema_definition:
          anyOf:
            - type: string
            - type: 'null'
          title: Schema Definition
          description: DDL statement (e.g., CREATE SCHEMA)
        is_dq_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Dq Tagged
        is_pii_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Pii Tagged
        is_sensitivity_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Sensitivity Tagged
        version:
          anyOf:
            - type: string
              pattern: ^\d+\.\d+$
            - type: 'null'
          title: Version
          description: For optimistic locking (e.g., '0.1', '0.10')
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Tag FQNs to associate (e.g., ['PII.Email'])
        tables:
          anyOf:
            - items:
                $ref: '#/components/schemas/TableMetadata'
              type: array
            - type: 'null'
          title: Tables
      type: object
      required:
        - name
        - fully_qualified_name
      title: SchemaMetadata
      description: Schema metadata for store requests.
    DatabaseMetadata:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        fully_qualified_name:
          type: string
          maxLength: 512
          minLength: 1
          title: Fully Qualified Name
        display_name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Display Name
        description:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Description
        summary_text:
          anyOf:
            - type: string
              maxLength: 8000
            - type: 'null'
          title: Summary Text
          description: >-
            Human-readable summary used as the source text for semantic search
            embedding. Should be a rich contextual description (~1000 tokens)
            for best results. When omitted, the entity is excluded from semantic
            search but remains discoverable via structured queries.
        type:
          type: string
          const: database
          title: Type
          default: database
        owners:
          anyOf:
            - items:
                $ref: '#/components/schemas/OwnerSchema'
              type: array
            - type: 'null'
          title: Owners
        extension:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extension
        schema_definition:
          anyOf:
            - type: string
            - type: 'null'
          title: Schema Definition
          description: DDL statement (e.g., CREATE DATABASE)
        is_dq_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Dq Tagged
        is_pii_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Pii Tagged
        is_sensitivity_tagged:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Sensitivity Tagged
        version:
          anyOf:
            - type: string
              pattern: ^\d+\.\d+$
            - type: 'null'
          title: Version
          description: For optimistic locking (e.g., '0.1', '0.10')
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Tag FQNs to associate (e.g., ['PII.Email'])
        schemas:
          anyOf:
            - items:
                $ref: '#/components/schemas/SchemaMetadata'
              type: array
            - type: 'null'
          title: Schemas
      type: object
      required:
        - name
        - fully_qualified_name
      title: DatabaseMetadata
      description: Database metadata for store requests.
    AssetType:
      type: string
      enum:
        - database
        - database_schema
        - table
        - column
      title: AssetType
      description: Asset type discriminator values.
    MetadataErrorCode:
      type: string
      enum:
        - not_found
        - permission_denied
        - validation_error
      title: MetadataErrorCode
      description: Error codes for per-item errors in bulk operations.
    ErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
        - INVALID_TOKEN
        - INSUFFICIENT_PERMISSIONS
        - RESOURCE_NOT_FOUND
        - RESOURCE_ALREADY_EXISTS
        - VALIDATION_ERROR
        - RATE_LIMIT_EXCEEDED
        - SERVICE_UNAVAILABLE
        - INTERNAL_ERROR
      title: ErrorCode
      description: Standard error codes for API responses.
    OwnerSchema:
      properties:
        name:
          type: string
          minLength: 1
          title: Name
        type:
          type: string
          title: Type
          description: 'Owner type: user or team'
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
      type: object
      required:
        - name
        - type
      title: OwnerSchema
      description: Owner information for metadata entities.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````