---
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`).
    - `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.
    - `dry_run` boolean
    - `remove-vendor` boolean — Removes the `vendor` folder before installation (clean install).
  - object
    - `name` string, required — Creates a Contao project from an uploaded theme file.
    - `upload` string — ID of a theme file that was uploaded.
    - `no-update` boolean — Only create the project files but do not run a `composer update`.
  - object
    - `name` string, required — 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
    - `name` string, required — 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' | '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

## Changes

- **2023-10-10** `2f479445adad` — 8 breaking, 9 warning, 20 info
  - the `oneOf[#/components/schemas/TaskComposerClearCache]/` request property type/format changed from ``/`` to `object`/``
  - the `oneOf[#/components/schemas/TaskComposerDumpAutoload]/` request property type/format changed from ``/`` to `object`/``
  - the `oneOf[#/components/schemas/TaskContaoBackupCreate]/` request property type/format changed from ``/`` to `object`/``
  - the `oneOf[#/components/schemas/TaskContaoBackupRestore]/` request property type/format changed from ``/`` to `object`/``
  - …33 more
- **2023-10-05** `243e0ac08b13` — 7 breaking, 9 info
  - the `oneOf[#/components/schemas/TaskComposerClearCache]/allOf[subschema #2]/name` request property type/format changed from ``/`` to `string`/``
  - the `oneOf[#/components/schemas/TaskComposerDumpAutoload]/allOf[subschema #2]/name` request property type/format changed from ``/`` to `string`/``
  - the `oneOf[#/components/schemas/TaskContaoRebuildCache]/allOf[subschema #2]/name` request property type/format changed from ``/`` to `string`/``
  - the `oneOf[#/components/schemas/TaskManagerSelfUpdate]/allOf[subschema #2]/name` request property type/format changed from ``/`` to `string`/``
  - …12 more
- **2022-08-24** `8a278f8d40ef` — 1 info
  - added the optional property `sponsor` to the response with the `200` status
- …earlier changes not shown

[Full history](https://skmtc.dev/contao/apis/contao-manager-api/changes/api/task/put.md)

---

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