curl --request PATCH \ --url https://api.dune.com/api/v1/query/{queryId} \ --header 'Content-Type: application/json' \ --header 'X-DUNE-API-KEY: <x-dune-api-key>' \ --data '{ "query_id": 1252207, "query_sql": "SELECT * FROM {{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}",}'
Copy
Ask AI
{ "query_id": 123}
Query Management
Update Query
This API allows for anyone to update the sql text,
parameters, name, tags, and state of a query. Only the API key
generated under the context of the owner of that query will work.
PATCH
/
v1
/
query
/
{queryId}
Copy
Ask AI
curl --request PATCH \ --url https://api.dune.com/api/v1/query/{queryId} \ --header 'Content-Type: application/json' \ --header 'X-DUNE-API-KEY: <x-dune-api-key>' \ --data '{ "query_id": 1252207, "query_sql": "SELECT * FROM {{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}",}'
Copy
Ask AI
{ "query_id": 123}
To access Query endpoints, an Analyst plan or higher is required.
Copy
Ask AI
curl --request PATCH \ --url https://api.dune.com/api/v1/query/{queryId} \ --header 'Content-Type: application/json' \ --header 'X-DUNE-API-KEY: <x-dune-api-key>' \ --data '{ "query_id": 1252207, "query_sql": "SELECT * FROM {{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}",}'