Skip to main content

Clean Chat Context

This endpoint allows you to clear the context of a specific chat within an assistant session. Use this endpoint to reset or remove prior conversation history within a chat, effectively starting a new session without old messages influencing the assistant's responses.

Endpoint

  • Method: POST
  • URL: https://api.tasking.ai/v1/assistants/{assistant_id}/chats/{chat_id}/clean_context

Path Parameters

ParameterTypeRequiredDescription
assistant_idstringYesThe unique identifier for the assistant.
chat_idstringYesThe unique identifier for the chat session.

Header Parameters

All TaskingAI API requests require the following headers:

HeaderTypeDescription
Content-TypestringThe content type of the request. Set to application/json.
AuthorizationstringAPI key for authorization in the format Bearer $TASKINGAI_API_KEY. The key can be obtained in the project settings in your TaskingAI console.

Request Body

This endpoint does not require a request body. Send an empty JSON object {} as shown in the example below.

Request Example

{}

Responses

If the request is successful, the response will contain information about the message confirming the context has been cleared.

{
"status": "success",
"data": {
"object": "Message",
"assistant_id": "assistant_1",
"chat_id": "chat_1",
"message_id": "message_1",
"role": "system",
"content": {
"text": "context_cleaned"
},
"metadata": {},
"created_by": "user_1",
"updated_by": "user_1",
"created_timestamp": 1730211093770,
"updated_timestamp": 1730211093770
}
}