Create a dataset import session
curl --request POST \
--url https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"name": "<string>",
"file": {
"name": "<string>",
"size_bytes": 123
},
"split_policy": {
"mode": "preserve"
},
"duplicate_policy": {
"split_overlap": "reject"
}
}
'import requests
url = "https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports"
payload = {
"idempotency_key": "<string>",
"name": "<string>",
"file": {
"name": "<string>",
"size_bytes": 123
},
"split_policy": { "mode": "preserve" },
"duplicate_policy": { "split_overlap": "reject" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
idempotency_key: '<string>',
name: '<string>',
file: {name: '<string>', size_bytes: 123},
split_policy: {mode: 'preserve'},
duplicate_policy: {split_overlap: 'reject'}
})
};
fetch('https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports', 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://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports",
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([
'idempotency_key' => '<string>',
'name' => '<string>',
'file' => [
'name' => '<string>',
'size_bytes' => 123
],
'split_policy' => [
'mode' => 'preserve'
],
'duplicate_policy' => [
'split_overlap' => 'reject'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports"
payload := strings.NewReader("{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"split_policy": {},
"duplicate_policy": {},
"state": "uploading",
"total_bytes": 2,
"counters": {
"staged_rows": 1,
"rejected_rows": 1,
"validation_errors": 1,
"errors_by_code": {},
"rows_by_split": {}
},
"error": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"file": {
"name": "<string>",
"size_bytes": 2,
"part_size_bytes": 2,
"part_count": 2,
"state": "pending",
"uploaded_bytes": 1,
"parts": [
{
"part_number": 2,
"size_bytes": 1,
"etag": "<string>"
}
]
},
"validation": {
"validation_state": "pending",
"validated_bytes": 1,
"validated_lines": 1,
"validated_rows": 1,
"raw_sha256": "<string>",
"error_count": 1,
"errors_truncated": true,
"errors": [
{
"physical_line": 2,
"source_byte_offset": 1,
"code": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "Task 'missing' not found in entity 'your-team'",
"type": "not_found"
}
}Create a dataset import session
POST
/
tasks
/
{alias}
/
dataset-imports
Create a dataset import session
curl --request POST \
--url https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"name": "<string>",
"file": {
"name": "<string>",
"size_bytes": 123
},
"split_policy": {
"mode": "preserve"
},
"duplicate_policy": {
"split_overlap": "reject"
}
}
'import requests
url = "https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports"
payload = {
"idempotency_key": "<string>",
"name": "<string>",
"file": {
"name": "<string>",
"size_bytes": 123
},
"split_policy": { "mode": "preserve" },
"duplicate_policy": { "split_overlap": "reject" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
idempotency_key: '<string>',
name: '<string>',
file: {name: '<string>', size_bytes: 123},
split_policy: {mode: 'preserve'},
duplicate_policy: {split_overlap: 'reject'}
})
};
fetch('https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports', 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://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports",
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([
'idempotency_key' => '<string>',
'name' => '<string>',
'file' => [
'name' => '<string>',
'size_bytes' => 123
],
'split_policy' => [
'mode' => 'preserve'
],
'duplicate_policy' => [
'split_overlap' => 'reject'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports"
payload := strings.NewReader("{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://distillation.training.wandb.ai/v1/tasks/{alias}/dataset-imports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"idempotency_key\": \"<string>\",\n \"name\": \"<string>\",\n \"file\": {\n \"name\": \"<string>\",\n \"size_bytes\": 123\n },\n \"split_policy\": {\n \"mode\": \"preserve\"\n },\n \"duplicate_policy\": {\n \"split_overlap\": \"reject\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"split_policy": {},
"duplicate_policy": {},
"state": "uploading",
"total_bytes": 2,
"counters": {
"staged_rows": 1,
"rejected_rows": 1,
"validation_errors": 1,
"errors_by_code": {},
"rows_by_split": {}
},
"error": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"file": {
"name": "<string>",
"size_bytes": 2,
"part_size_bytes": 2,
"part_count": 2,
"state": "pending",
"uploaded_bytes": 1,
"parts": [
{
"part_number": 2,
"size_bytes": 1,
"etag": "<string>"
}
]
},
"validation": {
"validation_state": "pending",
"validated_bytes": 1,
"validated_lines": 1,
"validated_rows": 1,
"raw_sha256": "<string>",
"error_count": 1,
"errors_truncated": true,
"errors": [
{
"physical_line": 2,
"source_byte_offset": 1,
"code": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"message": "Task 'missing' not found in entity 'your-team'",
"type": "not_found"
}
}Authorizations
A W&B API key.
Headers
Accessible personal or team entity. Omit to use the authenticated user's default entity.
Path Parameters
Pattern:
^[a-z0-9-]{1,64}$Body
application/json
Response
Durable multipart upload session.
Destination dataset ID, assigned when dataset creation begins. Wait for state ready before using the dataset. Null before creation or after the dataset is deleted.
The split policy accepted when the import was created.
The duplicate policy accepted when the import was created.
Available options:
uploading, queued, validating, auditing, committing, ready, failed, cancelled, expired Required range:
x >= 1Validation totals when available; otherwise null.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Last modified on September 21, 2026
Was this page helpful?