Update Dataset
Update dataset metadata (name and/or description).
Endpoint
PATCH https://api.platform.knowledgator.com/datasets/{dataset_id}/
Headers
| Name | Type | Description |
|---|---|---|
KnowledgatorAPI-Key | String | Your API key |
Content-Type | String | application/json |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dataset_id | String | Yes (path) | Dataset identifier (2-64 chars, alphanumeric with hyphens) |
name | String | No | New dataset name (1-64 chars, alphanumeric with spaces, dots, parentheses, hyphens) |
description | String | No | New dataset description |
Note: At least one of name or description must be provided.
Request Body
{
"name": "Updated NER Dataset",
"description": "Updated description"
}
Response
Returns 204 No Content on success.
Error Codes
| Status Code | Description |
|---|---|
| 204 | No Content – Update successful. |
| 400 | Bad Request – Invalid parameters or dataset doesn't exist. |
| 401 | Unauthorized – Invalid API key or email verification required. |
| 403 | Forbidden – Invalid CSRF token. |
| 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');
// Update name
await kg.datasets.update('6babd48a-2256-4466-b16b-9fd45ba59688', {
name: "Updated NER Dataset"
});
// Update description
await kg.datasets.update('6babd48a-2256-4466-b16b-9fd45ba59688', {
description: "Updated description"
});
// Update both
await kg.datasets.update('6babd48a-2256-4466-b16b-9fd45ba59688', {
name: "Updated NER Dataset",
description: "Updated description"
});
console.log('Dataset updated successfully');
Python
from knowledgator import Knowledgator
kg = Knowledgator(api_key="YOUR_API_KEY")
# Update name
kg.datasets.update("6babd48a-2256-4466-b16b-9fd45ba59688", name="Updated NER Dataset")
# Update description
kg.datasets.update("6babd48a-2256-4466-b16b-9fd45ba59688", description="Updated description")
# Update both
kg.datasets.update(
"6babd48a-2256-4466-b16b-9fd45ba59688",
name="Updated NER Dataset",
description="Updated description"
)
print("Dataset updated successfully")
Expected SDK Output
Dataset updated successfully
Python
import requests
import json
url = "https://api.platform.knowledgator.com/datasets/6babd48a-2256-4466-b16b-9fd45ba59688/"
headers = {
"KnowledgatorAPI-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
# Update name
data = {"name": "Updated NER Dataset"}
response = requests.patch(url, headers=headers, json=data)
print(f"Status: {response.status_code}")
# Update both
data = {
"name": "Updated NER Dataset",
"description": "Updated description"
}
response = requests.patch(url, headers=headers, json=data)
print(f"Status: {response.status_code}")
cURL
# Update name
curl -i -X PATCH "https://api.platform.knowledgator.com/datasets/6babd48a-2256-4466-b16b-9fd45ba59688/" \
-H "KnowledgatorAPI-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Updated NER Dataset"}'
# Update both
curl -i -X PATCH "https://api.platform.knowledgator.com/datasets/6babd48a-2256-4466-b16b-9fd45ba59688/" \
-H "KnowledgatorAPI-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Updated NER Dataset", "description": "Updated description"}'
Expected Response (cURL)
HTTP/1.1 204 No Content
Additional Information
- Partial Updates: You can update just the name, just the description, or both
- Validation: Name must follow the same validation rules as during creation
- Use Cases:
- Rename datasets for better organization
- Update descriptions as dataset contents evolve
- Correct metadata errors