Logo
User Context

Get Context Data

View API

Overview

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

HeaderTypeRequiredDescription
access-keystringYesYour unique access-key generated from the platform UI

Query Parameters

ParameterTypeRequiredDescription
context_idintegerYesThe 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

FieldTypeDescription
data.idintegerUnique Context ID
data.context_namestringContext name
data.context_typestringContext type (e.g., domain_context)
data.descriptionstringContext description
data.tagsstringComma-separated tags
data.text_inputstringContext textual input
data.created_atstringCreation timestamp
data.updated_atstringLast updated timestamp
data.md_file_sizestringMarkdown file size
data.statusstringCurrent status of the context (e.g., processed, processing)
data.messagestringAny processing error or info message
data.presigned_md_urlstringPresigned 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.

On this page