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

# List Workflows

> Retrieve all workflows available to your Chamelio organization, including their identifiers and current versions, so you can select one to initiate a task.

## Endpoint

```
GET /workflows
```

## Authentication

This endpoint requires authentication via API key. Include your API key in the `X-API-Key` header:

```bash theme={null}
X-API-Key: ca_your_api_key_here
```

## Query Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `active_only` | boolean | No | Only return active workflows. Defaults to `false` |

## Request Example

```bash cURL theme={null}
curl -X GET "https://platform.chamelio.ai/workflows?active_only=true" \
  -H "X-API-Key: ca_your_api_key_here"
```

```python Python theme={null}
import requests

url = "https://platform.chamelio.ai/workflows"
headers = {
    "X-API-Key": "ca_your_api_key_here"
}
params = {
    "active_only": True
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
```

```javascript JavaScript theme={null}
const response = await fetch('https://platform.chamelio.ai/workflows?active_only=true', {
  method: 'GET',
  headers: {
    'X-API-Key': 'ca_your_api_key_here'
  }
});

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

## Response

### Success Response

**Status Code:** `200 OK`

```json theme={null}
{
  "workflows": [
    {
      "workflow_id": "vendor_contract_review",
      "workflow_name": "Vendor Contract Review",
      "version": 1,
      "description": "Review and approve vendor contracts",
      "is_active": true,
      "variables": [
        {
          "variable_id": "contract_file",
          "variable_name": "Contract Document",
          "type": "file",
          "required": true,
          "description": "The vendor contract to review"
        },
        {
          "variable_id": "vendor_name",
          "variable_name": "Vendor Name",
          "type": "text",
          "required": true,
          "description": "Name of the vendor"
        }
      ]
    }
  ],
  "total": 1
}
```

### Response Fields

| Field | Type | Description |
| - | - | - |
| `workflows` | array | List of available workflow schemas |
| `total` | integer | Total number of workflows returned |

### Workflow Schema Fields

| Field | Type | Description |
| - | - | - |
| `workflow_id` | string | Unique identifier for the workflow |
| `workflow_name` | string | Human-readable workflow name |
| `version` | integer | Workflow version number |
| `description` | string | Description of what the workflow does |
| `is_active` | boolean | Whether the workflow is currently active |
| `variables` | array | List of input variables for the workflow |

## Error Responses

### 401 Unauthorized

Returned when authentication fails. See the [authentication errors](https://docs.chamelio.ai/api-reference/api-keys.md#authentication-errors) section for details.

```json theme={null}
{
  "detail": "Invalid API key"
}
```

### 500 Internal Server Error

Returned when the request fails due to a server error.

```json theme={null}
{
  "detail": "Failed to list workflows"
}
```

## Notes

> [!NOTE]
>
> Use the `workflow_id` and `version` from this response to get the full workflow schema or initiate a workflow instance.

> [!TIP]
>
> Set `active_only=true` to filter out deprecated or inactive workflows and only see workflows you can currently use.

## Use Cases

This endpoint is useful for:

* **Workflow discovery** - Explore available workflows in your organization
* **Dynamic integrations** - Build applications that adapt to available workflows
* **Workflow management** - Monitor which workflows are active
* **User interfaces** - Populate workflow selection dropdowns
