openapi: 3.0.0 servers: - description: Snowflake REST Server url: https://org-account.snowflakecomputing.com info: version: 0.0.1 title: Snowflake Table API description: The Snowflake Table API is a REST API that you can use to access, update, and perform certain actions on Tables resource in a Snowflake database. contact: name: Snowflake, Inc. url: https://snowflake.com email: support@snowflake.com paths: /api/v2/databases/{database}/schemas/{schema}/tables: get: summary: List tables tags: - table description: Lists the tables under the database and schema. operationId: listTables parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/like - $ref: common.yaml#/components/parameters/startsWith - $ref: common.yaml#/components/parameters/showLimit - $ref: common.yaml#/components/parameters/fromName - name: history description: Optionally includes dropped tables that have not yet been purged. in: query required: false schema: type: boolean - name: deep description: Optionally includes dependency information of the table. in: query required: false schema: type: boolean responses: '200': description: successful headers: X-Snowflake-Request-ID: $ref: common.yaml#/components/headers/X-Snowflake-Request-ID Link: $ref: common.yaml#/components/headers/Link content: application/json: schema: type: array items: $ref: '#/components/schemas/Table' '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout post: summary: Create a table (clone and undrop are separate subresources) tags: - table description: Create a table. operationId: createTable parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/createMode - $ref: common.yaml#/components/parameters/copyGrants requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Table' responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:as_select: post: deprecated: true summary: Create a table using the result of the specified select query tags: - table description: Create a table as select. operationId: createTableAsSelectDeprecated parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/createMode - $ref: common.yaml#/components/parameters/copyGrants - name: query in: query required: true description: The SQL select query to run to set up the table values (and possibly columns). schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Table' responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables:as-select: post: summary: Create a table using the result of the specified select query tags: - table description: Create a table as select. operationId: createTableAsSelect parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/createMode - $ref: common.yaml#/components/parameters/copyGrants - name: query in: query required: true description: The SQL select query to run to set up the table values (and possibly columns). schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TableAsSelect' responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:using_template: post: deprecated: true summary: Create a table using the templates specified in staged files tags: - table description: Create a table using template. operationId: createTableUsingTemplateDeprecated parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/createMode - $ref: common.yaml#/components/parameters/copyGrants - name: query description: The SQL query that uses INFER_SCHEMA on staged files to set the column definitions for the new table. in: query required: true schema: type: string responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables:using-template: post: summary: Create a table using the templates specified in staged files tags: - table description: Create a table using template. operationId: createTableUsingTemplate parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/createMode - $ref: common.yaml#/components/parameters/copyGrants - name: query description: The SQL query that uses INFER_SCHEMA on staged files to set the column definitions for the new table. in: query required: true schema: type: string requestBody: required: false content: application/json: schema: $ref: '#/components/schemas/TableUsingTemplate' responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}: get: summary: Fetch a table. tags: - table description: Fetch a Table using the describe command output. operationId: fetchTable parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name responses: '200': description: successful headers: X-Snowflake-Request-ID: $ref: common.yaml#/components/headers/X-Snowflake-Request-ID Link: $ref: common.yaml#/components/headers/Link content: application/json: schema: $ref: '#/components/schemas/Table' '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout put: summary: Create a (or alter an existing) table. tags: - table description: Create a (or alter an existing) table. Even if the operation is just an alter, the full property set must be provided. operationId: createOrAlterTable parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Table' responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout delete: parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/ifExists summary: Delete a table tags: - table description: Delete a table with the given name. operationId: deleteTable responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:clone: post: summary: Clone table tags: - table description: Create a new table by cloning from the specified resource operationId: cloneTable parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/createMode - $ref: common.yaml#/components/parameters/copyGrants - name: targetDatabase in: query description: Database of the newly created table. Defaults to the source table's database. schema: $ref: ./common.yaml#/components/schemas/Identifier - name: targetSchema in: query description: Schema of the newly created table. Defaults to the source table's schema. schema: $ref: ./common.yaml#/components/schemas/Identifier requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TableClone' responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:create_like: post: deprecated: true summary: Create a table like this existing one tags: - table description: Create a new table like the specified resource, but empty operationId: createTableLikeDeprecated parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/createMode - $ref: common.yaml#/components/parameters/copyGrants - name: newTableName description: The name of the table to be created. in: query required: true schema: type: string responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:create-like: post: summary: Create a table like this existing one tags: - table description: Create a new table like the specified resource, but empty operationId: createTableLike parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/createMode - $ref: common.yaml#/components/parameters/copyGrants requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TableLike' responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:undrop: post: parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name summary: Undrop a table tags: - table description: Undrop specified table operationId: undropTable responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:suspend_recluster: post: deprecated: true parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/ifExists summary: Suspend recluster of a table tags: - table description: Suspend recluster of a table operationId: suspendReclusterTableDeprecated responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:suspend-recluster: post: parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/ifExists summary: Suspend recluster of a table tags: - table description: Suspend recluster of a table operationId: suspendReclusterTable responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:resume_recluster: post: deprecated: true parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/ifExists summary: Resume recluster of a table tags: - table description: Resume recluster of a table operationId: resumeReclusterTableDeprecated responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:resume-recluster: post: parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/ifExists summary: Resume recluster of a table tags: - table description: Resume recluster of a table operationId: resumeReclusterTable responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:swapwith: post: deprecated: true parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/ifExists - name: targetTableName description: The fully-specified name of the target table to be swapped with. in: query required: true schema: type: string summary: Swap with another table tags: - table description: Swap with another table operationId: swapWithTableDeprecated responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:swap-with: post: parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/ifExists - name: targetName description: The name of the target table to be swapped with. in: query required: true schema: $ref: common.yaml#/components/schemas/Identifier - name: targetDatabase in: query description: Database of the target table. Defaults to the source table's database. schema: $ref: common.yaml#/components/schemas/Identifier - name: targetSchema in: query description: Schema of the target table. Defaults to the source table's schema. schema: $ref: common.yaml#/components/schemas/Identifier summary: Swap with another table tags: - table description: Swap with another table operationId: swapWithTable responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout /api/v2/databases/{database}/schemas/{schema}/tables/{name}:set-tags: post: summary: Set tags on a table. tags: - table description: Set tags on a table. operationId: setTags parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/ifExists responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout requestBody: required: true content: application/json: schema: type: array items: $ref: common.yaml#/components/schemas/TagAssignment /api/v2/databases/{database}/schemas/{schema}/tables/{name}:unset-tags: post: summary: Unset tags from a table. tags: - table description: Unset tags from a table. operationId: unsetTags parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/ifExists responses: '200': $ref: common.yaml#/components/responses/200SuccessResponse '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout requestBody: required: true content: application/json: schema: type: array items: $ref: common.yaml#/components/schemas/TagReference /api/v2/databases/{database}/schemas/{schema}/tables/{name}:get-tags: get: summary: Get the tag assignments for a table. tags: - table description: Returns all tags assigned to a table. This operation requires an active warehouse. operationId: getTags parameters: - $ref: common.yaml#/components/parameters/database - $ref: common.yaml#/components/parameters/schema - $ref: common.yaml#/components/parameters/name - $ref: common.yaml#/components/parameters/withLineage responses: '200': description: successful headers: X-Snowflake-Request-ID: $ref: common.yaml#/components/headers/X-Snowflake-Request-ID Link: $ref: common.yaml#/components/headers/Link content: application/json: schema: type: array items: $ref: common.yaml#/components/schemas/TagAssignment '202': $ref: common.yaml#/components/responses/202SuccessAcceptedResponse '400': $ref: common.yaml#/components/responses/400BadRequest '401': $ref: common.yaml#/components/responses/401Unauthorized '403': $ref: common.yaml#/components/responses/403Forbidden '404': $ref: common.yaml#/components/responses/404NotFound '405': $ref: common.yaml#/components/responses/405MethodNotAllowed '408': $ref: common.yaml#/components/responses/408RequestTimeout '409': $ref: common.yaml#/components/responses/409Conflict '410': $ref: common.yaml#/components/responses/410Gone '429': $ref: common.yaml#/components/responses/429LimitExceeded '500': $ref: common.yaml#/components/responses/500InternalServerError '503': $ref: common.yaml#/components/responses/503ServiceUnavailable '504': $ref: common.yaml#/components/responses/504GatewayTimeout components: schemas: Table: type: object description: A Snowflake table properties: name: type: string description: Specifies the name for the table, must be unique for the schema in which the table is created kind: type: string enum: - PERMANENT - TRANSIENT - TEMPORARY - '' - transient - temporary x-enum-varnames: - PERMANENT - TRANSIENT - TEMPORARY - DEPRECATED_PERMANENT - DEPRECATED_TRANSIENT - DEPRECATED_TEMPORARY default: PERMANENT description: Table type - permanent, transient, or temporary cluster_by: type: array description: Specifies one or more columns or column expressions in the table as the clustering key items: type: string cluster_by_raw: type: string nullable: true readOnly: true description: Raw clustering key string from the DDL statement. enable_schema_evolution: type: boolean description: Table has schema evolution enabled or disabled change_tracking: type: boolean description: Change tracking is enabled or disabled data_retention_time_in_days: type: integer description: Specifies the retention period for the table so that Time Travel actions SELECT, CLONE, UNDROP can be performed on historical data in the table max_data_extension_time_in_days: type: integer description: Specifies the retention period for the table so that Time Travel actions SELECT, CLONE, UNDROP can be performed on historical data in the table default_ddl_collation: type: string description: Specifies a default collation specification for the columns in the table, including columns added to the table in the future data_metric_schedule: $ref: common.yaml#/components/schemas/DataMetricSchedule columns: type: array items: $ref: '#/components/schemas/TableColumn' constraints: type: array items: $ref: '#/components/schemas/Constraint' comment: type: string description: Comment for the table row_timestamp: type: boolean nullable: true description: Whether ROW_TIMESTAMP is enabled on this table. error_logging: type: boolean nullable: true description: Whether ERROR_LOGGING is enabled on this table. created_on: type: string format: date-time readOnly: true description: Date and time when the table was created. database_name: type: string readOnly: true description: Database in which the table is stored schema_name: type: string readOnly: true description: Schema in which the table is stored rows: type: integer format: int64 readOnly: true description: Number of rows in the table. Returns NULL for external tables. bytes: type: integer format: int64 readOnly: true description: Number of bytes that will be scanned if the entire table is scanned in a query. Note that this number may be different than the number of actual physical bytes stored on-disk for the table owner: type: string readOnly: true description: Role that owns the table dropped_on: type: string format: date-time readOnly: true description: Date and time when the table was dropped automatic_clustering: type: boolean readOnly: true description: If Automatic Clustering is enabled for your account, specifies whether it is explicitly enabled or disabled for the table. search_optimization: type: boolean readOnly: true description: If ON, the table has the search optimization service enabled search_optimization_progress: type: integer format: int64 readOnly: true description: Percentage of the table that has been optimized for search. search_optimization_bytes: type: integer format: int64 readOnly: true description: Number of additional bytes of storage that the search optimization service consumes for this table search_optimization_configuration: type: array readOnly: true description: Per-expression search optimization configuration. Configuration is not settable through this API (POST/PUT); use ALTER TABLE ... ADD/DROP SEARCH OPTIMIZATION. items: $ref: '#/components/schemas/SearchOptimizationExpression' owner_role_type: type: string readOnly: true description: The type of role that owns the object. budget: type: string readOnly: true description: Name of the budget if the object is monitored by a budget table_type: type: string enum: - NORMAL - DYNAMIC - EXTERNAL - EVENT - HYBRID - ICEBERG - IMMUTABLE readOnly: true description: Type of the table required: - name TableColumn: type: object description: A column in the table properties: name: type: string description: Column name datatype: type: string description: The data type for the column nullable: type: boolean default: true description: Specifies that the column does allow NULL values or not. collate: type: string description: Specifies the collation to use for column operations such as string comparison default: type: string description: Specifies whether a default value is automatically inserted in the column if a value is not explicitly specified via an INSERT or CREATE TABLE AS SELECT statement autoincrement: type: boolean autoincrement_start: type: integer description: The default value for the column starts with the specified number autoincrement_increment: type: integer description: Each successive value for the column automatically increments by the specified amount autoincrement_order: type: string nullable: true description: Identity sequence ordering keyword. "ORDER" guarantees monotonically increasing values across concurrent sessions; "NOORDER" allows session-local allocation for higher concurrency. constraints: type: array items: $ref: '#/components/schemas/Constraint' comment: type: string description: Specifies a comment for the column required: - name - datatype Constraint: type: object description: Constraints define integrity and consistency rules for data stored in tables. properties: name: type: string description: Name of the Constraint column_names: type: array items: type: string description: Column name for the constraint constraint_type: type: string description: Type of the constraint deferrability: type: string nullable: true readOnly: true description: Constraint deferrability. enforced: type: boolean nullable: true readOnly: true description: Whether the constraint is enforced. enable: type: boolean nullable: true readOnly: true description: Always null. validate: type: boolean nullable: true readOnly: true description: Whether existing data is validated against the constraint. rely: type: boolean nullable: true description: Whether the optimizer can rely on the constraint. comment: type: string nullable: true description: Comment associated with the constraint. Used only on out-of-line (table-level) constraints; ignored on inline (column-level) constraints. discriminator: propertyName: constraint_type mapping: PRIMARY KEY: PrimaryKey FOREIGN KEY: ForeignKey UNIQUE: UniqueKey CHECK: CheckConstraint PrimaryKey: allOf: - $ref: '#/components/schemas/Constraint' type: object description: A primary key is the column or columns that contain values that uniquely identify each row in a table. UniqueKey: allOf: - $ref: '#/components/schemas/Constraint' type: object description: Unique keys are columns in a table that uniquely identify items in the rows. This sounds a lot like a primary key, but the main difference is that unique keys can have NULL values. ForeignKey: allOf: - $ref: '#/components/schemas/Constraint' type: object description: Foreign keys link data in one table to the data in another table. properties: referenced_table_name: type: string referenced_column_names: type: array items: type: string match: type: string nullable: true readOnly: true description: Match type for the foreign key. on_delete: type: string nullable: true readOnly: true description: Action taken on delete of the referenced row. on_update: type: string nullable: true readOnly: true description: Action taken on update of the referenced row. required: - referenced_table_name - referenced_column_names SearchOptimizationExpression: type: object description: A single configured search optimization expression. Read-only; configure with ALTER TABLE ... ADD/DROP SEARCH OPTIMIZATION. properties: expression_id: type: integer format: int64 description: Stable identifier assigned by Snowflake to this configuration. Matches the id shown by DESCRIBE SEARCH OPTIMIZATION and usable with ALTER TABLE ... DROP SEARCH OPTIMIZATION ON . method: type: string enum: - EQUALITY - SUBSTRING - FULL_TEXT - GEO description: User-facing search method for this expression. target: type: string description: SQL target of this expression (e.g. "EQUALITY(col)", "SUBSTRING(col)", including any nested VARIANT path). required: - expression_id - method - target CheckConstraint: allOf: - $ref: '#/components/schemas/Constraint' type: object description: CHECK constraint (informational; not enforced by Snowflake). properties: check_expression: type: string required: - check_expression TableClone: type: object description: Clone table allOf: - $ref: '#/components/schemas/Table' properties: point_of_time: $ref: common.yaml#/components/schemas/PointOfTime TableAsSelect: type: object description: Create table as select properties: name: type: string description: Specifies the name for the table, must be unique for the schema in which the table is created columns: type: array items: $ref: '#/components/schemas/TableColumn' cluster_by: type: array description: Specifies one or more columns or column expressions in the table as the clustering key items: type: string TableUsingTemplate: type: object description: Create table using template properties: name: type: string description: Specifies the name for the table, must be unique for the schema in which the table is created TableLike: type: object description: Create table like an existing table properties: name: type: string description: Specifies the name for the table, must be unique for the schema in which the table is created securitySchemes: KeyPair: $ref: common.yaml#/components/securitySchemes/KeyPair ExternalOAuth: $ref: common.yaml#/components/securitySchemes/ExternalOAuth SnowflakeOAuth: $ref: common.yaml#/components/securitySchemes/SnowflakeOAuth ProgrammaticAccessToken: $ref: common.yaml#/components/securitySchemes/ProgrammaticAccessToken security: - KeyPair: [] - ExternalOAuth: [] - SnowflakeOAuth: [] - ProgrammaticAccessToken: []