OpenHouse Tables APIs v0.1

> Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu. API description for OpenHouse Tables API Base URLs: * http://localhost:8080 Terms of service License: Apache 2.0

Snapshot

## Puts Iceberg snapshots to Table > Code samples `PUT /v0/databases/{databaseId}/tables/{tableId}/iceberg/v2/snapshots` Puts Iceberg snapshots to Table > Body parameter ```json { "baseTableVersion": "Base table version to apply the change to", "jsonSnapshots": [ "string" ], "createUpdateTableRequestBody": { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"},{\"id\":3,\"required\":true,\"name\":\"timestampColumn\",\"type\":\"timestamp\"}]}", "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]", "tableProperties": { "key": "value" }, "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "stageCreate": false, "baseTableVersion": "string", "tableType": "PRIMARY_TABLE" } } ```

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| |tableId|path|string|true|Table ID| |body|body|[IcebergSnapshotsRequestBody](#schemaicebergsnapshotsrequestbody)|true|none| > Example responses > 200 Response ```json { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "tableUri": "my_cluster.my_database.my_table", "tableUUID": "73ea0d21-3c89-4987-a6cf-26e4f86bdcee", "tableLocation": "://////metadata/.metadata.json", "tableVersion": "string", "tableCreator": "bob", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"}]}", "lastModifiedTime": 1651002318265, "creationTime": 1651002318265, "tableProperties": { "key": "value" }, "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": [ "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]" ], "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "tableType": "PRIMARY_TABLE" } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Iceberg snapshot PUT: UPDATED|[GetTableResponseBody](#schemagettableresponsebody)| |201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Iceberg snapshot PUT: CREATED|[GetTableResponseBody](#schemagettableresponsebody)| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Iceberg snapshot PUT: BAD_REQUEST|[GetTableResponseBody](#schemagettableresponsebody)| |409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|Iceberg snapshot PUT: CONFLICT|[GetTableResponseBody](#schemagettableresponsebody)|

Table

## Get Table in a Database > Code samples `GET /v1/databases/{databaseId}/tables/{tableId}` Returns a Table resource identified by tableId in the database identified by databaseId.

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| |tableId|path|string|true|Table ID| > Example responses > 200 Response ```json { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "tableUri": "my_cluster.my_database.my_table", "tableUUID": "73ea0d21-3c89-4987-a6cf-26e4f86bdcee", "tableLocation": "://////metadata/.metadata.json", "tableVersion": "string", "tableCreator": "bob", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"}]}", "lastModifiedTime": 1651002318265, "creationTime": 1651002318265, "tableProperties": { "key": "value" }, "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": [ "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]" ], "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "tableType": "PRIMARY_TABLE" } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Table GET: OK|[GetTableResponseBody](#schemagettableresponsebody)| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Table GET: UNAUTHORIZED|[GetTableResponseBody](#schemagettableresponsebody)| |403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Table GET: FORBIDDEN|[GetTableResponseBody](#schemagettableresponsebody)| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Table GET: NOT_FOUND|[GetTableResponseBody](#schemagettableresponsebody)| ## Update a Table > Code samples `PUT /v1/databases/{databaseId}/tables/{tableId}` Updates or creates a Table and returns the Table resources. If the table does not exist, it will be created. If the table exists, it will be updated. > Body parameter ```json { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"},{\"id\":3,\"required\":true,\"name\":\"timestampColumn\",\"type\":\"timestamp\"}]}", "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]", "tableProperties": { "key": "value" }, "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "stageCreate": false, "baseTableVersion": "string", "tableType": "PRIMARY_TABLE" } ```

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| |tableId|path|string|true|Table ID| |body|body|[CreateUpdateTableRequestBody](#schemacreateupdatetablerequestbody)|true|none| > Example responses > 200 Response ```json { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "tableUri": "my_cluster.my_database.my_table", "tableUUID": "73ea0d21-3c89-4987-a6cf-26e4f86bdcee", "tableLocation": "://////metadata/.metadata.json", "tableVersion": "string", "tableCreator": "bob", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"}]}", "lastModifiedTime": 1651002318265, "creationTime": 1651002318265, "tableProperties": { "key": "value" }, "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": [ "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]" ], "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "tableType": "PRIMARY_TABLE" } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Table PUT: UPDATED|[GetTableResponseBody](#schemagettableresponsebody)| |201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Table PUT: CREATED|[GetTableResponseBody](#schemagettableresponsebody)| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Table PUT: BAD_REQUEST|[GetTableResponseBody](#schemagettableresponsebody)| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Table PUT: UNAUTHORIZED|[GetTableResponseBody](#schemagettableresponsebody)| |403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Table PUT: FORBIDDEN|[GetTableResponseBody](#schemagettableresponsebody)| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Table PUT: DB_NOT_FOUND|[GetTableResponseBody](#schemagettableresponsebody)| ## DELETE Table > Code samples `DELETE /v1/databases/{databaseId}/tables/{tableId}` Deletes a table resource

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| |tableId|path|string|true|Table ID|

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|Table DELETE: NO_CONTENT|None| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Table DELETE: BAD_REQUEST|None| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Table DELETE: UNAUTHORIZED|None| |403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Table DELETE: FORBIDDEN|None| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Table DELETE: TBL_DB_NOT_FOUND|None| ## Search Tables in a Database > Code samples `POST /v1/databases/{databaseId}/tables/search` Returns a list of Table resources present in a database. Only filter supported is 'database_id'.

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| > Example responses > 200 Response ```json { "results": [ { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "tableUri": "my_cluster.my_database.my_table", "tableUUID": "73ea0d21-3c89-4987-a6cf-26e4f86bdcee", "tableLocation": "://////metadata/.metadata.json", "tableVersion": "string", "tableCreator": "bob", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"}]}", "lastModifiedTime": 1651002318265, "creationTime": 1651002318265, "tableProperties": { "key": "value" }, "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": [ "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]" ], "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "tableType": "PRIMARY_TABLE" } ] } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Table SEARCH: OK|[GetAllTablesResponseBody](#schemagetalltablesresponsebody)| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Table SEARCH: BAD_REQUEST|[GetAllTablesResponseBody](#schemagetalltablesresponsebody)| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Table SEARCH: UNAUTHORIZED|[GetAllTablesResponseBody](#schemagetalltablesresponsebody)| |403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Table SEARCH: FORBIDDEN|[GetAllTablesResponseBody](#schemagetalltablesresponsebody)| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Table SEARCH: NOT_FOUND|[GetAllTablesResponseBody](#schemagetalltablesresponsebody)| ## List Tables in a Database > Code samples `GET /v1/databases/{databaseId}/tables` Returns a list of Table resources present in a database identified by databaseId.

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| > Example responses > 200 Response ```json { "results": [ { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "tableUri": "my_cluster.my_database.my_table", "tableUUID": "73ea0d21-3c89-4987-a6cf-26e4f86bdcee", "tableLocation": "://////metadata/.metadata.json", "tableVersion": "string", "tableCreator": "bob", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"}]}", "lastModifiedTime": 1651002318265, "creationTime": 1651002318265, "tableProperties": { "key": "value" }, "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": [ "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]" ], "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "tableType": "PRIMARY_TABLE" } ] } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Table GET_ALL: OK|[GetAllTablesResponseBody](#schemagetalltablesresponsebody)| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Table GET_ALL: UNAUTHORIZED|[GetAllTablesResponseBody](#schemagetalltablesresponsebody)| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Table GET_ALL: DB NOT_FOUND|[GetAllTablesResponseBody](#schemagetalltablesresponsebody)| ## Create a Table > Code samples `POST /v1/databases/{databaseId}/tables` Creates and returns a Table resource in a database identified by databaseId > Body parameter ```json { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"},{\"id\":3,\"required\":true,\"name\":\"timestampColumn\",\"type\":\"timestamp\"}]}", "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]", "tableProperties": { "key": "value" }, "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "stageCreate": false, "baseTableVersion": "string", "tableType": "PRIMARY_TABLE" } ```

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| |body|body|[CreateUpdateTableRequestBody](#schemacreateupdatetablerequestbody)|true|none| > Example responses > 201 Response ```json { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "tableUri": "my_cluster.my_database.my_table", "tableUUID": "73ea0d21-3c89-4987-a6cf-26e4f86bdcee", "tableLocation": "://////metadata/.metadata.json", "tableVersion": "string", "tableCreator": "bob", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"}]}", "lastModifiedTime": 1651002318265, "creationTime": 1651002318265, "tableProperties": { "key": "value" }, "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": [ "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]" ], "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "tableType": "PRIMARY_TABLE" } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Table POST: CREATED|[GetTableResponseBody](#schemagettableresponsebody)| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Table POST: BAD_REQUEST|[GetTableResponseBody](#schemagettableresponsebody)| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Table POST: UNAUTHORIZED|[GetTableResponseBody](#schemagettableresponsebody)| |403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Table POST: FORBIDDEN|[GetTableResponseBody](#schemagettableresponsebody)| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Table POST: DB_NOT_FOUND|[GetTableResponseBody](#schemagettableresponsebody)| |409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|Table POST: TBL_EXISTS|[GetTableResponseBody](#schemagettableresponsebody)| ## Get AclPolicies for Table > Code samples `GET /v1/databases/{databaseId}/tables/{tableId}/aclPolicies` Returns principal to role mappings on Table resource identified by databaseId and tableId.

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| |tableId|path|string|true|Table ID| > Example responses > 200 Response ```json { "results": [ { "principal": "string", "role": "string" } ] } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|AclPolicies GET: OK|[GetAclPoliciesResponseBody](#schemagetaclpoliciesresponsebody)| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|AclPolicies GET: BAD_REQUEST|[GetAclPoliciesResponseBody](#schemagetaclpoliciesresponsebody)| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|AclPolicies GET: UNAUTHORIZED|[GetAclPoliciesResponseBody](#schemagetaclpoliciesresponsebody)| |403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|AclPolicies GET: FORBIDDEN|[GetAclPoliciesResponseBody](#schemagetaclpoliciesresponsebody)| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|AclPolicies GET: TABLE_NOT_FOUND|[GetAclPoliciesResponseBody](#schemagetaclpoliciesresponsebody)| ## Update AclPolicies for Table > Code samples `PATCH /v1/databases/{databaseId}/tables/{tableId}/aclPolicies` Updates role for principal on Table identified by databaseId and tableId > Body parameter ```json { "role": "string", "principal": "string", "operation": "GRANT" } ```

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| |tableId|path|string|true|Table ID| |body|body|[UpdateAclPoliciesRequestBody](#schemaupdateaclpoliciesrequestbody)|true|none|

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|AclPolicies PATCH: NO_CONTENT|None| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|AclPolicies PATCH: BAD_REQUEST|None| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|AclPolicies PATCH: UNAUTHORIZED|None| |403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|AclPolicies PATCH: FORBIDDEN|None| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|AclPolicies PATCH: TABLE_NOT_FOUND|None|

Database

## Get AclPolicies on Database > Code samples `GET /databases/{databaseId}/aclPolicies` Returns principal to role mappings on resource identified by databaseId.

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| > Example responses > 200 Response ```json { "results": [ { "principal": "string", "role": "string" } ] } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|AclPolicies GET: OK|[GetAclPoliciesResponseBody](#schemagetaclpoliciesresponsebody)| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|AclPolicies GET: BAD_REQUEST|[GetAclPoliciesResponseBody](#schemagetaclpoliciesresponsebody)| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|AclPolicies GET: UNAUTHORIZED|[GetAclPoliciesResponseBody](#schemagetaclpoliciesresponsebody)| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|AclPolicies GET: DB_NOT_FOUND|[GetAclPoliciesResponseBody](#schemagetaclpoliciesresponsebody)| ## Update AclPolicies on database > Code samples `PATCH /v1/databases/{databaseId}/aclPolicies` Updates role for principal on database identified by databaseId > Body parameter ```json { "role": "string", "principal": "string", "operation": "GRANT" } ```

Parameters

|Name|In|Type|Required|Description| |---|---|---|---|---| |databaseId|path|string|true|Database ID| |body|body|[UpdateAclPoliciesRequestBody](#schemaupdateaclpoliciesrequestbody)|true|none|

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|AclPolicies PATCH: UPDATED|None| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|AclPolicies PATCH: BAD_REQUEST|None| |401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|AclPolicies PATCH: UNAUTHORIZED|None| |403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|AclPolicies PATCH: FORBIDDEN|None| |404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|AclPolicies PATCH: DB_NOT_FOUND|None| ## List all Databases > Code samples `GET /v1/databases` Returns a list of Database resources. > Example responses > 200 Response ```json { "results": [ { "databaseId": "my_database", "clusterId": "my_cluster" } ] } ```

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Database GET_ALL: OK|[GetAllDatabasesResponseBody](#schemagetalldatabasesresponsebody)| # Schemas

ClusteringColumn

```json "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]" ``` Clustering columns for the table ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |columnName|string|true|none|Name of the clustering column in provided schema. The column should be of the type 'String'.Nested columns can also be provided with a dot-separated name (for example: 'eventHeader.countryCode').Column name is case-sensitive.|

CreateUpdateTableRequestBody

```json { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"},{\"id\":3,\"required\":true,\"name\":\"timestampColumn\",\"type\":\"timestamp\"}]}", "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]", "tableProperties": { "key": "value" }, "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "stageCreate": false, "baseTableVersion": "string", "tableType": "PRIMARY_TABLE" } ``` Request containing details of the Table to be created ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |tableId|string|true|none|Unique Resource identifier for a table within a Database| |databaseId|string|true|none|Unique Resource identifier for the Database containing the Table| |clusterId|string|true|none|Unique Resource identifier for the Cluster containing the Database| |schema|string|true|none|Schema of the table. OpenHouse tables use Iceberg schema specification| |timePartitioning|[TimePartitionSpec](#schematimepartitionspec)|false|none|Time partitioning of the table| |clustering|[[ClusteringColumn](#schemaclusteringcolumn)]¦null|false|none|Clustering columns for the table| |tableProperties|object|true|none|Table properties| |» **additionalProperties**|string|false|none|Table properties| |policies|[Policies](#schemapolicies)|false|none|Policies of the table| |stageCreate|boolean|false|none|Boolean that determines creating a staged table| |baseTableVersion|string|true|none|The version of table that the current update is based upon| |tableType|string|false|none|The type of a table| #### Enumerated Values |Property|Value| |---|---| |tableType|PRIMARY_TABLE| |tableType|REPLICA_TABLE|

IcebergSnapshotsRequestBody

```json { "baseTableVersion": "Base table version to apply the change to", "jsonSnapshots": [ "string" ], "createUpdateTableRequestBody": { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"},{\"id\":3,\"required\":true,\"name\":\"timestampColumn\",\"type\":\"timestamp\"}]}", "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]", "tableProperties": { "key": "value" }, "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "stageCreate": false, "baseTableVersion": "string", "tableType": "PRIMARY_TABLE" } } ``` Request containing a list of JSON serialized Iceberg Snapshots to be put ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |baseTableVersion|string|true|none|Base Table Version| |jsonSnapshots|[string]|false|none|List of json serialized snapshots to put| |createUpdateTableRequestBody|[CreateUpdateTableRequestBody](#schemacreateupdatetablerequestbody)|false|none|Request containing details of the Table to be created|

Policies

```json { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" } ``` Policies of the table ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |retention|[Retention](#schemaretention)|false|none|Retention as required in /tables API request. The column holds the retention part or Policies.| |sharingEnabled|boolean|false|none|Whether data sharing needs to enabled for the table in /tables API request. Sharing is disabled by default| |columnTags|object|false|none|Policy tags applied to columns in /tables API request.| |» **additionalProperties**|[PolicyTag](#schemapolicytag)|false|none|Policy tags applied to columns in /tables API request.|

PolicyTag

```json "{'colName': [PII, HC]}" ``` Policy tags applied to columns in /tables API request. ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |tags|[string]|false|none|Policy tags|

Retention

```json "{retention:{count:3, granularity: 'day'}}" ``` Retention as required in /tables API request. The column holds the retention part or Policies. ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |count|integer(int32)|true|none|time period in count for which the retention on table will be applied| |granularity|string|true|none|time period granularity for which the retention on table will be applied| |columnPattern|[RetentionColumnPattern](#schemaretentioncolumnpattern)|false|none|Optional object to specify retention column in case where timestamp is represented as a string| #### Enumerated Values |Property|Value| |---|---| |granularity|HOUR| |granularity|DAY| |granularity|MONTH| |granularity|YEAR|

RetentionColumnPattern

```json "{columnName:datepartition, pattern: yyyy-MM-dd-HH}" ``` Optional object to specify retention column in case where timestamp is represented as a string ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |columnName|string|true|none|Name of retention column| |pattern|string|true|none|Pattern for the value of the retention column following java.time.format.DateTimeFormatter standard.|

TimePartitionSpec

```json "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}" ``` Time partitioning of the table ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |columnName|string|true|none|Name of the timestamp column in provided schema. The column should be of the type 'Timestamp'. Nested columns can also be provided with a dot-separated name (for example: 'eventHeader.timeColumn').Column name is case-sensitive.| |granularity|string|true|none|Granularity of the time partition.| #### Enumerated Values |Property|Value| |---|---| |granularity|HOUR| |granularity|DAY| |granularity|MONTH| |granularity|YEAR|

GetTableResponseBody

```json { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "tableUri": "my_cluster.my_database.my_table", "tableUUID": "73ea0d21-3c89-4987-a6cf-26e4f86bdcee", "tableLocation": "://////metadata/.metadata.json", "tableVersion": "string", "tableCreator": "bob", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"}]}", "lastModifiedTime": 1651002318265, "creationTime": 1651002318265, "tableProperties": { "key": "value" }, "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": [ "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]" ], "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "tableType": "PRIMARY_TABLE" } ``` ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |tableId|string|false|read-only|Unique Resource identifier for a table within a Database| |databaseId|string|false|read-only|Unique Resource identifier for the Database containing the Table| |clusterId|string|false|read-only|Unique Resource identifier for the Cluster containing the Database| |tableUri|string|false|read-only|Fully Qualified Resource URI for the table| |tableUUID|string|false|read-only|Table UUID| |tableLocation|string|false|read-only|Location of Table in File System / Blob Store| |tableVersion|string|false|read-only|Current Version of the Table.| |tableCreator|string|false|read-only|Authenticated user principal that created the Table.| |schema|string|false|read-only|Schema of the Table in Iceberg| |lastModifiedTime|integer(int64)|false|read-only|Last modification epoch time in UTC measured in milliseconds of a table.| |creationTime|integer(int64)|false|read-only|Table creation epoch time measured in UTC in milliseconds of a table.| |tableProperties|object|false|read-only|A map of table properties| |» **additionalProperties**|string|false|none|A map of table properties| |timePartitioning|[TimePartitionSpec](#schematimepartitionspec)|false|none|Time partitioning of the table| |clustering|[[ClusteringColumn](#schemaclusteringcolumn)]¦null|false|none|Clustering columns for the table| |policies|[Policies](#schemapolicies)|false|none|Policies of the table| |tableType|string|false|read-only|The type of a table| #### Enumerated Values |Property|Value| |---|---| |tableType|PRIMARY_TABLE| |tableType|REPLICA_TABLE|

GetAllTablesResponseBody

```json { "results": [ { "tableId": "my_table", "databaseId": "my_database", "clusterId": "my_cluster", "tableUri": "my_cluster.my_database.my_table", "tableUUID": "73ea0d21-3c89-4987-a6cf-26e4f86bdcee", "tableLocation": "://////metadata/.metadata.json", "tableVersion": "string", "tableCreator": "bob", "schema": "{\"type\":\"struct\",\"fields\":[{\"id\":1,\"required\":true,\"name\":\"id\",\"type\":\"string\"},{\"id\":2,\"required\":true,\"name\":\"name\",\"type\":\"string\"}]}", "lastModifiedTime": 1651002318265, "creationTime": 1651002318265, "tableProperties": { "key": "value" }, "timePartitioning": "\"timePartitioning\":{\"columnName\":\"timestampCol\",\"granularity\":\"HOUR\"}", "clustering": [ "\"clustering\":[{\"columnName\":\"country\"},{\"columnName\":\"city\"}]" ], "policies": { "retention": "{retention:{count:3, granularity: 'day'}}", "sharingEnabled": false, "columnTags": "{'colName': [PII, HC]}" }, "tableType": "PRIMARY_TABLE" } ] } ``` ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |results|[[GetTableResponseBody](#schemagettableresponsebody)]|false|read-only|List of Table objects in a database|

UpdateAclPoliciesRequestBody

```json { "role": "string", "principal": "string", "operation": "GRANT" } ``` Request containing aclPolicies of the Database to be updated ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |role|string|true|none|Role that is being granted/revoked.| |principal|string|true|none|Grantee principal whose role is being updated| |operation|string|true|none|Whether this is a grant/revoke request| #### Enumerated Values |Property|Value| |---|---| |operation|GRANT| |operation|REVOKE|

AclPolicy

```json { "principal": "string", "role": "string" } ``` List of acl policies associated with table/database ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |principal|string|false|read-only|Principal with the role on the table/database| |role|string|false|read-only|Role associated with the principal|

GetAclPoliciesResponseBody

```json { "results": [ { "principal": "string", "role": "string" } ] } ``` ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |results|[[AclPolicy](#schemaaclpolicy)]|false|read-only|List of acl policies associated with table/database|

GetAllDatabasesResponseBody

```json { "results": [ { "databaseId": "my_database", "clusterId": "my_cluster" } ] } ``` ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |results|[[GetDatabaseResponseBody](#schemagetdatabaseresponsebody)]|false|read-only|List of Database objects|

GetDatabaseResponseBody

```json { "databaseId": "my_database", "clusterId": "my_cluster" } ``` List of Database objects ### Properties |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |databaseId|string|false|read-only|Unique Resource identifier for the Database| |clusterId|string|false|read-only|Unique Resource identifier for the Cluster containing the Database|