Logo
User Context

Get All Contexts

View API

Overview

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

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

Query Parameters

ParameterTypeRequiredDefaultDescription
page_numintegerNo1Page number for pagination
page_sizeintegerNo10Number of records per page
search_paramstringNoOptional search keyword to filter by name
context_typestringNodomain_contextFilter 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

FieldTypeDescription
data.context_dataarrayList of context objects
data.context_data[].idintegerContext ID
data.context_data[].context_namestringContext name
data.context_data[].descriptionstringContext description
data.context_data[].tagsstringComma-separated tags
data.context_data[].text_inputstringContext textual input
data.context_data[].created_atstringCreation timestamp
data.context_data[].updated_atstringLast updated timestamp
data.context_data[].md_file_sizestringMarkdown file size
data.context_data[].statusstringProcessing status
data.context_data[].messagestringAny processing error or info message
data.context_data[].presigned_md_urlstringPresigned URL to download markdown file
data.page_sizeintegerCurrent page size
data.page_indexintegerCurrent page number
data.total_pagesintegerTotal number of pages
data.total_recordsintegerTotal number of records

Next Steps

Explore the full API specifications in the User Context API Reference.

On this page