Conventions

  • Base address http://127.0.0.1:5001 unless you changed HOST and PORT.
  • Most routes live under /api/v1. Dataset routes live under /api/datasets. Industry routes under /industry. Setup under /setup. Sign in under /auth.
  • Send JSON with Content-Type: application/json.
  • Most JSON replies have a success field, and a data field or a named field such as experiments, runs or versions. Errors carry success false and an error message. Dataset routes use {"error": "..."}.
  • Identify yourself with the browser session, an X-API-Key header, a JWT, or an Identity Server bearer token in identity_server mode. See Setup and accounts.
  • Route parameters are written in angle brackets, for example /projects/<project_id>.

Authorization is stated on the topic pages only for handlers that check it in code. The handlers for settings, credentials, workflow templates, workflow versions, industry modules, the ml-server routes, database routes and the environment listing routes show no sign in check in the code. Do not expose MLStudio to untrusted networks.

Quick tour with curl

# 1. create a project
curl -X POST http://127.0.0.1:5001/api/v1/projects \
  -H "X-API-Key: <your-key>" -H "Content-Type: application/json" \
  -d '{"name": "demo", "framework": "scikit-learn"}'

# 2. list your projects
curl -H "X-API-Key: <your-key>" "http://127.0.0.1:5001/api/v1/projects?status=active&sort=updated_at&order=desc"

# 3. upload a file
curl -X POST http://127.0.0.1:5001/api/v1/projects/1/upload \
  -H "X-API-Key: <your-key>" -F "file=@train.csv" -F "destination=data"

# 4. start a workflow run
curl -X POST http://127.0.0.1:5001/api/v1/workflows/1/runs \
  -H "X-API-Key: <your-key>" -H "Content-Type: application/json" -d '{"mode": "full"}'

# 5. list experiments
curl -H "X-API-Key: <your-key>" "http://127.0.0.1:5001/api/v1/experiments?status=completed&per_page=10"

Route index

Details of each group are on the page named in the first column.

PageRoutes
Setup and accountsGET /setup/status, /setup/supported-databases; POST /setup/create-admin, /setup/configure-database, /setup/test-database, /setup/configure-auth, /setup/test-identity-server, /setup/complete; POST /auth/api/login, /auth/api/register; GET /auth/api/logout; GET /profile/api/keys; POST /profile/api/keys/generate; DELETE /profile/api/keys/<id>
ProjectsGET, POST /api/v1/projects; GET, PUT, DELETE /api/v1/projects/<id>; POST archive, restore, clone; GET stats, activity, environment; snapshots; collaborators; visibility; project templates; environments
Datasets and filesfiles, upload, data-columns, data-preview under /api/v1/projects/<id>/; /api/datasets/search, trending, download, downloads, config/kaggle, create-project-with-dataset
Workflows/api/v1/projects/<id>/workflows; /api/v1/workflows; preflight; runs; versions; import; export; publish-module; /api/v1/templates
Schedules and webhooks/api/v1/workflows/<id>/webhook; /api/v1/workflows/<id>/schedule; /api/v1/schedules; /api/v1/webhooks/<token>
Experiments/api/v1/experiments and the routes under it; POST /models/<project_id>/train; GET /models/<project_id>/list
Industry modes/industry/api/...; /api/v1/industry-modules/...
Connecting to other systems/api/v1/ml-server/...; /api/v1/community/...; /api/v1/credentials; /api/v1/database/...; /api/v1/health; /api/v1/settings

Example: list projects

GET /api/v1/projects

{
  "success": true,
  "data": [
    {"id": 1, "name": "demo", "framework": "scikit-learn", "status": "active"}
  ]
}

The list key is data. (The older main documentation page shows projects, which the code does not return.) The example shows only some of the fields a project has.

Example: start a run

POST /api/v1/workflows/1/runs
{"mode": "full"}

Reply:
{"success": true, "run_id": 31, "experiment_id": 18, "status": "pending", "message": "Workflow run started"}

Example: refused run mode

Requesting "mode": "debug", or giving from_node, node, from_node_id or a non-empty breakpoints list, returns 400 with a message explaining that only full runs are supported.

Real time events

MLStudio uses Socket.IO. Training sends training_progress and training_complete to the room project_<id>. Dataset download progress is pushed the same way. Socket.IO accepts connections from any origin by default, and cross origin requests to the REST API are allowed.

Routes not documented

Plugin pack management routes (list, install, remove, enable, disable) exist but are not described here because their request bodies were not confirmed. Use the plugin screen in the application.