> ## Documentation Index
> Fetch the complete documentation index at: https://cobalt-55-abhishek.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Toggle Workflow in Config

> Enable or disable a workflow within a config.

Enable or disable a single workflow within an app's config installation. Returns the updated list of workflows in the config.

## Authentication

Configs are scoped to a linked account via the `linked_account_id` header.

<ParamField header="x-api-key" type="string" required>Your Refold API key.</ParamField>
<ParamField header="linked_account_id" type="string" required>The linked account.</ParamField>

## Path Parameters

<ParamField path="slug" type="string" required>The app slug. **Example:** `hubspot`</ParamField>
<ParamField path="config_id" type="string" required>The config ID (defaults to the linked account ID).</ParamField>
<ParamField path="workflow_id" type="string" required>The workflow to enable or disable.</ParamField>

## Body Parameters

<ParamField body="enabled" type="boolean" required>
  `true` to enable the workflow, `false` to disable it.
</ParamField>

## Response

<Tabs>
  <Tab title="200 OK">
    <ResponseField name="workflows" type="array">
      The config's workflows after the change, each `{id, name, description, enabled}`.
    </ResponseField>
  </Tab>

  <Tab title="404 Not Found">
    <ResponseField name="status_code" type="integer">HTTP status code.</ResponseField>
    <ResponseField name="http_error_type" type="string">Error category.</ResponseField>
    <ResponseField name="error_code" type="string">Internal error code.</ResponseField>
    <ResponseField name="message" type="string">Human-readable error description.</ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```json 200 theme={null}
  {
    "workflows": [
      {
        "id": "699d8648a81ba363578cc2f4",
        "name": "Sync Contacts",
        "description": "Sync contacts to HubSpot",
        "enabled": false
      }
    ]
  }
  ```

  ```json 404 theme={null}
  {
    "status_code": 404,
    "http_error_type": "NOT_FOUND",
    "error_code": "SERVER_ERROR",
    "message": "Config with config id user_12345 not found"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH "https://app.refold.ai/api/v2/public/slug/{slug}/config/{config_id}/workflows/{workflow_id}" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "linked_account_id: YOUR_LINKED_ACCOUNT_ID" \
    -H "Content-Type: application/json" \
    -d '{ "enabled": false }'
  ```
</RequestExample>
