

Post a partial dataset JSON to create a new dataset.
title.id is automatically assigned.sharing defaults to public.topics not defined in the site settings are silently dropped.canCreateDatasets. See Permissions.
editor role on the new dataset.| Authorization | API key. | string | Required |
| Content-Type | Must be "application/json". Most clients will set this automatically. | string | Required |
| 200 | Returns the full dataset JSON. |
| 400 | Returns a JSON object explaining the error. |
| 403 | API key does not have permission to create datasets. |
import requests, os, json
api_key = os.getenv("DATAPRESS_API_KEY")
headers = { "Authorization": api_key }
dataset = {
"title": "My new dataset",
# Optional:
"logo": { "title": "My Organisation", "img": None },
"topics": ["waste-and-recycling"], # from /api/v3/site
}
url = f"https://data.website/api/v3/dataset"
response = requests.post(url, json=dataset, headers=headers)
print(json.dumps(response.json(), indent=2))
{
"dataset": {
"id": "444xy", // Automatically assigned
"title": "My new dataset",
"logo": { "title": "My Organisation", "img": null },
"topics": ["waste-and-recycling"],
// [...full JSON structure...]
}
}