# Edit Torrent Item

`PUT https://api.torbox.app/v1/api/torrents/edittorrent`

- Operation ID: `edit_torrent_item`
- Group: Torrents
- Auth: API key, `Authorization: Bearer <api key>` (Sign in with TorBox gives the same key)

### Overview

Updates a download item based on the item's ID.
Sending a PUT request with valid items overwrites the previous items entirely, so use this endpoint with caution. Please make sure to read the restrictions below as they are important.

### Restrictions

- Does not affect the cached database (or any other user's item).

- Name must pass validation:

    - Above 1 character long.

    - Below 200 characters long.

    - Cannot contain any non-url or non filesystem safe characters. (This is removed automatically).

    - Cannot contain any leading or trailing whitespace. You can have spaces in the middle. (This is removed automatically).

- Tags follow the same rules as the name.

- Alternative hashes must be of MD5, SHA1, or SHA256.


### Authorization

Requires an API key using the Authorization Bearer Header.

## Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `torrent_id` | integer | yes |  |
| `name` | string | no |  |
| `tags` | string[] | no |  |
| `alternative_hashes` | string[] | no |  |
| `airlocked` | boolean | no |  |

## Responses

- `200` Successful Response
- `400` Bad Request
- `401` Unauthorized
- `403` Forbidden
- `404` Not Found
- `409` Conflict
- `422` Validation Error
- `429` Too Many Requests
- `500` Internal Server Error
- `503` Service Unavailable
