---
title: "Update routine"
method: PATCH
path: "/routines/{jobId}"
tags: ["routines"]
---

# Update routine

`PATCH /routines/{jobId}`

## Request

- Base URL: `https://www.dench.com/api/v1`
- URL: `https://www.dench.com/api/v1/routines/{jobId}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Update a routine.

## Path parameters

- `jobId` string, required

## Request body

- object
  - `name` string
  - `prompt` string
  - `schedule` union: Schedule: recurring (`every`), cron expression, or one-shot (`at`).
    - object
      - `kind` 'every', required
      - `everyMs` integer, required: Interval in milliseconds (1s to 365d).
      - `anchorMs` integer: Optional anchor timestamp for the recurring fire.
    - object
      - `kind` 'cron', required
      - `expr` string, required: 5-field POSIX cron expression.
      - `tz` string: IANA timezone, e.g. America/New_York.
    - object
      - `kind` 'at', required
      - `at` string, required: ISO 8601 timestamp for a one-shot run.
  - `description` string
  - `overlapPolicy` 'skip' | 'queue' | 'kill_old': What to do when a previous run is still active. Defaults to `skip`.
  - `enabled` boolean
  - `deleteAfterRun` boolean
  - `target` 'chat_turn': Routine run target.

## Response `200`

Successful response

- object
  - `jobId` string, required
  - `nextFireAt` number, nullable

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid authentication
- `404`: Operation or resource not found
- `500`: Server error

---

[API](https://skmtc.dev/dench/apis/dench-api.md) - [All operations](https://skmtc.dev/dench/apis/dench-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dench/apis/dench-api/revisions/4a145b38f19c?raw)
