---
title: "Update a Routine's interval or enabled state"
method: PATCH
path: "/api/v1/routines/{routineId}"
---

# Update a Routine's interval or enabled state

`PATCH /api/v1/routines/{routineId}`

## Request

- Base URL: `https://charm.ing`
- URL: `https://charm.ing/api/v1/routines/{routineId}`
- Auth: HTTP bearer

Session-gated; requires `app:write` on the routine's app. Re-enable is `{enabled: true}` — not a separate action. Re-enabling resets the consecutive-failure counter.

## Request body

- object
  - `interval` 'hourly' | 'daily' | 'weekly'
  - `enabled` boolean

## Response `200`

Routine updated.

- RoutineResponse
  - `ok` true, required
  - `routine` Routine, required: A declared op scheduled to run on a timer. The op is invoked with empty input, so it must declare no required input fields.
    - `id` string, required: Public id, `routine_<uuid>` form.
    - `app_id` string, uuid, required
    - `op` string, required
    - `interval` 'hourly' | 'daily' | 'weekly', required
    - `enabled` boolean, required
    - `disabled_reason` 'owner' | 'auto' | 'null', nullable, required
    - `next_run_at` string, date-time, nullable, required: `null` while the Routine is disabled — the underlying schedule is preserved and reappears here once re-enabled, with no recomputation.
    - `last_run_at` string, date-time, nullable, required
    - `last_outcome` string, nullable, required
    - `last_error` object, nullable, required
      - `kind` string, required
      - `message` string, required
    - `consecutive_failures` integer, required

## Other responses

- `400`: Invalid body.
- `401`: Sign-in required.
- `404`: Routine not found, or the caller lacks `app:write` on its app.

---

[API](https://skmtc.dev/charm/apis/charming-api.md) · [All operations](https://skmtc.dev/charm/apis/charming-api/llms.txt) · [OpenAPI document](https://skmtc.dev/charm/apis/charming-api/revisions/a9d06c419b3a?raw)
