# Merge one category into another.

`POST /api/plugins/docs/categories/{id}/merge`

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, string, required)
  Type: string

Request body: application/json (required)

Type: object

Schema: [MergeDocumentCategoryDTO](https://sourcey-gauzy.pages.dev/api-reference/models/mergedocumentcategorydto/index.md)

- `targetId` (required)
  Type: string

Responses:

- 200: Categories merged successfully.

Content type: application/json

Type: object

Schema: [DocumentCategory](https://sourcey-gauzy.pages.dev/api-reference/models/documentcategory/index.md)

- `deletedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `createdAt` (optional)
  Type: string, date-time
  
  The creation timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `updatedAt` (optional)
  Type: string, date-time
  
  The last update timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `id` (optional)
  Type: string

- `isActive` (optional)
  Type: boolean
  
  default: true

- `isArchived` (optional)
  Type: boolean
  
  default: false

- `archivedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `tenantId` (optional)
  Type: string

- `organizationId` (optional)
  Type: string

- `name` (required)
  Type: string

- `slug` (required)
  Type: string

- `color` (optional)
  Type: string

- `icon` (optional)
  Type: string

- `description` (optional)
  Type: string

- `isSystem` (required)
  Type: boolean

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/plugins/docs/categories/string/merge' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "targetId": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "targetId": "string"
}`;

const response = await fetch('http://localhost:3000/api/plugins/docs/categories/string/merge', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "targetId": "string"
}'''

response = requests.post(
    'http://localhost:3000/api/plugins/docs/categories/string/merge',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
