Context

Add context data to the context processor

POST
/api/v1/context/add

This endpoint accepts context data and sends it to a context processor for further handling. It returns a success or error response depending on the result from the context processor.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

documents*array<>

Array of documents with content and additional metadata

source*string

The source of the context data

context_type*string

Type of context being added

Value in

  • "resource"
  • "conversation"
  • "instruction"
scope*string

Scope of the context

Default"internal"

Value in

  • "internal"
  • "external"
metadata?

Additional metadata for the context

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/context/add" \  -H "Content-Type: application/json" \  -d '{    "documents": [      {        "content": "Customer asked about pricing for the Scale plan."      }    ],    "source": "support-inbox",    "context_type": "resource",    "scope": "internal",    "metadata": {      "fileName": "support_thread_TCK-1234.txt",      "fileType": "text/plain",      "groupName": [        "support",        "pricing"      ],      "lastModified": "2025-01-10T12:34:56.000Z",      "fileSize": 2048    }  }'
{  "success": true,  "context_id": "string",  "processed_documents": 0}