User Context
Get Context Data
View APIOverview
The Get Context Data endpoint retrieves the detailed information of a specific user context by its ID.
Use this endpoint to:
- Retrieve metadata and details of a single context
- Verify context existence before applying it in AI workflows
Endpoint Details
Method:
GET
Endpoint:/api/user_context/get_context_data
Base URL:https://api.k-v.ai
Authentication: Access Key (Required)
Request Specification
Headers
| Header | Type | Required | Description |
|---|---|---|---|
| access-key | string | Yes | Your unique access-key generated from the platform UI |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| context_id | integer | Yes | The ID of the context to retrieve |
Code Snippets
curl --location 'https://api.k-v.ai/api/user_context/get_context_data?context_id=10' \
--header 'access-key: YOUR_ACCESS_KEY'import requests
url = "https://api.k-v.ai/api/user_context/get_context_data?context_id=10"
headers = {
'access-key': 'YOUR_ACCESS_KEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)const axios = require('axios');
let config = {
method: 'get',
url: 'https://api.k-v.ai/api/user_context/get_context_data?context_id=10',
headers: {
'access-key': 'YOUR_ACCESS_KEY'
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});Response Specification
Success Response (200 OK)
{
"data": {
"id": 66,
"context_name": "test dev",
"context_type": "domain_context",
"description": "test des",
"tags": "policy",
"text_input": "Direct textual context and guidelines...",
"created_at": "30/04/2026 08:28",
"updated_at": "30/04/2026 08:28",
"md_file_size": "0.0001",
"status": "processed",
"message": "",
"presigned_md_url": "https://kv-platform.s3.amazonaws.com/md_files_context/..."
},
"message": "Data retrieved successfully"
}Response Fields
| Field | Type | Description |
|---|---|---|
| data.id | integer | Unique Context ID |
| data.context_name | string | Context name |
| data.context_type | string | Context type (e.g., domain_context) |
| data.description | string | Context description |
| data.tags | string | Comma-separated tags |
| data.text_input | string | Context textual input |
| data.created_at | string | Creation timestamp |
| data.updated_at | string | Last updated timestamp |
| data.md_file_size | string | Markdown file size |
| data.status | string | Current status of the context (e.g., processed, processing) |
| data.message | string | Any processing error or info message |
| data.presigned_md_url | string | Presigned URL to download markdown file |
Error Responses
422 Validation Error
{
"detail": [
{
"loc": ["query", "context_id"],
"msg": "field required",
"type": "value_error.missing"
}
]
}Next Steps
Explore the full API specifications in the User Context API Reference.