---
title: "How do I undo a template deprecation?"
answer: "Template deprecation in Coolhand is permanent and cannot be undone. Neither the REST API nor the agent tools provide an endpoint to restore a deprecated template. To resume routing traffic for those prompts, create a new template with the required prompt patterns or external key; pending unmatched logs will automatically rematch."
category: "Logs \u0026 API"
tags: ["templates","deprecation","workloads","prompt-matching"]
published: 2026-11-17T16:36:02Z
updated: 2026-11-17T16:31:33Z
canonical_url: https://coolhandlabs.com/help/how-do-i-undo-a-template-deprecation
index_url: https://coolhandlabs.com/help.md
---

# How do I undo a template deprecation?

Template deprecation in Coolhand is permanent and cannot be undone. Neither the REST API nor the agent tools provide an endpoint to restore a deprecated template. To resume routing traffic for those prompts, create a new template with the required prompt patterns or external key; pending unmatched logs will automatically rematch.

Template deprecation in Coolhand is permanent. Once a template is marked as deprecated, there is no API endpoint, dashboard action, or agent tool to un-deprecate or reactivate it.

If a template was deprecated by mistake, you can recover by creating a new active template with the same settings.

## What happens when a template is deprecated

When a template is deprecated:

- **Matching stops immediately:** Coolhand completely excludes deprecated templates from prompt matching. New incoming logs will never route to a deprecated template, even if their prompt text matches its patterns.
- **Traffic routes to Unmatched:** If no other active template matches the incoming requests, those logs route to your client's Unmatched bucket.
- **Evaluations stop:** Automated evaluations are not scheduled for deprecated templates.
- **Historical logs and metrics remain:** Past logs, token counts, feedback, and metrics associated with the deprecated template are preserved and remain accessible.
- **API visibility:** Deprecated templates are omitted by default from `GET /api/v2/llm_request_templates`, but you can include them by passing `include_deprecated=true`. Fetching a template directly by ID via `GET /api/v2/llm_request_templates/{id}` always returns the template, even when deprecated.

## How to restore prompt routing

To restore log routing after an accidental deprecation, create a new replacement template.

### Restoring pattern-matched templates

For templates that route logs using prompt regular expressions:

1. **Retrieve the original patterns and configuration:** Fetch the deprecated template by its ID using `GET /api/v2/llm_request_templates/{id}` or through template search with deprecated templates included. Copy the `user_prompt_pattern`, `system_prompt_pattern`, prompt group, and workload ID.
2. **Create and publish a new template:** Create a new template with the desired prompt patterns assigned to your workload, and publish it.
3. **Automatic rematching:** As soon as the new template is published, Coolhand automatically runs a rematch across your Unmatched logs. Any logs that accumulated in the Unmatched bucket while the template was deprecated will be evaluated against the new template and associated accordingly.

### Restoring declared templates

If the deprecated template was a declared template managed programmatically:

1. **Choose a new external key:** Deprecated templates permanently hold their `external_key`. Attempting to recreate or update a template using a key held by a deprecated template will return an HTTP `422 Unprocessable Entity` error. Select a new key (for example, appending a version suffix such as `my-template:v2`).
2. **Create the template via the API:** Send a `PUT` request to `/api/v2/llm_request_templates/by_key/{external_key}` with the new key and the target `workload_id` or `workload_key`. For detailed instructions, see [How do I create or update a template using an external key?](https://coolhandlabs.com/help/create-update-template-with-external-key.md).
3. **Update your log collection calls:** Update your application or SDK configuration to send the new external key in the `declared` block of incoming log requests so future logs match the new template.

---

Related:
- [What is a workload?](https://coolhandlabs.com/help/what-is-a-workload.md)
- [How do I create and manage multiple public API keys for different environments?](https://coolhandlabs.com/help/how-do-i-manage-multiple-public-api-keys-for-different-environments.md)
- [How do I create or update a template using an external key?](https://coolhandlabs.com/help/create-update-template-with-external-key.md)
- [What every field on an LLM request log means](https://coolhandlabs.com/help/llm-request-log-fields.md)

[← All help articles](https://coolhandlabs.com/help.md) · [Logs & API](https://coolhandlabs.com/help/category/logs-and-api.md)
