---
title: "Change or pause an agent's routine"
method: PATCH
path: "/v1/personal-agents/{id}/routines/{routineId}"
tags: ["Agents"]
---

# Change or pause an agent's routine

`PATCH /v1/personal-agents/{id}/routines/{routineId}`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/personal-agents/{id}/routines/{routineId}`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Send only the fields that change: name, instructions, schedule, or active to pause or resume. The owner's change applies at once. A manager's change becomes a request the owner must approve, answered with 202.

## Path parameters

- `id` string, required
- `routineId` string, required

## Request body

- UpdatePersonalAgentRoutine
  - `name` string
  - `instructions` string
  - `schedule` union
    - object
      - `kind` 'once', required
      - `timezone` string, required
      - `at` integer, required
    - object
      - `kind` 'daily', required
      - `timezone` string, required
      - `hour` integer, required
      - `minute` integer, required
    - object
      - `kind` 'weekly', required
      - `timezone` string, required
      - `daysOfWeek` integer[], required
      - `hour` integer, required
      - `minute` integer, required
    - object: Every everyHours hours on the hour, counted from startHour on each listed day (0 = Sunday) and stopping before endHour, in timezone. Needs the organization's every-few-hours schedules.
      - `kind` 'interval', required
      - `timezone` string, required
      - `everyHours` integer, required
      - `daysOfWeek` integer[]
      - `startHour` integer
      - `endHour` integer
    - object: Runs offsetMinutes (negative is before) from the start or end of each meeting on the owner's primary Google Calendar: timed meetings they accepted or organize, with someone else invited. Cloud Automations only; needs Google Calendar connected and the organization's before-and-after-meeting Automations.
      - `kind` 'calendar', required
      - `timezone` string, required
      - `edge` 'start' | 'end', required
      - `offsetMinutes` integer, required
      - `rule` object
        - `withExternalAttendees` boolean
        - `titleIncludes` string
  - `active` boolean

## Response `200`

Routine updated.

- AutomationDetail
  - `automation` Automation, required
    - `id` string, required
    - `organizationId` string, required
    - `ownerMemberId` string, required
    - `name` string, required
    - `state` 'active' | 'inactive' | 'needs_attention' | 'archived', required
    - `currentRevisionId` string, required
    - `nextDueAt` integer, nullable, required
    - `latestRunAt` integer, nullable, required
    - `latestSuccessfulRunId` string, nullable
    - `latestSuccessfulResult` unknown
    - `needsAttentionReason` AutomationNeedsAttentionReason, nullable, required
      - `code` 'owner_membership_lost' | 'model_access_lost' | 'provider_unavailable' | 'connect_access_unavailable' | 'openwork_web_access_required' | 'execution_runtime_unavailable', required
      - `message` string, required
      - `occurredAt` integer, required
    - `agentId` string, nullable
    - `createdAt` integer, required
    - `updatedAt` integer, required
    - `archivedAt` integer, nullable, required
  - `revision` AutomationRevision, required
    - `id` string, required
    - `automationId` string, required
    - `version` integer, required
    - `instructions` string, required
    - `schedule` union, required
      - object
        - `kind` 'once', required
        - `timezone` string, required
        - `at` integer, required
      - object
        - `kind` 'daily', required
        - `timezone` string, required
        - `hour` integer, required
        - `minute` integer, required
      - object
        - `kind` 'weekly', required
        - `timezone` string, required
        - `daysOfWeek` integer[], required
        - `hour` integer, required
        - `minute` integer, required
      - object: Every everyHours hours on the hour, counted from startHour on each listed day (0 = Sunday) and stopping before endHour, in timezone. Needs the organization's every-few-hours schedules.
        - `kind` 'interval', required
        - `timezone` string, required
        - `everyHours` integer, required
        - `daysOfWeek` integer[]
        - `startHour` integer
        - `endHour` integer
      - object: Runs offsetMinutes (negative is before) from the start or end of each meeting on the owner's primary Google Calendar: timed meetings they accepted or organize, with someone else invited. Cloud Automations only; needs Google Calendar connected and the organization's before-and-after-meeting Automations.
        - `kind` 'calendar', required
        - `timezone` string, required
        - `edge` 'start' | 'end', required
        - `offsetMinutes` integer, required
        - `rule` object
          - `withExternalAttendees` boolean
          - `titleIncludes` string
      - object
        - `kind` 'event', required
    - `model` object, required
      - `providerId` string, required
      - `modelId` string, required
      - `variant` string, nullable
    - `action` union
      - object
        - `kind` 'agent', required
        - `instructions` string, required
        - `model` object, required
          - `providerId` string, required
          - `modelId` string, required
          - `variant` string, nullable
      - object
        - `kind` 'saved_script', required
        - `script` object, required
          - `pluginId` string, required
          - `configObjectId` string, required
          - `configObjectVersionId` string, required
        - `input` unknown
    - `executionTarget` 'desktop' | 'cloud'
    - `workspaceId` string, nullable
    - `agentRevisionId` string, nullable
    - `maximumRuntimeMs` integer, required
    - `digest` string, required
    - `createdAt` integer, required
  - `latestRun` AutomationRun, nullable, required
    - `id` string, required
    - `automationId` string, required
    - `revisionId` string, required
    - `trigger` 'scheduled' | 'recovery' | 'manual', required
    - `scheduledFor` integer, nullable, required
    - `idempotencyKey` string, required
    - `status` 'queued' | 'claimed' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'skipped', required
    - `leaseOwner` string, nullable, required
    - `leaseExpiresAt` integer, nullable, required
    - `heartbeatAt` integer, nullable, required
    - `attemptCount` integer, required
    - `executionTarget` 'desktop' | 'cloud', required
    - `executionThread` AutomationExecutionThread, nullable, required
      - `id` string, required
      - `threadKind` 'automation', required
      - `executionLocation` 'desktop' | 'cloud', required
      - `automationId` string, required
      - `automationRunId` string, required
      - `engineKind` string, required
      - `nativeThreadId` string, nullable
      - `workspaceId` string, nullable
    - `providerId` string, required
    - `modelId` string, required
    - `modelVariant` string, nullable
    - `startedAt` integer, nullable, required
    - `finishedAt` integer, nullable, required
    - `error` AutomationError, nullable, required
      - `code` 'owner_membership_lost' | 'model_access_lost' | 'provider_unavailable' | 'connect_access_unavailable' | 'openwork_web_access_required' | 'execution_runtime_unavailable' | 'connection_action_required' | 'execution_failed' | 'execution_timed_out' | 'runner_unavailable' | 'cancelled' | 'lease_lost' | 'internal_error', required
      - `message` string, required
      - `retryable` boolean, required
    - `resultSummary` string, nullable, required
    - `codemodeReceiptId` string, nullable
    - `validatedResult` unknown
    - `triggerContext` AutomationRunTriggerContext, nullable
      - `kind` 'calendar_meeting', required
      - `eventId` string, required
      - `title` string, nullable, required
      - `start` integer, required
      - `end` integer, required
      - `attendeeDomains` string[], required
      - `externalAttendees` integer, required
      - `link` string, nullable, required
    - `usage` AutomationUsage, required
      - `inputTokens` integer, nullable, required
      - `outputTokens` integer, nullable, required
      - `costMicros` integer, nullable, required
    - `createdAt` integer, required
    - `updatedAt` integer, required

## Other responses

- `202`: Change requested and waiting for the owner.
- `400`: Invalid request.
- `403`: You cannot make this change.
- `404`: Not found.
- `409`: The routine cannot be updated right now.

## Changes

- **2026-12-02** `b20ab6931f6a`: 1 breaking
  - added `subschema #6` to the `revision/schedule` response property `oneOf` list for the response status `200`
- **2026-11-26** `b55d1864549e`: 2 warning, 1 info
  - added the new `awaiting_owner` enum value to the `request/status` response property for the response status `202`
  - added the new `turn_on` enum value to the `request/canDecide/items/` response property for the response status `202`
  - added the optional property `request/connectorAccess` to the response with the `202` status
- **2026-11-26** `bc0092687a7b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/personal-agents/:id/routines/:routineId/patch.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
