Update Raw Data
Modify an existing raw data item.
Endpoint
PATCH https://api.platform.knowledgator.com/data/{id}/
Headers
| Name | Type | Description |
|---|---|---|
KnowledgatorAPI-Key | String | Your API key |
Content-Type | String | application/json |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | Yes | Unique data identifier |
Request Body
{
"name": "Updated Data Name",
"description": "Updated description for this data item."
}
Parameters
name(string, optional): New name for the raw data record (1-64 chars).description(string, optional): New description for the record.
Response
{
"status": "success",
"message": "Data updated successfully"
}
Error Codes
| Status Code | Description |
|---|---|
| 200 | OK – Update successful. |
| 400 | Bad Request – Invalid input. |
| 401 | Unauthorized – Invalid API key. |
| 404 | Not Found – Invalid data ID. |
| 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');
await kg.datasets.updateData('data-123', {
name: "Updated Data Name"
});
Python
from knowledgator import Knowledgator
kg = Knowledgator(api_key="YOUR_API_KEY")
kg.datasets.update_data('data-123', name="Updated Data Name")
Python
import requests
data_id = "data-123"
url = f"https://api.platform.knowledgator.com/data/{data_id}/"
headers = {
"Content-Type": "application/json",
"KnowledgatorAPI-Key": "YOUR_API_KEY"
}
payload = {
"name": "Updated Data Name"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
cURL
curl -X PATCH https://api.platform.knowledgator.com/data/data-123/ \
-H "Content-Type: application/json" \
-H "KnowledgatorAPI-Key: YOUR_API_KEY" \
-d '{
"name": "Updated Data Name"
}'
Additional Information
- Atomic Updates: Only changed fields need to be included in the request body.
- Use Cases:
- Correcting record names or tags
- Updating metadata
- Managing data organization