Skip to content
GuidesPlaygroundDashboard

Create a new dataset (admin only)

client.datasets.create(DatasetCreateParams { name, slug, attribution, 3 more } body, RequestOptionsoptions?): Dataset { id, inserted_at, name, 6 more }
POST/api/v1/datasets

Create a new dataset (admin only)

ParametersExpand Collapse
body: DatasetCreateParams { name, slug, attribution, 3 more }
name: string

Dataset name

slug: string

URL-friendly slug

attribution?: string | null

Attribution text

description?: string | null

Dataset description

license?: string | null

License identifier

source_url?: string | null

Source data URL

ReturnsExpand Collapse
Dataset { id, inserted_at, name, 6 more }
id: string

Dataset ID

formatuuid
inserted_at: string

Creation timestamp

formatdate-time
name: string

Dataset name

slug: string

URL-friendly slug

updated_at: string

Last update timestamp

formatdate-time
attribution?: string | null

Attribution text

description?: string | null

Dataset description

license?: string | null

License identifier

source_url?: string | null

Source data URL

Create a new dataset (admin only)

import Plaza from '@plazafyi/sdk';

const client = new Plaza({
  apiKey: process.env['PLAZA_API_KEY'], // This is the default and can be omitted
});

const dataset = await client.datasets.create({ name: 'name', slug: 'slug' });

console.log(dataset.id);
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "inserted_at": "2019-12-27T18:11:19.117Z",
  "name": "name",
  "slug": "slug",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "attribution": "attribution",
  "description": "description",
  "license": "license",
  "source_url": "source_url"
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "inserted_at": "2019-12-27T18:11:19.117Z",
  "name": "name",
  "slug": "slug",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "attribution": "attribution",
  "description": "description",
  "license": "license",
  "source_url": "source_url"
}