---
title: "Enable or disable metric collection for an external service."
method: PATCH
path: "/external-services/{id}/metrics/enable"
tags: ["Metrics"]
---

# Enable or disable metric collection for an external service.

`PATCH /external-services/{id}/metrics/enable`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/external-services/{id}/metrics/enable`
- Auth: HTTP bearer

When `enabled=true`, seeds the default alert rules for the service's engine
via [`temps_alarms::seed_default_rules`] (idempotent).

## Path parameters

- `id` integer, required

## Request body

- ToggleServiceMetricsRequest: Request body to toggle metric collection for an external service.
  - `enabled` boolean, required: Whether to enable (`true`) or disable (`false`) metric collection.

## Response `200`

Metrics toggle applied

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Service not found
- `500`: Internal server error

## Changes

- **2026-06-05** `61b7612b2d33`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/external-services/:id/metrics/enable/patch.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
