> ## Documentation Index
> Fetch the complete documentation index at: https://docs.convocore.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Custom Metric

> Delete a custom metric from an agent

## Overview

Permanently deletes a custom metric definition from an agent. This stops the metric from being tracked in future conversations.

<Warning>
  **Important:**

  * This action cannot be undone
  * Historical data is **not deleted** - past metric values remain in conversation records
  * The metric will no longer be tracked in new conversations
  * System metrics cannot be deleted
</Warning>

## What Happens After Deletion

1. ✅ **Historical Data Preserved**: All previously recorded metric values remain in conversations
2. ✅ **Analytics Access**: You can still query historical data for this metric
3. ❌ **Future Tracking Stops**: The metric won't be collected in new conversations
4. ❌ **Metric Not Listed**: The metric disappears from the metrics list

## System Metrics Protection

System metrics are protected and cannot be deleted:

```json theme={null}
{
  "error": {
    "code": "FORBIDDEN",
    "message": "System metrics cannot be deleted"
  }
}
```

## Alternative: Disable Instead of Delete

If you want to temporarily stop tracking a metric without losing its definition:

<Tip>
  Consider creating a "disabled" or "archived" state in your application instead of deleting metrics. This preserves the configuration for potential future reactivation.
</Tip>

## Use Cases

* **Cleanup**: Remove outdated or unused metrics
* **Reorganization**: Clear metrics before implementing a new tracking strategy
* **Mistake Correction**: Remove incorrectly configured metrics

## Before Deleting

1. **Export Data**: Back up historical data if needed
2. **Update Documentation**: Remove references to the metric from internal docs
3. **Notify Team**: Inform team members who rely on this metric
4. **Check Dependencies**: Ensure no dashboards or reports depend on this metric


## OpenAPI

````yaml DELETE /agents/{agentId}/custom-metrics/{metricId}
openapi: 3.0.3
info:
  title: Convocore OpenAPI
  description: Full API reference for Convocore
  version: 1.0.4
servers:
  - url: https://eu-gcp-api.vg-stuff.com/v3
    description: EU Node.js API server
  - url: https://na-gcp-api.vg-stuff.com/v3
    description: NA Node.js API server
security: []
paths:
  /agents/{agentId}/custom-metrics/{metricId}:
    delete:
      tags:
        - Custom Metrics
      summary: Delete a custom metric
      description: >-
        Deletes a custom metric. Warning: This will not delete historical data
        but the metric will no longer be tracked in future conversations.
      operationId: customMetrics-deleteMetric
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the agent
        - name: metricId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the metric to delete
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                required:
                  - success
                  - message
                additionalProperties: false
        default:
          $ref: '#/components/responses/error'
      security:
        - Authorization: []
components:
  responses:
    error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              issues:
                type: array
                items:
                  type: object
                  properties:
                    message:
                      type: string
                  required:
                    - message
                  additionalProperties: false
            required:
              - message
              - code
            additionalProperties: false
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````