Agent API (Sample)

The following specifications describe a standard API used by the Code Capsules chat window to communicate with the agent.

Send a message to the AI agent

post

Send a message to the conversational AI agent and receive a complete response. For streaming responses, use the /message/stream endpoint instead.

Authorizations
X-CC-API-KEYstringRequired

API key for authentication

Body
datestring · date-timeRequired

Timestamp of the message

Example: 2025-11-07T10:30:00Z
Responses
200

Successful response from the AI agent

application/json
post
/api/chat/message

Stream a message from the AI agent

post

Send a message to the conversational AI agent and receive a streaming response. The response is sent as Server-Sent Events (SSE) with each chunk containing the type and content.

Authorizations
X-CC-API-KEYstringRequired

API key for authentication

Body
datestring · date-timeRequired

Timestamp of the message

Example: 2025-11-07T10:30:00Z
Responses
200

Successful streaming response from the AI agent

text/event-stream
Responsestring

Server-Sent Events stream containing message chunks

post
/api/chat/message/stream

Get chat history for the authenticated user

get

Retrieve the complete chat history for the currently authenticated user, including all previous conversations.

Authorizations
X-CC-API-KEYstringRequired

API key for authentication

Responses
200

Chat history retrieved successfully

application/json
get
/api/chat/history

Add text context to the vector store

post

Add text content to the vector store for use in RAG (Retrieval-Augmented Generation) context retrieval.

Authorizations
X-CC-API-KEYstringRequired

API key for authentication

Body
textstringRequired

The text content to be added to the vector store

Responses
200

Context added successfully

application/json
post
/api/context/text

Add context from URL to the vector store

post

Fetch content from a URL and add it to the vector store for use in RAG (Retrieval-Augmented Generation) context retrieval.

Authorizations
X-CC-API-KEYstringRequired

API key for authentication

Body
urlstring · uriRequired

The URL to fetch content from

Example: https://example.com/article
Responses
200

Context added successfully

application/json
post
/api/context/url

Schemas

Last updated

Was this helpful?