> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# PUT /v1/workflows/{id}/fund-auto-swap

Update workflow fund auto-swap configuration

` PUT /v1/workflows/{id}/fund-auto-swap `

Update workflow fund auto-swap configuration

## Parameters

### ` id ` (path, required)

Workflow ID

- ` value `: type ` string `

## Request body (required)

Content type: ` application/json `

Fund auto-swap config

- ` value `: type ` unknown `

  - ` oneOf alternative 1 `: type ` object `

  - ` oneOf alternative 2 `: type ` object `

    - ` enabled `: type ` boolean `

    - ` maxSwapAmountUsd `: type ` number `

    - ` mode `: type ` string `

    - ` sources `: type ` array `

      - ` array item `: type ` object `

        - ` chainId `: type ` integer ` — ChainID is the source chain to sell from.

        - ` id `: type ` string ` — ID is a unique identifier for this source (e.g., "src_abc123").

        - ` priority `: type ` integer ` — Priority controls order of evaluation (lower = tried first).

        - ` slippageBps `: type ` integer ` — SlippageBps is the slippage tolerance in basis points. Default 300 (3%).

        - ` tokenAddress `: type ` string ` — TokenAddress is the token to sell. Use "native" for native gas tokens.

        - ` tokenDecimals `: type ` integer ` — TokenDecimals is the number of decimal places for the token (e.g. 18 for ETH, 6 for USDC). Stored so the UI can display the human-readable amount without re-fetching on-chain metadata.

        - ` walletId `: type ` string ` — WalletID is the org wallet to sell from.

## Responses

### ` 200 ` — OK

Content type: ` application/json `

- ` value `: type ` object `

  - ` code `: type ` integer `

    - example: ` 200 `

  - ` data `: type ` object `

    - ` enabled `: type ` boolean `

    - ` maxSwapAmountUsd `: type ` number `

    - ` mode `: type ` string `

    - ` sources `: type ` array `

      - ` array item `: type ` object `

        - ` chainId `: type ` integer ` — ChainID is the source chain to sell from.

        - ` id `: type ` string ` — ID is a unique identifier for this source (e.g., "src_abc123").

        - ` priority `: type ` integer ` — Priority controls order of evaluation (lower = tried first).

        - ` slippageBps `: type ` integer ` — SlippageBps is the slippage tolerance in basis points. Default 300 (3%).

        - ` tokenAddress `: type ` string ` — TokenAddress is the token to sell. Use "native" for native gas tokens.

        - ` tokenDecimals `: type ` integer ` — TokenDecimals is the number of decimal places for the token (e.g. 18 for ETH, 6 for USDC). Stored so the UI can display the human-readable amount without re-fetching on-chain metadata.

        - ` walletId `: type ` string ` — WalletID is the org wallet to sell from.

  - ` message `: type ` string `

    - example: ` "success" `

  - ` requestId `: type ` string `

    - example: ` "abc-123" `

### ` 400 ` — Bad Request

Content type: ` application/json `

- ` value `: type ` object `

  - ` code `: type ` integer `

  - ` details `: type ` array `

    - ` array item `: type ` unknown `

  - ` message `: type ` string `

  - ` requestId `: type ` string `

### ` 403 ` — Forbidden

Content type: ` application/json `

- ` value `: type ` object `

  - ` code `: type ` integer `

  - ` details `: type ` array `

    - ` array item `: type ` unknown `

  - ` message `: type ` string `

  - ` requestId `: type ` string `

### ` 404 ` — Not Found

Content type: ` application/json `

- ` value `: type ` object `

  - ` code `: type ` integer `

  - ` details `: type ` array `

    - ` array item `: type ` unknown `

  - ` message `: type ` string `

  - ` requestId `: type ` string `

## Request examples

### cURL

```curl
curl -X PUT 'https://api.example.com/v1/workflows/string/fund-auto-swap' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

### JavaScript

```javascript
const response = await fetch('https://api.example.com/v1/workflows/string/fund-auto-swap', {
  method: 'PUT',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({})
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.put('https://api.example.com/v1/workflows/string/fund-auto-swap', headers=headers, json={})
print(response.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{}`)
	req, _ := http.NewRequest("PUT", "https://api.example.com/v1/workflows/string/fund-auto-swap", body)
	req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
	req.Header.Set("Content-Type", "application/json")

	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
	result, _ := io.ReadAll(resp.Body)
	fmt.Println(string(result))
}
```