package_create
Create a new dataset (package).
You must be authorized to create new datasets. If you specify any groups for the new dataset, you must also be authorized to edit these groups.
Plugins may change the parameters of this function depending on the value of the type parameter, see the IDatasetForm plugin interface.
Authorization
apiTokenHeader CKAN API token
In: header
Request Body
multipart/form-data
the name of the new dataset, must be between 2 and 100 characters long and contain only lowercase alphanumeric characters, - and _
the title of the dataset (default: same as name)
if True creates a private dataset
the name of the dataset's author
the email address of the dataset's author
the name of the dataset's maintainer
the email address of the dataset's maintainer
the id of the dataset's license, see license_list() for available values
a description of the dataset
a URL for the dataset's source
no longer than 100 characters
the current state of the dataset, e.g. 'active' or 'deleted', only active datasets show up in search results and other lists of datasets, thsi parameter will be ignored if you are not authorized to change the state of the dataset (default: 'active')
the type of the dataset, IDatasetForm plugins associate themselves with different dataset types and provide custom dataset handling behaviour for these types
the dataset's resources
the dataset's tags
the dataset's extras, extras are arbitrary (key: value) metadata items that can be added to datasets, each extra dictionary should have keys 'key' (a string), 'value' (a string)
Private package data belonging to plugins. Only sysadmin users may set this value. It should be a dict that can be dumped into JSON, and plugins should namespace their data with the plugin name to avoid collisions with other plugins, e.g.:
{
"name": "test-dataset",
"plugin_data": {
"plugin1": {"key1": "value1"},
"plugin2": {"key2": "value2"}
}
}list of relationship dictionaries
list of relationship dictionaries
the groups to which the dataset belongs, each group dictionary should have one or more of the following keys which identify an existing group: 'id' (the id of the group, string), or 'name' (the name of the group, string), to see which groups exist call group_list()
the id of the dataset's owning organization, see organization_list() or organization_list_for_user() for available values. This parameter can be made optional if the config option ckan.auth.create_unowned_dataset is set to True.
curl -X POST "http://localhost:5000/api/3/action/package_create"