# Create

Launch stage: GA

`POST /api/2.0/clean-rooms/{asset.clean_room_name}/assets`

Create a clean room asset —share an asset like a notebook or table into the clean room.
 For each UC asset that is added through this method, the clean room owner must also have
 enough privilege on the asset to consume it.
 The privilege must be maintained indefinitely for the clean room to be able to access the asset.
 Typically, you should use a group as the clean room owner.

API scopes: cleanrooms

## Path parameters

- `asset` (object, optional)
  - `clean_room_name` (string, optional)
    The name of the clean room this asset belongs to.
     This field is required for create operations and populated by the server for responses.
    Example: `test-clean-room1`
  - `name` (string, optional)
    A fully qualified name that uniquely identifies the asset within the clean room.
     This is also the name displayed in the clean room UI.
    
     For UC securable assets (tables, volumes, etc.), the format is *shared_catalog*.*shared_schema*.*asset_name*
    
     For notebooks, the name is the notebook file name.
     For jar analyses, the name is the jar analysis name.
    Example: `creator.sales.products`
  - `asset_type` (string, optional)
    The type of the asset.
    Possible values: `ASSET_TYPE_UNSPECIFIED`, `TABLE`, `NOTEBOOK_FILE`, `VOLUME`, `VIEW`, `FOREIGN_TABLE`, `JAR_ANALYSIS`
  - `added_at` (int64, optional)
    When the asset is added to the clean room, in epoch milliseconds.
    Example: `1716424663321`
  - `status` (string, optional)
    Status of the asset
    Possible values: `ENUM_UNSPECIFIED`, `ACTIVE`, `PERMISSION_DENIED`, `PENDING`
  - `owner_collaborator_alias` (string, optional)
    The alias of the collaborator who owns this asset
    Example: `creator`
  - `table_local_details` (object, required)
    Local details for a table that are only available to its owner.
     Present if and only if **asset_type** is **TABLE**
    - `local_name` (string, optional)
      The fully qualified name of the table in its owner's local metastore,
       in the format of *catalog*.*schema*.*table_name*
      Example: `demo.sales.products`
    - `partitions` (array of object, optional)
      Partition filtering specification for a shared table.
      - `values` (array of object, optional)
        An array of partition values.
  - `volume_local_details` (object, required)
    Local details for a volume that are only available to its owner.
     Present if and only if **asset_type** is **VOLUME**
    - `local_name` (string, optional)
      The fully qualified name of the volume in its owner's local metastore,
       in the format of *catalog*.*schema*.*volume_name*
      Example: `demo.sales.products`
  - `view_local_details` (object, required)
    Local details for a view that are only available to its owner.
     Present if and only if **asset_type** is **VIEW**
    - `local_name` (string, optional)
      The fully qualified name of the view in its owner's local metastore,
       in the format of *catalog*.*schema*.*view_name*
      Example: `demo.sales.products`
  - `foreign_table_local_details` (object, required)
    Local details for a foreign that are only available to its owner.
     Present if and only if **asset_type** is **FOREIGN_TABLE**
    - `local_name` (string, optional)
      The fully qualified name of the foreign table in its owner's local metastore,
       in the format of *catalog*.*schema*.*foreign_table_name*
      Example: `demo.sales.products`
  - `table` (object, required)
    Table details available to all collaborators of the clean room.
     Present if and only if **asset_type** is **TABLE**
    - `columns` (array of object, optional)
      The metadata information of the columns in the table
      - `name` (string, optional)
        Name of Column.
      - `type_text` (string, optional)
        Full data type specification as SQL/catalogString text.
      - `type_name` (string, optional)
        Possible values: `BOOLEAN`, `BYTE`, `SHORT`, `INT`, `LONG`, `FLOAT`, `DOUBLE`, `DATE`, `TIMESTAMP`, `STRING`, `BINARY`, `DECIMAL`, `INTERVAL`, `ARRAY`, `STRUCT`, `MAP`, `CHAR`, `NULL`, `USER_DEFINED_TYPE`, `TIMESTAMP_NTZ`, `VARIANT`, `GEOMETRY`, `GEOGRAPHY`, `TABLE_TYPE`
      - `position` (int32, optional)
        Ordinal position of column (starting at position 0).
      - `type_precision` (int32, optional)
        Digits of precision; required for DecimalTypes.
      - `type_scale` (int32, optional)
        Digits to right of decimal; Required for DecimalTypes.
      - `type_interval_type` (string, optional)
        Format of IntervalType.
      - `type_json` (string, optional)
        Full data type specification, JSON-serialized.
      - `comment` (string, optional)
        User-provided free-form text description.
      - `nullable` (boolean, optional)
        Whether field may be Null (default: true).
        Default: `true`
      - `partition_index` (int32, optional)
        Partition index for column.
      - `mask` (object, optional)
  - `notebook` (object, required)
    Notebook details available to all collaborators of the clean room.
     Present if and only if **asset_type** is **NOTEBOOK_FILE**
    - `notebook_content` (string, optional)
      Base 64 representation of the notebook contents.
       This is the same format as returned by [workspace/export](https://docs.databricks.com/api/workspace/workspace/export) with the format of **HTML**.
    - `etag` (string, optional)
      Server generated etag that represents the notebook version.
    - `runner_collaborator_aliases` (array of string, optional)
      Aliases of collaborators that can run the notebook.
    - `reviews` (array of object, optional)
      All existing approvals or rejections
      - `reviewer_collaborator_alias` (string, optional)
        Collaborator alias of the reviewer
      - `created_at_millis` (int64, optional)
        When the review was submitted, in epoch milliseconds
      - `review_state` (string, optional)
        Review outcome
        Possible values: `NOTEBOOK_REVIEW_STATE_UNSPECIFIED`, `APPROVED`, `REJECTED`, `PENDING`
      - `comment` (string, optional)
        Review comment
        Example: `Code looks wrong`
        Constraints: `<= 500 characters`
      - `review_sub_reason` (string, optional)
        Specified when the review was not explicitly made by a user
        Possible values: `NOTEBOOK_REVIEW_SUB_REASON_UNSPECIFIED`, `BACKFILLED`, `AUTO_APPROVED`
    - `review_state` (string, optional)
      Top-level status derived from all reviews
      Possible values: `NOTEBOOK_REVIEW_STATE_UNSPECIFIED`, `APPROVED`, `REJECTED`, `PENDING`
    - `description` (string, optional)
      Optional description of the notebook shown to all collaborators.
      Example: `This is a description of the Clean Room Notebook`
      Constraints: `<= 10000 characters`
    - `environment_version` (string, optional)
      The serverless environment version used to execute the notebook (e.g. "4").
       Defaults to "2" if not specified.
  - `view` (object, required)
    View details available to all collaborators of the clean room.
     Present if and only if **asset_type** is **VIEW**
    - `columns` (array of object, optional)
      The metadata information of the columns in the view
      - `name` (string, optional)
        Name of Column.
      - `type_text` (string, optional)
        Full data type specification as SQL/catalogString text.
      - `type_name` (string, optional)
        Possible values: `BOOLEAN`, `BYTE`, `SHORT`, `INT`, `LONG`, `FLOAT`, `DOUBLE`, `DATE`, `TIMESTAMP`, `STRING`, `BINARY`, `DECIMAL`, `INTERVAL`, `ARRAY`, `STRUCT`, `MAP`, `CHAR`, `NULL`, `USER_DEFINED_TYPE`, `TIMESTAMP_NTZ`, `VARIANT`, `GEOMETRY`, `GEOGRAPHY`, `TABLE_TYPE`
      - `position` (int32, optional)
        Ordinal position of column (starting at position 0).
      - `type_precision` (int32, optional)
        Digits of precision; required for DecimalTypes.
      - `type_scale` (int32, optional)
        Digits to right of decimal; Required for DecimalTypes.
      - `type_interval_type` (string, optional)
        Format of IntervalType.
      - `type_json` (string, optional)
        Full data type specification, JSON-serialized.
      - `comment` (string, optional)
        User-provided free-form text description.
      - `nullable` (boolean, optional)
        Whether field may be Null (default: true).
        Default: `true`
      - `partition_index` (int32, optional)
        Partition index for column.
      - `mask` (object, optional)
  - `foreign_table` (object, required)
    Foreign table details available to all collaborators of the clean room.
     Present if and only if **asset_type** is **FOREIGN_TABLE**
    - `columns` (array of object, optional)
      The metadata information of the columns in the foreign table
      - `name` (string, optional)
        Name of Column.
      - `type_text` (string, optional)
        Full data type specification as SQL/catalogString text.
      - `type_name` (string, optional)
        Possible values: `BOOLEAN`, `BYTE`, `SHORT`, `INT`, `LONG`, `FLOAT`, `DOUBLE`, `DATE`, `TIMESTAMP`, `STRING`, `BINARY`, `DECIMAL`, `INTERVAL`, `ARRAY`, `STRUCT`, `MAP`, `CHAR`, `NULL`, `USER_DEFINED_TYPE`, `TIMESTAMP_NTZ`, `VARIANT`, `GEOMETRY`, `GEOGRAPHY`, `TABLE_TYPE`
      - `position` (int32, optional)
        Ordinal position of column (starting at position 0).
      - `type_precision` (int32, optional)
        Digits of precision; required for DecimalTypes.
      - `type_scale` (int32, optional)
        Digits to right of decimal; Required for DecimalTypes.
      - `type_interval_type` (string, optional)
        Format of IntervalType.
      - `type_json` (string, optional)
        Full data type specification, JSON-serialized.
      - `comment` (string, optional)
        User-provided free-form text description.
      - `nullable` (boolean, optional)
        Whether field may be Null (default: true).
        Default: `true`
      - `partition_index` (int32, optional)
        Partition index for column.
      - `mask` (object, optional)
  - `jar_analysis` (object, required, Public Preview)
    Jar analysis details available to all collaborators of the clean room.
     Present if and only if **asset_type** is **JAR_ANALYSIS**
    - `etag` (string, optional, Public Preview)
      Server generated etag that represents the jar analysis version.
    - `description` (string, optional, Public Preview)
      Optional description of the jar analysis shown to all collaborators.
      Example: `This is a description of the Clean Room JAR`
      Constraints: `<= 10000 characters`
    - `runner_collaborator_aliases` (array of string, optional, Public Preview)
      Collaborators that can run the jar.
    - `reviews` (array of object, optional, Public Preview)
      All existing approvals or rejections.
      - `reviewer_collaborator_alias` (string, optional, Public Preview)
        collaborator alias of the reviewer
      - `created_at_millis` (int64, optional, Public Preview)
        timestamp of when the review was submitted
      - `review_state` (string, optional, Public Preview)
        review outcome
        Possible values: `JAR_ANALYSIS_REVIEW_STATE_UNSPECIFIED`, `APPROVED`, `REJECTED`, `PENDING`
      - `comment` (string, optional, Public Preview)
        review comment
        Example: `Not ready to run yet`
        Constraints: `<= 500 characters`
      - `review_sub_reason` (string, optional, Public Preview)
        specified when the review was not explicitly made by a user
        Possible values: `JAR_ANALYSIS_REVIEW_SUB_REASON_UNSPECIFIED`, `AUTO_APPROVED`
    - `review_state` (string, optional, Public Preview)
      Top-level status derived from all reviews.
      Possible values: `JAR_ANALYSIS_REVIEW_STATE_UNSPECIFIED`, `APPROVED`, `REJECTED`, `PENDING`
    - `main_class_name` (string, optional, Public Preview)
      The full name of the class containing the main method to be executed. This class must be contained in a JAR provided as a library
       The code must use `SparkContext.getOrCreate` to obtain a Spark context; otherwise, runs of the job fail
      Example: `com.databricks.ComputeModels`
    - `central_jar_file_paths` (array of string, optional, Public Preview)
      The full paths in central to the jar files that are added to the library during execution (e.g. /Volumes/creator/schema/volume/folder/my_jar_file.jar)
       Only returned for the owner collaborator.
    - `environment_version` (string, optional, Public Preview)
      The serverless environment version used to execute the JAR analysis (e.g. "4").
       Defaults to "4-scala-preview" if not specified.

## Returns

Returns the CleanRoomAsset object.

## Response

```json
{
  "clean_room_name": "test-clean-room1",
  "name": "creator.sales.products",
  "asset_type": "string",
  "added_at": 1716424663321,
  "status": "string",
  "owner_collaborator_alias": "creator",
  "table_local_details": {
    "local_name": "demo.sales.products",
    "partitions": [
      {}
    ]
  },
  "volume_local_details": {
    "local_name": "demo.sales.products"
  },
  "view_local_details": {
    "local_name": "demo.sales.products"
  },
  "foreign_table_local_details": {
    "local_name": "demo.sales.products"
  },
  "table": {
    "columns": [
      {}
    ]
  },
  "notebook": {
    "notebook_content": "string",
    "etag": "string",
    "runner_collaborator_aliases": [
      "string"
    ],
    "reviews": [
      {}
    ],
    "review_state": "string",
    "description": "This is a description of the Clean Room Notebook",
    "environment_version": "string"
  },
  "view": {
    "columns": [
      {}
    ]
  },
  "foreign_table": {
    "columns": [
      {}
    ]
  },
  "jar_analysis": {
    "etag": "string",
    "description": "This is a description of the Clean Room JAR",
    "runner_collaborator_aliases": [
      "string"
    ],
    "reviews": [
      {}
    ],
    "review_state": "string",
    "main_class_name": "com.databricks.ComputeModels",
    "central_jar_file_paths": [
      "string"
    ],
    "environment_version": "string"
  }
}
```

