Create and save a query on Dune

This API allows for anyone to create a query. The owner of the query will be under the context of the API key.

post/v1/query

Request

  • Base URL
    https://api.dune.com/api
  • URL
    https://api.dune.com/api/v1/query
  • Auth
    none declared. Required headers: X-Dune-Api-Key

Query parameters

api_keystring

API Key, alternative to using the HTTP header X-Dune-Api-Key

Headers

X-Dune-Api-Keystring required

API Key for the service

Request body */*

descriptionstring

The description of the created query.

is_privateboolean

Indicates if the query is private, meaning that only the team or, in case of personal queries, the user that created it can see it.

is_tempboolean

Indicates if the query is temporary (unsaved). Temporary queries can be executed but won't appear in the library.

namestring required

The name of the created query.

query_sqlstring required

The SQL of the query.

tagsstring[]

The tags of the query.

Example request

{
  "is_private": true
}

Response

OK

query_idinteger

The Unique ID of the created query

Example response

{
  "query_id": 1
}

Changes

No recorded changes to this operation across all 2 revisions of this API.