Skip to main content
POST
/
v1
/
uploads
curl --request POST \
  --url https://api.dune.com/api/v1/uploads \
  --header 'X-DUNE-API-KEY: <x-dune-api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "namespace":"my_user",
  "table_name":"interest_rates",
  "description": "10 year daily interest rates, sourced from https://fred.stlouisfed.org/series/DGS10",
  "is_private": false,
  "schema": [{"name": "date", "type": "timestamp"}, {"name": "dgs10", "type": "double",  "nullable": true}]
}'
{
  "already_existed": true,
  "example_query": "<string>",
  "full_name": "<string>",
  "message": "<string>",
  "namespace": "<string>",
  "table_name": "<string>"
}
The resulting table will be empty, and can be inserted into with the /insert endpoint.
  • If a table already exists with the same name, the request will fail.
  • Column names in the table can’t start with a special character or a digit.
  • Each successful table creation consumes 10 credits.
  • To delete a table, you can go to user settings (dune.com) -> data -> delete or use the /delete endpoint.
Migrating from the old API? See the Migration Guide for help updating your code.

Schema

You need to define the schema of your data by providing schema array of columns in the request. Each column has three parameters: name: the name of the field type: the data type of the field
Dune supports ISO 8601 timestamp format
nullable: if the column is nullable (true/false, true by default)
curl --request POST \
  --url https://api.dune.com/api/v1/uploads \
  --header 'X-DUNE-API-KEY: <x-dune-api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "namespace":"my_user",
  "table_name":"interest_rates",
  "description": "10 year daily interest rates, sourced from https://fred.stlouisfed.org/series/DGS10",
  "is_private": false,
  "schema": [{"name": "date", "type": "timestamp"}, {"name": "dgs10", "type": "double",  "nullable": true}]
}'

Headers

X-Dune-Api-Key
string
required

API Key for the service

Query Parameters

api_key
string

Alternative to using the X-Dune-Api-Key header

Body

*/*

payload

description
string
is_private
boolean
namespace
string
schema
object[]
table_name
string

Response

OK

already_existed
boolean
example_query
string
full_name
string
message
string
namespace
string
table_name
string