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

# Update Workflow

> Update an existing workflow's configuration or code.

Update a workflow's name, code, events, room scope, or enabled state. At least one field must be provided.

## Endpoint

```
PATCH /v1/accounts/:accountId/workflows/:id
```

## Authentication

**Bearer token** required.

## Path Parameters

<ParamField path="id" type="string" required>
  The workflow's unique ID.
</ParamField>

## Request Body

All fields are optional, but at least one must be provided.

<ParamField body="name" type="string">
  New workflow name.
</ParamField>

<ParamField body="code" type="string">
  New source code.
</ParamField>

<ParamField body="events" type="string[]">
  New list of trigger events.
</ParamField>

<ParamField body="roomId" type="string | null">
  New room scope. Set to `null` to trigger for all rooms.
</ParamField>

<ParamField body="enabled" type="boolean">
  Enable or disable the workflow.
</ParamField>

## Response

<ResponseField name="workflow" type="WorkflowRegistration">
  The updated workflow object. See [`WorkflowRegistration`](/types/workflows#workflowregistration).
</ResponseField>

## Example

<CodeGroup>
  ```bash curl theme={null}
  curl -X PATCH https://api.collab-kit.com/v1/accounts/${ACCOUNT_ID}/workflows/wf_abc123 \
    -H "Authorization: Bearer ${TOKEN}" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Updated welcome message",
      "enabled": false
    }'
  ```

  ```typescript JavaScript theme={null}
  const res = await fetch(`https://api.collab-kit.com/v1/accounts/${accountId}/workflows/wf_abc123`, {
    method: 'PATCH',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      name: 'Updated welcome message',
      enabled: false,
    }),
  });
  const { data } = await res.json();
  ```
</CodeGroup>

```json Response theme={null}
{
  "type": "response",
  "success": true,
  "description": "Workflow updated",
  "data": {
    "workflow": {
      "id": "wf_abc123",
      "organization_id": "a1b2c3d4-...",
      "name": "Updated welcome message",
      "code": "export default async function(event, { store, room }) { ... }",
      "events": ["participant.joined"],
      "room_id": null,
      "enabled": false,
      "created_at": "2026-05-29T10:00:00.000Z",
      "updated_at": "2026-05-29T11:00:00.000Z"
    }
  },
  "error": null
}
```
