Skip to main content
POST
/
v1
/
team
/
datasets
Create dataset
curl --request POST \
  --url https://ai.data.cloud/api/v1/team/datasets \
  --header 'Content-Type: application/json' \
  --header 'x-pd-api-key: <api-key>' \
  --data '
{
  "name": "My dataset",
  "description": "my default dataset",
  "userId": "tmm-cm5m7khoz52zh07n4m7x1ut60"
}
'
import requests

url = "https://ai.data.cloud/api/v1/team/datasets"

payload = {
    "name": "My dataset",
    "description": "my default dataset",
    "userId": "tmm-cm5m7khoz52zh07n4m7x1ut60"
}
headers = {
    "x-pd-api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'x-pd-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: 'My dataset',
    description: 'my default dataset',
    userId: 'tmm-cm5m7khoz52zh07n4m7x1ut60'
  })
};

fetch('https://ai.data.cloud/api/v1/team/datasets', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://ai.data.cloud/api/v1/team/datasets",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'name' => 'My dataset',
    'description' => 'my default dataset',
    'userId' => 'tmm-cm5m7khoz52zh07n4m7x1ut60'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-pd-api-key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://ai.data.cloud/api/v1/team/datasets"

	payload := strings.NewReader("{\n  \"name\": \"My dataset\",\n  \"description\": \"my default dataset\",\n  \"userId\": \"tmm-cm5m7khoz52zh07n4m7x1ut60\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-pd-api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://ai.data.cloud/api/v1/team/datasets")
  .header("x-pd-api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"My dataset\",\n  \"description\": \"my default dataset\",\n  \"userId\": \"tmm-cm5m7khoz52zh07n4m7x1ut60\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://ai.data.cloud/api/v1/team/datasets")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-pd-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"My dataset\",\n  \"description\": \"my default dataset\",\n  \"userId\": \"tmm-cm5m7khoz52zh07n4m7x1ut60\"\n}"

response = http.request(request)
puts response.read_body
{
  "code": 0,
  "data": {
    "id": "dataset-adsdfasafdsfasdgasd"
  }
}

Authorizations

x-pd-api-key
string
header
required

Headers

x-pd-external-trace-id
string

The external trace ID. The length ranges from 0 to 128 characters.

Body

application/json
name
string
required

The dataset name.

userId
string
required

Your user ID.

How to obtain your user ID: Sign in to Powerdrill Enterprise, click Users in the top navigation bar, and find your user ID in the list of users.

description
string

The dataset description.

Response

200 - application/json
code
integer
required

Status code. 0 indicates that the operation is successful. Otherwise, the operation fails. Possible error codes include:

  • 100: Bad request.
  • 201: Request frequency limit.
  • 9999: Internal error.
  • 100001: Invalid operation.
data
object
required