# Create Torrent

`POST https://api.torbox.app/v1/api/torrents/createtorrent`

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

### Overview

Creates a torrent under your account. Simply send **either** a magnet link, or a torrent file. Once they have been checked, they will begin downloading assuming your account has available active download slots, and they aren't too large.

### Rate Limits

This endpoint has two limits that apply at the same time:

- **300 requests per minute:** a shared ceiling that _every_ request counts against, whether the torrent is cached or uncached.

- **60 uncached torrents per hour:** an additional, stricter limit that only uncached torrents count against. A request sent with `add_only_if_cached` is not counted, because it adds nothing when the torrent is not cached. It is counted when it is also sent with `as_queued`, because a queued torrent is added whether it is cached or not.


The important thing is that cached and uncached requests both draw from the same 300/min pool, but uncached requests _also_ draw from their own separate 60/hour pool. An uncached request therefore counts twice: once against the per-minute limit, and once against the per-hour uncached limit.

**Example:** In a single minute you add 250 cached + 50 uncached torrents. That's 300 total, so you've hit the per-minute limit for that minute. But those 50 uncached torrents also came out of your 60/hour uncached budget, leaving only **10 uncached torrents** for the remaining 59 minutes of that hour. (You could still add plenty more _cached_ torrents during that hour, since cached requests aren't capped hourly: only by the 300/min ceiling.)

### Authorization

Requires an API key using the Authorization Bearer Header.

## Request body (`multipart/form-data`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `file` | string | no | The torrent's torrent file. Optional. |
| `magnet` | string | no | The torrent's magnet link. Optional. |
| `seed` | integer | no | Tells TorBox your preference for seeding this torrent. 1 is auto. 2 is seed. 3 is don't seed. Optional. Default is 1, or whatever the user has in their settings. Overwrites option in settings. |
| `allow_zip` | boolean | no | Tells TorBox if you want to allow this torrent to be zipped or not. TorBox only zips if the torrent is 100 files or larger. |
| `name` | string | no | The name you want the torrent to be. Optional. |
| `as_queued` | boolean | no | Tells TorBox you want this torrent instantly queued. This is bypassed if user is on free plan, and will process the request as normal in this case. Optional. |
| `add_only_if_cached` | boolean | no | Only adds the download if it is cached on TorBox. If not cached, it won't be added. |

## Responses

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