User Context
Get All Contexts
View APIOverview
The Get All Contexts endpoint retrieves a paginated list of your user contexts. You can filter the results by search parameters and context type.
Use this endpoint to:
- Retrieve a list of all domain or agent contexts
- Search contexts by name
- Manage your platform context resources
Endpoint Details
Method:
GET
Endpoint:/api/user_context/get_all_contexts
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 | Default | Description |
|---|---|---|---|---|
| page_num | integer | No | 1 | Page number for pagination |
| page_size | integer | No | 10 | Number of records per page |
| search_param | string | No | Optional search keyword to filter by name | |
| context_type | string | No | domain_context | Filter by type: domain_context or agent_context |
Code Snippets
curl --location 'https://api.k-v.ai/api/user_context/get_all_contexts?context_type=domain_context&page_num=1&page_size=10' \
--header 'access-key: YOUR_ACCESS_KEY'import requests
url = "https://api.k-v.ai/api/user_context/get_all_contexts?context_type=domain_context&page_num=1&page_size=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_all_contexts?context_type=domain_context&page_num=1&page_size=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": {
"context_data": [
{
"id": 66,
"context_name": "test dev",
"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/..."
}
],
"page_size": 10,
"page_index": 1,
"total_pages": 1,
"total_records": 9
},
"message": "Context data fetched successfully"
}Response Fields
| Field | Type | Description |
|---|---|---|
| data.context_data | array | List of context objects |
| data.context_data[].id | integer | Context ID |
| data.context_data[].context_name | string | Context name |
| data.context_data[].description | string | Context description |
| data.context_data[].tags | string | Comma-separated tags |
| data.context_data[].text_input | string | Context textual input |
| data.context_data[].created_at | string | Creation timestamp |
| data.context_data[].updated_at | string | Last updated timestamp |
| data.context_data[].md_file_size | string | Markdown file size |
| data.context_data[].status | string | Processing status |
| data.context_data[].message | string | Any processing error or info message |
| data.context_data[].presigned_md_url | string | Presigned URL to download markdown file |
| data.page_size | integer | Current page size |
| data.page_index | integer | Current page number |
| data.total_pages | integer | Total number of pages |
| data.total_records | integer | Total number of records |
Next Steps
Explore the full API specifications in the User Context API Reference.