---
title: "Re-assign an agent's harness_provider (live)"
method: PATCH
path: "/api/agents/{id}/harness-provider"
tags: ["Agents"]
---

# Re-assign an agent's harness_provider (live)

`PATCH /api/agents/{id}/harness-provider`

Updates `agents.harness_provider` and upserts `swarm_config` (scope=agent, key=HARNESS_PROVIDER) so the worker's poll-loop reconciliation picks up the new provider within ~10s. No restart required. The swarm_config row is what actually drives the worker; the column mirrors the latest set value for dashboards.

## Path parameters

- `id` string, required

## Request body

- object
  - `harness_provider` 'claude' | 'codex' | 'pi' | 'devin' | 'claude-managed' | 'opencode', required

## Response `200`

Updated agent row

## Other responses

- `400` — Validation error (unknown provider)
- `404` — Agent not found

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/revisions/4f62e32be8ec?raw)
