Update Dataset
Update an existing dataset. Note that we only update the elements or files included in the request. All omitted elements or files will remain untouched.
Method
PATCH /datasets/{owner}/{id}
Parameters
Name | Type | Description | Required |
---|---|---|---|
description | string | Short description for dataset. Max. 120 characters. | |
summary | string | Dataset summary, markdown supported. Max. 25,000 characters. | |
tags | array | Array of strings to tag dataset. 2 to 25 characters each. Letters, numbers and spaces only. { "tags": [ "tag1", "tag2" ]} |
|
license | string | Public Domain , PDDL , CC-0 , CC-BY , ODC-BY , CC-BY-SA , ODC-ODbL , CC BY-NC-SA or Other See full descriptions |
|
visibility | string | OPEN or PRIVATE |
|
files | object | List of files and their sources to add to dataset. |
The files
object contains the following keys:
Name | Type | Description |
---|---|---|
name | string | The filename including the file extension. |
source | object | List of file URLs. |
description | string | Short description for the file. Max. 120 characters. |
labels | array | Array of strings to label file. Acceptable string values are: raw data , clean data , documentation , script , visualization , and report . { "labels": [ "raw data", "report" ]} |
The source
object contains the following keys:
Name | Type | Description |
---|---|---|
url | string | The direct-download URL for each file. |
Body JSON schema
{
"description": "string",
"summary": "string",
"tags": [
"string"
],
"license": "string",
"visibility": "string",
"files": [
{
"name": "string",
"source": {
"url": "string"
},
"description": "string",
"labels": [
"string"
]
}
]
}
Response schema (Status 200)
{
"message": "string"
}
Errors
HTTP Status Code | Reason | Solution |
---|---|---|
400 | Bad request. | Check syntax and URIs. |
401 | Unauthorized | Verify credentials / API key |
403 | Forbidden | |
404 | Not found. | |
422 | Bad request. | Check syntax and URIs. |
500 | Server error. |
EXAMPLE
Request URL:
https://api.data.world/v0/datasets/jonloyens/an-intro-to-dataworld-dataset
cURL:
$ export DW_API_TOKEN=<your api token goes here>
$ curl -H 'Authorization: Bearer ${DW_API_TOKEN}' -H 'Content-Type: application/json' -d @request.json https://api.data.world/v0/datasets/jonloyens/an-intro-to-dataworld-dataset --request PATCH
Where @request.json
is a reference to a locally stored file with the JSON request content, as seen below:
{
"description": "2017 data.world basketball program",
"summary": "Fake data.world basketball team players and stats. Includes 2016 and 2017 team",
"tags": [
"basketball"
],
"files": [
{
"name": "DataDotWorld2017BBallTeam.csv",
"source": {
"url": "https://docs.google.com/spreadsheets/d/1UheyB6pxTCfLpRmIGITM0fKb8jHVEvPuajmuejxxRyE/pub?gid=1371600687&single=true&output=csv"
},
"description": "Purely fictitious performance data on our purely fictitious data.world basketball team.",
"labels": [
"raw data", "clean data"
]
}
]
}
Response Body:
{
"message": "Dataset successfully updated."
}