Skip to main content
POST
/
api
/
v1
/
workflows
Create Workflow
curl --request POST \
  --url https://api.example.com/api/v1/workflows \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "triggerType": "<string>",
  "triggerConfig": {},
  "steps": [
    {
      "type": "<string>",
      "name": "<string>",
      "config": {},
      "onSuccess": 123,
      "onFailure": 123
    }
  ],
  "enabled": true
}
'
{
  "workflow": {}
}
Create a workflow that chains AI tasks together with scheduling, event triggers, and conditional logic.

Authentication

Requires a Bearer token. See Authentication.

Request Body

name
string
required
Human-readable workflow name.
triggerType
string
required
How the workflow is triggered. One of: schedule, event, manual.
triggerConfig
object
Trigger-specific configuration (e.g., { "cron": "0 9 * * 1" } for schedule triggers).
steps
object[]
required
Ordered array of workflow steps. At least one step is required.
enabled
boolean
default:"true"
Whether the workflow is active.

Request Examples

curl -X POST https://hitheo.ai/api/v1/workflows \
  -H "Authorization: Bearer $THEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Weekly Pipeline Report",
    "triggerType": "schedule",
    "triggerConfig": { "cron": "0 9 * * 1" },
    "steps": [
      {
        "type": "ai_transform",
        "name": "Generate report",
        "config": { "prompt": "Analyze this week's pipeline changes", "skills": ["data-extraction"] }
      },
      {
        "type": "notification",
        "name": "Send to team",
        "config": { "channel": "email", "to": "team@acme.com" }
      }
    ]
  }'

Response (HTTP 201)

workflow
object
The created workflow object with generated id and timestamps.

Errors

StatusCodeDescription
400missing_fieldsname, triggerType, and steps are required

Endpoint

POST /api/v1/workflows Requires authentication via Bearer token. See Authentication.