Skip to content
GuidesPlaygroundDashboard

Create a new dataset (admin only)

$client->datasets->create(string name, string slug, ?string attribution, ?string description, ?string license, ?string sourceURL): Dataset
POST/api/v1/datasets

Create a new dataset (admin only)

ParametersExpand Collapse
name: string

Dataset name

slug: string

URL-friendly slug

attribution?:optional string

Attribution text

description?:optional string

Dataset description

license?:optional string

License identifier

sourceURL?:optional string

Source data URL

ReturnsExpand Collapse
string id

Dataset ID

\Datetime insertedAt

Creation timestamp

string name

Dataset name

string slug

URL-friendly slug

\Datetime updatedAt

Last update timestamp

?string attribution

Attribution text

?string description

Dataset description

?string license

License identifier

?string sourceURL

Source data URL

Create a new dataset (admin only)

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'My API Key', environment: 'local');

$dataset = $client->datasets->create(
  name: 'name',
  slug: 'slug',
  attribution: 'attribution',
  description: 'description',
  license: 'license',
  sourceURL: 'source_url',
);

var_dump($dataset);
{
  "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"
}