# The legacy interface

Before the API, scripts drove CrushMFT through the same interface as the WebInterface: a form post with `command=<name>` to `/WebInterface/function/`, answered with XML or with JSON whose values are all strings. That interface is now called the **legacy interface**, and in CrushMFT 27:

- **It stays.** The WebInterface, the CrushTunnel command line and the client apps keep using it. Three commands are gone in CrushMFT 27, with what they did: `importJob` (making a job from a file in the job import folder; the API's `jobs.import` went with it), and `setReportSchedules` and `deleteReportSchedules` (the old report schedules: use the report schedule operations of the [Reports](API-Reports.md) area; `reportSchedules` still reads the old ones, so they can be moved from CrushFTP 11).
- **It is frozen for automation.** New capabilities for scripts come to the API.
- **It can be closed to scripts, gradually.** In Preferences, API, clear **Let scripts send admin commands to the legacy interface with a user name and password**. An admin command sent there with a Basic header is then refused, with a message that names the API. File transfers, WebDAV, the WebInterface and the CrushTunnel command line are not affected. Nobody is forced to: turn it off once your scripts have moved.

## From a command to an operation

Every operation in this reference names the legacy command it replaces, under **Legacy**: `getUser` is `GET /users/{group}/{username}`, `setUserItem` is `PATCH /users/{group}/{username}` (and its relatives), `getServerItem` is `GET /prefs/{section}`. Search this wiki for a command name to find its operation.

What changes for a script:

| Legacy interface | API |
|---|---|
| `POST /WebInterface/function/` with `command=getUser&serverGroup=MainUsers&username=bob` | `GET /WebInterface/api/v1/users/MainUsers/bob` |
| Every answer `200 OK`; a refusal is the text `FAILURE:` inside | Real status codes and an error with a `code` |
| XML documents inside form fields | JSON |
| Every value a string, percent-escaped | Booleans, numbers, lists |
| A password read back for an administrator | Never: `{"set": true}` |
| No way to try first | `?dry_run=true` |

## Commands with no operation

These stay on the legacy interface only, each for the reason given: most are the WebInterface's own (its login, its page state), the protocols of the client apps and agents, or replaced by an operation of a different shape.

[[openapi API/openapi.json ext=x-crushmft-not-in-api]]
