---
title: "Sets task data."
method: PUT
path: "/api/task"
tags: ["Tasks"]
---

# Sets task data.

`PUT /api/task`

## Request body

- union
  - object
    - `name` string, required — Updates the installed Composer packages (`composer update`).
    - `config` object
      - `dry_run` boolean
      - `uploads` boolean — Install uploaded packages that are in the list of packages to update
      - `require` object — List of packages to require. Key is package name and value is version, which can be empty.
      - `remove` string[] — List of packages to remove.
      - `update` string[] — List of package names to include in the update. If not set, all packages will be updated.
  - object
    - `name` string, required — Installs Composer packages from lock file (`composer install`). This automatically runs an update if there is no `composer.lock` file and uses the Composer Resolver Cloud if enabled.
    - `config` object
      - `dry_run` boolean
      - `remove-vendor` boolean — Removes the `vendor` folder before installation (clean install).
  - object
    - `name` string, required
    - `config` union
      - object — Creates a Contao project from an uploaded theme file.
        - `upload` string, required — ID of a theme file that was uploaded.
        - `no-update` boolean — Only create the project files but do not run a `composer update`.
      - object — Installs a Contao project through Composer.
        - `package` string, required — A composer package to use with `create-project` (e.g. `contao/contao-demo`).
        - `version` string — Version of the package to install.
        - `no-update` boolean — Only create the project files but do not run a `composer update`.
      - object — Creates a `composer.json` for the Contao Managed Edition.
        - `version` string, required
        - `no-update` boolean — Only create the `composer.json` but do not run a `composer update`.
  - object
    - `name` string, required — Clears the Contao/Symfony cache and optionally rebuilds it.
    - `environment` string
    - `warmup` boolean
  - object
    - `name` string, required — Creates a full backup of the current database.
  - object
    - `name` string, required — Restore a database backup from file.
    - `file` string — The database backup file name from /var/backups.
    - `backup` boolean — Whether to create a new backup before restore (and therefore overwriting the database content).
  - object — Clears the Contao (Symfony) Cache
    - `name` string, required — Clears the Composer cache.
  - object
    - `name` string, required — Dumps the Composer autoloader.
  - object
    - `name` string, required — Updated the Contao Manager to the latest version.

## Response `200`

The current task data.

- TaskStatus
  - `id` string — A unique UUIDv4 for the current task.
  - `title` string
  - `console` string
  - `cancellable` boolean — If the task can be aborted
  - `autoclose` boolean — If it should be possible to close the task automatically.
  - `audit` boolean — If a successful task might requires audit (install tool).
  - `status` 'active' | 'complete' | 'paused' | 'error' | 'aborting' | 'stopped'
  - `operations` object[]
    - `summary` string
    - `details` string
    - `console` string
    - `status` 'active' | 'complete' | 'error' | 'stopped'
  - `sponsor` object — Sponsor of the current task on the Composer Cloud
    - `name` string
    - `link` string

## Other responses

- `400` — If a task is already running or the payload is invalid

---

[API](https://skmtc.net/contao/apis/contao-manager-api.md) · [All operations](https://skmtc.net/contao/apis/contao-manager-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/contao/contao-manager-api/revisions/074d8046de13/schema)
