Skip to main content

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.

Endpoint

GET /workflows/{workflow_id}/{version}/schema

Authentication

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

Path Parameters

ParameterTypeRequiredDescription
workflow_idstringYesUnique identifier for the workflow
versionstringYesVersion number (e.g., “1”) or “latest” for the most recent version

Request Example

curl -X GET "https://platform.chamelio.ai/workflows/vendor_contract_review/latest/schema" \
  -H "X-API-Key: ca_your_api_key_here"

Response

Success Response

Status Code: 200 OK
{
  "workflow_schema": {
    "workflow_id": "vendor_contract_review",
    "workflow_name": "Vendor Contract Review",
    "version": 1,
    "description": "Review and approve vendor contracts with automated checks",
    "is_active": true,
    "variables": [
      {
        "variable_id": "contract_file",
        "variable_name": "Contract Document",
        "type": "file",
        "required": true,
        "description": "The vendor contract to review",
        "validation": {
          "allowed_extensions": ["pdf", "docx"]
        }
      },
      {
        "variable_id": "vendor_name",
        "variable_name": "Vendor Name",
        "type": "text",
        "required": true,
        "description": "Name of the vendor"
      },
      {
        "variable_id": "contract_value",
        "variable_name": "Contract Value",
        "type": "number",
        "required": true,
        "description": "Total contract value in USD"
      },
      {
        "variable_id": "reviewer_email",
        "variable_name": "Reviewer",
        "type": "email",
        "required": true,
        "description": "Email of the person who will review"
      }
    ],
    "steps": [
      {
        "step_id": "intake_step",
        "step_name": "Collect Contract Details",
        "step_type": "intake",
        "description": "Collect contract and vendor information"
      },
      {
        "step_id": "review_step",
        "step_name": "AI Review",
        "step_type": "agent",
        "description": "AI analyzes contract for risks and compliance"
      },
      {
        "step_id": "approval_step",
        "step_name": "Manager Approval",
        "step_type": "approval",
        "description": "Manager reviews and approves or rejects"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
workflow_schemaobjectComplete workflow schema including all variables and steps

Workflow Schema Object

FieldTypeDescription
workflow_idstringUnique identifier for the workflow
workflow_namestringHuman-readable workflow name
versionintegerWorkflow version number
descriptionstringDescription of what the workflow does
is_activebooleanWhether the workflow is currently active
variablesarrayList of input variables with validation rules
stepsarrayList of workflow steps in execution order

Variable Object Fields

FieldTypeDescription
variable_idstringUnique identifier for the variable
variable_namestringHuman-readable variable name
typestringVariable type: text, number, boolean, date, email, select, file, user_entity, business
requiredbooleanWhether the variable is required for workflow initiation
descriptionstringDescription of what the variable represents
validationobjectOptional validation rules (e.g., allowed file extensions, value ranges)

Error Responses

400 Bad Request

Returned when the version format is invalid.
{
  "detail": "Invalid version format: invalid_version"
}

401 Unauthorized

Returned when authentication fails. See the authentication errors section for details.
{
  "detail": "Invalid API key"
}

404 Not Found

Returned when the workflow or version doesn’t exist.
{
  "detail": "Workflow not found"
}

500 Internal Server Error

Returned when the request fails due to a server error.
{
  "detail": "Failed to get workflow schema"
}

Notes

Use "latest" as the version to always get the most recent workflow schema without tracking version numbers.
Variable types and validation rules must be respected when initiating workflows. Validation failures will result in a 422 error.

Use Cases

This endpoint is useful for:
  • Form generation - Dynamically create input forms based on workflow variables
  • Validation - Validate user input before initiating workflows
  • Documentation - Display workflow requirements to users
  • Integration planning - Understand what data is needed to start a workflow