Create SQL Interface Query

Version 4.0.24.18 (latest)

Create a SQL interface query.

This allows you to create a new SQL interface query that you can later run. Looker queries are immutable once created and are not deleted. If you create a query that is exactly like an existing query then the existing query will be returned and no new query will be created. Whether a new query is created or not, you can use the 'id' in the returned query with the 'run' method.

The query parameters are passed as json in the body of the request.

Request

POST /sql_interface_queries
Datatype
Description
Request
HTTP Request
body
HTTP Body
Expand HTTP Body definition...
body
SQL Interface Query Create
Expand SqlInterfaceQueryCreate definition...
can
object
Operations the current user is able to perform on this object
sql
string
Original SQL request
jdbc_client
boolean
Whether the query should be run for use in a JDBC Client. This changes the formatting of some datetime based values.

Response

200: SQL Interface Query

Datatype
Description
can
object
Operations the current user is able to perform on this object
id
integer
Unique Id
signature
string
Calcite signature

400: Bad Request

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

403: Permission Denied

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

404: Not Found

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

409: Resource Already Exists

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

422: Validation Error

Datatype
Description
(object)
message
string
Error details
Expand ValidationErrorDetail definition...
field
string
Field with error
code
string
Error code
message
string
Error info message
documentation_url
string
Documentation link
documentation_url
string
Documentation link

429: Too Many Requests

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

500: Server Error

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link