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

# List categories

> Retrieve all available workflow categories.

Categories help organize workflows into logical collections.
Use the category slugs when creating or updating workflows.




## OpenAPI

````yaml /openapi_specs/workflows.json get /categories
openapi: 3.0.3
info:
  title: Workflows Engine API
  description: >
    # Workflows Engine API


    Execute and monitor AI workflows with a simple, consistent API.


    ## Quick Start


    1. **Trigger a workflow** - POST to `/{workflowID}/trigger` with your inputs

    2. **Monitor execution** - GET `/executions/{executionID}` to check status

    3. **Optional**: Provide a `webhook_url` to receive automatic notifications
    when complete


    ---


    ## Webhook Notifications


    When you provide a `webhook_url` when triggering a workflow, the Workflows
    Engine will automatically 

    **POST** to your endpoint with the execution results when the workflow
    completes (successfully or with an error).


    ### Key Features


    - ✅ **Consistent Payload**: The webhook payload has the same structure as
    the response from `GET /executions/{executionID}`

    - ✅ **Automatic Retries**: Failed webhook deliveries are automatically
    retried with exponential backoff

    - ✅ **Simple Integration**: No authentication required - your endpoint just
    needs to accept POST requests


    ### Webhook Request


    The engine will POST to your `webhook_url` with:


    - **Method**: `POST`

    - **Content-Type**: `application/json`

    - **Body**: Execution details (see payload structure below)


    ### Example Webhook Payload


    ```json

    {
      "execution_id": "69ae8c7b-7500-4a45-b7c0-348b8cc2665b",
      "workflow_id": "50741f40-8621-4d46-8a91-dff4d873be98",
      "status": "completed",
      "started_at": "2025-12-04T11:48:10Z",
      "inputs": {
        "story": "tell an epic story of a rat graduating from law"
      },
      "step_outputs": {
        "step1": {
          "step_id": "step1",
          "status": "completed",
          "output": "Once upon a time in Ratropolis...",
          "primary": "Once upon a time in Ratropolis...",
          "metadata": {
            "model": "openai-chatgpt-5",
            "version": "0.0.1",
            "params": {
              "system_prompt": "You are a helpful assistant",
              "max_output_tokens": 512
            }
          }
        },
        "step2": {
          "step_id": "step2",
          "status": "completed",
          "output": [
            "https://storage.googleapis.com/uploads/image1.png",
            "https://storage.googleapis.com/uploads/image2.png"
          ],
          "primary": "https://storage.googleapis.com/uploads/image1.png",
          "metadata": {
            "model": "nano-banana-pro",
            "params": {
              "num_images": 2,
              "aspect_ratio": "16:9"
            }
          }
        }
      },
      "output": [
        "https://storage.googleapis.com/uploads/image1.png",
        "https://storage.googleapis.com/uploads/image2.png"
      ]
    }

    ```


    ### Example Webhook Handler


    ```python

    @app.post("/webhooks/workflow-completed")

    async def handle_workflow_webhook(request: Request):
        execution = await request.json()
        
        if execution["status"] == "completed":
            # Process successful execution
            final_output = execution["output"]
            step_details = execution["step_outputs"]
            print(f"Workflow completed: {final_output}")
            
        elif execution["status"] == "failed":
            # Handle failure
            error = execution.get("error_cause", "Unknown error")
            print(f"Workflow failed: {error}")
        
        return {"received": True}
    ```


    Your webhook endpoint should return a `200 OK` status to acknowledge
    receipt.


    ---


    ## Fallback Configuration


    Model steps support an optional **fallback configuration** that
    automatically retries with an alternative 

    model if the primary model invocation fails. This provides resilience
    against temporary model outages 

    or rate limits.


    ### How Fallback Works


    When a model step has fallback configured, the workflow engine will:


    1. **Execute the primary model** with its configured parameters

    2. **If the primary attempt fails**, automatically execute the fallback
    model configuration

    3. **Mark the step as failed only if both primary and fallback attempts
    fail**


    ### Fallback Configuration


    Add a `fallback` object to any model step in your workflow definition:


    ```json

    {
      "step_id": "generate_image",
      "type": "model",
      "model": "flux-dev",
      "params": {
        "prompt": "{{inputs.prompt}}",
        "num_images": 1
      },
      "fallback": {
        "enabled": true,
        "model": "flux-1-1-pro",
        "params": {
          "prompt": "{{inputs.prompt}}",
          "guidance_scale": 7.5
        }
      }
    }

    ```


    ### Fallback Properties


    | Property | Type | Description |

    |----------|------|-------------|

    | `enabled` | boolean | Enable or disable fallback for this step (default:
    `true`) |

    | `model` | string | Alternative AI model identifier to use on failure |

    | `version` | string | Fallback model version (defaults to primary version
    when omitted) |

    | `params` | object | Model-specific parameters for the fallback (supports
    template variables) |


    ### Detecting Fallback Usage


    When a fallback is used, the step's metadata in execution results will
    include:


    - `fallback_used: true` - Indicates the step completed using the fallback
    configuration

    - `primary_error` - Human-readable description of why the primary attempt
    failed


    ### Example Execution Response with Fallback


    ```json

    {
      "step_id": "generate_image",
      "status": "completed",
      "output": "https://storage.googleapis.com/uploads/image.png",
      "metadata": {
        "model": "flux-1-1-pro",
        "fallback_used": true,
        "primary_error": "Primary model flux-dev failed: rate limit exceeded"
      }
    }

    ```


    ---


    ## Unlisted Workflows


    Versions can be "unlisted" - accessible via direct link but hidden from
    public listings.


    **Visibility states:**

    - **Private** (default): Organization only

    - **Unlisted**: Accessible via link, hidden from public listings

    - **Public**: Visible in listings and accessible to everyone


    **Setting unlisted:** Use `allowed_to_share: true` when creating or updating
    a version.


    ```bash

    # Create unlisted version

    PUT /workflows/{workflowID}/versions/v1 { "allowed_to_share": true, ... }

    ```


    **Behavior:**

    - `allowed_to_share: true` → Creates/updates as unlisted

    - `allowed_to_share: false` → Creates/updates as private

    - No effect on public versions (never downgraded)
  version: 1.0.0
  x-logo:
    url: ./logo-white.svg
    altText: Eachlabs Logo
servers:
  - url: https://workflows.eachlabs.run/api/v1
    description: >-
      Deprecated compatibility production host. This public URL remains
      supported for now, but will soon move under the api-service host at
      https://api.eachlabs.ai.
security:
  - ApiKeyAuth: []
tags:
  - name: Categories
    description: Workflow categories for organization
  - name: Workflows
    description: Workflow and version management
  - name: Executions
    description: Workflow execution and monitoring
  - name: Public Workflows
    description: Access public and unlisted workflows by organization nickname
paths:
  /categories:
    get:
      tags:
        - Categories
      summary: List categories
      description: |
        Retrieve all available workflow categories.

        Categories help organize workflows into logical collections.
        Use the category slugs when creating or updating workflows.
      operationId: listCategories
      responses:
        '200':
          description: Categories retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoriesResponse'
components:
  schemas:
    CategoriesResponse:
      type: object
      required:
        - categories
      properties:
        categories:
          type: array
          items:
            $ref: '#/components/schemas/Category'
          description: List of available workflow categories
      example:
        categories:
          - slug: image-generation
            label: Image Generation
            description: Workflows for generating images
            is_default: true
            created_at: '2025-12-01T10:00:00Z'
            updated_at: '2025-12-01T10:00:00Z'
          - slug: text-processing
            label: Text Processing
            description: Workflows for processing text
            is_default: true
            created_at: '2025-12-01T10:00:00Z'
            updated_at: '2025-12-01T10:00:00Z'
    Category:
      type: object
      required:
        - slug
        - label
      properties:
        slug:
          type: string
          description: Unique category identifier (used in API requests)
          example: image-generation
        label:
          type: string
          description: Human-readable category name
          example: Image Generation
        description:
          type: string
          description: Category description
          example: Workflows for generating images
        is_default:
          type: boolean
          description: Whether this is a default system category
          example: true
        created_at:
          type: string
          format: date-time
          description: RFC3339 timestamp when category was created
          example: '2025-12-01T10:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: RFC3339 timestamp when category was last updated
          example: '2025-12-01T10:00:00Z'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````