Create Raw Data
Create a new raw data record with optional file upload.
Endpoint
POST https://api.platform.knowledgator.com/data/
Headers
| Name | Type | Description |
|---|---|---|
KnowledgatorAPI-Key | String | Your API key |
Content-Type | String | multipart/form-data |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Name (1-64 chars) |
type | String | Yes | Service type: ner, text-classification, relation-extraction |
format | String | Yes | Format: jsonl, csv, parquet, json |
description | String | No | Description |
file | File | No | Initial 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 identifiername: Data nametype: Service typeformat: Data formatstatus: Initial status (typically "pending")created_at: ISO 8601 timestamp of creation
Error Codes
| Status Code | Description |
|---|---|
| 201 | Created – Data created successfully. |
| 400 | Bad Request – Invalid input or validation failed. |
| 401 | Unauthorized – Invalid API key. |
| 500 | Internal 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