POST
/
v1
/
materialized-views
curl --request POST \
  --url https://api.dune.com/api/v1/materialized-views \
  --header 'Content-Type: */*' \
  --header 'X-Dune-Api-Key: <x-dune-api-key>' \
  --data '{
  "cron_expression": "<string>",
  "is_private": true,
  "name": "<string>",
  "performance": "<string>",
  "query_id": 123
}'
{
  "execution_id": "01HZ065JVE23C23FM2HKWQP2RT",
  "name": "dune.dune.result_erc_20_token_summary"
}
  • This endpoint will create a new matview if none exists for the gven 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

Path Parameters

name
string
required

Matview Name

Query Parameters

api_key
string

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

Body

*/*
MatviewsUpsertRequest
cron_expression
string
is_private
boolean
name
string
performance
string

Performance level of the refresh. Available options: medium, large

query_id
integer

Response

200
application/json
OK
execution_id
string

Unique identifier for the execution triggered to refresh the materialized view

name
string

Unique identifier for the materialized view