# Merge Container Tags

## JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({containerTags: ['<string>'], targetContainerTag: '<string>'})
};

fetch('https://api.supermemory.ai/v3/container-tags/merge', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Response Codes

- **200**: Successful operation
- **400**: Bad request
- **401**: Unauthorized
- **403**: Forbidden
- **404**: Not found
- **500**: Internal server error

### Example Response

```json
{
  "success": true,
  "mergedCount": 123,
  "targetTag": "<string>",
  "deletedTags": [
    "<string>"
  ]
}
```

## Authorizations

- **Authorization**: `string`
  - Required: Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.

## Body

- **containerTags**: `string[]`
  - Required: List of container tags to merge (min: 2, max: 2). All documents from these tags will be merged into the target.
- **targetContainerTag**: `string`
  - Required.

## Response

- **success**: `boolean`
  - Required: Whether the merge operation completed successfully.
- **mergedCount**: `number`
  - Required: Number of documents that were merged.
- **targetTag**: `string`
  - Required: The target container tag that documents were merged into.
- **deletedTags**: `string[]`
  - Required: List of container tags that were deleted after successful merge.
