---
title: "Replace a repository's workflow"
method: PUT
path: "/api/v0beta1/repositories/{id}/workflow"
tags: ["Repositories"]
---

# Replace a repository's workflow

`PUT /api/v0beta1/repositories/{id}/workflow`

## Path parameters

- `id` string, required

## Request body

- UpsertWorkflowRequest
  - `default_agent` 'claude' | 'codex' | 'null', nullable
  - `start_step` string, required
  - `steps` object[], required
    - `name` string, required
    - `body` string, required
    - `on_success` string, nullable
    - `on_failure` string, nullable

## Response `200`

Updated workflow.

- WorkflowResponse
  - `workflow` object, nullable, required
    - `default_agent` string, nullable, required
    - `start_step` string, required
    - `steps` object[], required
      - `name` string, required
      - `body` string, required
      - `on_success` string, nullable, required
      - `on_failure` string, nullable, required
    - `created_at` union, required
      - string
      - string, date-time
    - `updated_at` union, required
      - string
      - string, date-time

## Other responses

- `400` — Error
- `401` — Error
- `403` — Error
- `404` — Error

---

[API](https://skmtc.net/amika/apis/amika-api.md) · [All operations](https://skmtc.net/amika/apis/amika-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/amika/amika-api/revisions/664536fccd0e/schema)
