Skip to content
GuidesBlogPlaygroundDashboard

Create a new dataset (admin only)

datasets().create(DatasetCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : Dataset
POST/api/v1/datasets

Create a new dataset (admin only)

ParametersExpand Collapse
params: DatasetCreateParams
name: String

Human-readable dataset name

slug: String

URL-friendly identifier (lowercase, hyphens, no spaces)

attribution: Optional<String>

Required attribution text

description: Optional<String>

Dataset description

license: Optional<String>

License identifier (e.g. CC-BY-4.0)

sourceUrl: Optional<String>

Source data URL

formaturi
ReturnsExpand Collapse
class Dataset:

Metadata for a custom dataset. Datasets contain user-uploaded geospatial features separate from the OSM data.

id: String

Dataset UUID

formatuuid
insertedAt: LocalDateTime

Creation timestamp (UTC)

formatdate-time
name: String

Human-readable dataset name

slug: String

URL-friendly identifier

updatedAt: LocalDateTime

Last update timestamp (UTC)

formatdate-time
attribution: Optional<String>

Required attribution text

description: Optional<String>

Dataset description

license: Optional<String>

License identifier (e.g. CC-BY-4.0)

sourceUrl: Optional<String>

URL of the original data source

formaturi

Create a new dataset (admin only)

package com.plazafyi.example

import com.plazafyi.client.PlazaClient
import com.plazafyi.client.okhttp.PlazaOkHttpClient
import com.plazafyi.models.datasets.Dataset
import com.plazafyi.models.datasets.DatasetCreateParams

fun main() {
    val client: PlazaClient = PlazaOkHttpClient.fromEnv()

    val params: DatasetCreateParams = DatasetCreateParams.builder()
        .name("NYC Bike Lanes")
        .slug("nyc-bike-lanes")
        .build()
    val dataset: Dataset = client.datasets().create(params)
}
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "inserted_at": "2019-12-27T18:11:19.117Z",
  "name": "NYC Bike Lanes",
  "slug": "nyc-bike-lanes",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "attribution": "attribution",
  "description": "description",
  "license": "license",
  "source_url": "https://example.com"
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "inserted_at": "2019-12-27T18:11:19.117Z",
  "name": "NYC Bike Lanes",
  "slug": "nyc-bike-lanes",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "attribution": "attribution",
  "description": "description",
  "license": "license",
  "source_url": "https://example.com"
}