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

# Add music to collection

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

Add a release to the Discogs collection. Searches Discogs by title/artist or accepts a discogs\_id directly. Adds to Discogs, stores locally, and processes cover image.

## Authorization

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

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

## Body

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

#### title (body, string)

#### artist (body, string)

#### year (body, number)

## Response

#### 200

Release added successfully

#### status (string, required)

#### release (object, required)

#### properties

#### title (string, required)

#### artist (string, required)

#### year (number, required)

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

#### format (string, required)

#### discogs (object, required)

#### properties

#### instance\_id (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/vinyl' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"discogs_id": 0, "title": "string", "artist": "string", "year": 0}'
```

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

```python Python
import requests

res = requests.post(
    'https://api.rewind.rest/v1/admin/collecting/vinyl',
    headers={'Authorization': 'Bearer <token>'},
    json={"discogs_id": 0, "title": "string", "artist": "string", "year": 0}
)
data = res.json()
```

#### Response

```json 200
{
  "status": "string",
  "release": {
    "title": "string",
    "artist": "string",
    "year": 0,
    "discogs_id": 0,
    "format": "string"
  },
  "discogs": {
    "instance_id": 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
}
```
