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

# Creates or updates data assets

> Creates or updates data assets



## OpenAPI

````yaml /api-reference/bundled.yaml post /v0/data-assets
openapi: 3.1.0
info:
  title: Gable API
  description: >
    API to interact with the Gable platform

    ## Authorization

    All API requests require an API key to be passed in the `X-API-KEY` header.
    For instructions on finding your API key and api endpoint check out the [API
    Key documentation](../docs/api-keys.md).

    Example: `curl -H "X-API-KEY: <your-api-key>"
    https://api-{organization}.gable.ai/v0/ping`
  contact:
    name: Gable Engineering
    url: https://gable.ai
    email: engineers@gable.ai
  version: 1.28.0
servers:
  - url: https://{hostname}.gable.ai
    description: Gable API
    variables:
      hostname:
        default: demo-api
        description: Customer environment assigned by Gable
security:
  - ApiKeyAuth: []
tags:
  - name: action
  - name: api-keys
  - name: auth
  - name: changelog
  - name: config
  - name: contract
  - name: data-asset
  - name: debug
  - name: s3
  - name: settings
  - name: slack
  - name: sso
  - name: webhook
  - name: notifications
  - name: constraints
  - name: telemetry
  - name: component
  - name: components
  - name: sca
  - name: cross-service-components
  - name: lineage
  - name: events
  - name: measurements
  - name: defect-report
  - name: experimental
paths:
  /v0/data-assets:
    post:
      tags:
        - data-asset
      summary: Creates or updates data assets
      description: Creates or updates data assets
      operationId: createOrUpdateDataAssets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrUpdateDataAssetsRequest'
      responses:
        '200':
          description: Assets created or updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrUpdateDataAssetsResponse'
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateOrUpdateDataAssetsRequest:
      type: array
      items:
        $ref: '#/components/schemas/DataAssetInput'
    CreateOrUpdateDataAssetsResponse:
      type: array
      items:
        $ref: '#/components/schemas/DataAssetOutput'
    ErrorResponse:
      type: object
      required:
        - message
      properties:
        id:
          type: number
        title:
          type: string
        message:
          type: string
    DataAssetInput:
      type: object
      properties:
        dataAssetResourceName:
          $ref: '#/components/schemas/DataAssetResourceName'
        domain:
          description: The domain or category to which the data asset belongs.
          type: string
        path:
          description: The name or path identifying the data asset.
          type: string
        type:
          $ref: '#/components/schemas/SourceType'
        description:
          type: string
          description: A brief description of this particular version of the data asset.
        rawSchema:
          type: string
          description: >-
            The raw schema of the data asset from the source system. This can be
            the contents of a schema file or data from the information  schema
            of a database. This is used to regenerate the schema of the data
            asset if needed.
        fields:
          description: The fields of the data asset.
          type: array
          items:
            $ref: '#/components/schemas/CreateOrUpdateDataAssetFieldRequest'
        prLink:
          description: Link to the PR that may have added or edited the data assets
          type: string
          example: https://github.com/fakeorg/fakerepo/pull/123
      required:
        - dataAssetResourceName
        - domain
        - path
        - type
        - fields
    DataAssetOutput:
      type: object
      required:
        - id
        - dataAssetResourceName
        - versionId
        - newVersionCreated
      properties:
        id:
          description: ID of the created or updated data asset
          type: string
          format: uuid
        versionId:
          description: Version ID of the now current data asset
          type: string
          format: uuid
        dataAssetResourceName:
          $ref: '#/components/schemas/DataAssetResourceName'
        newVersionCreated:
          description: Indicates whether a new version was created
          type: boolean
    DataAssetResourceName:
      type: string
      pattern: >-
        ^(protobuf|avro|json_schema|java|postgres|mysql|mssql|snowflake|bigquery|python|pyspark|typescript|s3|dataframe|kotlin|swift|php)://(?=.*[a-zA-Z0-9])[a-zA-Z0-9_@\.:/-]+[:/](?=.*[a-zA-Z0-9])[a-zA-Z0-9
        _\./-\{\}\-]+$
      description: >-
        The unique identifier of the data asset. It follows the pattern
        '{data_asset_type}://{data_asset_source}:{data_asset_name}'
    SourceType:
      type: string
      description: >-
        The type of the source data asset, indicating its source or format
        (e.g., postgres, protobuf).
      enum:
        - postgres
        - mysql
        - mssql
        - json_schema
        - avro
        - protobuf
        - python
        - pyspark
        - typescript
        - java
        - s3
        - dataframe
        - kotlin
        - swift
        - php
        - golang
    CreateOrUpdateDataAssetFieldRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the field.
        description:
          type: string
          description: A brief description of the field.
        order:
          type: integer
          description: The order or position of the field in the data asset.
        nativeDataType:
          type: string
          description: The native data type of the field in the source system.
        type:
          type: object
          additionalProperties: true
          description: >-
            A custom or specific attribute to represent the Gable type of the
            field.
        parentFieldId:
          type: string
          format: uuid
          description: For nested fields, this is the ID of the parent field.
        changeSummary:
          type: string
          description: >-
            A very brief LLM-generated summary of the changes made to the data
            asset field.
        changeDescription:
          type: string
          description: >-
            A detailed LLM-generated description of the changes made to the data
            asset field.
      required:
        - name
        - nativeDataType
        - type
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````