---
title: "Change a database's workload mode (internal, operator-only)"
method: PUT
path: "/external-services/{id}/workload-mode"
tags: ["External Services"]
---

# Change a database's workload mode (internal, operator-only)

`PUT /external-services/{id}/workload-mode`

## 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}/workload-mode`
- Auth: HTTP bearer

An ADR-055 migration control for operators and the CLI; the console does
not show it. Databases default to `legacy` and need no change here.

## Path parameters

- `id` integer, required

## Request body

- UpdateWorkloadModeRequest
  - `mode` 'legacy' | 'shadow' | 'enforce', required

## Response `200`

Mode changed; nothing running changed

- WorkloadModeChangeResponse
  - `pending_changes` PendingChanges, nullable: What recreating a database's container from its workload spec would change, listed before anything is changed. A recreate is only accepted with this response's `fingerprint`, so what the administrator confirmed is what is applied.
    - `changes` WorkloadChange[], required
      - `after_recreate` string, required: What the container will have once recreated from its spec.
      - `current` string, required: What the running container has. Secrets are shown as `***`.
      - `field` string, required: `labels`, `restart_policy`, `pids_limit`, `no_new_privileges`, `healthcheck`, `log_config`, ...
    - `computed_at` string, date-time, required
    - `container_found` boolean, required: Whether the database's container exists to compare against.
    - `container_name` string, nullable
    - `fingerprint` string, required: Identifies `changes`: pass it back to confirm a recreate.
    - `mode` 'legacy' | 'shadow' | 'enforce', required
    - `node_id` integer, nullable: `None`: the control plane.
    - `service_id` integer, required
    - `service_name` string, required
    - `support` WorkloadSupport, required: Whether a database can leave `legacy`, and why not.
      - `reason` string, nullable: Why the database stays on its engine's own path, when unsupported.
      - `supported` boolean, required
  - `previous_mode` 'legacy' | 'shadow' | 'enforce', required
  - `workload` ServiceWorkloadModeResponse, required: A database's workload mode.
    - `mode` 'legacy' | 'shadow' | 'enforce', required: `legacy`: the engine (or the worker's agent) builds its own container request. `shadow`: the same, and a background pass logs where the running container differs from its workload spec. `enforce`: the container is created from its admitted spec through the Docker driver, the next time it is created or recreated.
    - `node_id` integer, nullable: `None`: the database runs on the control plane.
    - `service_id` integer, required
    - `service_name` string, required
    - `service_type` string, required
    - `support` WorkloadSupport, required: Whether the database can leave `legacy`, and why not.
      - `reason` string, nullable: Why the database stays on its engine's own path, when unsupported.
      - `supported` boolean, required

## Other responses

- `400`: The database cannot use this mode
- `401`: Unauthorized
- `403`: Instance administrator required
- `404`: Service not found
- `500`: Internal server error

## Changes

- **2026-11-09** `12896146b193`: 5 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `404` status
  - …1 more
- **2026-10-28** `b8d51a990805`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/external-services/:id/workload-mode/put.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)
