Skip to main content

Create Raw Data

Create a new raw data record with optional file upload.

Endpoint​

POST https://api.platform.knowledgator.com/data/


Headers​

NameTypeDescription
KnowledgatorAPI-KeyStringYour API key
Content-TypeStringmultipart/form-data

Request Parameters​

ParameterTypeRequiredDescription
nameStringYesName (1-64 chars)
typeStringYesService type: ner, text-classification, relation-extraction
formatStringYesFormat: jsonl, csv, parquet, json
descriptionStringNoDescription
fileFileNoInitial file to upload

Response​

{
"id": "data-123",
"name": "Single Data Item",
"type": "ner",
"format": "jsonl",
"status": "pending",
"created_at": "2024-01-15T10:30:00Z"
}

Response Fields​

  • id: Unique identifier
  • name: Data name
  • type: Service type
  • format: Data format
  • status: Initial status (typically "pending")
  • created_at: ISO 8601 timestamp of creation

Error Codes​

Status CodeDescription
201Created – Data created successfully.
400Bad Request – Invalid input or validation failed.
401Unauthorized – Invalid API key.
500Internal Server Error – Server-side issue.

Example Usage​

SDK Usage​

💡 Dedicated SDK Guides: See Python SDK | TypeScript SDK

TypeScript/JavaScript​

import { createClient } from '@knowledgator/typescript-sdk';

const kg = createClient('YOUR_API_KEY');

const item = await kg.datasets.createData({
name: "Single Data Item",
type: "ner",
format: "jsonl",
description: "Individual data item for NER"
});
console.log(item.id);

Python​

from knowledgator import Knowledgator

kg = Knowledgator(api_key="YOUR_API_KEY")

item = kg.datasets.create_data(
name="Single Data Item",
type="ner",
format="jsonl",
description="Individual data item for NER"
)
print(item.id)

Python​

import requests

url = "https://api.platform.knowledgator.com/data/"
headers = {
"KnowledgatorAPI-Key": "YOUR_API_KEY"
}
data = {
"name": "Single Data Item",
"type": "ner",
"format": "jsonl",
"description": "Individual data item for NER"
}

response = requests.post(url, headers=headers, data=data)
print(response.json())

cURL​

curl -X POST https://api.platform.knowledgator.com/data/ \
-H "KnowledgatorAPI-Key: YOUR_API_KEY" \
-F "name=Single Data Item" \
-F "type=ner" \
-F "format=jsonl" \
-F "description=Individual data item for NER"

Additional Information​

  • Atomic Creation: Create data records individually for fine-grained control.
  • Immediate Upload: You can optionally include a file in the same request.
  • Use Cases:
    • Dynamic data creation
    • Targeted data ingestion
    • Ad-hoc data processing