Delete Context Management API
Introduced 3.5
Use this API to delete a context management configuration. Once deleted, the context management can no longer be used by agents.
Agents store the name of the context management configuration, not a copy of it. After you delete a configuration, executing an agent registered with its name fails with a 404 error, and registering a new agent with its name fails with a 400 error. To run such an agent, recreate the configuration with the same name or specify a different configuration in the context_management_name parameter when executing the agent.
Endpoints
DELETE /_plugins/_ml/context_management/{context_management_name}
Path parameters
The following table lists the available path parameters.
| Parameter | Data type | Required/Optional | Description |
|---|---|---|---|
context_management_name | String | Required | The name of the context management to delete. |
Example request
DELETE /_plugins/_ml/context_management/advanced-context-management
Example response
{
"context_management_name": "advanced-context-management",
"status": "deleted"
}
Error responses
If you attempt to delete a context management configuration that doesn’t exist, the API returns a 404 error indicating the resource was not found:
{
"error": {
"root_cause": [
{
"type": "status_exception",
"reason": "Context management template not found: sliding_window_max_40000_tokens_managers123"
}
],
"type": "status_exception",
"reason": "Context management template not found: sliding_window_max_40000_tokens_managers123"
},
"status": 404
}
Related documentation
For more information, see Context management.