Skip to main content
POST
/
workflows
/
upload
Upload workflow bundle
curl --request POST \
  --url https://api.trymaitai.ai/api/v1/workflows/upload \
  --header 'Content-Type: application/json' \
  --header 'X-Maitai-Api-Key: <api-key>' \
  --data @- <<EOF
{
  "workflow_ref_name": "hs_classification",
  "script": "def execute(ctx):\n    return {'ok': True}",
  "application_name": "HS Classification Workflow",
  "publish_version": true,
  "version_bump": "patch",
  "version_notes": "Initial release"
}
EOF
{
  "data": {
    "id": 42,
    "workflow_ref_name": "hs_classification",
    "published_version": {
      "version_number": "1.0.0"
    },
    "version_created": true
  }
}

Authorizations

X-Maitai-Api-Key
string
header
required

Your Maitai API key from the Portal.

Body

application/json
workflow_ref_name
string
required
script
string
required

Workflow Python source. Or multipart script_file / workflow_file / file.

workflow_name
string

Display name. Defaults from workflow_ref_name when omitted.

description
string
timeout_seconds
integer
execution_mode
enum<string>
Available options:
sync,
async,
stream
application_id
integer
application_name
string

Bind to application by name; creates if missing.

allow_inproc_nesting
boolean
inproc_nested_refs
string[]
publish_version
boolean

Publish an immutable workflow version after upload.

version_notes
string

Notes for the published version.

version_bump
enum<string>

Semver bump when publishing. Defaults to minor.

Available options:
major,
minor,
patch
accessories
object[]

Inline accessories as base64 objects (multipart accessory_ also supported).

Response

200 - application/json

Upload workflow bundle.

data
any