---
title: "add_to_collection"
description: "Add a post that is on the platform to a collection (YouTube playlist, or save a Pin to another Pinterest board). position 0 puts it first; omitted puts it last. For a post still 'scheduled', set metadata.playlistIds instead. Needs the **manage** permission. Also available as the MCP tool `add_to_collection`."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.mixetape.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: mixetape API › manage

`POST /api/v1/tools/add_to_collection`

Add a post that is on the platform to a collection (YouTube playlist, or save a Pin to another Pinterest board). position 0 puts it first; omitted puts it last. For a post still 'scheduled', set metadata.playlistIds instead. Needs the **manage** permission. Also available as the MCP tool `add_to_collection`.

## Authentication

- `apiKey`, http, header `Authorization`

## Request body

_Required._

- `add_to_collection.id` (string, required) — mixetape post id (list_posts)
- `add_to_collection.collectionId` (string, required)
- `add_to_collection.position` (number, optional)

## Example request

```json
{
  "id": "string",
  "collectionId": "string",
  "position": 0
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://mixetape.com/api/v1/tools/add_to_collection \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "string",
  "collectionId": "string",
  "position": 0
}
'
```

### TypeScript

```typescript
const url = 'https://mixetape.com/api/v1/tools/add_to_collection';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({id: 'string', collectionId: 'string', position: 0})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://mixetape.com/api/v1/tools/add_to_collection"

payload = {
    "id": "string",
    "collectionId": "string",
    "position": 0
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The tool's result.

#### Example

```json
{
  "result": null
}
```

- `add_to_collection.response.200.result` (unknown, required) — What the tool returns

### 400

The request is invalid; `error` says why.

#### Example

```json
{
  "error": "string"
}
```

- `add_to_collection.response.400.error` (string, required) — What went wrong, in plain words

### 401

No valid API key.

#### Example

```json
{
  "error": "string"
}
```

- `add_to_collection.response.401.error` (string, required) — What went wrong, in plain words

### 403

The key lacks the permission this needs.

#### Example

```json
{
  "error": "string"
}
```

- `add_to_collection.response.403.error` (string, required) — What went wrong, in plain words

### 404

Not found, or not yours.

#### Example

```json
{
  "error": "string"
}
```

- `add_to_collection.response.404.error` (string, required) — What went wrong, in plain words


Source: https://docs.mixetape.com/api/manage/add_to_collection/index.md
