> ## 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.

# POST /v1/workflows/{id}/widget

Enable public widget for a workflow

` POST /v1/workflows/{id}/widget `

Enable public widget for a workflow

## Parameters

### ` id ` (path, required)

Workflow ID

- ` value `: type ` string `

## Request body (required)

Content type: ` application/json `

Widget configuration

- ` value `: type ` unknown `

  - ` oneOf alternative 1 `: type ` object `

  - ` oneOf alternative 2 `: type ` object `

    - Required fields: ` title `

    - ` buttonLabel `: type ` string ` — ButtonLabel is the text displayed on the trigger button (optional, defaults to "Send")

      - maxLength: ` 50 `

    - ` description `: type ` string ` — Description explains what the workflow does (optional)

      - maxLength: ` 500 `

    - ` maxAmount `: type ` string ` — MaxAmount is the maximum amount allowed per trigger (optional)

    - ` minAmount `: type ` string ` — MinAmount is the minimum amount required to trigger (optional)

    - ` title `: type ` string ` — Title is the display title for the widget (required)

      - maxLength: ` 100 `

## Responses

### ` 200 ` — OK

Content type: ` application/json `

- ` value `: type ` object `

  - ` code `: type ` integer `

    - example: ` 200 `

  - ` data `: type ` object ` — Widget contains the public widget configuration with derived trigger values

    - ` buttonLabel `: type ` string ` — ButtonLabel is the text displayed on the trigger button

    - ` chainId `: type ` integer ` — ChainID is derived from the trigger's chainId

    - ` description `: type ` string ` — Description explains what the workflow does

    - ` enabled `: type ` boolean ` — Enabled controls whether the public widget is active

    - ` maxAmount `: type ` string ` — MaxAmount is the maximum amount allowed per trigger (in smallest unit)

    - ` minAmount `: type ` string ` — MinAmount is the minimum amount required to trigger (in smallest unit)

    - ` recipientAddress `: type ` string ` — RecipientAddress is derived from the trigger's toAddress/contractAddress

    - ` title `: type ` string ` — Title is the display title for the widget

    - ` tokenAddress `: type ` string ` — TokenAddress is derived from the trigger's tokenAddress (empty for native token)

  - ` 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 `

### ` 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 POST 'https://api.example.com/v1/workflows/string/widget' \
  -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/widget', {
  method: 'POST',
  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.post('https://api.example.com/v1/workflows/string/widget', headers=headers, json={})
print(response.json())
```

### Go

```go
package main

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

func main() {
	body := strings.NewReader(`{}`)
	req, _ := http.NewRequest("POST", "https://api.example.com/v1/workflows/string/widget", 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))
}
```