Skip to main content
POST
This upserts (create or replace) a materialized view from an existing query
Minimum required API key scope: Read/Write
  • This endpoint will create a new matview if none exists for the given query ID, or update an existing one if the query ID matches.
  • It will fail to create a matview with the same name as an existing one, but for a different query ID
  • The name of the matview is just the last part of the matview, not including dune.<your_team>. and must be prefixed with result_
  • The cron_expression parameter must be passed in as a valid 5 section cron expression. See here for how to write them.
  • The cron expression interval must be at least 15 minutes and at most weekly

Headers

X-Dune-Api-Key
string
required

API Key for the service

Query Parameters

api_key
string

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

Body

*/*

MatviewsUpsertRequest

cron_expression
string
expires_at
string
is_private
boolean
name
string
performance
string

Performance tier for the refresh execution. Accepts small, medium, large. Omit to use the default tier for the source query's engine.

query_id
integer

Response

OK

execution_id
string

Unique identifier for the execution triggered to refresh the materialized view

Example:

"01HZ065JVE23C23FM2HKWQP2RT"

name
string

Unique identifier for the materialized view

Example:

"dune.dune.result_erc_20_token_summary"