# Replace workflow

URL: https://docs.hanzo.ai/docs/openapi/workflow/put-workflow

> Answers 307 with Location /v1/workflow/ — this address serves nothing itself.

`PUT /v1/workflow`

> [Workflow →](https://docs.hanzo.ai/docs/openapi/workflow) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/workflow`     |
| **Method**    | `PUT`                                  |
| **Operation** | `put_workflow`                         |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Answers 307 with Location /v1/workflow/ — this address serves nothing itself. The status and the Location are the same on every method; a GET additionally carries the short HTML body a browser falls back to when it does not follow the redirect itself.

A 307 preserves both the method and the body, so a client that follows redirects re-sends the request unchanged to /v1/workflow/ and nothing is lost. A client that does NOT follow redirects sees only the 307 and performs no work — address /v1/workflow/ directly and the hop disappears.

## Request

The document declares no body for `PUT /v1/workflow`. The handler is typed in cloud but its shape is not yet emitted, so the fields are not listed here — ask MCP's `describe` for `put_workflow`, which answers from the running route.

## Response

The document declares no response body for this operation. It answers `200` on success and the platform error shape on failure — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo workflow replace
```

**SDK**

**.ts**

```ts
import { Configuration, WorkflowApi } from 'hanzoai';

const api = new WorkflowApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.putWorkflow();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import WorkflowApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = WorkflowApi(client).put_workflow()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.WorkflowAPI.PutWorkflow(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, workflow_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = workflow_api::put_workflow(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.WorkflowApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new WorkflowApi(client).putWorkflow();
```

**HTTP**

```bash
curl -X PUT https://api.hanzo.ai/v1/workflow \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP declares no tool for **workflow** — `tools/list` on `https://api.hanzo.ai/v1/mcp` names the products it does reach. Use HTTP or an SDK.

---

[Workflow API](https://docs.hanzo.ai/docs/openapi/workflow) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
