Source: https://dinakar-rewind.docs.pageloop.ai/api-reference/collecting/adminaddcollectingmedia

# Add physical media

POST `https://api.rewind.rest/v1/admin/collecting/media`

Add a movie to the physical media collection. Resolves via TMDb, pushes to Trakt, stores locally.

## Authorization

#### Authorization (header, string, required)

API key. Read keys (rw\_live\_...) access GET endpoints. Admin keys (rw\_admin\_...) access all endpoints.

## Body

#### tmdb\_id (body, number)

#### imdb\_id (body, string)

#### title (body, string)

#### year (body, number)

#### media\_type (body, string, required)

#### resolution (body, string)

#### hdr (body, string)

#### audio (body, string)

#### audio\_channels (body, string)

## Response

#### 200

Media added successfully

#### status (string, required)

#### movie (object, required)

#### properties

#### title (string, required)

#### year (number, required)

#### tmdb\_id (number, required)

#### media\_type (string, required)

#### trakt (object, required)

#### properties

#### added (number, required)

#### existing (number, required)

#### image\_processed (boolean, required)

#### 400

Bad request

#### error (string, required)

#### status (integer, required)

#### 401

Unauthorized

#### error (string, required)

#### status (integer, required)

#### 404

Not found

#### error (string, required)

#### status (integer, required)

#### 500

Internal server error

#### error (string, required)

#### status (integer, required)

#### Request

```bash cURL
curl -X POST 'https://api.rewind.rest/v1/admin/collecting/media' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"tmdb_id": 0, "imdb_id": "string", "title": "string", "year": 0, "media_type": "string", "resolution": "string", "hdr": "string", "audio": "string", "audio_channels": "string"}'
```

```javascript JavaScript
const res = await fetch('https://api.rewind.rest/v1/admin/collecting/media', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"tmdb_id": 0, "imdb_id": "string", "title": "string", "year": 0, "media_type": "string", "resolution": "string", "hdr": "string", "audio": "string", "audio_channels": "string"}),
});
const data = await res.json();
```

```python Python
import requests

res = requests.post(
    'https://api.rewind.rest/v1/admin/collecting/media',
    headers={'Authorization': 'Bearer <token>'},
    json={"tmdb_id": 0, "imdb_id": "string", "title": "string", "year": 0, "media_type": "string", "resolution": "string", "hdr": "string", "audio": "string", "audio_channels": "string"}
)
data = res.json()
```

#### Response

```json 200
{
  "status": "string",
  "movie": {
    "title": "string",
    "year": 0,
    "tmdb_id": 0
  },
  "media_type": "string",
  "trakt": {
    "added": 0,
    "existing": 0
  },
  "image_processed": true
}
```

```json 400
{
  "error": "Not found",
  "status": 404
}
```

```json 401
{
  "error": "Not found",
  "status": 404
}
```

```json 404
{
  "error": "Not found",
  "status": 404
}
```

```json 500
{
  "error": "Not found",
  "status": 404
}
```
